UNPKG

@mike-lischke/antlr-tgen

Version:

A generator for antlr-ng runtime test cases

24 lines (18 loc) 288 B
[type] Parser [grammar] grammar T; s : a a; a : {<LTEquals("1", "\"x\"")>}? ID INT {<writeln("\"alt 1\"")>} | {<LTEquals("1", "\"y\"")>}? ID INT {<writeln("\"alt 2\"")>} ; ID : 'a'..'z'+ ; INT : '0'..'9'+; WS : (' '|'\n') -> skip ; [start] s [input] y 3 x 4 [output] alt 2 alt 1