[antlr-interest] handling abbreviated keywords in ANTLR

shaun at ebi.ac.uk shaun at ebi.ac.uk
Mon Jul 9 04:48:45 PDT 2007

Thank you Michael for the suggestion.

I was hoping there may be a programmatic alternative (I should have
mentioned) to defining in the grammar each and every keyword alternative.

I now see from some archived posts (ANTLR 2) suggestions of over-riding
testLiterals method and programmatically checking the 'current' token
against a hash.

Does anybody have an example of how to provide this functionality in ANTLR
3 (other than defining each alternative)?

The author of this archived post hints at a solution:


Unfortunately the link he provides is dead:


Thank you,


More information about the antlr-interest mailing list