summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/data.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-08-11 10:59:10 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-08-11 10:59:10 +0000
commit584d589041f63fdd3ea777019679275657902c2d (patch)
tree6150ef1da26bc76e0c3e14954e080f9a801b45f4 /src/runtime/c/pgf/data.h
parent02dda1e66f80047f0a8718557a8bf7cc84c16625 (diff)
a partial support for def rules in the C runtime
The def rules are now compiled to byte code by the compiler and then to native code by the JIT compiler in the runtime. Not all constructions are implemented yet. The partial implementation is now in the repository but it is not activated by default since this requires changes in the PGF format. I will enable it only after it is complete.
Diffstat (limited to 'src/runtime/c/pgf/data.h')
-rw-r--r--src/runtime/c/pgf/data.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h
index d75b17f85..552856995 100644
--- a/src/runtime/c/pgf/data.h
+++ b/src/runtime/c/pgf/data.h
@@ -76,6 +76,7 @@ typedef struct {
PgfEquations* defns; // maybe null
PgfExprProb ep;
void* predicate;
+ void* function;
} PgfAbsFun;
extern GU_DECLARE_TYPE(PgfAbsFun, abstract);
@@ -102,6 +103,25 @@ typedef struct {
PgfAbsFun* abs_lin_fun;
} PgfAbstr;
+typedef enum {
+ PGF_INSTR_EVAL,
+ PGF_INSTR_CASE,
+ PGF_INSTR_CASE_INT,
+ PGF_INSTR_CASE_STR,
+ PGF_INSTR_CASE_FLT,
+ PGF_INSTR_ALLOC,
+ PGF_INSTR_PUT_CONSTR,
+ PGF_INSTR_PUT_CLOSURE,
+ PGF_INSTR_PUT_INT,
+ PGF_INSTR_PUT_STR,
+ PGF_INSTR_PUT_FLT,
+ PGF_INSTR_SET_VALUE,
+ PGF_INSTR_SET_VARIABLE,
+ PGF_INSTR_TAIL_CALL,
+ PGF_INSTR_FAIL,
+ PGF_INSTR_RET
+} PgfInstruction;
+
struct PgfPGF {
uint16_t major_version;
uint16_t minor_version;