[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comments in lexical definitions
From: |
W. L. Estes |
Subject: |
Re: comments in lexical definitions |
Date: |
Thu, 16 Aug 2001 09:37:23 -0400 |
> > Ok, there is an example at the end of the mail. I've used C++ comments
> > for the comments I am missing in lexical definition files.
>
> [Looked at example...]
>
> So you want to be able to put comments *between* individual rules, where
> currently only whitespace is allowed (setting aside initial state blocks).
>
> This immediately raises the problem of distinguishing between such a
> comment and a (possibly) valid pattern to be matched. The syntax for
> patterns is rather generic, meaning there's not much space to squeeze in a
> comment indicator without breaking existing (f)lex inputs. '//' e.g. would
> currently cause a syntax error (two occurences of the "trailing context"
> operator in one rule aren't allowed).
Ok, if you want comments in your flex input, put them as part of the
action. E.g.:
some-pattern ECHO; /* this is my comment */
Breaking existing f/lex programs for a feature that is not needed is
not going to happen.
--Will