🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2073

Re: Looking for source code for Prolog (general)

#2073
From: Kjell E Post
Date: Tue, 30 Apr 1991 09:00
34 lines
1987 bytes
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
Technical Details
Message-ID: <kjell.673002037@ygdrasil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!stanford.edu!agate!darkstar!ygdrasil!kjell
References: <1991Apr30.075951.9679@news.iastate.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <kjell.673002037@ygdrasil>
Date: 30 Apr 91 09:00:37 GMT
References: <1991Apr30.075951.9679@news.iastate.edu>
Sender: usenet@darkstar.ucsc.edu
Lines: 34