diff options
| author | krasimir <krasimir@chalmers.se> | 2015-07-04 15:06:34 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2015-07-04 15:06:34 +0000 |
| commit | 192b1cc01897906f67e15a0046897eb5fecbe002 (patch) | |
| tree | 8eb75e259ac1e4e2d426078bf41db73ff9556837 /src/runtime/c/pgf/reasoner.h | |
| parent | b3680b60258372baa1d5e606026760ef223641b9 (diff) | |
the reasoner's states are now closures just like the code for the def rules. This means more compact JIT compiled code and uniformity with the code for def rules
Diffstat (limited to 'src/runtime/c/pgf/reasoner.h')
| -rw-r--r-- | src/runtime/c/pgf/reasoner.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/runtime/c/pgf/reasoner.h b/src/runtime/c/pgf/reasoner.h index 966ba11a5..714b31b4a 100644 --- a/src/runtime/c/pgf/reasoner.h +++ b/src/runtime/c/pgf/reasoner.h @@ -7,20 +7,6 @@ typedef struct PgfReasoner PgfReasoner; typedef struct PgfReasonerState PgfReasonerState; typedef struct PgfExprState PgfExprState; -typedef void (*PgfPredicate)(PgfReasoner* rs, PgfReasonerState* st); - -void -pgf_reasoner_try_first(PgfReasoner* rs, PgfExprState* parent, PgfAbsFun* absfun); - -void -pgf_reasoner_try_else(PgfReasoner* rs, PgfExprState* prev, PgfAbsFun* absfun); - -void -pgf_reasoner_complete(PgfReasoner* rs, PgfExprState* st); - -void -pgf_reasoner_try_constant(PgfReasoner* rs, PgfExprState* prev, PgfAbsFun* absfun); - typedef struct { PgfFunction code; } PgfClosure; @@ -117,6 +103,9 @@ struct PgfEvalGates { PgfFunction mk_const; + PgfFunction combine1; + PgfFunction combine2; + PgfClosure* (*enter)(PgfReasoner* rs, PgfClosure* closure); GuFinalizer fin; @@ -126,6 +115,24 @@ struct PgfEvalGates { PgfReasoner* pgf_new_reasoner(PgfPGF* pgf, GuExn* err, GuPool* pool, GuPool* out_pool); +void +pgf_reasoner_try_first(PgfReasoner* rs, PgfExprState* parent, PgfAbsFun* absfun); + +void +pgf_reasoner_try_else(PgfReasoner* rs, PgfExprState* prev, PgfAbsFun* absfun); + +void +pgf_reasoner_combine1(PgfReasoner* rs, PgfClosure* closure); + +void +pgf_reasoner_combine2(PgfReasoner* rs, PgfClosure* closure); + +void +pgf_reasoner_complete(PgfReasoner* rs, PgfExprState* st); + +void +pgf_reasoner_try_constant(PgfReasoner* rs, PgfExprState* prev, PgfAbsFun* absfun); + PgfClosure* pgf_evaluate_expr_thunk(PgfReasoner* rs, PgfExprThunk* thunk); |
