home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!udel!gvls1!faatcrl!iecc!compilers-sender
- From: jarmo@ksvltd.FI (Jarmo Raiha)
- Newsgroups: comp.compilers
- Subject: Backtracking yacc
- Keywords: yacc, parse, question, comment
- Message-ID: <92-09-059@comp.compilers>
- Date: 10 Sep 92 23:01:10 GMT
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: Jarmo Raiha <jarmo@ksvltd.FI>
- Organization: Compilers Central
- Lines: 18
- Approved: compilers@iecc.cambridge.ma.us
-
- Has anybody seen such a thing as backtracking yacc? What I had in mind
- was a LALR parser that resolves ambiquity by backtracking to the point
- where it had multiple routes to go. It would parse the input until it
- encounters a dead end, and after that it would try an alternative path.
-
- I know this would not solve much. Resolving the the conflicts 'the wrong
- way' can still result to an errorless parsing, but I would like to know if
- there have been any study about this approach. Is this a completely dead
- idea ?
-
- Jarmo Raiha
- [That might help for conflicts in an unambiguous grammar that needs more than
- one token lookahead, but not for the more common case that a conflict is due
- to a truly ambiguous grammar. Besides, isn't there a theorem that says that
- any LR(k) grammar can be rewritten as LR(1)? -John]
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-