Struct Assn

Inheritance Relationships

Base Type

Struct Documentation

struct Assn : public AST::ASTNode

Public Functions

Assn(Typing *lhs, ASTNode *rhs)
~Assn()
void print_original_src(unsigned int indent_depth = 0)
bool check_initialize_before_use(InitializedList &inits, InitializedList *all_inits, bool is_method)

Verifies that both the left and right hand side of statement pass the initialize before use test. It next adds the assigned variable to the initialized list.

Return
True if all initialized before use test passes.
Parameters
  • inits: Set of initialized variables

bool perform_type_inference(TypeCheck::Settings &settings, Quack::Class *parent_type)

Implements type inference for a single note in the AST.

Return
True if type inference was successful.
Parameters
  • st: Symbol table for the method
  • return_type: Return type from the block
  • parent_type: Type of the parent node. If parent node has no type, then BASE_CLASS.

std::string generate_code(CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const

Generates the code for an assignment.

Return
No return information since not applicable to an assignment
Parameters
  • settings: Code generator settings
  • indent_lvl: Level of indentation

Public Members

Typing *lhs_
ASTNode *rhs_