|Prolog interpreter with flex and bison ... firstname.lastname@example.org (Elias Biris) (1997-01-29)|
|Re: Prolog interpreter with flex and bison ... email@example.com (1997-02-11)|
|From:||firstname.lastname@example.org (Dwight VandenBerghe)|
|Date:||11 Feb 1997 22:08:43 -0500|
On 29 Jan 1997 11:20:24 -0500, Elias Biris <email@example.com>
>My trouble sofar has to do with how to do the variables' binding in a
>way similar to Prolog.
Unless I am missing something here, what you are faced with is
unification, not binding. The straight-forward way to do this is at
runtime, not at compile time. A given argument to a Prolog clause
might take on different "types" depending on who called it, and with
what parameter. You test these at runtime with a sort of switch
statement. Maybe the thing to do is to find a copy of David Warren's
old paper on the WAM (Warren Abstract Machine) and try to generate
code for it, instead of compiled code. I wrote a Prolog compiler into
WAM code back in the mid-eighties for DOE, albeit in Awk (!!), but
most of the details escape me. It wasn't that hard - it took ten
days, as I remember. If my memory about unification is misleading me
here, perhaps someone with more currently firing brain cells in this
area is welcome to jump and and set the story straight!
Return to the
Search the comp.compilers archives again.