Class Typecheck

  extended by Typecheck

public class Typecheck
extends java.lang.Object

This class is an entry point to the minijava type checker in the minijava package. The program's interface is as required by Homework 2 specification.
Sample usage (where input is a file containing the input expression string):

java Typecheck < input

The driver program first parses the source file to create an abstract syntax tree. A SymbolTableBuilder then visits the tree to build a symbol table. This symbol table, in turn, is referenced by a TypeChecker visitor as it traverses statements and expressions in the syntax tree and applies type checking constraints and rules to it.

If the program type checks, the message "Program type checks successfully" is printed. Otherwise, if any problem is encountered along the way, a TypeException is caught and the message "Type error" is displayed.

Santoso Wijaya
See Also:
SymbolTableBuilder, SymbolTable, TypeChecker

Constructor Summary
Method Summary
static void main(java.lang.String[] args)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Typecheck()
Method Detail


public static void main(java.lang.String[] args)