Skip to content

Commit

Permalink
feat: upgrade antl4 java parser to antl 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Oct 22, 2020
1 parent 5be03a2 commit f63d7f9
Show file tree
Hide file tree
Showing 7 changed files with 2,126 additions and 1,745 deletions.
2 changes: 1 addition & 1 deletion languages/comment/comment_lexer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions languages/g4/JavaParser.g4
Expand Up @@ -85,7 +85,7 @@ typeParameters
;

typeParameter
: annotation* IDENTIFIER (EXTENDS typeBound)?
: annotation* IDENTIFIER (EXTENDS annotation* typeBound)?
;

typeBound
Expand Down Expand Up @@ -246,7 +246,7 @@ classOrInterfaceType

typeArgument
: typeType
| '?' ((EXTENDS | SUPER) typeType)?
| annotation* '?' ((EXTENDS | SUPER) typeType)?
;

qualifiedNameList
Expand All @@ -267,7 +267,7 @@ formalParameter
;

lastFormalParameter
: variableModifier* typeType '...' variableDeclaratorId
: variableModifier* typeType annotation* '...' variableDeclaratorId
;

qualifiedName
Expand Down Expand Up @@ -296,9 +296,12 @@ floatLiteral
;

// ANNOTATIONS
altAnnotationQualifiedName
: (IDENTIFIER DOT)* '@' IDENTIFIER
;

annotation
: '@' qualifiedName ('(' ( elementValuePairs | elementValue )? ')')?
: ('@' qualifiedName | altAnnotationQualifiedName) ('(' ( elementValuePairs | elementValue )? ')')?
;

elementValuePairs
Expand Down Expand Up @@ -478,7 +481,7 @@ expression
| expression '[' expression ']'
| methodCall
| NEW creator
| '(' typeType ')' expression
| '(' annotation* typeType ')' expression
| expression postfix=('++' | '--')
| prefix=('+'|'-'|'++'|'--') expression
| prefix=('~'|'!') expression
Expand Down Expand Up @@ -582,7 +585,7 @@ typeList
;

typeType
: annotation? (classOrInterfaceType | primitiveType) ('[' ']')*
: annotation* (classOrInterfaceType | primitiveType) (annotation* '[' ']')*
;

primitiveType
Expand Down Expand Up @@ -612,4 +615,4 @@ explicitGenericInvocationSuffix

arguments
: '(' expressionList? ')'
;
;
3 changes: 2 additions & 1 deletion languages/java/JavaParser.interp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion languages/java/java_lexer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3,814 changes: 2,086 additions & 1,728 deletions languages/java/java_parser.go

Large diffs are not rendered by default.

25 changes: 19 additions & 6 deletions languages/java/javaparser_base_listener.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion languages/java/javaparser_listener.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f63d7f9

Please sign in to comment.