mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-06-20 08:46:14 -06:00
now (+) in the abstract syntax works, i.e. it knows how to deal with partial sums
This commit is contained in:
@@ -15,9 +15,17 @@ typedef struct {
|
||||
PgfEvalGates* eval_gates; // cached from pgf->abstr->eval_gates
|
||||
GuPool* pool;
|
||||
GuExn* err;
|
||||
void* enter_stack_ptr;
|
||||
void* tmp; // for temporary register spills
|
||||
PgfIndirection cafs[]; // derived from gu_seq_data(pgf->abstr->eval_gates->cafs)
|
||||
} PgfEvalState;
|
||||
|
||||
typedef struct {
|
||||
PgfLiteral lit;
|
||||
GuBuf* consts;
|
||||
void* enter_stack_ptr;
|
||||
} PgfEvalAccum;
|
||||
|
||||
typedef struct PgfEnv PgfEnv;
|
||||
|
||||
struct PgfEnv {
|
||||
@@ -53,6 +61,12 @@ typedef struct {
|
||||
PgfLiteral lit;
|
||||
} PgfValueLit;
|
||||
|
||||
typedef struct {
|
||||
PgfClosure header;
|
||||
PgfLiteral lit;
|
||||
GuBuf* consts;
|
||||
} PgfValueSum;
|
||||
|
||||
typedef struct {
|
||||
PgfClosure header;
|
||||
PgfClosure* fun;
|
||||
@@ -70,6 +84,7 @@ struct PgfEvalGates {
|
||||
PgfFunction evaluate_value_const;
|
||||
PgfFunction evaluate_meta;
|
||||
PgfFunction evaluate_gen;
|
||||
PgfFunction evaluate_sum;
|
||||
PgfFunction evaluate_caf;
|
||||
|
||||
PgfFunction update_closure;
|
||||
@@ -90,4 +105,23 @@ PgfClosure*
|
||||
pgf_evaluate_lambda_application(PgfEvalState* state, PgfExprThunk* lambda,
|
||||
PgfClosure* arg);
|
||||
|
||||
void
|
||||
pgf_evaluate_accum_init_int(PgfEvalState* state,
|
||||
PgfEvalAccum* accum, int val);
|
||||
|
||||
void
|
||||
pgf_evaluate_accum_init_str(PgfEvalState* state,
|
||||
PgfEvalAccum* accum, GuString val);
|
||||
|
||||
void
|
||||
pgf_evaluate_accum_init_flt(PgfEvalState* state,
|
||||
PgfEvalAccum* accum, float val);
|
||||
|
||||
void
|
||||
pgf_evaluate_accum_add(PgfEvalState* state,
|
||||
PgfEvalAccum* accum, PgfClosure* closure);
|
||||
|
||||
PgfClosure*
|
||||
pgf_evaluate_accum_done(PgfEvalState* state, PgfEvalAccum* accum);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user