20 lines
195 B
Plaintext
20 lines
195 B
Plaintext
|
|
grammar TreeRewrite;
|
||
|
|
|
||
|
|
options {
|
||
|
|
output=AST;
|
||
|
|
language=ObjC;
|
||
|
|
}
|
||
|
|
|
||
|
|
rule: INT subrule -> ^(subrule INT)
|
||
|
|
;
|
||
|
|
|
||
|
|
subrule
|
||
|
|
: INT
|
||
|
|
;
|
||
|
|
|
||
|
|
INT : ('0'..'9')+
|
||
|
|
;
|
||
|
|
|
||
|
|
WS : ' ' {$channel=HIDDEN;}
|
||
|
|
;
|