[antlr-interest] How to do abbreviation
open.zone at virgin.net
Sat May 12 03:12:10 PDT 2007
> Is there a way to parse abbreviated key words using ANTLR?
> For example, I would like to recognize "ex 1" as "example 1".
A. Using tokens:
EX_AMPLE = 'ex';
EXAMPLE = 'example';
command: example INT;
example: EX_AMPLE | EXAMPLE;
B. Using rules (can get messy and expect conflicts with IDENT rule):
EXAMPLE: 'ex' ( 'ample' )?;
The best way to contact me is via the list/forum. My time is very limited.
More information about the antlr-interest