[type]
Parser

[grammar]
grammar T;
s
@init {<LL_EXACT_AMBIG_DETECTION()>}
@after {<DumpDFA()>}
   : '{' stat* '}' ;
stat: 'if' ID 'then' stat ('else' ID)?
       | 'return'
       ;
ID : 'a'..'z'+ ;
WS : (' '|'\t'|'\n')+ -> skip ;

[start]
s

[input]
{ if x then return else foo
if x then if y then return else foo }

[output]
Decision 1:
s0-'}'->:s2=>2
s0-'else'->:s1^=>1

[errors]
line 1:19 reportAttemptingFullContext d=1 (stat), input='else'
line 1:19 reportContextSensitivity d=1 (stat), input='else'
line 2:27 reportAttemptingFullContext d=1 (stat), input='else'
line 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}'

[flags]
showDiagnosticErrors

