[type]
Parser

[grammar]
grammar T;

r
   : (a b | a) EOF {<writeln("$text")>}
   ;
a
   : X Y?
   ;
b
   : Y
   ;
X: 'X';
Y: 'Y';
WS  : [ \r\n\t]+ -> skip ;

[start]
r

[input]
X Y

[output]
"""XY
"""

[errors]
"""line 1:3 missing 'Y' at '<EOF>'
"""

[flags]
predictionMode=SLL
