at.dms.compiler.tools.common
Class PositionedError

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

public class PositionedError
extends FormattedException

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

See Also:
Serialized Form

Constructor Summary
PositionedError(TokenReference where, Message message)
          An error with a formatted message as argument
PositionedError(TokenReference where, MessageDescription description)
          An error without parameters
PositionedError(TokenReference where, MessageDescription description, Object parameter)
          An error with one parameter
PositionedError(TokenReference where, MessageDescription description, Object[] parameters)
          An error with an arbitrary number of parameters
PositionedError(TokenReference where, MessageDescription description, Object parameter1, Object parameter2)
          An error with two parameters
 
Method Summary
 String getMessage()
          Returns the string explaining the error.
 TokenReference getTokenReference()
          Returns the position in the source code.
 
Methods inherited from class at.dms.compiler.tools.common.FormattedException
getFormattedMessage, hasDescription
 
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

PositionedError

public PositionedError(TokenReference where,
                       Message message)
An error with a formatted message as argument

Parameters:
where - the position in the source code
message - the formatted message

PositionedError

public PositionedError(TokenReference where,
                       MessageDescription description,
                       Object[] parameters)
An error with an arbitrary number of parameters

Parameters:
where - the position in the source code
description - the message description
parameters - the array of parameters

PositionedError

public PositionedError(TokenReference where,
                       MessageDescription description,
                       Object parameter1,
                       Object parameter2)
An error with two parameters

Parameters:
where - the position in the source code
description - the message description
parameter1 - the first parameter
parameter2 - the second parameter

PositionedError

public PositionedError(TokenReference where,
                       MessageDescription description,
                       Object parameter)
An error with one parameter

Parameters:
where - the position in the source code
description - the message description
parameter - the parameter

PositionedError

public PositionedError(TokenReference where,
                       MessageDescription description)
An error without parameters

Parameters:
where - the position in the source code
description - the message description
Method Detail

getTokenReference

public TokenReference getTokenReference()
Returns the position in the source code.


getMessage

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

Overrides:
getMessage in class FormattedException