Main Page | Class List | Directories | File List | Class Members | File Members

slang.c File Reference

#include "slinclud.h"
#include <math.h>
#include "slang.h"
#include "_slang.h"

Go to the source code of this file.

Classes

struct  Function_Header_Type
struct  _pSLang_Function_Type
struct  SLang_Global_Var_Type
struct  SLang_Local_Var_Type
struct  Linenum_Info_Type
struct  _pSLBlock_Type
struct  Function_Stack_Type
struct  Block_Context_Type
struct  _Special_NameTable_Type
struct  _Compile_Context_Type

Defines

#define USE_COMBINED_BYTECODES   1
#define USE_UNUSED_BYCODES_IN_SWITCH   1
#define SLANG_MAX_LOCAL_VARIABLES   255
#define INTERRUPT_ERROR   0x01
#define INTERRUPT_SIGNAL   0x02
#define IS_SLANG_ERROR   (Handle_Interrupt & INTERRUPT_ERROR)
#define GET_CLASS_TYPE(x)   (((x) < 256) ? The_Class_Type[(x)] : _pSLang_get_class_type(x))
#define GET_CLASS(cl, t)
#define GET_LOWER_CLASS(cl, t)
#define IS_ARITH_TYPE(t)   (((t) < 256) ? Is_Arith_Type_Array[t] : 0)
#define GATHER_STATISTICS   0
#define COMPILE_BLOCK_TYPE_FUNCTION   1
#define COMPILE_BLOCK_TYPE_BLOCK   2
#define COMPILE_BLOCK_TYPE_TOP_LEVEL   3
#define COMPILE_COMBINE_STATS   0

Typedefs

typedef _pSLBlock_Type SLBlock_Type
typedef void(* VF0_Type )(void)
typedef void(* VF1_Type )(VOID_STAR)
typedef void(* VF2_Type )(VOID_STAR, VOID_STAR)
typedef void(* VF3_Type )(VOID_STAR, VOID_STAR, VOID_STAR)
typedef void(* VF4_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef void(* VF5_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef void(* VF6_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef void(* VF7_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef long(* LF0_Type )(void)
typedef long(* LF1_Type )(VOID_STAR)
typedef long(* LF2_Type )(VOID_STAR, VOID_STAR)
typedef long(* LF3_Type )(VOID_STAR, VOID_STAR, VOID_STAR)
typedef long(* LF4_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef long(* LF5_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef long(* LF6_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef long(* LF7_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef double(* FF0_Type )(void)
typedef double(* FF1_Type )(VOID_STAR)
typedef double(* FF2_Type )(VOID_STAR, VOID_STAR)
typedef double(* FF3_Type )(VOID_STAR, VOID_STAR, VOID_STAR)
typedef double(* FF4_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef double(* FF5_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef double(* FF6_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef double(* FF7_Type )(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
typedef _Special_NameTable_Type Special_NameTable_Type
typedef _Compile_Context_Type Compile_Context_Type

Functions

static SLang_Name_Typefind_global_hashed_name (char *, unsigned long, SLang_NameSpace_Type *, SLang_NameSpace_Type *, SLang_NameSpace_Type *, int)
static void free_function_header (Function_Header_Type *)
static int check_signals (void)
void _pSLang_set_class_info (SLtype t, SLang_Class_Type *cl)
SLclass_Type _pSLang_get_class_type (SLtype t)
static void do_traceback (char *)
static void do_function_traceback (Function_Header_Type *, unsigned int)
static int init_interpreter (void)
static _INLINE_ int pop_object (SLang_Object_Type *x)
int SLang_pop (SLang_Object_Type *x)
static int pop_2_objs (SLang_Object_Type *a, SLang_Object_Type *b)
static _INLINE_ int pop_n_objs_reverse (SLang_Object_Type *x, unsigned int n)
_INLINE_ int SLang_peek_at_stack (void)
int _pSLang_peek_at_stack2 (SLtype *_typep)
int SLang_peek_at_stack_n (unsigned int n)
static int pop_ctrl_integer (int *i)
int SLang_peek_at_stack1_n (unsigned int n)
int SLang_peek_at_stack1 (void)
_INLINE_ void SLang_free_object (SLang_Object_Type *obj)
static _INLINE_ int push_object (SLang_Object_Type *x)
int SLang_push (SLang_Object_Type *x)
int SLclass_push_ptr_obj (SLtype type, VOID_STAR pval)
static _INLINE_ int push_int_object (SLtype type, int x)
int SLclass_push_int_obj (SLtype type, int x)
static _INLINE_ int push_double_object (SLtype type, double x)
int SLclass_push_double_obj (SLtype type, double x)
static _INLINE_ int push_char_object (SLtype type, char x)
int SLclass_push_char_obj (SLtype type, char x)
static int _typecast_object_to_type (SLang_Object_Type *y, SLang_Object_Type *obj, SLtype type, int allow_arrays)
_INLINE_ int SLang_pop_int (int *i)
static _INLINE_ int pop_object_of_type (SLtype type, SLang_Object_Type *obj, int allow_arrays)
int SLclass_pop_ptr_obj (SLtype type, VOID_STAR *s)
int _pSLang_pop_object_of_type (SLtype type, SLang_Object_Type *obj, int allow_arrays)
int SLreverse_stack (int n)
static int roll_stack (int np)
int SLroll_stack (int np)
int SLstack_depth (void)
int SLdup_n (int n)
_INLINE_ int _pSL_increment_frame_pointer (void)
_INLINE_ int _pSL_decrement_frame_pointer (void)
static int decrement_slang_frame_pointer (void)
static int increment_slang_frame_pointer (_pSLang_Function_Type *fun, unsigned int linenum)
_INLINE_ int SLang_start_arg_list (void)
static _INLINE_ int end_arg_list (void)
int SLang_end_arg_list (void)
static _INLINE_ int do_bc_call_direct_frame (int(*f)(void))
static int do_name_type_error (SLang_Name_Type *nt)
static int do_binary_ab (int op, SLang_Object_Type *obja, SLang_Object_Type *objb)
static int int_int_binary (int op, SLang_Object_Type *obja, SLang_Object_Type *objb)
static int dbl_dbl_binary (int op, SLang_Object_Type *obja, SLang_Object_Type *objb)
static int do_binary_ab_inc_ref (int op, SLang_Object_Type *obja, SLang_Object_Type *objb)
static int do_binary_ab_inc_ref_assign (int op, SLang_Object_Type *obja, SLang_Object_Type *objb, SLang_Object_Type *objc)
static _INLINE_ int do_binary (int op)
static _INLINE_ void do_binary_b (int op, SLang_Object_Type *bp)
static void do_binary_b_inc_ref (int op, SLang_Object_Type *bp)
static int do_unary_op (int op, SLang_Object_Type *obj, int unary_type)
static _INLINE_ int do_unary (int op, int unary_type)
static int do_assignment_binary (int op, SLang_Object_Type *obja_ptr)
static int map_assignment_op_to_binary (SLtype op_type, int *op, int *is_unary)
static int perform_lvalue_operation (int op_type, SLang_Object_Type *obja_ptr)
static _INLINE_ int set_lvalue_obj (int op_type, SLang_Object_Type *obja_ptr)
static int set_struct_lvalue (SLBlock_Type *bc_blk)
static int set_deref_lvalue (int op)
static int make_unit_object (SLang_Object_Type *a, SLang_Object_Type *u)
static int set_array_lvalue (int op)
static int set_intrin_lvalue (SLBlock_Type *bc_blk)
static int push_intrinsic_variable (SLang_Intrin_Var_Type *ivar)
static int push_nametype_variable (SLang_Name_Type *nt)
static int set_nametype_variable (SLang_Name_Type *nt)
int _pSLang_deref_assign (SLang_Ref_Type *ref)
static int push_struct_field (char *name)
static int do_struct_method (char *name)
static void trace_dump (char *format, char *name, SLang_Object_Type *objs, int n, int dir)
static VOID_STAR pop_pointer (SLang_Object_Type *obj, SLtype type)
static int execute_intrinsic_fun (SLang_Intrin_Fun_Type *objf)
static int inner_interp (register SLBlock_Type *)
static void lang_do_loops (int stype, SLBlock_Type *block, unsigned int num_blocks)
static void lang_do_and_orelse (int stype, SLBlock_Type *addr, SLBlock_Type *addr_max)
static int try_interp_block (SLBlock_Type **bp, int clear_error)
static void do_try (SLBlock_Type *ev_block, SLBlock_Type *final)
static void do_else_if (SLBlock_Type *zero_block, SLBlock_Type *non_zero_block)
int _pSLang_trace_fun (char *f)
int _pSLdump_objects (char *prefix, SLang_Object_Type *x, unsigned int n, int dir)
static int find_local_variable_index (Function_Header_Type *header, char *name)
static SLang_Name_Typefind_global_name (char *name, SLang_NameSpace_Type *pns, SLang_NameSpace_Type *sns, SLang_NameSpace_Type *gns, int do_error)
int _pSLang_get_frame_depth (void)
static int get_function_stack_info (int depth, Function_Stack_Type *sp)
int _pSLang_get_frame_fun_info (int depth, _pSLang_Frame_Info_Type *f)
int _pSLang_set_frame_variable (int depth, char *name)
int _pSLang_get_frame_variable (int depth, char *name)
static void execute_slang_fun (_pSLang_Function_Type *fun, unsigned int linenum)
static void do_app_unary (SLang_App_Unary_Type *nt)
static void do_arith_binary (SLang_Arith_Binary_Type *nt)
static int inner_interp_nametype (SLang_Name_Type *nt)
int _pSLang_dereference_ref (SLang_Ref_Type *ref)
int _pSLang_is_ref_initialized (SLang_Ref_Type *ref)
int _pSLang_uninitialize_ref (SLang_Ref_Type *ref)
int _pSLpush_slang_obj (SLang_Object_Type *obj)
static _INLINE_ int push_local_variable (int i)
static int dereference_object (void)
static int case_function (void)
static void tmp_variable_function (SLBlock_Type *addr)
static int _pSLang_parse_dollar_string (char *str, char ***argvp, unsigned int *argcp)
static int push_dollar_string (char *str)
static int do_inner_interp_error (SLBlock_Type *err_block, SLBlock_Type *addr_start, SLBlock_Type *addr)
static int setup_default_compile_linkage (int)
static int push_compile_context (char *)
static int pop_compile_context (void)
static int lang_free_branch (SLBlock_Type *p)
static void free_local_variable_names (char **list, unsigned int num)
static Function_Header_Typeallocate_function_header (unsigned int nargs, unsigned int nlocals, char *file)
static int push_block_context (int type)
static int pop_block_context (void)
static int setup_compile_namespaces (char *name, char *namespace_name)
int _pSLcompile_push_context (SLang_Load_Type *load_object)
static void reset_compiler_state (void)
int _pSLcompile_pop_context (void)
static _INLINE_ char * parse_namespace_encoded_name (char *name)
static SLang_Name_Typelocate_namespace_encoded_name (char *name, int err_on_bad_ns)
static SLang_Name_Typelocate_hashed_name (char *name, unsigned long hash)
SLang_Name_Type_pSLlocate_name (char *name)
SLang_Name_Type_pSLlocate_global_name (char *name)
static SLang_Name_Typeadd_name_to_namespace (char *name, unsigned long hash, unsigned int sizeof_obj, unsigned char name_type, SLang_NameSpace_Type *ns)
static SLang_Name_Typeadd_global_name (char *name, unsigned long hash, unsigned char name_type, unsigned int sizeof_obj, SLang_NameSpace_Type *ns)
static int add_intrinsic_function (SLang_NameSpace_Type *ns, char *name, FVOID_STAR addr, SLtype ret_type, unsigned int nargs, SLtype *arg_types)
static int va_add_intrinsic_function (SLang_NameSpace_Type *ns, char *name, FVOID_STAR addr, SLtype ret_type, unsigned int nargs, va_list ap)
int SLadd_intrinsic_function (char *name, FVOID_STAR addr, SLtype ret_type, unsigned int nargs,...)
int SLns_add_intrinsic_function (SLang_NameSpace_Type *ns, char *name, FVOID_STAR addr, SLtype ret_type, unsigned int nargs,...)
static SLang_Name_Typeadd_xxx_helper (SLang_NameSpace_Type *ns, char *name, int what, unsigned int sizeof_what)
int SLns_add_hconstant (SLang_NameSpace_Type *ns, char *name, SLtype type, short value)
int SLns_add_iconstant (SLang_NameSpace_Type *ns, char *name, SLtype type, int value)
int SLns_add_lconstant (SLang_NameSpace_Type *ns, char *name, SLtype type, long value)
int SLns_add_dconstant (SLang_NameSpace_Type *ns, char *name, double value)
int SLns_add_fconstant (SLang_NameSpace_Type *ns, char *name, float value)
int SLns_add_intrinsic_variable (SLang_NameSpace_Type *ns, char *name, VOID_STAR addr, SLtype data_type, int ro)
int SLadd_intrinsic_variable (char *name, VOID_STAR addr, SLtype data_type, int ro)
static int add_slang_function (char *name, unsigned char type, unsigned long hash, Function_Header_Type *h, char *file, SLang_NameSpace_Type *ns)
static int SLns_autoload (char *name, char *file, char *nsname)
int SLang_autoload (char *name, char *file)
static void lang_try_now (void)
static int is_nametype_callable (SLang_Name_Type *nt)
int _pSLang_ref_is_callable (SLang_Ref_Type *ref)
int SLang_is_defined (char *name)
SLang_Name_TypeSLang_get_fun_from_ref (SLang_Ref_Type *ref)
int SLexecute_function (SLang_Name_Type *nt)
int SLang_execute_function (char *name)
SLang_Name_TypeSLang_get_function (char *name)
static void lang_begin_function (void)
static void rearrange_optimized_binary (SLBlock_Type *b, _pSLang_BC_Type t1, _pSLang_BC_Type t2, _pSLang_BC_Type t3)
static void rearrange_optimized_optimized (SLBlock_Type *b, _pSLang_BC_Type t1)
static void rearrange_optimized_unary (SLBlock_Type *b, _pSLang_BC_Type t1, _pSLang_BC_Type t2)
static void optimize_block2 (SLBlock_Type *b)
static void optimize_block (SLBlock_Type *b)
static void end_define_function (void)
static int lang_define_function (char *name, unsigned char type, unsigned long hash, SLang_NameSpace_Type *ns)
static int check_linkage (char *name, unsigned long hash, int check_static)
static void define_private_function (char *name, unsigned long hash)
static void define_static_function (char *name, unsigned long hash)
static void define_public_function (char *name, unsigned long hash)
static void lang_end_block (void)
static int lang_begin_block (void)
static int lang_check_space (void)
static int add_global_variable (char *name, char name_type, unsigned long hash, SLang_NameSpace_Type *ns)
int SLadd_global_variable (char *name)
static int add_local_variable (char *name, unsigned long hash)
static void compile_basic_token_mode (_pSLang_Token_Type *)
static void reset_active_interpreter (void)
void SLang_restart (int localv)
static void compile_line_info (_pSLang_BC_Type bc_main_type, char *file, long linenum)
static void set_line_number_info (long val)
static void compile_directive (unsigned char sub_type)
static void compile_unary (int op, _pSLang_BC_Type mt)
static void compile_binary (int op)
static int try_compressed_bytecode (_pSLang_BC_Type last_bc, _pSLang_BC_Type bc)
static int handle_special (Special_NameTable_Type *nt, _pSLang_Token_Type *tok)
static int handle_special_file (Special_NameTable_Type *nt, _pSLang_Token_Type *tok)
static int handle_special_line (Special_NameTable_Type *nt, _pSLang_Token_Type *tok)
static void compile_hashed_identifier (char *name, unsigned long hash, _pSLang_Token_Type *tok)
static void compile_tmp_variable (char *name, unsigned long hash)
static void compile_simple (_pSLang_BC_Type main_type)
static void compile_identifier (char *name, _pSLang_Token_Type *tok)
static void compile_call_direct (int(*f)(void), _pSLang_BC_Type byte_code)
static void compile_lvar_call_direct (int(*f)(void), _pSLang_BC_Type bc, _pSLang_BC_Type frame_op)
static void compile_integer (long i, _pSLang_BC_Type bc_main_type, SLtype bc_sub_type)
static void compile_double (char *s, _pSLang_BC_Type main_type, SLtype type)
static void compile_float (char *s)
static void compile_string (char *s, unsigned long hash)
static void compile_string_dollar (char *s, unsigned long hash)
static void compile_bstring (SLang_BString_Type *s)
static void compile_assign (unsigned char assign_type, char *name, unsigned long hash)
static void compile_struct_assign (_pSLang_Token_Type *t)
static void compile_array_assign (_pSLang_Token_Type *t)
static void compile_deref_assign (_pSLang_Token_Type *t)
static void compile_dot (_pSLang_Token_Type *t, _pSLang_BC_Type bc_main_type)
static void compile_ref (char *name, unsigned long hash)
static void compile_break (_pSLang_BC_Type break_type, int requires_block, int requires_fun, char *str)
static void compile_public_variable_mode (_pSLang_Token_Type *t)
static void compile_local_variable_mode (_pSLang_Token_Type *t)
static void compile_static_variable_mode (_pSLang_Token_Type *t)
static void compile_private_variable_mode (_pSLang_Token_Type *t)
static void compile_function_mode (_pSLang_Token_Type *t)
static int check_error_block (void)
static void compile_directive_mode (_pSLang_Token_Type *t)
static void compile_assign_mode (_pSLang_Token_Type *t)
void _pSLcompile (_pSLang_Token_Type *t)
static int unset_interrupt_state (VOID_STAR maskp)
static int set_interrupt_state (VOID_STAR maskp)
static void interpreter_error_hook (int set)
void _pSLang_signal_interrupt (void)
int _pSLang_check_signals_hook (VOID_STAR unused)
static int add_generic_table (SLang_NameSpace_Type *ns, SLang_Name_Type *table, char *pp_name, unsigned int entry_len)
int SLadd_intrin_fun_table (SLang_Intrin_Fun_Type *tbl, char *pp)
int SLadd_intrin_var_table (SLang_Intrin_Var_Type *tbl, char *pp)
int SLadd_app_unary_table (SLang_App_Unary_Type *tbl, char *pp)
int _pSLadd_arith_unary_table (SLang_Arith_Unary_Type *tbl, char *pp)
int _pSLadd_arith_binary_table (SLang_Arith_Binary_Type *tbl, char *pp)
int SLadd_math_unary_table (SLang_Math_Unary_Type *tbl, char *pp)
int SLadd_iconstant_table (SLang_IConstant_Type *tbl, char *pp)
int SLadd_dconstant_table (SLang_DConstant_Type *tbl, char *pp)
int SLadd_fconstant_table (SLang_FConstant_Type *tbl, char *pp)
int SLns_add_intrin_fun_table (SLang_NameSpace_Type *ns, SLang_Intrin_Fun_Type *tbl, char *pp)
int SLns_add_intrin_var_table (SLang_NameSpace_Type *ns, SLang_Intrin_Var_Type *tbl, char *pp)
int SLns_add_app_unary_table (SLang_NameSpace_Type *ns, SLang_App_Unary_Type *tbl, char *pp)
int SLns_add_math_unary_table (SLang_NameSpace_Type *ns, SLang_Math_Unary_Type *tbl, char *pp)
int SLns_add_hconstant_table (SLang_NameSpace_Type *ns, SLang_HConstant_Type *tbl, char *pp)
int SLns_add_iconstant_table (SLang_NameSpace_Type *ns, SLang_IConstant_Type *tbl, char *pp)
int SLns_add_lconstant_table (SLang_NameSpace_Type *ns, SLang_LConstant_Type *tbl, char *pp)
int SLns_add_dconstant_table (SLang_NameSpace_Type *ns, SLang_DConstant_Type *tbl, char *pp)
SLang_Array_Type_pSLang_apropos (char *namespace_name, char *pat, unsigned int what)
static int implements_ns (char *namespace_name)
void _pSLang_implements_intrinsic (char *name)
void _pSLang_use_namespace_intrinsic (char *name)
static SLang_NameSpace_Type_pSLang_cur_namespace (void)
char * _pSLang_cur_namespace_intrinsic (void)
char * _pSLang_current_function_name (void)
SLang_Object_Type_pSLang_get_run_stack_pointer (void)
SLang_Object_Type_pSLang_get_run_stack_base (void)
int _pSLang_dump_stack (void)
int _pSLang_is_arith_type (SLtype t)
void _pSLang_set_arith_type (SLtype t, unsigned char v)
void _pSLang_use_frame_namespace (int depth)

Variables

static char * Local_Variable_Names [SLANG_MAX_LOCAL_VARIABLES]
void(* SLang_Enter_Function )(char *) = NULL
void(* SLang_Exit_Function )(char *) = NULL
int _pSLang_Trace = 0
static int Trace_Mode = 0
static char * Trace_Function
int SLang_Traceback = 0
static int BOS_Stack_Depth
static char * This_Compile_Filename
static unsigned int This_Compile_Linenum
int SLang_Num_Function_Args
static int * Num_Args_Stack
static unsigned int Recursion_Depth
static SLang_Object_TypeFrame_Pointer
static int Next_Function_Num_Args
static unsigned int Frame_Pointer_Depth
static unsigned int * Frame_Pointer_Stack
static _pSLang_Function_TypeCurrent_Function = NULL
static Function_Header_TypeCurrent_Function_Header
static Function_Stack_TypeFunction_Stack
static Function_Stack_TypeFunction_Stack_Ptr
static SLang_NameSpace_TypeThis_Private_NameSpace
static SLang_NameSpace_TypeThis_Static_NameSpace
static SLang_NameSpace_TypeGlobal_NameSpace
static SLang_NameSpace_TypeLocals_NameSpace
static int Lang_Break_Condition = 0
static int Lang_Break = 0
static int Lang_Return = 0
static SLang_Object_TypeRun_Stack
static SLang_Object_TypeStack_Pointer
static SLang_Object_TypeStack_Pointer_Max
static SLang_Object_Type Local_Variable_Stack [SLANG_MAX_LOCAL_STACK]
static SLang_Object_TypeLocal_Variable_Frame = Local_Variable_Stack
static int Handle_Interrupt
static SLclass_Type The_Class_Type [256]
static SLang_Class_TypeThe_Lower_Classes [256]
static int Is_Arith_Type_Array [256]
static SLang_Object_Type Switch_Objects [SLANG_MAX_NESTED_SWITCH]
static SLang_Object_TypeSwitch_Obj_Ptr = Switch_Objects
static SLang_Object_TypeSwitch_Obj_Max = Switch_Objects + SLANG_MAX_NESTED_SWITCH
static SLBlock_TypeExit_Block_Ptr
static SLBlock_TypeGlobal_User_Block [5]
static SLBlock_Type ** User_Block_Ptr = Global_User_Block
void(* SLang_Interrupt )(void)
int _pSLang_Auto_Declare_Globals = 0
int(* SLang_Auto_Declare_Var_Hook )(char *)
static int Local_Variable_Number
static unsigned int Function_Args_Number
static int Lang_Defining_Function
static void(* Default_Variable_Mode )(_pSLang_Token_Type *)
static void(* Default_Define_Function )(char *, unsigned long)
static Block_Context_Type Block_Context_Stack [SLANG_MAX_BLOCK_STACK_LEN]
static unsigned int Block_Context_Stack_Len
static SLBlock_TypeCompile_ByteCode_Ptr
static SLBlock_TypeThis_Compile_Block
static SLBlock_TypeThis_Compile_Block_Max
static int This_Compile_Block_Type
static void(* Compile_Mode_Function )(_pSLang_Token_Type *)
static Special_NameTable_Type Special_Name_Table []
static unsigned int Assign_Mode_Type
void(* _pSLcompile_ptr )(_pSLang_Token_Type *) = _pSLcompile
static Compile_Context_TypeCompile_Context_Stack


Define Documentation

#define COMPILE_BLOCK_TYPE_BLOCK   2
 

Definition at line 4782 of file slang.c.

Referenced by compile_basic_token_mode(), compile_break(), lang_begin_block(), lang_end_block(), and reset_compiler_state().

#define COMPILE_BLOCK_TYPE_FUNCTION   1
 

Definition at line 4781 of file slang.c.

Referenced by lang_begin_function(), lang_define_function(), and reset_compiler_state().

#define COMPILE_BLOCK_TYPE_TOP_LEVEL   3
 

Definition at line 4783 of file slang.c.

Referenced by _pSLcompile_pop_context(), _pSLcompile_push_context(), compile_directive_mode(), lang_begin_function(), lang_define_function(), lang_try_now(), and reset_compiler_state().

#define COMPILE_COMBINE_STATS   0
 

Definition at line 5735 of file slang.c.

#define GATHER_STATISTICS   0
 

Definition at line 3650 of file slang.c.

#define GET_CLASS cl,
 ) 
 

Value:

if (((t)>=256) || (NULL == (cl = The_Lower_Classes[(t)]))) \
       cl = _pSLclass_get_class(t)

Definition at line 252 of file slang.c.

Referenced by _pSLang_get_frame_variable(), _pSLdump_objects(), _pSLpush_slang_obj(), compile_assign(), dereference_object(), do_binary_ab(), do_function_traceback(), do_struct_method(), do_unary_op(), lang_do_loops(), pop_ctrl_integer(), push_intrinsic_variable(), push_local_variable(), push_struct_field(), set_intrin_lvalue(), set_struct_lvalue(), SLang_free_object(), and SLdup_n().

#define GET_CLASS_TYPE  )     (((x) < 256) ? The_Class_Type[(x)] : _pSLang_get_class_type(x))
 

Definition at line 242 of file slang.c.

Referenced by _pSLpush_slang_obj(), do_assignment_binary(), do_binary(), do_binary_ab(), do_binary_ab_inc_ref_assign(), do_binary_b(), do_binary_b_inc_ref(), do_unary(), do_unary_op(), execute_slang_fun(), lang_do_loops(), pop_pointer(), push_local_variable(), set_array_lvalue(), set_lvalue_obj(), SLang_free_object(), and SLdup_n().

#define GET_LOWER_CLASS cl,
 ) 
 

Value:

if (NULL == (cl = The_Lower_Classes[(t)])) \
       cl = _pSLclass_get_class(t)

Definition at line 255 of file slang.c.

Referenced by inner_interp(), and lang_free_branch().

#define INTERRUPT_ERROR   0x01
 

Definition at line 227 of file slang.c.

Referenced by interpreter_error_hook().

#define INTERRUPT_SIGNAL   0x02
 

Definition at line 228 of file slang.c.

Referenced by _pSLang_signal_interrupt(), and check_signals().

#define IS_ARITH_TYPE  )     (((t) < 256) ? Is_Arith_Type_Array[t] : 0)
 

Definition at line 282 of file slang.c.

Referenced by _pSLang_is_arith_type(), _typecast_object_to_type(), and do_binary_ab().

#define IS_SLANG_ERROR   (Handle_Interrupt & INTERRUPT_ERROR)
 

Definition at line 230 of file slang.c.

Referenced by do_bc_call_direct_frame(), do_try(), execute_slang_fun(), inner_interp(), lang_do_and_orelse(), lang_do_loops(), set_intrin_lvalue(), SLexecute_function(), and try_interp_block().

#define SLANG_MAX_LOCAL_VARIABLES   255
 

Definition at line 49 of file slang.c.

Referenced by add_local_variable().

#define USE_COMBINED_BYTECODES   1
 

Definition at line 34 of file slang.c.

#define USE_UNUSED_BYCODES_IN_SWITCH   1
 

Definition at line 39 of file slang.c.


Typedef Documentation

typedef struct _Compile_Context_Type Compile_Context_Type
 

typedef double(* FF0_Type)(void)
 

Definition at line 2091 of file slang.c.

typedef double(* FF1_Type)(VOID_STAR)
 

Definition at line 2092 of file slang.c.

typedef double(* FF2_Type)(VOID_STAR, VOID_STAR)
 

Definition at line 2093 of file slang.c.

typedef double(* FF3_Type)(VOID_STAR, VOID_STAR, VOID_STAR)
 

Definition at line 2094 of file slang.c.

typedef double(* FF4_Type)(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
 

Definition at line 2095 of file slang.c.

typedef double(* FF5_Type)(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
 

Definition at line 2096 of file slang.c.

typedef double(* FF6_Type)(VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR, VOID_STAR)
 

Definition at line 2097 of file slang.c.