com.go.tea.compiler
Class TypeChecker

java.lang.Object
  |
  +--com.go.tea.compiler.TypeChecker

public class TypeChecker
extends java.lang.Object

A TypeChecker operates on a template's parse tree, created by a Parser, filling in type information while it checks the validity of the whole template. After a template has been type-checked and there are no errors, the template is ready for code generation. Add an ErrorListener to capture any semantic errors detected by the TypeChecker.

Version:
111 , 7/26/01
Author:
Brian S O'Neill

Constructor Summary
TypeChecker(CompilationUnit unit)
           
 
Method Summary
 void addErrorListener(ErrorListener listener)
           
 int getErrorCount()
           
 void removeErrorListener(ErrorListener listener)
           
 void setClassLoader(java.lang.ClassLoader loader)
          Sets the ClassLoader to use to load classes with.
 void setExceptionGuardianEnabled(boolean enabled)
          Enabling Exception Guardian causes statements that might throw a exception to be guarded.
 void typeCheck()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeChecker

public TypeChecker(CompilationUnit unit)
Method Detail

addErrorListener

public void addErrorListener(ErrorListener listener)

removeErrorListener

public void removeErrorListener(ErrorListener listener)

setClassLoader

public void setClassLoader(java.lang.ClassLoader loader)
Sets the ClassLoader to use to load classes with. If set to null, then classes are loaded using Class.forName.

setExceptionGuardianEnabled

public void setExceptionGuardianEnabled(boolean enabled)
Enabling Exception Guardian causes statements that might throw a exception to be guarded. By default, this feature is off. If a guarded statement throws a RuntimeException, it is caught and handed off to ThreadGroup.uncaughtException. Execution then proceeds to the next statement. If the guarded statement is an assignment, then the variable is assigned null if an exception is caught.

typeCheck

public void typeCheck()

getErrorCount

public int getErrorCount()