17 lines
174 B
ANTLR
17 lines
174 B
ANTLR
grammar Tree;
|
|
|
|
|
|
int_tree_top : int_tree EOF #top
|
|
;
|
|
|
|
int_tree: INT #leaf
|
|
| '(' INT int_tree+ ')' #node
|
|
;
|
|
|
|
|
|
INT: [0-9]+;
|
|
WS : (' '|'\t'|'\n')+ -> skip;
|
|
|
|
|
|
|