Replies: 2 comments
-
Hi @dims12
shiftExpression
: unaryExpression
| shiftExpression ('*' | '/' | '%') shiftExpression
| shiftExpression ('+' | '-') shiftExpression
| shiftExpression ('<<' | '>>' | '>>>') shiftExpression
; Similarly, we can rewrite the expression
: lambdaExpression
| unaryExpression
| expression ('*' | '/' | '%') expression
| expression ('+' | '-') expression
| expression ('<<' | '>>' | '>>>') expression
| expression ('<' | '>' | '<=' | '>=' | 'instanceof') expression
| expression ('==' | '!=') expression
| expression '&' expression
| expression '^' expression
| expression '|' expression
| expression '&&' expression
| expression '||' expression
| <assoc=right> expression '?' expression ':' expression
| leftHandSide ('=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|=') expression
; |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't recommend using this grammar because it's slow and outdated. Use java instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I noticed that
additiveExpression
is never used here: https://github.com/antlr/grammars-v4/blob/master/java/java8/Java8Parser.g4#L1276`(Used only in itself and in
shiftExpression
)Is it by design of Java grammar is far from completeness?
Beta Was this translation helpful? Give feedback.
All reactions