UNPKG

@mike-lischke/antlr-tgen

Version:

A generator for antlr-ng runtime test cases

28 lines (21 loc) 394 B
[notes] This is a regression test for antlr/antlr4#625 "Duplicate action breaks operator precedence" https://github.com/antlr/antlr4/issues/625 [type] Parser [grammar] grammar T; s @after {<ToStringTree("$ctx"):writeln()>} : e ; e : a=e op=('*'|'/') b=e {}{} | INT {}{} | '(' x=e ')' {}{} ; INT : '0'..'9'+ ; WS : (' '|'\n') -> skip ; [start] s [input] 4 [output] """(s (e 4)) """