util
Class ErrorHandler

java.lang.Object
  extended by util.ErrorHandler

public class ErrorHandler
extends java.lang.Object

The ErrorHandler class performs error handling.


Field Summary
 int LEX_ERROR
          Lexical error constant - use to indicate the type of error
 int PARSE_ERROR
          Parse error constant - use to indicate the type of error
 int SEMANT_ERROR
          Semantic error constant - use to indicate the type of error
 
Constructor Summary
ErrorHandler()
           
 
Method Summary
 void checkErrors()
          Check the errors - halts if there are any registered errors
 void register(int type, java.lang.String errorMessage)
          Register an error
 void register(int type, java.lang.String filename, int lineNum, java.lang.String errorMessage)
          Register an error
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEX_ERROR

public final int LEX_ERROR
Lexical error constant - use to indicate the type of error

See Also:
Constant Field Values

PARSE_ERROR

public final int PARSE_ERROR
Parse error constant - use to indicate the type of error

See Also:
Constant Field Values

SEMANT_ERROR

public final int SEMANT_ERROR
Semantic error constant - use to indicate the type of error

See Also:
Constant Field Values
Constructor Detail

ErrorHandler

public ErrorHandler()
Method Detail

register

public void register(int type,
                     java.lang.String filename,
                     int lineNum,
                     java.lang.String errorMessage)
Register an error

Parameters:
type - the type (lex, parse, semantic) of error
filename - the name of the filename where the error occurred
lineNum - the starting line number in the source file where the error occurred
errorMessage - the error message

register

public void register(int type,
                     java.lang.String errorMessage)
Register an error

Parameters:
type - the type (lex, parse, semantic) of error
errorMessage - the error message

checkErrors

public void checkErrors()
Check the errors - halts if there are any registered errors