previous                   ToC                next


8.      Type checking


In the second pass, the compiler front end must firstly perform type checking, to assure that the type of a construct matches the type expected by its context.

Type checking rules have to verify that operators and functions are applied to the right number and types of operands.

Actual types must match with expected types even when coercion occurs (the type of an operand is automatically converted to the type expected by an operator).

The type checker for mjava is specified in mjava.cup.

You can generate the parser and run it on the input program WrongProgram.mjava by means of the files in TypeChecher.rar.

The output reported in  TypeCheckerResult.txt will be printed on the Java console.



previous                   ToC                next