18#define REDUCT_EVAL_REGS_INITIAL 64
19#define REDUCT_EVAL_REGS_GROWTH_FACTOR 2
21#define REDUCT_EVAL_FRAMES_INITIAL 32
22#define REDUCT_EVAL_FRAMES_GROWTH_FACTOR 2
28typedef struct reduct_eval_frame
40typedef struct reduct_eval_state
Core definitions and structures.
reduct_uint64_t reduct_handle_t
Handle type.
REDUCT_API reduct_handle_t reduct_eval_string(reduct_t *reduct, const char *str, reduct_size_t len)
Parses, compiles and evaluates a string.
REDUCT_API void reduct_eval_state_deinit(reduct_eval_state_t *state)
Deinitialize an evaluation state structure.
REDUCT_API reduct_handle_t reduct_eval_file(reduct_t *reduct, const char *path)
Parses, compiles and evaluates a file.
REDUCT_API reduct_handle_t reduct_eval_call(reduct_t *reduct, reduct_handle_t callable, reduct_size_t argc, reduct_handle_t *argv)
Calls a Reduct callable (closure or native) with arguments.
REDUCT_API reduct_handle_t reduct_eval(reduct_t *reduct, reduct_function_t *function)
Evaluates a compiled Reduct function.
reduct_uint32_t reduct_inst_t
Instruction type.
Evaluation frame structure.
struct reduct_closure * closure
The closure being evaluated.
reduct_inst_t * ip
The current instruction pointer.
reduct_uint32_t prevRegCount
The previous register count to restore upon return.
reduct_uint32_t base
The base register, where the functions registers start.
Evaluation state structure.
reduct_uint32_t frameCapacity
reduct_eval_frame_t * frames
reduct_uint32_t frameCount
reduct_uint32_t regCapacity
Compiled function structure.