at.dms.compiler.tools.common
Class UnpositionedError

java.lang.Object
  extended by java.lang.Throwable
      extended by at.dms.compiler.tools.common.UnpositionedError
All Implemented Interfaces:
Serializable

public class UnpositionedError
extends 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)
          Creates an error with a formatted message as argument.
UnpositionedError(MessageDescription description)
          Creates an error without parameters.
UnpositionedError(MessageDescription description, Object parameter)
          Creates an error with one parameter.
UnpositionedError(MessageDescription description, Object[] parameters)
          Creates an error with an arbitrary number of parameters.
UnpositionedError(MessageDescription description, Object parameter1, Object parameter2)
          Creates an error with two parameters.
 
Method Summary
 PositionedError addPosition(TokenReference where)
          Returns an error with a reference to the source file.
 Message getFormattedMessage()
          Returns the formatted message.
 String getMessage()
          Returns a string explaining the error.
 boolean hasDescription(MessageDescription description)
          Returns true iff the error has specified description.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, 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)
Creates an error with a formatted message as argument.

Parameters:
message - the formatted message

UnpositionedError

public UnpositionedError(MessageDescription description,
                         Object[] parameters)
Creates an error with an arbitrary number of parameters.

Parameters:
description - the message description
parameters - the array of parameters

UnpositionedError

public UnpositionedError(MessageDescription description,
                         Object parameter1,
                         Object parameter2)
Creates an error with two parameters.

Parameters:
description - the message description
parameter1 - the first parameter
parameter2 - the second parameter

UnpositionedError

public UnpositionedError(MessageDescription description,
                         Object parameter)
Creates an error with one parameter.

Parameters:
description - the message description
parameter - the parameter

UnpositionedError

public UnpositionedError(MessageDescription description)
Creates an error without parameters.

Parameters:
description - the message description
Method Detail

getMessage

public String getMessage()
Returns a string explaining the error.

Overrides:
getMessage in class Throwable

getFormattedMessage

public Message getFormattedMessage()
Returns the formatted message.


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