Re: Q: Recursive Descent w/Backtracking

bevan@cs.man.ac.uk (Stephen J Bevan)
Mon, 31 Oct 1994 22:45:23 GMT

          From comp.compilers

Related articles
Q: Recursive Descent w/Backtracking SCHMIDTG@iccgcc.cs.hh.ab.com (1994-10-21)
Re: Q: Recursive Descent w/Backtracking rockwell@nova.umd.edu (1994-10-28)
Re: Q: Recursive Descent w/Backtracking ichudov@wiltel.com (1994-10-28)
Re: Q: Recursive Descent w/Backtracking davidm@Rational.COM (1994-10-25)
Re: Q: Recursive Descent w/Backtracking bevan@cs.man.ac.uk (1994-10-31)
Re: Q: Recursive Descent w/Backtracking pjj@cs.man.ac.uk (1994-10-28)
Re: Q: Recursive Descent w/Backtracking hbaker@netcom.com (1994-11-03)
Re: Q: Recursive Descent w/Backtracking ridoux@irisa.fr (1994-11-07)
| List of all articles for this month |

Newsgroups: comp.compilers
From: bevan@cs.man.ac.uk (Stephen J Bevan)
Keywords: parse
Organization: Department of Computer Science; University of Manchester
References: 94-10-151
Date: Mon, 31 Oct 1994 22:45:23 GMT

SCHMIDTG@iccgcc.cs.hh.ab.com writes:
      I have a rough outline of an algorithm that is designed to handle this
      case. It uses a stack to keep track of the set of production choices
      which have been applied and the current input pointer (to string w)
      in case backtracking has to move the pointer back.
      ... Unfortunately, the algorithm is very unclear as to how the
      unexplored the nodes are managed so that the proper node is always
      explored at the right point in time.


      So does anyone have a lucid description of an algorithm which will handle
      backtracking over all possibilites of a grammar tree?


A simple combinator parser will do this by default i.e. you have to
work hard to get it not to backtrack. Descriptions of combinator
parsers can be found in many books on functional language programming,
and there are also a number of good papers on the subject. See the
FAQ in comp.lang.functional for exact references.
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.