« Return to Thread: Grammar for parsing regular expression

Re: Grammar for parsing regular expression

by J.Chris Findlay :: Rate this Message:

Reply to Author | View in Thread

On Thu, Apr 16, 2009 at 3:48 AM, Randall R Schulz <rschulz@...> wrote:
> So you can save yourself time and energy by accepting the fundamental
> fact that REs cannot be parsed by REs.

At least, not all at once (c:
(Though PCRE-style RE's can get close, and given a bounded RE text
(i.e. extracted from everything else by some lexical state change or
similar), are a great help at splitting it up.)

When I built a PCRE parser, it was its own animal (hand-coded state
machine) and only dealt with RE's.  To parse RE's out of something
else its much easier (read only possible) to do it as either a lexical
state subset or a separate parser, depending on things like how
complex this particular dialect of RE's is.

--
- J.Chris Findlay
  (c:

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Grammar for parsing regular expression