[antlr-interest] Conditional lexing

Mike Lischke mike at lischke-online.de
Fri Sep 14 06:48:08 PDT 2012


> The next step is now to keep a global flag to track when a version comment is active so I can properly handle the trailing '*/' part. What is usually used for such a flag, USERx?


Using USERx doesn't work for at least two reasons: the lexer state seems to be reset for each token run and using it in a gated semantic predicate leads to a dfa which excludes the gated expression, so it is not even attempted to match it. Solved by using a member var.

Mike
-- 
www.soft-gems.net




More information about the antlr-interest mailing list