Class ParseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ca.solostudios.strata.parser.tokenizer.ParseException
-
- All Implemented Interfaces:
java.io.Serializable
public final class ParseException extends java.lang.Exception
Represents an error or a warning, which occurred when parsing an input.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ParseException(@NotNull java.lang.Exception exception, @NotNull Position position)
Constructs a new parse exception with the provided exception as a cause and position.ParseException(@NotNull java.lang.Exception exception, @NotNull java.lang.String parseString, @NotNull Position position)
Constructs a new parse exception with the provided exception as a cause, parse string, and position.ParseException(@NotNull java.lang.String message, @NotNull Position position)
Constructs a new parse exception with the provided message and position.ParseException(@NotNull java.lang.String message, @NotNull java.lang.String parseString, @NotNull Position position)
Constructs a new parse exception with the provided message, parse string, and position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Position
getPosition()
The position where the error or warning occurred.java.lang.String
toString()
Formats this parse exception as a string.
-
-
-
Constructor Detail
-
ParseException
public ParseException(@NotNull @NotNull java.lang.String message, @NotNull @NotNull java.lang.String parseString, @NotNull @NotNull Position position)
Constructs a new parse exception with the provided message, parse string, and position.- Parameters:
message
- The message explaining why the parsing exception occurred.parseString
- The string that was being parsed.position
- The position at which the error occurred.
-
ParseException
public ParseException(@NotNull @NotNull java.lang.String message, @NotNull @NotNull Position position)
Constructs a new parse exception with the provided message and position.- Parameters:
message
- The message explaining why the parsing exception occurred.position
- The position at which the error occurred.
-
ParseException
public ParseException(@NotNull @NotNull java.lang.Exception exception, @NotNull @NotNull java.lang.String parseString, @NotNull @NotNull Position position)
Constructs a new parse exception with the provided exception as a cause, parse string, and position.- Parameters:
exception
- The exception, which caused this.parseString
- The string that was being parsed.position
- The position at which the error occurred.
-
ParseException
public ParseException(@NotNull @NotNull java.lang.Exception exception, @NotNull @NotNull Position position)
Constructs a new parse exception with the provided exception as a cause and position.- Parameters:
exception
- The exception, which caused this.position
- The position at which the error occurred.
-
-
Method Detail
-
toString
public java.lang.String toString()
Formats this parse exception as a string.- Overrides:
toString
in classjava.lang.Throwable
- Returns:
- The parse exception formatted as a string
-
getPosition
@NotNull public @NotNull Position getPosition()
The position where the error or warning occurred.- Returns:
- the position of this error or warning.
-
-