[antlr-interest] Best way to detect java reserved keywords (and fail with an user-friendly error)

Luis Pureza pureza at gmail.com
Tue Oct 11 11:17:22 PDT 2011


Hi,

I'm looking for the best way to detect java reserved keywords in my grammar
and throw a pretty error message such as "Java reserved keywords are not
allowed".
I could define a token { CLASS: 'class' }; and override the
NoViableAltException handler, but I'd like to know if there is a better way.

Thanks,

Luís Pureza


More information about the antlr-interest mailing list