README for lab3: Semantic analysis and Type checking Ling Li & Xin Yu, Caltech, 02/12/2001 ---------------------------------------------------------------------- Convert AST to IR (Intermediate Representation) for functional C. All 4 tests ran perfectly. ---------------------------------------------------------------------- Changed files (from lab2): fc_ast/fc_ast_lex.mll The lexer fc_ast/fc_ast_parse.mly The parser fc_ir/fc_ir_ast.ml IR generator ---------------------------------------------------------------------- Done things: (no significant problems found) 0. Everything needed for those 4 tests, such as IR generation, coercion, type checking, ... 1. Correct an error with variables declaration in fc_ast_parse.mly. The variable type has to be reversed after it is generated by the parser. 2. The relop (such as x == y) is implemented via IfThenElse. 3. Double-checking is used in make_seq_expr: both types of the sequence and of the rest program are needed before we call cont or generating the auxiliary function. 4. Make special effort to deal with UStarOp, such as *p = 3. This may be simplified. ---------------------------------------------------------------------- To do: 1. Problems 1--3 in lab2 still exist. 2. The 'ret' types of all kinds of expressions need a clean-up. 3. Better not to use double-checking in make_seq_expr. ---------------------------------------------------------------------- This README file together with the programs can be found at http://www.cs.caltech.edu/~ling/course/cs134b/lab3/