jfun.parsec

Class ParserException

public class ParserException extends RuntimeException

ParserException is thrown when a grammar error happens.

Author: Ben Yu 2004-11-12

Constructor Summary
ParserException(ParseError err, String mname, Pos pos)
Create a ParserException object.
ParserException(String message, ParseError err, String mname, Pos pos)
Create a ParserException object.
ParserException(Throwable cause, ParseError err, String mname, Pos pos)
ParserException(String message, Throwable cause, ParseError err, String mname, Pos pos)
Method Summary
intgetColumnNo()
Gets the column number of the error.
ParseErrorgetError()
Get the ParseError object.
intgetLineNo()
Gets the line number of the error.
StringgetMessage()
Get the default formatted error message.
StringgetModuleName()
Gets the module name.
StackgetParsingTrace()
Get the parsing trace.
voidprintParsingTrace(PrintStream out)
Print the parsing trace.
voidprintParsingTrace(PrintWriter out)
Print the resultion trace.
voidprintParsingTrace()
Prints the parsing trace to the standard error output.
voidprintStackTrace(PrintStream s)
voidprintStackTrace(PrintWriter s)

Constructor Detail

ParserException

public ParserException(ParseError err, String mname, Pos pos)
Create a ParserException object.

Parameters: err the ParseError object. mname the module name. pos the position.

ParserException

public ParserException(String message, ParseError err, String mname, Pos pos)
Create a ParserException object.

Parameters: message the error message. err the ParseError object. mname the module name. pos the position.

ParserException

public ParserException(Throwable cause, ParseError err, String mname, Pos pos)

Parameters: cause the exception that causes this. err the ParseError object. mname the module name. pos the position.

ParserException

public ParserException(String message, Throwable cause, ParseError err, String mname, Pos pos)

Parameters: message the error message. cause the exception that causes this. err the ParseError object. mname the module name. pos the position.

Method Detail

getColumnNo

public int getColumnNo()
Gets the column number of the error.

Returns: the column number.

getError

public final ParseError getError()
Get the ParseError object.

Returns: Returns the err.

getLineNo

public int getLineNo()
Gets the line number of the error.

Returns: the line number.

getMessage

public String getMessage()
Get the default formatted error message.

See Also: java.lang.Throwable#getMessage()

getModuleName

public String getModuleName()
Gets the module name.

Returns: the module name.

getParsingTrace

public Stack getParsingTrace()
Get the parsing trace.

Returns: the parsing trace with objects of ParsingFrame as the elements.

printParsingTrace

public void printParsingTrace(PrintStream out)
Print the parsing trace.

Parameters: out the output stream.

printParsingTrace

public void printParsingTrace(PrintWriter out)
Print the resultion trace.

Parameters: out the output writer.

printParsingTrace

public void printParsingTrace()
Prints the parsing trace to the standard error output.

printStackTrace

public void printStackTrace(PrintStream s)

printStackTrace

public void printStackTrace(PrintWriter s)