|Implementing Thompson's construction firstname.lastname@example.org (Mike Warehime) (2007-12-09)|
|Re: Implementing Thompson's construction email@example.com (eliben) (2007-12-09)|
|Re: Implementing Thompson's construction firstname.lastname@example.org (email@example.com) (2007-12-10)|
|From:||"Mike Warehime" <firstname.lastname@example.org>|
|Date:||Sun, 9 Dec 2007 18:08:49 -0500|
I have read the red dragon book and I understand the algorithms and
how they work. But I am not real good at turning Thompson's
construction into Cor C++ code. I think my mental block is happening
when I try to think about how to incorporate transition and epsilon
transitions into data structures. I understand how to recursive
descent parse a regular expression and have built parse trees for the
regular expressions. Bu there is something I just don't get. I want
to use a lookup table for the transition characters to keep the tables
a little smaller but I don't know what to do for the nfa.
I have dissected the source for flex quite thoroughly, and I find it a
real mess but very convenient to use. Being able to use #define for
almost anything and it works for almost anything on any platform
I want to write a dfa table out and simulate a dfa on input and use it
in a iostream for tokenizing. I don't want or need a flex scanner. Too
much power. Too much complexity. But maybe, I just don't understand.
My goal is to write the dfa out into spaghetti code that does the
lexical analysis from a list of regular expressions.
[You might like re2c. -John]
Return to the
Search the comp.compilers archives again.