Related articles |
---|
--- Regexps, compilers etc., prog help --- sjain@a.chem.upenn.edu (1997-02-11) |
Re: --- Regexps, compilers etc., prog help --- the_artful_parser@null.net (Quinn Tyler Jackson) (1997-02-16) |
Re: --- Regexps, compilers etc., prog help --- pfox@lehman.com (Paul David Fox) (1997-02-16) |
Re: --- Regexps, compilers etc., prog help --- jmccarty@sun1307.spd.dsccc.com (1997-02-20) |
Re: --- Regexps, compilers etc., prog help --- nkramer@cs.cmu.edu (Nick Kramer) (1997-02-20) |
Re: --- Regexps, compilers etc., prog help --- ok@cs.rmit.edu.au (1997-02-22) |
Re: --- Regexps, compilers etc., prog help --- kanze@gabi-soft.fr (1997-03-14) |
Re: --- Regexps, compilers etc., prog help --- the_artful_parser@null.net (1997-03-16) |
[2 later articles] |
From: | "Quinn Tyler Jackson" <the_artful_parser@null.net> |
Newsgroups: | comp.compilers |
Date: | 16 Feb 1997 22:27:37 -0500 |
Organization: | Parse City |
References: | 97-02-072 |
Keywords: | lex, DFA |
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:
http://mypage.direct.ca/q/qjackson/
There is a regular expression-to-LPM translator in Javascript, as well
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
FAQ.
Cheers,
Quinn Tyler Jackson
--
the_artful_parser@null.net
http://mypage.direct.ca/q/qjackson/
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.