At 20:46 +0000 2005/06/13, Frans Englich wrote:
I think I have a special scenario wrt. to comment handling: in one version of
my language, comments are allowed while in another it is not. Hence,
depending on version I want to flag the existence of comments as syntax
errors, regardless of whether they are valid.

You could try to set a context switch in the lexer (see the Flex manual, "start conditions") on the comment lexing rule(s). Then this context switch can be turned on/off in various ways. For example, the lexer could be initiated (right after %% in the .l file) with checking a global variable doing this. This variable can be turned on/off from the parser.
--
  Hans Aberg


_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to