summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf/evaluator.h
blob: b2cffd167914eba56ba793ab22c702dcd5235013 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef PGF_EVALUATOR_H_
#define PGF_EVALUATOR_H_

struct PgfEvalState {
	PgfPGF* pgf;
	GuPool* pool;
	GuExn* err;
	GuBuf* stack;
};

typedef struct PgfClosure PgfClosure;
typedef struct PgfEvalState PgfEvalState;

typedef PgfClosure* (*PgfFunction)(PgfEvalState* state, PgfClosure* val);

struct PgfClosure {
	PgfFunction code;
};

typedef struct {
	PgfClosure header;
	PgfAbsFun* absfun;
	PgfClosure* args[];
} PgfValue;

PgfClosure*
pgf_evaluate_value(PgfEvalState* state, PgfClosure* closure);

void
pgf_evaluate_save_variables(PgfEvalState* state, PgfValue* val);

#endif