diff options
Diffstat (limited to 'dat.h')
-rw-r--r-- | dat.h | 32 |
1 files changed, 27 insertions, 5 deletions
@@ -2,7 +2,9 @@ typedef struct Term Term; typedef struct Binding Binding; typedef struct Goal Goal; typedef struct Choicepoint Choicepoint; -typedef int (*Builtin)(Term *, Term *, Binding **); +typedef struct Clause Clause; +typedef struct Module Module; +typedef int (*Builtin)(Term *, Binding **); struct Term { @@ -36,11 +38,29 @@ struct Goal struct Choicepoint { Goal *goalstack; - Term *retryclause; + Clause *retryclause; uvlong id; /* Unique number for each clause. Used to know where to cut to. */ + Module *currentmodule; Choicepoint *next; }; +struct Clause +{ + Term *head; + Term *body; + uvlong clausenr; + int public; + Clause *next; +}; + +struct Module +{ + /* What about imports */ + Rune *name; + Clause *clauses; + Module *next; +}; + /* Sorted so that a lower value means it comes earlier in the standard ordering */ enum { VariableTerm, @@ -55,7 +75,6 @@ enum { }; int debug; -Term *initgoals; /* Flags */ enum { @@ -66,6 +85,9 @@ enum { int flagdoublequotes; -/* Staate of the running system */ +/* State of the running system */ Choicepoint *choicestack; -Goal *goalstack;
\ No newline at end of file +Goal *goalstack; +Module *modules; +Module *systemmodule; /* The module for the builtins. Everything has access to those */ +Module *usermodule; /* The default module for user defined predicates */ |