mb_interpreter_t |
MyBASIC2 uses an interpreter structure to store data, pointers and data structures during parsing and running period; like local/global function directory, global variable dictionary, abstract syntax tree, parsing/running/debugging context, error information etc. An interpreter structure is a unit of MyBASIC2 environment and is created when calling mb_open. Function callbacks between MyBASIC2 script and host program all pass this structure as the first parameter. An interpreter structure can have children attached to them. The children are attached in a flat list in the current implementation. A mb_interpreter_t structure is disposed by calling mb_close.
A child interpreter will always inherit:
Unless specified otherwise:
Structure: mb_interpreter_t
typedef struct mb_interpreter_t { int length; uint_t id; void* ast; void* local_func_dict; void* global_func_dict; void* name_space_dict; void* local_var_dict; void* global_var_dict; void* environment_var_dict; void* loaded_libs; void* loaded_includes; void* namespace_stack; void* active_name_space; void* parsing_context; void* running_context; void* debugger_context; void* pParent; void* pCaller; char* pSysFiles; char* pFileName; char* pModule; char* pPassword; real_t version; mb_error_e last_error; mb_value_t exit_code; mb_termstate_t terminating; void* last_error_module; void* last_error_linked; WORD last_error_row; WORD last_error_col; WORD noofchildren; WORD break_key; WORD base; WORD option_flags; WORD environment; void* children; handle_t trace_window; mb_error_handler_t error_handler; mb_check_keyboard_t check_keyboard_handler; mb_print_func_t printer; mb_input_func_t inputer; mb_console_func_t console; DWORD hThread; LPCRITICAL_SECTION pCritical_section; void* userdata; } mb_interpreter_t; |