[antlr-interest] Switching lexer rules on/off from parser

Martin Probst mail at martin-probst.com
Mon Mar 21 09:26:47 PST 2005


Hi,

> The "be careful" has to do with lookahead.  If the lexer gets a few
> tokens ahead of the parser, it's possible to "see" a newline in
> declaration mode that should, in fact, terminate a statement.

This "be careful" should be taken very seriously. If you are using C++
code generation you will definetly run into problems as the current
implementation always looks one token ahead of the parser. I once wrote
a mail and a small patch to the list but Ric apparently didn't have the
time to look into that. If you run into the problem I can give you that
patch.

mfg
Martin



More information about the antlr-interest mailing list