Struct ObjectCall¶
- Defined in File ASTNode.h
Inheritance Relationships¶
Base Type¶
public AST::ASTNode(Struct ASTNode)
Struct Documentation¶
-
struct
ObjectCall: public AST::ASTNode¶ Public Functions
-
~ObjectCall()¶
-
void
print_original_src(unsigned int indent_depth)¶
-
bool
check_initialize_before_use(InitializedList &inits, InitializedList *all_inits, bool is_method)¶ Checks if the initialize before use test passes on the right subexpression.
- Return
- True if the initialized before use test passes for the right subexpression.
- Parameters
inits: Set of initialized variables.
-
void
update_initialized_list(InitializedList &inits, bool is_constructor)¶ Updates the initialized list in the initialized per use check.
- Parameters
inits: Set of initialized variables.is_constructor: True if the function being checked is a constructor.
-
std::string
generate_code(CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const¶ Processes object calls in the quack program. Object calls take two forms namely: obj.<field> and obj.<method>(…). Dynamic casting is used to determine which of the two applies for this specific case of code generator.
- Return
- Any object call string.
- Parameters
settings: Code generator settingsindent_lvl: Level of indentation.is_lhs: True if the node corresponds to a left hand side.
-
const std::string
process_object_call(const std::string &left_obj, CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const¶ After the left object is processed, process the right object.
- Return
- Variable containing the combined results of the object call
- Parameters
left_obj: Left object of the object callsettings: Code generator settingsindent_lvl: Level of indentation
-
bool
perform_type_inference(TypeCheck::Settings &settings, Quack::Class *parent_type)¶ Implements type inference for a single note in the AST.
-
bool
update_inferred_type(TypeCheck::Settings &settings, Quack::Class *inferred_type, bool is_field)¶ Updates the symbol table and the nodes using an inferred type
- Return
- True if the update is successful
- Parameters
st: Symbol table for the methodinferred_type: Type inferred for updatingthis_class: Class type of the object
-