Interpreter

Members

Functions

interpretAssignToSlice
Expression interpretAssignToSlice(BinExp e, Expression e1, Expression newval, bool isBlockAssignment)

Deal with assignments of the form: dest[] = newval destlow..upp = newval where newval has already been interpreted

interpretFourPointerRelation
void interpretFourPointerRelation(BinExp e)

If this is a four pointer relation, evaluate it, else return NULL.

visit
void visit(Statement s)

Statement

visit
void visit(Expression e)

Expression

Static functions

reverseRelation
TOK reverseRelation(TOK op)

Negate a relational operator, eg >= becomes <

stopPointersEscaping
bool stopPointersEscaping(Loc loc, Expression e)

Given an expression e which is about to be returned from the current function, generate an error if it contains pointers to local variables. Return true if it is safe to return, false if an error was generated.

Meta