Related articles |
---|
Lex state table format bfish@netxs.net (Brad Fish) (1998-09-22) |
Re: Lex state table format mravirala@my-dejanews.com (1998-09-26) |
Re: Lex state table format qjackson@wave.home.com (Quinn Tyler Jackson) (1998-09-29) |
From: | "Quinn Tyler Jackson" <qjackson@wave.home.com> |
Newsgroups: | comp.compilers |
Date: | 29 Sep 1998 15:36:28 -0400 |
Organization: | Compilers Central |
Keywords: | lex |
>Can anyone give me a quick rundown on the Lex state table
>format? I'm looking to create my own scanner generator.
>I understand how Lex translates its input into a series of
>states, but what's the best way to storethose states?
I don't know about "best" -- but I wrote a fairly easy to follow FSA
table generator that generates a table that scans LPM clauses. The
FSA generator itself is available at:
ftp://qtj.net/pub/source/powerbasic/lpm/fsagen_c.bas
The table it produces can be found in the file lpm_tbl.cpp, in the
archive:
ftp://qtj.net/pub/source/cpp/rdf_src.zip
the scan done using the table is found in the lpm_cm.cpp file in the
same archive.
Again, it's not the slickest thing in the world, but it is fairly easy
to follow. It produces a two dimensional state/shift type array which
has served me well enough.
--
Quinn Tyler Jackson
email: qjackson@wave.home.com
url: http://www.qtj.net/~quinn/
ftp: qtj.net
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.