[antlr-interest] How to do abbreviation

Gavin Lambert antlr at mirality.co.nz
Fri May 11 23:57:16 PDT 2007


At 18:39 12/05/2007, me 262 wrote:
 >  Is there a way to parse abbreviated key words using ANTLR? For
 >example, I would like to recognize "ex 1" as "example 1".

Can't you just list them as alternates?  eg:

EXAMPLE1: 'example 1' | 'ex 1';
or
EXAMPLE: 'example' | 'ex';



More information about the antlr-interest mailing list