[antlr-interest] Lexer options question and debugging suggestion

Sumanto Biswas sumanto at gmail.com
Wed Jul 2 08:01:42 PDT 2008


Hi,

I have an question related to antlr options: If I have an combined
grammar, can I separate lexer and parser options? Currently the
options on top of grammar file file seem to apply for parser only and
if I give a lexer specific option it complains. It would be nice if we
can have some sort of lexer::options.

Also, my understanding is that antlr is used as a tool to solve
problem, many times inside other applications. It would be great if we
could have an option to dynamically set debug mode. That ways, I can
just say lexer.setDebug(boolean), parser.setDebug(boolean) and I would
get debugging information.

Examples of some debugging:
1. Logging inside mTokens() in lexer for each input and its
corresponding token no (and name if possible).
2. Trace of parser decisions.

I am sure there would be more places where this can be implemented.
Just a suggestion to make antlr more useful - that ways I can just set
an option, maybe through a backdoor and get all debugging information,
and then unset to get normal behavior.

Regards,
Sumanto


More information about the antlr-interest mailing list