Any YACC / BISON gurus out there?

John R. Levine johnl at esegue.segue.boston.ma.us
Thu Oct 26 07:57:59 AEST 1989


In article <1341 at ssf> richard at ssf.uucp (Richard Thombs) writes:
>I need to be able to get YACC (or BISON if need be) to fail a parse when an
>action tells it to ... [and parse the token as something else].

Yacc doesn't work that way.  For any grammar that yacc can parse, there is
at most one thing that yacc can do with any token in any state.  If you want
to have context-sensitive parsing, you need to have the parser pass info
back to the lexer to give it hints about what kind of token to look for next.

I wrote a Fortran-77 subset parser a while ago that I have been giving away,
that does a lot of context-sensitive parsing hackery.  Feel free to ask.
-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650
johnl at esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl
Massachusetts has over 100,000 unlicensed drivers.  -The Globe



More information about the Comp.unix.questions mailing list