ParseException

open class ParseException(var input: Any?, var offendingSymbol: String?, var line: Int, var column: Int, message: String?, throwable: Throwable?) : TuPrologException

Reports a failure while turning Prolog source into a tuProlog domain object.

This is the stable exception boundary of parser-core and parser-theory. Low-level lexical and syntactic failures from parser-impl are retained as cause, while their diagnostic data is projected onto this type. Consequently, line and column are one-based even though the source positions used by parser-impl are zero-based.

clauseIndex is set by theory parsers and readers to the zero-based index of the clause that failed. It remains -1 when no clause index applies.

Parameters

message

human-readable description of the failure

throwable

lower-level cause, normally a typed parser-impl syntax exception

Inheritors

Constructors

Link copied to clipboard
constructor(input: Any?, offendingSymbol: String?, line: Int, column: Int, message: String?, throwable: Throwable?)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard

Zero-based failing clause index, or -1 when the failure is not associated with a theory.

Link copied to clipboard
var column: Int

one-based column containing the failure

Link copied to clipboard
var input: Any?

original input, or its diagnostic identifier when parsing a streamed source

Link copied to clipboard
var line: Int

one-based line containing the failure

Link copied to clipboard
expect open val message: String?
Link copied to clipboard

source text associated with the failure, if one is available

Functions

Link copied to clipboard
open override fun toString(): String

Returns a compact representation of the available diagnostic fields.