Struct While

Inheritance Relationships

Base Type

Struct Documentation

struct While : public AST::ASTNode

Public Functions

While(ASTNode *cond, Block *body)
~While()
void print_original_src(unsigned int indent_depth = 0)
bool check_initialize_before_use(InitializedList &inits, InitializedList *all_inits, bool is_method)

Performs an initialize before use test on the while loop. It checks the conditional statement as well as the body of the while loop.

Return
True if the initialized before use test passes for the conditional statement as well as the body for the while loop
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

Public Members

ASTNode *cond_
Block *body_