*refactored interpreter structure layout.
This commit is contained in:
parent
8a53a948be
commit
ec5c6390b8
@ -752,7 +752,15 @@ typedef struct _tuple3_t {
|
|||||||
#define _JMP_STR 0x02
|
#define _JMP_STR 0x02
|
||||||
|
|
||||||
typedef struct mb_interpreter_t {
|
typedef struct mb_interpreter_t {
|
||||||
|
/** Fundamental */
|
||||||
bool_t valid;
|
bool_t valid;
|
||||||
|
void* userdata;
|
||||||
|
_ls_node_t* ast;
|
||||||
|
/** Memory management */
|
||||||
|
_gc_t gc;
|
||||||
|
_ls_node_t* edge_destroy_objects;
|
||||||
|
_ls_node_t* lazy_destroy_objects;
|
||||||
|
/** Scripting interface and module */
|
||||||
_ht_node_t* local_func_dict;
|
_ht_node_t* local_func_dict;
|
||||||
_ht_node_t* global_func_dict;
|
_ht_node_t* global_func_dict;
|
||||||
#ifdef MB_ENABLE_MODULE
|
#ifdef MB_ENABLE_MODULE
|
||||||
@ -760,8 +768,8 @@ typedef struct mb_interpreter_t {
|
|||||||
char* with_module;
|
char* with_module;
|
||||||
_ls_node_t* using_modules;
|
_ls_node_t* using_modules;
|
||||||
#endif /* MB_ENABLE_MODULE */
|
#endif /* MB_ENABLE_MODULE */
|
||||||
|
/** Parsing and interpreting */
|
||||||
char* source_file;
|
char* source_file;
|
||||||
_ls_node_t* ast;
|
|
||||||
_parsing_context_t* parsing_context;
|
_parsing_context_t* parsing_context;
|
||||||
_running_context_t* running_context;
|
_running_context_t* running_context;
|
||||||
_ls_node_t* var_args;
|
_ls_node_t* var_args;
|
||||||
@ -774,27 +782,25 @@ typedef struct mb_interpreter_t {
|
|||||||
_ls_node_t* sub_stack;
|
_ls_node_t* sub_stack;
|
||||||
_ls_node_t* suspent_point;
|
_ls_node_t* suspent_point;
|
||||||
int schedule_suspend_tag;
|
int schedule_suspend_tag;
|
||||||
_ls_node_t* edge_destroy_objects;
|
|
||||||
_ls_node_t* lazy_destroy_objects;
|
|
||||||
_gc_t gc;
|
|
||||||
int_t no_eat_comma_mark;
|
int_t no_eat_comma_mark;
|
||||||
_ls_node_t* skip_to_eoi;
|
_ls_node_t* skip_to_eoi;
|
||||||
_ls_node_t* in_neg_expr;
|
_ls_node_t* in_neg_expr;
|
||||||
|
#ifdef MB_ENABLE_STACK_TRACE
|
||||||
|
_ls_node_t* stack_frames;
|
||||||
|
#endif /* MB_ENABLE_STACK_TRACE */
|
||||||
|
/** Error handling */
|
||||||
bool_t handled_error;
|
bool_t handled_error;
|
||||||
mb_error_e last_error;
|
mb_error_e last_error;
|
||||||
char* last_error_file;
|
char* last_error_file;
|
||||||
int last_error_pos;
|
int last_error_pos;
|
||||||
unsigned short last_error_row;
|
unsigned short last_error_row;
|
||||||
unsigned short last_error_col;
|
unsigned short last_error_col;
|
||||||
#ifdef MB_ENABLE_STACK_TRACE
|
/** Handlers */
|
||||||
_ls_node_t* stack_frames;
|
|
||||||
#endif /* MB_ENABLE_STACK_TRACE */
|
|
||||||
mb_debug_stepped_handler_t debug_stepped_handler;
|
mb_debug_stepped_handler_t debug_stepped_handler;
|
||||||
mb_error_handler_t error_handler;
|
mb_error_handler_t error_handler;
|
||||||
mb_print_func_t printer;
|
mb_print_func_t printer;
|
||||||
mb_input_func_t inputer;
|
mb_input_func_t inputer;
|
||||||
mb_import_handler_t import_handler;
|
mb_import_handler_t import_handler;
|
||||||
void* userdata;
|
|
||||||
} mb_interpreter_t;
|
} mb_interpreter_t;
|
||||||
|
|
||||||
/* Operations */
|
/* Operations */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user