help-bison
[Top][All Lists]
Advanced

[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 20:37:02 -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.

OK, so, when I compile gdbmi grammar with push-pull-parse and with
pure-parse I get a compile error. That's because in the generated c file 
yypull_parse calls YYLEX. After I preprocess the file I get,
     gdbmi_char = gdbmi_lex (&gdbmi_lval, &gdbmi_lloc);
but my lexer function doesn't take any arguments. The other 3
combinations, 
  push-parse 
  push-parse, pure-parse
  push-pull-parse
are OK. Only 
  push-pull-parse, pure-aprse
gives an error because it uses YYLEX and passes arguments to the lexer.

Is this an error with the last patch that you applied regarding this
implementation?

Thanks,
Bob Rossi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]