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? _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison