gov.llnl.babel.parsers.sidl
Class GrammarException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by gov.llnl.babel.parsers.sidl.SIDLException
              extended by gov.llnl.babel.parsers.sidl.GrammarException
All Implemented Interfaces:
java.io.Serializable

public class GrammarException
extends SIDLException

A GrammarException is thrown if an error is detected during the parse of the sidl grammar. This exception inherits from the base sidl exception class SIDLException.

See Also:
Serialized Form

Constructor Summary
GrammarException(ParseException ex, int production)
          Create a new exception object using the specified parser exception and production identifier.
 
Method Summary
 java.lang.String getErrorToken()
          Return the token string causing the grammar error.
 java.lang.String[] getExpectedTokens()
          Return the array of tokens expected by the grammar parser.
 java.lang.String getMessage()
          Generate an error message corresponding to this exception.
 
Methods inherited from class gov.llnl.babel.parsers.sidl.SIDLException
getColumnNumber, getLineNumber, getProductionNumber
 
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

GrammarException

public GrammarException(ParseException ex,
                        int production)
Create a new exception object using the specified parser exception and production identifier. Initialize the base class with the location of the error and the associated production number. Extract error token and expected token information from the parse exception object.

Method Detail

getErrorToken

public java.lang.String getErrorToken()
Return the token string causing the grammar error.


getExpectedTokens

public java.lang.String[] getExpectedTokens()
Return the array of tokens expected by the grammar parser.


getMessage

public java.lang.String getMessage()
Generate an error message corresponding to this exception. The error message will report the line number, column number, production, and the error and expected tokens.

Overrides:
getMessage in class java.lang.Throwable