Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!stanford.edu!agate!darkstar!ygdrasil!kjell From: kjell@ygdrasil.ucsc.edu (Kjell E Post) Newsgroups: comp.lang.prolog Subject: Re: Looking for source code for Prolog (general) Message-ID: Date: 30 Apr 91 09:00:37 GMT References: <1991Apr30.075951.9679@news.iastate.edu> Sender: usenet@darkstar.ucsc.edu Lines: 34 tnbf6@isuvax.iastate.edu writes: >I am currently working on a project, and am looking for examples of how to >parse prolog efficently (preferably using c or yacc code). Could anyone >direct me to sites with FTP-able prolog source code, and/or books >documenting how to create prolog parsers (I have noticed that many books >on begining prolog give a rudiementry sketch of the prolog heirarchy, but >they tend not to go into full detail) Thank you in advance. >Norman Nunley --- tnbf6@ccvax.iastate.edu Depends on your ambition level. If you don't want operators it should be fairly easy. Just take the grammar from the DEC-20 manual and yaccify it. The grammar is also reproduced in the manuals for SICStus and Quintus Prolog. [Disclaimer: I haven't tried this but w/o operators it should be easy.] If you want operators, well... the language is then no longer static since operators can change fixity and associativity dynamically while you're parsing the input file. Probably the best thing to look at is the public domain parser read.pl. Send me mail if you want me to dig it out for you. The syntax of the language is in a sense defined by this program. ISO is working on a more formal document. -- | | |\ /| |\ |\ | Kjell Post | Vi i Sverige har blivit | /|\ | \/ | | \ | \ | CS Grad Student, UCSC | trygghetsnarkomaner. /|\ \|/ | | | | | email: kjell@cs.ucsc.edu | Livet best}r inte bara av / | \ | | | | | `--------------------------' trygghet. --Curt Nicolin