All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
expr.h File Reference
This graph shows which files directly or indirectly include this file:

Data Structures

struct  ex_block_t
struct  ex_bool_t
struct  ex_expr_s
 Binary and unary expressions. More...
struct  ex_func_s
struct  ex_label_s
struct  ex_labelref_t
struct  ex_list_t
struct  ex_pointer_s
 Pointer constant expression. More...
struct  ex_state_t
 State expression used for think function state-machines. More...
struct  ex_temp_t
struct  ex_value_s
struct  ex_vector_t
struct  expr_s


#define POINTER_VAL(p)   (((p).def ? (p).def->offset : 0) + (p).val)


typedef struct ex_expr_s ex_expr_t
 Binary and unary expressions. More...
typedef struct ex_func_s ex_func_t
typedef struct ex_label_s ex_label_t
typedef struct ex_pointer_s ex_pointer_t
 Pointer constant expression. More...
typedef struct ex_value_s ex_value_t
typedef struct expr_s expr_t


enum  expr_type {
  ex_error, ex_state, ex_bool, ex_label,
  ex_labelref, ex_block, ex_expr, ex_uexpr,
  ex_symbol, ex_temp, ex_vector, ex_nil,
 Type of the exression node in an expression tree. More...


expr_taddress_expr (expr_t *e1, expr_t *e2, struct type_s *t)
expr_tappend_expr (expr_t *block, expr_t *e)
expr_tarray_expr (expr_t *array, expr_t *index)
expr_tassign_expr (expr_t *e1, expr_t *e2)
expr_tasx_expr (int op, expr_t *e1, expr_t *e2)
void backpatch (ex_list_t *list, expr_t *label)
expr_tbinary_expr (int op, expr_t *e1, expr_t *e2)
expr_tbool_expr (int op, expr_t *label, expr_t *e1, expr_t *e2)
expr_tbranch_expr (int op, expr_t *test, expr_t *label)
expr_tbuild_do_while_statement (expr_t *statement, int not, expr_t *test, expr_t *break_label, expr_t *continue_label)
expr_tbuild_for_statement (expr_t *init, expr_t *test, expr_t *next, expr_t *statement, expr_t *break_label, expr_t *continue_label)
expr_tbuild_function_call (expr_t *fexpr, struct type_s *ftype, expr_t *params)
expr_tbuild_if_statement (int not, expr_t *test, expr_t *s1, expr_t *els, expr_t *s2)
expr_tbuild_state_expr (expr_t *e)
expr_tbuild_while_statement (int not, expr_t *test, expr_t *statement, expr_t *break_label, expr_t *continue_label)
expr_tcast_error (expr_t *e, struct type_s *t1, struct type_s *t2)
expr_tcast_expr (struct type_s *t, expr_t *e)
expr_tconditional_expr (expr_t *cond, expr_t *e1, expr_t *e2)
expr_tconstant_expr (expr_t *e)
 Return a value expression representing the constant stored in e. More...
expr_tconvert_bool (expr_t *e, int block)
expr_tconvert_from_bool (expr_t *e, struct type_s *type)
void convert_int (expr_t *e)
void convert_name (expr_t *e)
 Convert a name to an expression of the appropriate type. More...
void convert_nil (expr_t *e, struct type_s *t)
void convert_short (expr_t *e)
void convert_short_int (expr_t *e)
expr_tconvert_vector (expr_t *e)
expr_tcopy_expr (expr_t *e)
 Create a deep copy of an expression tree. More...
void dump_dot_expr (void *e, const char *filename)
expr_tencode_expr (struct type_s *type)
float expr_float (expr_t *e)
int expr_integer (expr_t *e)
const float * expr_quaternion (expr_t *e)
short expr_short (expr_t *e)
const char * expr_string (expr_t *e)
unsigned expr_uinteger (expr_t *e)
const float * expr_vector (expr_t *e)
etype_t extract_type (expr_t *e)
 Get the basic type code of the expression result. More...
expr_tfield_expr (expr_t *e1, expr_t *e2)
expr_tfold_constants (expr_t *e)
expr_tfunction_expr (expr_t *e1, expr_t *e2)
const char * get_op_string (int op)
struct type_sget_type (expr_t *e)
 Get the type descriptor of the expression result. More...
expr_tgoto_expr (expr_t *label)
int has_function_call (expr_t *e)
expr_tincop_expr (int op, expr_t *e, int postop)
int is_compare (int op)
 Check if the op-code is a comparison. More...
int is_constant (expr_t *e)
 Check of the expression refers to a constant value. More...
int is_float_val (expr_t *e)
int is_integer_val (expr_t *e)
int is_logic (int op)
 Check if the op-code is a logic operator. More...
int is_math_op (int op)
 Check if the op-code is a math operator. More...
int is_quaternion_val (expr_t *e)
int is_short_val (expr_t *e)
int is_string_val (expr_t *e)
int is_vector_val (expr_t *e)
expr_tmessage_expr (expr_t *receiver, struct keywordarg_s *message)
expr_tnew_alias_expr (struct type_s *type, expr_t *expr)
expr_tnew_binary_expr (int op, expr_t *e1, expr_t *e2)
 Create a new binary expression node node. More...
expr_tnew_block_expr (void)
 Create a new statement block expression node. More...
expr_tnew_bool_expr (ex_list_t *true_list, ex_list_t *false_list, expr_t *e)
expr_tnew_entity_expr (int entity_val)
 Create a new entity constant expression node. More...
expr_tnew_expr (void)
 Create a new expression node. More...
expr_tnew_field_expr (int field_val, struct type_s *type, struct def_s *def)
 Create a new field constant expression node. More...
expr_tnew_float_expr (float float_val)
 Create a new float constant expression node. More...
expr_tnew_func_expr (int func_val, struct type_s *type)
 Create a new function constant expression node. More...
expr_tnew_integer_expr (int integer_val)
 Create a new integer constant expression node. More...
expr_tnew_label_expr (void)
 Create a new label expression node. More...
const char * new_label_name (void)
 Create a new label name. More...
expr_tnew_label_ref (ex_label_t *label)
 Create a new label reference expression node. More...
expr_tnew_move_expr (expr_t *e1, expr_t *e2, struct type_s *type, int indirect)
 Create an expression representing a block copy. More...
expr_tnew_name_expr (const char *name)
 Create a new symbol expression node from a name. More...
expr_tnew_nil_expr (void)
 Create a new nil expression node. More...
expr_tnew_param_expr (struct type_s *type, int num)
 Create an expression of the correct type that references the specified parameter slot. More...
expr_tnew_pointer_expr (int val, struct type_s *type, struct def_s *def)
 Create a new pointer constant expression node. More...
expr_tnew_quaternion_expr (const float *quaternion_val)
 Create a new quaternion constant expression node. More...
expr_tnew_ret_expr (struct type_s *type)
 Create an expression of the correct type that references the return slot. More...
expr_tnew_self_expr (void)
 Create a reference to the global .self entity variable. More...
expr_tnew_short_expr (short short_val)
 Create a new short constant expression node. More...
expr_tnew_state_expr (expr_t *frame, expr_t *think, expr_t *step)
 Create a new state expression node. More...
expr_tnew_string_expr (const char *string_val)
 Create a new string constant expression node. More...
expr_tnew_symbol_expr (struct symbol_s *symbol)
 Create a new symbol reference (non-temporary variable) expression node. More...
expr_tnew_temp_def_expr (struct type_s *type)
 Create a new temporary variable expression node. More...
expr_tnew_this_expr (void)
 Create a reference to the .this entity field. More...
expr_tnew_uinteger_expr (unsigned uinteger_val)
 Create a new integer constant expression node. More...
expr_tnew_unary_expr (int op, expr_t *e1)
 Create a new unary expression node node. More...
expr_tnew_value_expr (ex_value_t *value)
 Create a new value expression node. More...
expr_tnew_vector_expr (const float *vector_val)
 Create a new vector constant expression node. More...
expr_tnew_vector_list (expr_t *e)
expr_tparam_mismatch (expr_t *e, int param, const char *fn, struct type_s *t1, struct type_s *t2)
expr_tpointer_expr (expr_t *pointer)
void print_expr (expr_t *e)
expr_tprotocol_expr (const char *protocol)
expr_treturn_expr (struct function_s *f, expr_t *e)
expr_treverse_expr_list (expr_t *e)
expr_tselector_expr (struct keywordarg_s *selector)
expr_tsizeof_expr (expr_t *expr, struct type_s *type)
expr_tsuper_expr (struct class_type_s *class_type)
expr_ttest_error (expr_t *e, struct type_s *t)
expr_ttest_expr (expr_t *e)
expr_tthink_expr (struct symbol_s *think_sym)
expr_ttype_mismatch (expr_t *e1, expr_t *e2, int op)
 Report a type mismatch error. More...
expr_tunary_expr (int op, expr_t *e)


struct type_sev_types []