Class ScriptParseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LangParseException
Script.
The engine's front door is the AST: a Script is the
currency, and how one is produced — the .relix text grammar,
a serialized query format, a programmatic builder — is a frontend concern the
core does not name. This exception is the core-level counterpart: the seam
types that ask a frontend for a Script (notably
ScriptLoader.load) declare this type, and each frontend
throws a subtype carrying its own diagnostic detail.
This is a RuntimeException so that producing an AST does not force
checked-exception handling at every call site.
The message is used verbatim — subclasses that decorate it with position
information (as the .relix grammar's exception does) must do so
themselves before calling super.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionScriptParseException(String message) Constructs an exception with no known source position.ScriptParseException(String message, int line, int column) Constructs an exception at a known source position. -
Method Summary
Modifier and TypeMethodDescriptionfinal intcolumn()Returns the 1-based source column the failure occurred at, or0when unknown; seeline().Returns the description of the problem without any position a subclass appended to the message.final intline()Returns the 1-based source line the failure occurred at, or0when the producing frontend has no line/column notion (a builder API) or could not attribute one.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ScriptParseException
Constructs an exception with no known source position.- Parameters:
message- a human-readable description of the problem
-
ScriptParseException
Constructs an exception at a known source position.- Parameters:
message- a human-readable description of the problemline- 1-based source line, or 0 when the position is unknowncolumn- 1-based source column, or 0 when the position is unknown
-
-
Method Details
-
line
public final int line()Returns the 1-based source line the failure occurred at, or0when the producing frontend has no line/column notion (a builder API) or could not attribute one.- Returns:
- the 1-based line, or 0 if unknown
-
column
public final int column()Returns the 1-based source column the failure occurred at, or0when unknown; seeline().- Returns:
- the 1-based column, or 0 if unknown
-
description
Returns the description of the problem without any position a subclass appended to the message.A caller that reports the position itself — beside a file name, say — would otherwise state it twice. The default is the message verbatim, which is right for a frontend that decorates nothing.
- Returns:
- the message without its position text; never null
-