at.dms.compiler
Class UnpositionedError

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--at.dms.compiler.UnpositionedError
All Implemented Interfaces:
java.io.Serializable

public class UnpositionedError
extends java.lang.Throwable

This class is the root class for all compiler errors without a reference to the source text.

See Also:
Serialized Form

Constructor Summary
UnpositionedError(Message message)
          An exception with a formatted message as argument.
UnpositionedError(MessageDescription description)
          An exception without parameters.
UnpositionedError(MessageDescription description, java.lang.Object parameter)
          An exception with one parameter.
UnpositionedError(MessageDescription description, java.lang.Object[] parameters)
          An exception with an arbitrary number of parameters.
UnpositionedError(MessageDescription description, java.lang.Object parameter1, java.lang.Object parameter2)
          An exception with two parameters.
 
Method Summary
 PositionedError addPosition(TokenReference where)
          Returns an error with a reference to the source file.
 java.lang.String getErrorMessage()
          Returns the string explaining the exception.
 Message getFormattedMessage()
          Returns the formatted message.
 java.lang.String getMessage()
          Returns a string explaining the exception.
 boolean hasDescription(MessageDescription description)
          Returns true iff the error has specified description.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnpositionedError

public UnpositionedError(Message message)
An exception with a formatted message as argument.
Parameters:
message - The formatted message.

UnpositionedError

public UnpositionedError(MessageDescription description,
                         java.lang.Object[] parameters)
An exception with an arbitrary number of parameters.
Parameters:
description - The message description.
parameters - The array of parameters.

UnpositionedError

public UnpositionedError(MessageDescription description,
                         java.lang.Object parameter1,
                         java.lang.Object parameter2)
An exception with two parameters.
Parameters:
description - the message description
parameter1 - the first parameter
parameter2 - the second parameter

UnpositionedError

public UnpositionedError(MessageDescription description,
                         java.lang.Object parameter)
An exception with one parameter.
Parameters:
description - The message description.
parameter - The parameter.

UnpositionedError

public UnpositionedError(MessageDescription description)
An exception without parameters.
Parameters:
description - The message description.
Method Detail

getMessage

public java.lang.String getMessage()
Returns a string explaining the exception.
Overrides:
getMessage in class java.lang.Throwable

getFormattedMessage

public Message getFormattedMessage()
Returns the formatted message.

getErrorMessage

public java.lang.String getErrorMessage()
Returns the string explaining the exception.

hasDescription

public boolean hasDescription(MessageDescription description)
Returns true iff the error has specified description.

addPosition

public PositionedError addPosition(TokenReference where)
Returns an error with a reference to the source file.
Parameters:
where - The position in the source file responsible for the error.