Class ParserException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ParserException
    extends java.lang.RuntimeException
    Is thrown when any grammar error happens or any exception is thrown during parsing.
    See Also:
    Serialized Form
    • Field Detail

      • location

        private final Location location
      • module

        @Deprecated
        private final java.lang.String module
        Deprecated.
    • Constructor Detail

      • ParserException

        @Deprecated
        public ParserException​(ParseErrorDetails details,
                               java.lang.String moduleName,
                               Location location)
        Deprecated.
        Creates a ParserException object.
        Parameters:
        details - the ParseErrorDetails that describes the error details.
        moduleName - the module name.
        location - the error location.
      • ParserException

        @Deprecated
        public ParserException​(java.lang.Throwable cause,
                               ParseErrorDetails details,
                               java.lang.String moduleName,
                               Location location)
        Deprecated.
        Creates a ParserException object.
        Parameters:
        cause - the exception that causes this.
        details - the ParseErrorDetails that describes the error details.
        moduleName - the module name.
        location - the location.
    • Method Detail

      • getErrorDetails

        public ParseErrorDetails getErrorDetails()
        Returns the detailed description of the error, or null if none.
      • getParseTree

        public ParseTree getParseTree()
        Returns the parse tree until the parse error happened, when parseTree() was invoked. null if absent.
        Since:
        2.3
      • setParseTree

        public void setParseTree​(ParseTree parseTree)
        Since:
        2.3
      • toErrorMessage

        private static java.lang.String toErrorMessage​(java.lang.String message,
                                                       java.lang.String module,
                                                       ParseErrorDetails details,
                                                       Location location)
      • getModuleName

        @Deprecated
        public java.lang.String getModuleName()
        Deprecated.
        Returns the module name, or null if none.
      • getLocation

        @Deprecated
        public Location getLocation()
        Deprecated.
        Use getLine() and getColumn() instead.
        Returns the location of the error.
      • getLine

        public final int getLine()
        Returns the line where the error occurred.
        Since:
        3.1
      • getColumn

        public final int getColumn()
        Returns the column where the error occurred.
        Since:
        3.1