org.anarres.cpp
Class ErrorMessage

java.lang.Object
  extended by org.anarres.cpp.ErrorMessage

public class ErrorMessage
extends Object


Constructor Summary
ErrorMessage(Source source, int line, int column, boolean error, String msg)
           
ErrorMessage(Source source, Token postok, boolean error, String msg)
           
 
Method Summary
 int getColumn()
          Returns the column number at which this error occurred.
 int getLine()
          Returns the line number at which this error occurred.
 String getMessage()
          Returns the error message itself.
 String getSource()
          Returns a text description of the file or other location in which this error occurred.
 String toString()
          Returns a user-readable version of this ErrorMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorMessage

public ErrorMessage(Source source,
                    int line,
                    int column,
                    boolean error,
                    String msg)
Parameters:
error - true if an error, false if a warning.

ErrorMessage

public ErrorMessage(Source source,
                    Token postok,
                    boolean error,
                    String msg)
Parameters:
postok - The token at the error location.
error - true if an error, false if a warning.
Method Detail

getSource

public String getSource()
Returns a text description of the file or other location in which this error occurred. This is always the String form of the Source passed to the constructor.

See Also:
StringLexerSource.toString(), FileLexerSource.toString()

getLine

public int getLine()
Returns the line number at which this error occurred. Line numbers start from zero.


getColumn

public int getColumn()
Returns the column number at which this error occurred. Column numbers start from zero.


getMessage

public String getMessage()
Returns the error message itself.


toString

public String toString()
Returns a user-readable version of this ErrorMessage.

Overrides:
toString in class Object


Copyright © 2007 Shevek, Anarres. All Rights Reserved.