SecondSemanticPass

The second pass resolves variable types, base classes, evaluates static ifs/asserts etc.

Members

Functions

errorIfBool
void errorIfBool(Expression e)

Reports an error if the type of e is not bool.

errorIfNonBool
void errorIfNonBool(Expression e)

Reports an error if e has no boolean result.

findOverload
Expression findOverload(UnaryExpr e, Identifier* id)

Returns a call expression if 'e' overrides an operatorwith the name 'id'.

findOverload
Expression findOverload(BinaryExpr e, Identifier* id, Identifier* id_r)

Returns a call expression if 'e' overrides an operator with the name 'id' or 'id_r'.

run
void run()

Runs the semantic pass on the module.

visitBinary
void visitBinary(BinaryExpr e)

Visit the operands of a binary operator.

Variables

breakableStmt
S breakableStmt;

The current surrounding, breakable statement.

errorOnUndefinedSymbol
bool errorOnUndefinedSymbol;

Determines whether to issue an error when a symbol couldn't be found.

ip
Interpreter ip;

Used to evaluate expressions.

Meta