Re: Several flex scanners share common rules/definitions?

"Steve Johnson" <sjohnson@mathworks.com>
13 Jul 2004 10:52:58 -0400

          From comp.compilers

Related articles
Several flex scanners share common rules/definitions? markus.cl@gmx.de (2004-06-26)
Re: Several flex scanners share common rules/definitions? cbarron413@adelphia.net (Carl Barron) (2004-06-28)
Re: Several flex scanners share common rules/definitions? snicol@apk.net (Scott Nicol) (2004-06-28)
Re: Several flex scanners share common rules/definitions? haberg@matematik.su.se (Hans Aberg) (2004-06-28)
Re: Several flex scanners share common rules/definitions? clint@0lsen.net (Clint Olsen) (2004-06-30)
Re: Several flex scanners share common rules/definitions? johnmillaway@yahoo.com (John Millaway) (2004-06-30)
Re: Several flex scanners share common rules/definitions? sjohnson@mathworks.com (Steve Johnson) (2004-07-13)
| List of all articles for this month |
From: "Steve Johnson" <sjohnson@mathworks.com>
Newsgroups: comp.compilers
Date: 13 Jul 2004 10:52:58 -0400
Organization: The MathWorks, Inc.
References: 04-06-102 04-06-124
Keywords: lex
Posted-Date: 13 Jul 2004 10:52:58 EDT

You might write a single file with two start states, and use it for both
applications. If the rulesets are too different, this will be overkill for
each application, but it does make the maintenance easier.


"John Millaway" <johnmillaway@yahoo.com> wrote in message
> --- Markus Dehmann <markus.cl@gmx.de> wrote:
> > I have two scanners that use basically the same regular expressions
> > and differ only in a few details. How can I write the two lex files so
> > that I don't have to write the common things twice?
>
> Hi Markus, You've two options. You could use a preprocessor, such as `m4' or
> a custom script, or you could include both scanners in the same file, but
> within different start states.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.