tip
Class Errors

java.lang.Object
  extended by tip.Errors

public class Errors
extends Object

Methods and intertype declarations having to do with error handling.


Constructor Summary
Errors()
           
 
Method Summary
static void check()
          Check if any errors have occurred yet.
static void error(Token pos, String message)
          Report an error at a specific position in a source file.
static void errorMessage(String message)
          Report an error not associated with a syntax node, such as a file error or parse error.
static void fatalError(Token pos, String message)
          Report an error at a specific position in a source file and stop the compilation.
static void reset()
          Reset the error flag for a fresh compilation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Errors

public Errors()
Method Detail

error

public static void error(Token pos,
                         String message)
Report an error at a specific position in a source file.

Parameters:
pos - the position at which the error occurred
message - the error message

fatalError

public static void fatalError(Token pos,
                              String message)
Report an error at a specific position in a source file and stop the compilation.

Parameters:
pos - the position at which the error occurred
message - the error message

errorMessage

public static void errorMessage(String message)
Report an error not associated with a syntax node, such as a file error or parse error.

Parameters:
message - the error message

check

public static void check()
Check if any errors have occurred yet. Called between each compiler phase to stop the compilation if errors occurred during the previous phase.

Throws:
SourceError - if any error has occurred.

reset

public static void reset()
Reset the error flag for a fresh compilation