[type]
Parser

[grammar]
grammar T;

<ImportListener("T")>
<LRListener("T")>

s
@after {
<ContextMember("$ctx", "r"):ToStringTree():writeln()>
<ContextMember("$ctx", "r"):WalkListener()>
}
   : r=e ;
e : e op='*' e
   | e op='+' e
   | INT
   ;
MULT: '*' ;
ADD : '+' ;
INT : [0-9]+ ;
ID  : [a-z]+ ;
WS : [ \t\n]+ -> skip ;

[start]
s

[input]
1+2*3

[output]
(e (e 1) + (e (e 2) * (e 3)))
1
2
3
2 3 2
1 2 1

