Class PrologParserException

    • Field Detail

      • line

        protected final int line
      • pos

        protected final int pos
    • Constructor Detail

      • PrologParserException

        public PrologParserException​(String text,
                                     int line,
                                     int pos)
        Constructor
        Parameters:
        text - text of parsing error
        line - line where the error has been detected
        pos - line position where the error has been detected
      • PrologParserException

        public PrologParserException​(String text,
                                     int line,
                                     int pos,
                                     Throwable cause)
        Constructor
        Parameters:
        text - text of parsing error
        line - line where the error has been detected
        pos - line position where the error has been detected
        cause - the root exception
    • Method Detail

      • getLine

        public int getLine()
        Get the error line, first line has index 1
        Returns:
        the error line, -1 if the line is undefined
      • getPos

        public int getPos()
        Get the error line position, first position has index 1
        Returns:
        the error line position, -1 if the position is undefined
      • hasValidPosition

        public boolean hasValidPosition()
        Check that the exception contains valid position
        Returns:
        true if position and line have been defined in the exception