2011-10-01 12:22:09 +08:00
|
|
|
grammar W;
|
|
|
|
|
2011-10-05 05:26:18 +08:00
|
|
|
s
|
2011-11-11 04:30:12 +08:00
|
|
|
@init {setBuildParseTree(true);}
|
2011-10-05 05:26:18 +08:00
|
|
|
@after {System.out.println(_localctx.toStringTree(this));}
|
|
|
|
: a
|
2011-10-01 12:22:09 +08:00
|
|
|
;
|
2011-10-05 05:26:18 +08:00
|
|
|
|
|
|
|
a : 'x' | 'y'
|
2011-10-01 12:22:09 +08:00
|
|
|
;
|
2011-10-05 05:26:18 +08:00
|
|
|
Z : 'z';
|
2011-10-01 12:22:09 +08:00
|
|
|
|
|
|
|
EQ : '=' ;
|
|
|
|
INT : '0'..'9'+ ;
|
|
|
|
ID : 'a'..'z'+ ;
|
|
|
|
WS : (' '|'\n')+ {skip();} ;
|