Re: Scanner generator design hints desired

peter@csg.uwaterloo.ca (Peter Bumbulis)
Sun, 17 Apr 1994 15:03:17 GMT

          From comp.compilers

Related articles
Scanner generator design hints desired dempsey@server.uwindsor.ca (1994-02-16)
Scanner generator design hints desired kanze@lts.sel.alcatel.de (James Kanze) (1994-02-17)
Re: Scanner generator design hints desired peter@csg.uwaterloo.ca (1994-04-17)
| List of all articles for this month |

Newsgroups: comp.compilers
From: peter@csg.uwaterloo.ca (Peter Bumbulis)
Keywords: lex, design
Organization: University of Waterloo
References: 94-02-107
Date: Sun, 17 Apr 1994 15:03:17 GMT

> Hello!! I'm working on a project to develop a scanner generator and was
> wondering if anyone could suggest a good data structure to hold the state
> table generated. A simple 2 dim array is not what I want.


On most systems executable code seems to give about twice the performance
of the best table driven strategy with little or no increase in size. (It
also has the added benefit of a more flexible runtime architecture.) If
your compiler generates decent code for switches (unfortunately there are
relatively few of these) then implementation is straight forward as well.
The trick to doing this is to check for buffer overflow directly (rather
than using the sentinel method). More details (and an implementation) can
be found in


                ftp://csg.uwaterloo.ca/pub/peter/re2c.0.5.tar.gz


and in an upcoming LOPLAS article ``RE2C -- A More Versatile Scanner
Generator'' (included in the above.)


Peter
--


Post a followup to this message

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