Struct StrLit

Inheritance Relationships

Base Type

Struct Documentation

struct StrLit : public AST::Literal<std::string>

Public Functions

StrLit(const char *v)
void print_original_src(unsigned int indent_depth = 0)
std::string generate_code(CodeGen::Settings &settings, unsigned indent_lvl, bool is_lhs) const

Generates the code to create a string literal. It relies on the standardized literal generation method.

Parameters
  • settings: Code generator setting
  • indent_lvl: Level of indention

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.