UNPKG

@mike-lischke/antlr-tgen

Version:

A generator for antlr-ng runtime test cases

36 lines (28 loc) 675 B
[type] Parser [grammar] grammar T; s : {<LL_EXACT_AMBIG_DETECTION()>} a ';' a ';' a; a : INT {<writeln("\"alt 1\"")>} | ID {<writeln("\"alt 2\"")>} // must pick this one for ID since pred is false | ID {<writeln("\"alt 3\"")>} | {<False()>}? ID {<writeln("\"alt 4\"")>} ; ID : 'a'..'z'+ ; INT : '0'..'9'+; WS : (' '|'\n') -> skip ; [start] s [input] 34; x; y [output] alt 1 alt 2 alt 2 [errors] line 1:4 reportAttemptingFullContext d=0 (a), input='x' line 1:4 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='x' line 1:7 reportAttemptingFullContext d=0 (a), input='y' line 1:7 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='y' [flags] showDiagnosticErrors