'true' and 'false' are both lexed as a BooleanLiteral token

This commit is contained in:
Sam Harwell 2013-05-18 11:09:22 -05:00
parent d9e1289d13
commit 9bd3e965ef
2 changed files with 16 additions and 12 deletions

View File

@ -504,7 +504,7 @@ literal
| FloatingPointLiteral | FloatingPointLiteral
| CharacterLiteral | CharacterLiteral
| StringLiteral | StringLiteral
| booleanLiteral | BooleanLiteral
| 'null' | 'null'
; ;
@ -514,11 +514,6 @@ integerLiteral
| DecimalLiteral | DecimalLiteral
; ;
booleanLiteral
: 'true'
| 'false'
;
// ANNOTATIONS // ANNOTATIONS
annotations annotations
@ -917,6 +912,13 @@ HexExponent : ('p'|'P') ('+'|'-')? ('0'..'9')+ ;
fragment fragment
FloatTypeSuffix : ('f'|'F'|'d'|'D') ; FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
// §3.10.3 Boolean Literals
BooleanLiteral
: 'true'
| 'false'
;
CharacterLiteral CharacterLiteral
: '\'' ( EscapeSequence | ~('\''|'\\') ) '\'' : '\'' ( EscapeSequence | ~('\''|'\\') ) '\''
; ;

View File

@ -501,7 +501,7 @@ literal
| FloatingPointLiteral | FloatingPointLiteral
| CharacterLiteral | CharacterLiteral
| StringLiteral | StringLiteral
| booleanLiteral | BooleanLiteral
| 'null' | 'null'
; ;
@ -511,11 +511,6 @@ integerLiteral
| DecimalLiteral | DecimalLiteral
; ;
booleanLiteral
: 'true'
| 'false'
;
// ANNOTATIONS // ANNOTATIONS
annotations annotations
@ -1019,6 +1014,13 @@ HexExponent : ('p'|'P') ('+'|'-')? ('0'..'9')+ ;
fragment fragment
FloatTypeSuffix : ('f'|'F'|'d'|'D') ; FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
// §3.10.3 Boolean Literals
BooleanLiteral
: 'true'
| 'false'
;
CharacterLiteral CharacterLiteral
: '\'' ( EscapeSequence | ~('\''|'\\') ) '\'' : '\'' ( EscapeSequence | ~('\''|'\\') ) '\''
; ;