[type] Parser [grammar] grammar T; s : a {} a; // do 2x: once in ATN, next in DFA; // action blocks lookahead from falling off of 'a' // and looking into 2nd 'a' ref. !ctx dependent pred a : ID {} | {}? ID {} ; ID : 'a'..'z'+ ; INT : '0'..'9'+; WS : (' '|'\n') -> skip ; [start] s [input] x y [output] alt 1 alt 1