fix playground

This commit is contained in:
Terence Parr 2012-09-29 17:02:33 -07:00
parent db1bfa9c03
commit 3575e9c3c7
5 changed files with 4 additions and 14 deletions

View File

@ -23,4 +23,4 @@ expr: INT
ID : ('a'..'z'|'A'..'Z')+ ;
INT : '0'..'9'+ ;
WS : (' '|'\t'|'\n'|'\r')+ {$channel=HIDDEN;} ;
WS : (' '|'\t'|'\n'|'\r')+ {setChannel(HIDDEN);} ;

View File

@ -1 +0,0 @@
a = b;

View File

@ -1,10 +0,0 @@
grammar Fuzzy;
options { tokenVocab=JavaLR; }
scan: (pattern|.)* EOF ;
pattern
: a=Identifier '=' b=Identifier ';'
{System.out.printf("assign %s=%s", $a.text, $b.text);}
;

View File

@ -141,10 +141,10 @@ fragment
UnicodeEscape
: '\\' 'u' HexDigit HexDigit HexDigit HexDigit
;// $ANTLR src "JavaCombined.g" 963
ENUM: 'enum' {if (!enumIsKeyword) $type=Identifier;}
ENUM: 'enum' {if (!enumIsKeyword) setType(Identifier);}
;// $ANTLR src "JavaCombined.g" 966
ASSERT
: 'assert' {if (!assertIsKeyword) $type=Identifier;}
: 'assert' {if (!assertIsKeyword) setType(Identifier);}
;// $ANTLR src "JavaCombined.g" 970
Identifier
: Letter (Letter|JavaIDDigit)*

View File

@ -1,4 +1,5 @@
grammar T;
options {k=3;}
s : ID ;
ID : 'a'..'z'+ ;
WS : (' '|'\n') {skip();} ;