Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!lotus!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.unix.questions Subject: Re: Any YACC / BISON gurus out there? Keywords: yacc bison Message-ID: <1989Oct25.215759.2319@esegue.segue.boston.ma.us> Date: 25 Oct 89 21:57:59 GMT References: <1341@ssf> Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine) Organization: Segue Software, Cambridge MA Lines: 15 In article <1341@ssf> richard@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@esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl Massachusetts has over 100,000 unlicensed drivers. -The Globe