[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: push parser
From: |
Bob Rossi |
Subject: |
Re: push parser |
Date: |
Mon, 30 Jul 2007 17:38:50 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Mon, Jul 02, 2007 at 10:16:13AM -0400, Joel E. Denny wrote:
> On Mon, 2 Jul 2007, Bob Rossi wrote:
>
> > OK. I don't even know what push-pull-parser does. When I submitted the
> > patch, I only had support for push-parser and pure-parser didn't effect
> > it at all. You did some improvements to the patch, and we ended up
> > with push-pull-parser as well. My question is, is push-parser still
> > the same idea as what I committed? If so, what is push-pull-parser?
> >
> > With out knowing what it is, the name seems odd to me. You can have a
> > push parser, and you can have a pull parser, but what's a
> > push-pull-parser? :)
>
> It's both.
>
> %push-parser defines yypush_parse. When combined with %pure-parser, it's
> close to your original form.
>
> %push-pull-parser adds yypull_parse, which is a wrapper around
> yypush_parse that invokes yylex in a loop. For example, one can
> yypush_parse tokens to select a subgrammar and then yypull_parse the rest
> of the input stream.
>
> %push-pull-parser also defines yyparse, which is a wrapper around
> yypull_parse. This yyparse has the same interface as the yyparse
> generated when neither %push-* directive is specified.
>
> yypull_parse and yyparse are not defined for %push-parser because that
> would require the user to define yylex even when he doesn't want to.
>
> To see some of these interfaces, you might try generating a few example
> parsers. It's probably easiest to look at the generated header file.
>
> Again, the following seems more intuitive to me now:
>
> %define push_pull "pull" // default
> %define push_pull "push"
> %define push_pull "both"
>
> > > You can use %pure-parser in combination with either %push-parser or
> > > %push-pull-parser.
OK, as of today, I'm going to document push-parser, push-pull-parser and
pure-parser in combination with those two. It seemed that perhaps you
were thinking about reimplementing how this works. Are you?
I just don't want to document this if you think you'll change it
shortly.
Thanks,
Bob Rossi
~