-Files:
-Typechecker.hs: Simple modification of the bnfc-generated Testsyntax which calls the type-checking functions.
-
-Typecheck.hs: Contains the type-checking functions typeCheckExp, typeCheckVar and typeCheckStm and some utility functions, responsible for the entire type-checking process.
-
-Abssyntax.hs, Parsyntax.y, Lexsyntax.x,ErrM.hs,Printsyntax.hs,Skelsyntax.hs: The files generated by bnfc, only modification is the removal of the Bool type in Abssyntx.hs so haskell's internal type can be used.
-
-
-typing rules
-++++++++++++
-
-
-(t is used for types, T is the context, and + is used for in)
-
-
-[Eq, NEq]
-
-T+ e1 Eq e2:bool <= T+ e1:t & T+ e2:t
-
-If e1 and e2 are of the same type, then Eq or NEq return bool
-
-
-[Plus, Minus, Times, Div]
-
-T+ e1 Plus e2:int <= T+ e1:int & T+ e2:int
-
-The operators Plus/Minus/Times/Div return int if both operands are ints
-
-
-[Lt, ELt, Gt, EGt]
-
-T+ e1 Lt e2:bool <= T+ e1:int & T+ e2:int