#include <node_builder.h>
Inheritance diagram for NodeBuilder:
Public Methods | |
NodeBuilder (SymbolTable*) | |
NodeBuilder (ScopedObject*) | |
SuifEnv* | get_suif_env () const |
ParameterSymbol* | new_param (LString name, QualifiedType* type) |
VariableSymbol* | new_int_var (LString name, bool addr_taken = false) |
VariableSymbol* | new_var (LString name, DataType* type, bool addr_taken = false) |
VariableSymbol* | new_var (LString name, QualifiedType* type, bool addr_taken = false) |
VariableSymbol* | lookup_var (LString name, bool local_only = false) |
Type* | lookup_type (LString, bool local_only = false) |
StructType* | new_struct_type (LString) |
void | add_struct_field (StructType*, LString fname, QualifiedType* ftype) |
IntegerType* | get_int_type (void) |
BooleanType* | get_bool_type (void) |
FloatingPointType* | get_float_type (void) |
IntegerType* | get_char_type (void) |
VoidType* | get_void_type (void) |
QualifiedType* | get_qualified_type (DataType*) |
Type* | get_unqualified_type (Type* t) |
Strip away all QualifiedType layer. More... | |
Type* | get_pointed_to_type (Type* t) |
if t is a pointer type, return its reference_type. More... | |
PointerType* | get_pointer_type (Type* t) |
StoreVariableStatement* | store_var (VariableSymbol*, Expression*) |
StoreStatement* | store (Expression* target_addr, Expression*) |
StoreStatement* | store_field (Expression* group_addr, LString field_name, Expression* value) |
EvalStatement* | eval (Expression*) |
StatementList* | new_statement_list (void) |
IfStatement* | new_if (Expression*, Statement*, Statement*) |
LoadExpression* | load (Expression* addr) |
LoadVariableExpression* | load_var (VariableSymbol*) |
LoadVariableExpression* | load_var (LString) |
SymbolAddressExpression* | sym_addr (Symbol*) |
Expression* | load_field (Expression* group_addr, LString field_name) |
FieldAccessExpression* | field_addr (Expression* grp_addr, LString field_name) |
IntConstant* | int_const (IInteger) |
IntConstant* | int_const (int) |
IntConstant* | bool_const (bool) |
FloatConstant* | float_const (float) |
Expression* | cstr_const (const char*, ProcedureDefinition*) |
The expression returned has type array(char). | |
IntConstant* | char_const (char) |
BinaryExpression* | binary_exp (LString op, DataType* result_type, Expression* arg1, Expression* arg2) |
BinaryExpression* | and_exp (Expression*, Expression*) |
BinaryExpression* | multiply_exp (Expression*, Expression*) |
BinaryExpression* | add_exp (Expression*, Expression*) |
BinaryExpression* | subtract_exp (Expression*, Expression*) |
BinaryExpression* | is_less_than_or_equal_to_exp (Expression*, Expression*) |
BinaryExpression* | divfloor_exp (Expression*, Expression*) |
BinaryExpression* | max_exp (Expression*, Expression*) |
BinaryExpression* | min_exp (Expression*, Expression*) |
UnaryExpression* | convert_exp (Expression*, DataType*) |
ProcedureSymbol* | lookup_proc (LString name, bool local_only = false) |
ProcedureDefinition* | new_proc_defn1 (LString name, DataType* return_type, ParameterSymbol* arg) |
VariableSymbol* | get_cstr_const_var (String s, ProcedureDefinition* p) |
Lookup or create if necessary a variable definition containint a C string. | |
void | replace (Statement* old_stmt, Statement* new_stmt) |
void | replace (Expression* old_exp, Expression* new_exp) |
Protected Methods | |
Expression* | get_field_offset_exp (FieldSymbol* f) |
Create an expression for byte offset of a group field. | |
bool | is_same_type (Type*, Type*) |
Decide if the two types are the same modular qualification. | |
void | trash (SuifObject* ) |
put into trash can only if garbage has no parent. | |
MultiValueBlock* | new_cstr_value_block (String s) |
VariableDefinition* | add_variable_definition (ProcedureDefinition* p, VariableSymbol* v, ValueBlock* b) |
The constructor takes in a SymbolTable. This symbol table represents the environment of the new IR nodes. New SymbolTableObjects will be automatically owned by this symbol table.
All lookup_ method will return a null if no matching object is found, unless otherwise stated.
|
|
|
|
|
|
|
|
|
|
|
The expression returned has type array(char).
|
|
|
|
|
|
|
Lookup or create if necessary a variable definition containint a C string.
|
Create an expression for byte offset of a group field.
|
|
|
if t is a pointer type, return its reference_type.
Otherwise return 0.
|
|
|
|
Strip away all QualifiedType layer.
If t is not a QualifiedType, return t;
|
|
|
|
|
Decide if the two types are the same modular qualification.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
put into trash can only if garbage has no parent.