The semantic Analysis phase helps to maintain the symbol table, which help to record the type of symbol and conduct type checking.

1. Bindings for Tiger

Tiger has two separate name spaces, one for types and the other for functions and variables.

The semant.sml file contains the fuction to translate Expression, Decleration, Type to types. Also have the function if two types share the same parents. The fucntions will take either a value environment (for function or variable declaration) or a type environment (for type declaration). Type checking are conducted on Expression, (Variable, Subscripts, Fields) and declaration

The symbol.sml is used to store ID efficiently for hash map/set.

The findescape.sml help us to find out which variable needs to escape. Escape means the variables can not be stored in register for some reasons, instead we need to escape them in memo. For Tiger, we do not have a grammar for adressing, so we do not need to worry about this case. But there is one case, we need to take care of: When variable is used in a lower level than its declaration level, then we need to escape this variable. Why? We use static link to find this variable is in which frame.