summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/data.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-09-25 10:35:06 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-09-25 10:35:06 +0000
commit14e6eec5ecdd9ca68a891dbf7173a3620f6e76c1 (patch)
tree6a4b0dd61a023a560f0c5a9b2e4d61f4a62e982e /src/runtime/c/pgf/data.h
parent928217f9d91b45fe48f6e176d42ee5c80d427257 (diff)
now a complete JIT compiler and ByteCode compiler for the def rules in the abstract syntax. there might be some bugs yet to be found, meta variables and computation under lambda is only partially supported
Diffstat (limited to 'src/runtime/c/pgf/data.h')
-rw-r--r--src/runtime/c/pgf/data.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h
index dc6965174..8c9b577d9 100644
--- a/src/runtime/c/pgf/data.h
+++ b/src/runtime/c/pgf/data.h
@@ -76,7 +76,7 @@ typedef struct {
PgfEquations* defns; // maybe null
PgfExprProb ep;
void* predicate;
- void* function;
+ size_t closure_id;
} PgfAbsFun;
extern GU_DECLARE_TYPE(PgfAbsFun, abstract);
@@ -95,31 +95,31 @@ typedef struct {
extern GU_DECLARE_TYPE(PgfAbsCat, abstract);
+typedef struct PgfEvalGates PgfEvalGates;
+
typedef struct {
PgfCId name;
PgfFlags* aflags;
PgfCIdMap* funs; // |-> PgfAbsFun*
PgfCIdMap* cats; // |-> PgfAbsCat*
PgfAbsFun* abs_lin_fun;
+ PgfEvalGates* eval_gates;
} PgfAbstr;
typedef enum {
- PGF_INSTR_ENTER,
- PGF_INSTR_CASE,
- PGF_INSTR_CASE_LIT,
- PGF_INSTR_ALLOC,
- PGF_INSTR_PUT_CONSTR,
- PGF_INSTR_PUT_FUN,
- PGF_INSTR_PUT_CLOSURE,
- PGF_INSTR_PUT_LIT,
- PGF_INSTR_SET,
- PGF_INSTR_SET_PAD,
- PGF_INSTR_PUSH,
- PGF_INSTR_EVAL,
- PGF_INSTR_CALL,
- PGF_INSTR_FAIL,
- PGF_INSTR_UPDATE,
- PGF_INSTR_RET
+ PGF_INSTR_CHECK_ARGS = 0,
+ PGF_INSTR_CASE = 1,
+ PGF_INSTR_CASE_LIT = 2,
+ PGF_INSTR_ALLOC = 3,
+ PGF_INSTR_PUT_CONSTR = 4,
+ PGF_INSTR_PUT_CLOSURE = 5,
+ PGF_INSTR_PUT_LIT = 6,
+ PGF_INSTR_SET = 7,
+ PGF_INSTR_SET_PAD = 8,
+ PGF_INSTR_PUSH = 9,
+ PGF_INSTR_EVAL = 10,
+ PGF_INSTR_RET = 13,
+ PGF_INSTR_FAIL = 15
} PgfInstruction;
struct PgfPGF {