Corrections to Java grammars used by TestPerformance
This commit is contained in:
parent
efa9ea7811
commit
5924d3f935
|
@ -624,7 +624,7 @@ variableModifiers
|
||||||
statement
|
statement
|
||||||
: block
|
: block
|
||||||
| ASSERT expression (':' expression)? ';'
|
| ASSERT expression (':' expression)? ';'
|
||||||
| 'if' parExpression statement (options {k=1;}:'else' statement)?
|
| 'if' parExpression statement ('else' statement)?
|
||||||
| 'for' '(' forControl ')' statement
|
| 'for' '(' forControl ')' statement
|
||||||
| 'while' parExpression statement
|
| 'while' parExpression statement
|
||||||
| 'do' statement 'while' parExpression ';'
|
| 'do' statement 'while' parExpression ';'
|
||||||
|
@ -675,7 +675,6 @@ switchLabel
|
||||||
;
|
;
|
||||||
|
|
||||||
forControl
|
forControl
|
||||||
options {k=3;} // be efficient for common case: for (ID ID : ID) ...
|
|
||||||
: enhancedForControl
|
: enhancedForControl
|
||||||
| forInit? ';' expression? ';' forUpdate?
|
| forInit? ';' expression? ';' forUpdate?
|
||||||
;
|
;
|
||||||
|
|
|
@ -166,7 +166,6 @@
|
||||||
* Character.isJavaIdentifierPart(int) returns true."
|
* Character.isJavaIdentifierPart(int) returns true."
|
||||||
*/
|
*/
|
||||||
grammar Java;
|
grammar Java;
|
||||||
options {backtrack=true; memoize=true;}
|
|
||||||
|
|
||||||
@lexer::members {
|
@lexer::members {
|
||||||
protected boolean enumIsKeyword = true;
|
protected boolean enumIsKeyword = true;
|
||||||
|
@ -622,7 +621,7 @@ variableModifiers
|
||||||
statement
|
statement
|
||||||
: block
|
: block
|
||||||
| ASSERT expression (':' expression)? ';'
|
| ASSERT expression (':' expression)? ';'
|
||||||
| 'if' parExpression statement (options {k=1;}:'else' statement)?
|
| 'if' parExpression statement ('else' statement)?
|
||||||
| 'for' '(' forControl ')' statement
|
| 'for' '(' forControl ')' statement
|
||||||
| 'while' parExpression statement
|
| 'while' parExpression statement
|
||||||
| 'do' statement 'while' parExpression ';'
|
| 'do' statement 'while' parExpression ';'
|
||||||
|
@ -673,7 +672,6 @@ switchLabel
|
||||||
;
|
;
|
||||||
|
|
||||||
forControl
|
forControl
|
||||||
options {k=3;} // be efficient for common case: for (ID ID : ID) ...
|
|
||||||
: enhancedForControl
|
: enhancedForControl
|
||||||
| forInit? ';' expression? ';' forUpdate?
|
| forInit? ';' expression? ';' forUpdate?
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in New Issue