Related articles |
---|
lex/flex and source correspondence parthaspanda22@gmail.com (2007-11-06) |
Re: lex/flex and source correspondence gene.ressler@gmail.com (Gene) (2007-11-08) |
Re: lex/flex and source correspondence dickey@saltmine.radix.net (Thomas Dickey) (2007-11-29) |
From: | Thomas Dickey <dickey@saltmine.radix.net> |
Newsgroups: | comp.compilers |
Date: | Thu, 29 Nov 2007 14:52:10 -0000 |
Organization: | RadixNet Internet Services |
References: | 07-11-023 |
Keywords: | lex, performance |
Posted-Date: | 30 Nov 2007 00:00:16 EST |
parthaspanda22@gmail.com wrote:
> A flex generated scanner could decide to store the entire input file
> in memory. That way, a single buffer can be used in several places in
> the tool chain that uses a scanner.
> Is this an idea that has been explored and thought of as unworthy?
> I know that multiple input files could increase the size of the
> buffer(s) but hey, we are living in the age of 100s of MB of main
> memory.
> Sincerely.
> [This is a very old idea. Turbo Pascal buffered full source files in
> RAM in the 1980s. -John]
Either lex or flex can do this by redefining the input/outputs.
However, flex can be used to support multiple parsers (by restricting
the exported symbols), while for lex it's (ahem) doable but not
simple.
Regarding buffering full source files - even as main memory's
increased, there are still text files that people want to edit which
are larger. So it's not a universal solution...
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Return to the
comp.compilers page.
Search the
comp.compilers archives again.