logo
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

enterFinally

virtual Void enterFinally(TryStmt stmt)

enterStmt

virtual Void enterStmt(Stmt stmt)

exitFinally

virtual Void exitFinally(TryStmt stmt)

exitStmt

virtual Void exitStmt(Stmt stmt)

make

new make(Compiler compiler)

run

virtual Void run()

visitExpr

virtual Expr visitExpr(Expr expr)

visitFieldDef

virtual Void visitFieldDef(FieldDef f)

visitMethodDef

virtual Void visitMethodDef(MethodDef m)

visitStmt

virtual Void visitStmt(Stmt stmt)

visitTypeDef

virtual Void visitTypeDef(TypeDef t)