Struct FunctionCall

Inheritance Relationships

Base Type

Struct Documentation

struct FunctionCall : public AST::ASTNode

Public Functions

FunctionCall(const char *ident, RhsArgs *args)
~FunctionCall()
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 print_original_src(unsigned int indent_depth)
std::string generate_code(CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const

This generate_code method only gets called directly for constructors. All other calls will be through an ObjectCall object and will have a special implementation (see method generate_object_call);

Return
Variable where the output of the constructor is stored.
Parameters
  • settings: Code generation settings
  • indent_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.

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_object_call(Quack::Class *obj_type, std::string object_name, CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const

Function call for an object name.

Return
Variable where the function call will be stored
Parameters
  • object_name: Name of the object whose method is being called.
  • settings: Code generator settings
  • indent_lvl: Level of indentation

Public Members

const std::string ident_
RhsArgs *args_