[type] Parser [grammar] grammar T; s @init { } @after { } : '${' v '}' ; v : A #altA | B #altB ; A : 'a' ; B : 'b' ; WHITESPACE : [ \n\t\r]+ -> channel(HIDDEN) ; ERROR : . ; [start] s [input] ${ ? a ?} [output] """(s ${ (v ? a) ? }) """ [errors] line 1:3 extraneous input '?' expecting {'a', 'b'} line 1:7 extraneous input '?' expecting '}' [skip] Cpp Go PHP