help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: interesting push parser use case


From: Joel E. Denny
Subject: Re: interesting push parser use case
Date: Sat, 8 Sep 2007 19:23:32 -0400 (EDT)

On Sat, 8 Sep 2007, Joel E. Denny wrote:

> On Sat, 8 Sep 2007, Bob Rossi wrote:
> 
> > The first issue is that I probably need a way to tell the parser that
> > I'm done giving it tokens. That way, it will finish all of it's rules.
> > Is there already a way to do this?
> 
> Yacc-generated parsers expect the last token in the input stream to be 
> token 0.  In the .output file, it's called $end.

I should be more careful.  A negative token number should be equivalent to 
zero.  $end is the usual representation, but I don't see $end in the Open 
Group specification of Yacc.

> > The second issue is slightly more fuzzy. Essentially, after each token I
> > give to the parser, it would probably be useful to know if it just
> > finished a particular rule, and if so, which rule.
> 
> Could you use %parse-param to pass a pointer to a variable to be set by 
> the semantic action of that rule?




reply via email to

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