Fix "protected" Decaf class fields

  * ast_expr.cc: Fix a bug that rejects field access of a parent class
    instance.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Reimplement the "protected" behaviour of fields

  * ast_decl.cc, ast_decl.h(ClassDecl::IsSubsetOf): Add a function to
    check whether a given type is a supertype.
  * ast_expr.cc(FieldAccess::ForeignAccessCheck): Redesign the condi-
    tion for supertype checking.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Improve test framework on updating and debugging

  * test.sh: Stop testing if build fails. For all the test cases, gene-
    rate the correct output on the fly.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>
Try to fix a too early function check

  * ast_decl.cc (ClassDecl::MergeSymbolTable): Postpone function check
    after symbol table construction.
  * ast_decl.h: Clear codes.

Signed-off-by: Hongjiu Zhang <zhanghj@umich.edu>