Skip to content

Commit f63d7f9

Browse files
committed
feat: upgrade antl4 java parser to antl 4.8
1 parent 5be03a2 commit f63d7f9

File tree

7 files changed

+2126
-1745
lines changed

7 files changed

+2126
-1745
lines changed

languages/comment/comment_lexer.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/g4/JavaParser.g4

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ typeParameters
8585
;
8686

8787
typeParameter
88-
: annotation* IDENTIFIER (EXTENDS typeBound)?
88+
: annotation* IDENTIFIER (EXTENDS annotation* typeBound)?
8989
;
9090

9191
typeBound
@@ -246,7 +246,7 @@ classOrInterfaceType
246246

247247
typeArgument
248248
: typeType
249-
| '?' ((EXTENDS | SUPER) typeType)?
249+
| annotation* '?' ((EXTENDS | SUPER) typeType)?
250250
;
251251

252252
qualifiedNameList
@@ -267,7 +267,7 @@ formalParameter
267267
;
268268

269269
lastFormalParameter
270-
: variableModifier* typeType '...' variableDeclaratorId
270+
: variableModifier* typeType annotation* '...' variableDeclaratorId
271271
;
272272

273273
qualifiedName
@@ -296,9 +296,12 @@ floatLiteral
296296
;
297297

298298
// ANNOTATIONS
299+
altAnnotationQualifiedName
300+
: (IDENTIFIER DOT)* '@' IDENTIFIER
301+
;
299302

300303
annotation
301-
: '@' qualifiedName ('(' ( elementValuePairs | elementValue )? ')')?
304+
: ('@' qualifiedName | altAnnotationQualifiedName) ('(' ( elementValuePairs | elementValue )? ')')?
302305
;
303306

304307
elementValuePairs
@@ -478,7 +481,7 @@ expression
478481
| expression '[' expression ']'
479482
| methodCall
480483
| NEW creator
481-
| '(' typeType ')' expression
484+
| '(' annotation* typeType ')' expression
482485
| expression postfix=('++' | '--')
483486
| prefix=('+'|'-'|'++'|'--') expression
484487
| prefix=('~'|'!') expression
@@ -582,7 +585,7 @@ typeList
582585
;
583586

584587
typeType
585-
: annotation? (classOrInterfaceType | primitiveType) ('[' ']')*
588+
: annotation* (classOrInterfaceType | primitiveType) (annotation* '[' ']')*
586589
;
587590

588591
primitiveType
@@ -612,4 +615,4 @@ explicitGenericInvocationSuffix
612615

613616
arguments
614617
: '(' expressionList? ')'
615-
;
618+
;

languages/java/JavaParser.interp

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

languages/java/java_lexer.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/java/java_parser.go

Lines changed: 2086 additions & 1728 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/java/javaparser_base_listener.go

Lines changed: 19 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/java/javaparser_listener.go

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)