[type]
Parser

[grammar]
grammar T;
s : e {<writeln("$e.result")>} ;
e returns [<StringType()> result]
    :   ID '=' e1=e    {$result = <AppendStr("\"(\"", AppendStr("$ID.text", AppendStr("\"=\"", AppendStr("$e1.result", "\")\""))))>;}
    |   ID    {$result = $ID.text;}
    |   e1=e '+' e2=e  {$result = <AppendStr("\"(\"", AppendStr("$e1.result", AppendStr("\"+\"", AppendStr("$e2.result", "\")\""))))>;}
    ;
ID : 'a'..'z'+ ;
INT : '0'..'9'+ ;
WS : (' '|'\n') -> skip ;

[start]
s

[input]
a

[output]
"""a
"""

