
class
compiler::CheckErrors
sys::Obj compiler::CompilerSupport compiler::CompilerStep compiler::CheckErrors
CheckErrors walks the tree of statements and expressions looking for errors the compiler can detect such as invalid type usage. We attempt to leave all the error reporting to this step, so that we can batch report as many errors as possible.
Since CheckErrors already performs a full tree walk down to each leaf expression, we also do a couple of other AST decorations in this step:
1) add temp local for field assignments like return ++x 2) add temp local for returns inside protected region 3) check for field accessor optimization 4) check for field storage requirements 5) add implicit cast when assigning Obj to non-Obj
Slots
-
private Void checkAssign(BinaryExpr expr)
-
private Void checkContinue(ContinueStmt stmt)
-
private Void checkRangeLiteral(RangeLiteralExpr range)
-
private Void checkReturn(ReturnStmt stmt)
-
private Void checkSame(BinaryExpr expr)
-
private Void checkShortcut(ShortcutExpr shortcut)
-
private Void checkSimpleLiteral(SimpleLiteralExpr simple)
-
private Void checkSlotProtection(CSlot slot, Location loc, Bool setter := false)
-
private Void checkSwitch(SwitchStmt stmt)
-
private Void checkTernary(TernaryExpr expr)
-
private Void checkTypeCheck(TypeCheckExpr expr)
-
private Void checkWithBlock(WithBlockExpr expr)
- enterFinally
- enterStmt
- exitFinally
- exitStmt
-
private Int finallyDepth
-
private Bool isFieldAssignImmutable(CType fieldType, Expr rhs)
- make
-
new make(Compiler compiler)
-
private Int protectedRegionDepth
- run
-
override Void run()
-
private Str slotProtectionErr(CSlot slot, Bool setter := false)
- visitExpr
- visitFieldDef
- visitMethodDef
- visitStmt
- visitTypeDef
More Info
Slots
- cast
- checkAbstractSlots
- checkArgs
- checkAssign
- checkAssignField
- checkBool
- checkBools
- checkBreak
- checkCall
- checkCompare
- checkConstType
- checkContinue
- checkCtor
- checkExprStmt
- checkField
- checkFieldFlags
- checkFor
- checkIf
- checkMethodFlags
- checkParam
- checkParams
- checkProtectionFlags
- checkRangeLiteral
- checkReturn
- checkSame
- checkShortcut
- checkSimpleLiteral
- checkSlotProtection
- checkSuper
- checkSwitch
- checkTernary
- checkThis
- checkThrow
- checkTry
- checkTypeCheck
- checkTypeFlags
- checkWhile
- checkWithBlock
- enterFinally
- enterStmt
- exitFinally
- exitStmt
- finallyDepth
- isConstFieldType
- isFieldAssignImmutable
- make
- protectedRegionDepth
- run
- slotProtectionErr
- useFieldAccessor
- visitExpr
- visitFieldDef
- visitMethodDef
- visitStmt
- visitTypeDef