richard@satori.cs.mu.OZ.AU (Richard Hagen) (01/08/90)
Has anyone seen any references for the problems/advantages of bidirectional grammars? I'm working on an implementation in NU-Prolog, but *any* pointers would be appreciated. Thanks, richard
cleary@cpsc.ucalgary.ca (John Cleary) (01/09/90)
In article <2980@munnari.oz.au>, richard@satori.cs.mu.OZ.AU (Richard Hagen) writes: > Has anyone seen any references for the problems/advantages of bidirectional > grammars? I'm working on an implementation in NU-Prolog, but *any* pointers > would be appreciated. > > Thanks, > > richard I have done this a number of times, at least once to actually achieve something other than an academic exercise. What you have to realize is that you need a breadth first search to get a reasonably interesting behaviour when you reverse the grammar. The easiest way to do a breadth first search is to use a bounded depth search where the depth is increased after all the solutions at the earlier depth are found. It is straightforward to write an interpreter to do this, and if you are a little more bold you can even compile away the interpreter. John Cleary