c - How to compile picoProlog from source code? -


i student in computer science, , learning logic programming prolog.

i have found interesting prolog interpreter, picoprolog (http://spivey.oriel.ox.ac.uk/corner/logic_programming).

to know more prolog, trying compile source code, failed.

in web page, said:

the interpreter source written in minimal dialect of pascal, avoiding many features including pointers, using macros overcome of pascal's limitations, in style inspired kernighan , plauger's book software tools in pascal. comes translator pascal dialect c can used build interpreter , source macro processor needed.

to build interpreter on linux machine, extract tar file , type make. building happens in several stages:

  1. first, pascal-to-c translator ptc built c source, including lexer , parser written lex , yacc. file readme gives details of restricted pascal subset accepted translator.
  2. next, ptc used build macro processor ppp.
  3. finally, picoprolog interpreter built source code in file pprolog.x first expanding macros using ppp obtain file pprolog.p, translating c ptc, , lastly compiling c code.

text , software copyright © j. m. spivey, 1996, 2002, 2010.

they said compiling on linux only, don't know how compile source code in windows machine. can compile turbo pascal 7.0 (without requirement) on windows xp? can remove part of script pascal compiling only?

i found question while googling, , though it's old, thought helpful add definitive answer author of program.

it indeed not hard picoprolog compile free pascal compiler. i've incorporated marco's suggestions source, fixed small bug revealed, , added workaround odd feature of free pascal. results can found on bitbucket page:

http://bitbucket.org/spivey/pprolog

with instructions building in readme.

note: built free pascal under linux on x86_64, haven't tested on windows. can't see reason why wouldn't work.