[antlr-interest] Dynamic tokens

Florian fvwalter at web.de
Mon Feb 15 04:44:19 PST 2010


Hi,

is it possible to have a lexer/parser which supports a dynamic list of
strings for a specific token?

I.e. something like this:

grammar Test;
rule : name+;
name: NAMETOKEN;
NAMETOKEN: 'Name1' | 'Name2' | 'Name3';

I'd like to replace the list of alternatives for NAMETOKEN with a list
of alternatives that is loaded at program start (or when the parser is
loaded) from an external configuration file.

Is this possible?

Thanks for any hints.

Regards, Florian


More information about the antlr-interest mailing list