prolog and recursive descent parsing?

carl immanuel manalo <carl_thinks_cs@yahoo.com>
Sun, 16 Sep 2007 16:44:28 -0700 (PDT)

          From comp.compilers

Related articles
prolog and recursive descent parsing? carl_thinks_cs@yahoo.com (carl immanuel manalo) (2007-09-16)
Re: prolog and recursive descent parsing? oliverhunt@gmail.com (oliverhunt@gmail.com) (2007-09-18)
Re: prolog and recursive descent parsing? haberg@math.su.se (2007-09-19)
Re: prolog and recursive descent parsing? peter.ludemann@gmail.com (2007-09-21)
| List of all articles for this month |

From: carl immanuel manalo <carl_thinks_cs@yahoo.com>
Newsgroups: comp.compilers
Date: Sun, 16 Sep 2007 16:44:28 -0700 (PDT)
Organization: Compilers Central
Keywords: prolog, parse, question

How does prolog use recursive descent parsing to solve problems given
to it?. Does it make a graph of the parse tree or something?


I've only encountered recursive descent parsing to solve problems like
boolean algebra or number arithmetic but prolog can do much more than
this.


I understand that it's easy enough to do for facts like.


male(bill).
female(mary).


one only has to compare the query to the facts in the database per
token. but what about rules like?


parent(X,Y):-mother(X,Y).
grandparent(X,Y):-parent(X,Z),parent(Z,Y).


I find it difficult to imagine that you would only check them per
token.


So, how does prolog handle this?


Post a followup to this message

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