@mike-lischke/antlr-tgen
Version:
A generator for antlr-ng runtime test cases
28 lines (21 loc) • 313 B
Plain Text
[type]
Parser
[grammar]
grammar T;
s : a a a;
a : {<False()>}? ID {<writeln("\"alt 1\"")>}
| {<True()>}? INT {<writeln("\"alt 2\"")>}
;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
[start]
s
[input]
3 4 x
[output]
alt 2
alt 2
[errors]
"""line 1:4 no viable alternative at input 'x'
"""