Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] Breaking Java Grammar changes for PMD 7.0.0 #1019

Closed
15 tasks done
adangel opened this issue Apr 3, 2018 · 3 comments
Closed
15 tasks done

[java] Breaking Java Grammar changes for PMD 7.0.0 #1019

adangel opened this issue Apr 3, 2018 · 3 comments
Labels
an:enhancement An improvement on existing features / rules in:ast About the AST structure or API, the parsing step in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception
Milestone

Comments

@adangel
Copy link
Member

adangel commented Apr 3, 2018

The goal is, to resemble the official Java Language Specification with PMD's own java grammar.
This makes it easier to maintain the grammar in the future and avoids special solution inside PMD.

Scheduled

Proposed

  • Split ForStatement into ForStatement and ForeachStatement
  • Make ASTLiteral an interface, use a different node for each type of literal (integer,
  • Merge UnaryExpression and UnaryExpressionNotPlusMinus. The two productions are needed for correct parsing, but there's no need to have two different nodes, especially since they have the same precedence.
  • Add a VariableDeclaratorId under enum constant declaration. This would consistently make VariableDeclaratorId represent a declaration of any value (field, parameter, local var, enum constant, etc).
  • Clarify parsing of PrimaryPrefix/Suffix when using "this" or "super". See also [java] New rule: AvoidReassigningLoopVariables #1530 (comment)

Remaining open tasks

@adangel adangel added this to the 7.0.0 milestone Apr 3, 2018
@jsotuyod jsotuyod added an:enhancement An improvement on existing features / rules in:pmd-internals Affects PMD's internals labels Apr 3, 2018
@jsotuyod
Copy link
Member

jsotuyod commented Apr 3, 2018

@oowekyala should we merge #905 into this?

@oowekyala
Copy link
Member

@jsotuyod I think adding that issue to the checklist is a good idea, but I'd prefer the issue to stay open. It gives room for clearer discussions/ easier referencing. Same for #998. I'll do that

I'd really love the grammar for expressions to be revamped for 7.0.0 too (#497), but I get a feeling this would have been a task for a GSoC given the number of rules and other clients to update. It also interacts with possible typeres GSoCs so it's hard to implement before the end of the summer

@adangel
Copy link
Member Author

adangel commented Jul 14, 2019

I'm closing this - the tasks are collected on https://github.com/pmd/pmd/wiki/PMD-7.0.0-Java

@adangel adangel closed this as completed Jul 14, 2019
@adangel adangel added in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception and removed in:pmd-internals Affects PMD's internals labels Jan 17, 2023
@adangel adangel mentioned this issue Jan 23, 2023
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules in:ast About the AST structure or API, the parsing step in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception
Projects
None yet
Development

No branches or pull requests

3 participants