[type] Parser [grammar] grammar T; r : (a b | a) EOF {} ; 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 '' """ [flags] predictionMode=SLL