|--- Regexps, compilers etc., prog help --- firstname.lastname@example.org (1997-02-11)|
|Re: --- Regexps, compilers etc., prog help --- email@example.com (Quinn Tyler Jackson) (1997-02-16)|
|Re: --- Regexps, compilers etc., prog help --- firstname.lastname@example.org (Paul David Fox) (1997-02-16)|
|Re: --- Regexps, compilers etc., prog help --- email@example.com (1997-02-20)|
|Re: --- Regexps, compilers etc., prog help --- firstname.lastname@example.org (Nick Kramer) (1997-02-20)|
|Re: --- Regexps, compilers etc., prog help --- email@example.com (1997-02-22)|
|Re: --- Regexps, compilers etc., prog help --- firstname.lastname@example.org (1997-03-14)|
|Re: --- Regexps, compilers etc., prog help --- email@example.com (1997-03-16)|
|[2 later articles]|
|From:||"Quinn Tyler Jackson" <firstname.lastname@example.org>|
|Date:||16 Feb 1997 22:27:37 -0500|
On 11 Feb 97 at 22:24, Hursh Jain wrote:
> I am interested in writing a regular expression evaluator, and also a
> toy compiler..
Why not take a look at:
as a pattern matcher (in portable C++) that can handle regular
expressions. (It deals with RE's by first translating them to LPM,
and then scanning the LPM.) There is also Henry Spencer's regexp.c
code, worth a good study. Then there is String++, which has regular
expression handling. You'll find that in the Simtel archives.
The RE-to-LPM translator will give you an idea of how RE's can be
parsed. Instead of translating to LPM, however, you will parse to an
array. The scanning part of your RE engine might use the info in that
array when matching against a string.
> [I'd sit down with the Dragon Book and read the chapter on regular
> expresssions and finite state machines. In this case, an ounce of
> theory is worth several hundred pounds of hacking, since it's such a
> thoroughly studied field. -John]
And then there's John's advice... I also suggest Parson's
_Introduction to Compiler Construction_, listed in the comp.compilers
Quinn Tyler Jackson
Return to the
Search the comp.compilers archives again.