> cout << p.getTokenName(r.getType());
> At this point I see the token name is "||" (with the quotes). Surely
> what I wanted was ONLY_IF_NOT_OP.
Look at your MyParserTokenTypes.cpp file. ONLY_IF_NOT_OP is a symbol
equal to an integer like
ALTER = 6
Look in MyParserTokenTypes.txt and you will see:
The tokenNames array defined by ANTLR goes for the one which would have
more meaning in an error message, which would be "alter" instead of
ALTER. It should be pretty easy to use the TokenTypes.txt file to get
what you want though.