#ifndef RUNTIME_SCOPE_H_ #define RUNTIME_SCOPE_H_ #include "var-map.h" #include #include #include #include #include struct bshell_runtime; enum bshell_runtime_scope_type { RUNTIME_SCOPE_OTHER = 0, RUNTIME_SCOPE_SCRIPT, RUNTIME_SCOPE_GLOBAL, }; struct bshell_runtime_scope { enum bshell_runtime_scope_type s_type; fx_queue_entry s_entry; struct var_map s_vars; fx_hashtable *s_functions; FX_VECTOR_DECLARE(fx_value, s_stack); size_t s_ip; bshell_scriptblock *s_block; bshell_instruction *s_instr; size_t s_nr_instr; fx_value *s_pool; size_t s_nr_pool; }; extern struct bshell_runtime_scope *runtime_push_scope( struct bshell_runtime *rt, enum bshell_runtime_scope_type type, bshell_scriptblock *block); extern void runtime_pop_scope(struct bshell_runtime *rt); extern struct bshell_runtime_scope *runtime_get_scope( struct bshell_runtime *rt); extern void bshell_runtime_scope_push_value( struct bshell_runtime_scope *scope, const fx_value *value); extern fx_value bshell_runtime_scope_pop_value( struct bshell_runtime_scope *scope); extern void bshell_runtime_scope_set_block( struct bshell_runtime_scope *scope, bshell_scriptblock *block); #endif