[notes] In this case, we use predicates that depend on global information like we would do for a symbol table. We simply execute the predicates assuming that all necessary information is available. The i++ action is done outside of the prediction and so it is executed. [type] Parser [grammar] grammar T; @parser::members {} s : ({ } a)+ ; a : {}? ID {} | {}? ID {} ; ID : 'a'..'z'+ ; INT : '0'..'9'+; WS : (' '|'\n') -> skip ; [start] s [input] x x y [output] i=1 alt 2 i=2 alt 1 i=3 alt 2