[core] Antlr visitor rules#1774
Conversation
… into feature/antlr-base-parser
…mraptor/pmd into feature/antlr-base-parser
… into feature/antlr-visitor-rules
Generated by 🚫 Danger |
oowekyala
left a comment
There was a problem hiding this comment.
This is an interesting change, it introduces some nice ideas that I think we can take further to reduce the complexity of language implementations (outside of this PR)
oowekyala
left a comment
There was a problem hiding this comment.
@matifraga I think, the comments I made can be handled at a later stage, as they indeed are not limited to Antlr rules. I'll open a couple of tickets to track them. This PR seems otherwise perfectly fine to me and I think it can be merged.
|
@lsoncini @matifraga @tomidelucca I added the ANTLR support on the wiki here: https://github.com/pmd/pmd/wiki/PMD-7.0.0#language-specific-improvements to track the progress a bit and see, what's still ahead. Here are the points I see next:
|
|
Thanks @adangel ! Sorry about unit testing, we will unit test the classes we introduced already. We do have a working rule for Swift already, we will send a PR soon. Regarding XPath our first attempt making a rule didn't work out, we are currently digging the code to find out why. We will also document with examples all that is needed to add a new rule using antlr as we did with the CPD feature. |
|
Don't worry. I just wanted to make sure, you guys have this on your radar... |
This pull request depends on #1698.
Before submitting a PR, please check that:
master. The PMD team will merge back to support branches as needed../mvnw clean verifypasses. This will build and test PMD, execute PMD and checkstyle rules. Check this for more infoPR Description:
This pull request adds the necessary classes to implement antlr-based abstract rules and generic implementations of both
RuleChainVisitor(AntlrRuleChainVisitor) andRuleViolationFactory(AntlrRuleViolationFactory).We also added
AbstractSwiftRuleto serve as an example to show how to implementAbstractAntlrVisitorfor a specific language and modified the ant-file antlr4.xml to make antlr's autogenerated BaseVisitors extendAbstractAntlrVisitor.Team Raptor.