500 Commits

Author SHA1 Message Date
Clément Fournier
297b177b3a Remove ASTClassOrInterfaceBodyDeclaration 2020-02-19 18:38:24 +01:00
Andreas Dangel
8e8eec62d9 Merge branch 'pr-2272' into java-grammar
[java] Make enum body track trailing comma/semi
2020-02-18 19:23:17 +01:00
Clément Fournier
97b1870472 Unify repr of annotations 2020-02-12 22:25:04 +01:00
Clément Fournier
ad023e8fa6 Support type test patterns 2020-02-09 00:10:50 +01:00
Clément Fournier
2cd7a29d9b Cleanup getImage calls in parser 2020-02-07 23:43:26 +01:00
Clément Fournier
1c09b28e56 Simplify Block::containsComment
Move logic out of the parser
2020-02-07 23:23:54 +01:00
Clément Fournier
c5fbfe5d87 Make enum body track trailing comma/semi 2020-02-07 20:02:25 +01:00
Clément Fournier
69ad3a7087 Simplify some jjtree aspects 2020-02-07 16:35:58 +01:00
Clément Fournier
1c5c80a516 Merge branch 'grammar-literals' into java-grammar 2020-02-07 14:58:41 +01:00
Clément Fournier
694d473f4d Catch a few numbers that shouldn't parse
Fix literals
2020-01-28 15:57:21 +01:00
Clément Fournier
3191ef360d Rework AccessNode
Introduce a ModifierList node, that ranges
 over the modifiers of a declaration (including
annotations).

This is a combination of a few old commits:

Figure out modifiers

Fix tests

Remove AccessTypeNode

Document

Remove specific methods

Fix symboltable test

Fix tests

Rename to JModifier

Fix copypaste default/abstract

Improve doc

Test anon classes

Remove useless impl

Static modifier should not be present on toplevel classes

Simplify impl

Add visibility enum

Port some tests

Fix test ranges

Fix modifier ordering

Cleanup

Fix unnecessary modifier rule

Rename to use plural

Improve visibility doc

Simplify some things

Checkstyle

Remove some usages of typekind

Fix missing import

Remove irrelevant method

REmove some duplication

Replace AccessNode with ModifierOwner

Rename to AccessNode to reduce diff

Remove changes to rules

Add convenience methods

Make VariableDeclaratorId a ModifierOwner

Fix variable name decl

Make enum constant an implicit AccessNode

Fix compil

Checkstyle

Cleanup

Deprecate TypeKind

Cleanup

Remove TypeKind

Revert "Remove TypeKind"

This reverts commit 222c169c3401a01507726f339ae9f9b2b20dc69a.

Fix doc

Fix UnnecessaryModifierRule

Use special node instead of ModifierSet

Remove useless tests

Fix tests WIP

Work should be resumed when #2211 is merged into java-grammar

Fix some tests

Doc
2020-01-28 15:28:21 +01:00
Clément Fournier
9b3c27eb42 Merge branch '7.0.x' into java-grammar 2020-01-28 14:19:09 +01:00
Clément Fournier
152801bb39 Merge branch '7.0.x' into master-ant-script 2020-01-25 14:28:37 +01:00
Clément Fournier
faeeb38ffa Merge branch 'master' into 7.0.x 2020-01-25 11:13:09 +01:00
Clément Fournier
d91e626a0b Format idents in java grammar 2020-01-25 10:59:57 +01:00
Clément Fournier
64c8342cf4 Compact identifier token definitions 2020-01-25 09:54:56 +01:00
Clément Fournier
b09b58513b Merge branch '7.0.x' into master-ant-script 2020-01-17 16:22:46 +01:00
Clément Fournier
26a5971af3 Replace deprecated usages 2020-01-17 15:46:54 +01:00
Clément Fournier
1eccf8ec7f Merge branch 'java-grammar' into grammar-switches 2020-01-16 03:57:33 +01:00
Clément Fournier
86d7c3e009 Merge branch 'grammar-dimensions' into java-grammar 2020-01-16 03:45:23 +01:00
Clément Fournier
94ebcdec82 Don't forget annotation methods 2020-01-16 03:25:16 +01:00
Clément Fournier
a465d4b585 Merge branch 'java-grammar' into grammar-catch-formal 2020-01-16 02:43:32 +01:00
Clément Fournier
d3908cb2bb Merge branch 'java-grammar' into grammar-dimensions 2020-01-16 02:42:45 +01:00
Clément Fournier
1072c49f46 Update grammar 2020-01-15 11:07:17 +01:00
Clément Fournier
0d6f03553a Port java module 2020-01-11 08:13:31 +01:00
Clément Fournier
8a128a3bea Replace token tracking function 2020-01-11 01:21:09 +01:00
Clément Fournier
ad7e9eb75d Make token document store first token 2020-01-11 00:23:43 +01:00
Clément Fournier
efc3becc01 Checkout wrapper script, pmd-core, pmd-modelica 2020-01-10 22:57:47 +01:00
Clément Fournier
88aa7746f0 Merge branch '7.0.x' into java-grammar 2020-01-10 21:34:48 +01:00
Clément Fournier
99700d7526 Extract changes from #2166 to 7.0.x
* Make Java nodes text-available
* Introduce shared JavaccToken in pmd-core
* Use factory to produce char streams

Tests are still on java-grammar,
since they use the DSL & newer
AST structure.

This is to prepare for other changes
that concern all javacc languages and
should not be done on java-grammar
2020-01-10 21:15:15 +01:00
Clément Fournier
77664d9d7f Improve switch grammar 2020-01-08 18:34:06 +01:00
Clément Fournier
1fefbd2c4a Make FieldDeclaration not a TypeNode 2020-01-07 23:13:05 +01:00
Clément Fournier
1eab9448e7 Use ArrayDimensions for VariableDeclaratorId
* Remove `Dimensionable`, remove its methods from the former implementations (except from ASTArrayDimsAndInits, which is itself deprecated)

* The varargs ellipsis is now represented as an ArrayTypeDim.
  * This affects FormalParameter and LambdaParameter

Closes #997. All forms of type annotations are now supported.
2020-01-07 23:12:53 +01:00
Clément Fournier
17305f3781 Cleanup 2020-01-07 22:35:37 +01:00
Clément Fournier
ee1e9bf286 Fix final catch param 2020-01-07 21:19:49 +01:00
Clément Fournier
bba0367b10 Cleanup FormalParameter 2020-01-07 21:18:41 +01:00
Clément Fournier
db1344d5aa Separate catch formal from method formal 2020-01-07 21:16:39 +01:00
Clément Fournier
4ce104a41b Move CharStream into impl.javacc package 2020-01-06 16:41:25 +01:00
Clément Fournier
c1191253a6 Add tests for text access 2020-01-06 16:41:24 +01:00
Clément Fournier
f6d25ccf33 Cleanup token manager errors 2020-01-06 16:40:58 +01:00
Clément Fournier
4c07f606df Rename token to JavaccToken in pmd-java 2020-01-06 16:40:58 +01:00
Clément Fournier
821c4c41d1 Rename JavaTokenFactory 2020-01-06 16:40:58 +01:00
Clément Fournier
0ce6234ba7 Simplify GTToken 2020-01-06 16:40:58 +01:00
Clément Fournier
1327d99307 Use token document instead 2020-01-06 16:40:57 +01:00
Clément Fournier
a70e70ad15 Refactor JavaCharStream to buffer whole file in memory, provide access to underlying text for all java nodes 2020-01-06 16:40:57 +01:00
Clément Fournier
5cc235dc94 Merge branch 'java-grammar' into grammar-new-statements 2019-12-15 01:45:08 +01:00
Clément Fournier
218fdc7264 Merge branch 'java-grammar' into grammar-prefix-postfix 2019-12-15 01:27:36 +01:00
Clément Fournier
b03e233647 Turn Statement into an interface
Remove BlockStatement
Introduce LocalClassDeclStatement
Introduce EmptyDeclaration (in preparation for PR about declarations)
Replace StatementExpression with ExpressionStatement

Make YieldStatement, ExplicitConstructorInvocation implement ASTStatement

Extract ForeachStatement from ForStatement

Rename
(ASTWhileStmt,
 ASTDoStmt,
 ASTForStmt,
 ASTIfStmt,
 ASTAssertStmt)#getGuardExpressionNode() -> getCondition()

Rename ASTCatchStatement -> ASTCatchClause
Rename ASTFinallyStatement -> ASTFinallyClause
Rename ASTTryStatement#getCatchStatements() -> getCatchClauses()

Make ASTYieldStatement not a TypeNode

Remove ASTTryStatement#hasFinally()

Add (ASTThrowStatement,  ASTYieldStatement, ASTReturnStatement)#getExpression()
Add ASTTryStatement#getBody()
2019-12-15 01:21:49 +01:00
Clément Fournier
44106075f4 Merge branch 'grammar-isolate-version-checks' into java-grammar 2019-12-11 20:41:11 +01:00
Clément Fournier
ff174620f4 Merge branch '7.0.x' into java-grammar 2019-12-11 20:22:55 +01:00