Package dev.zemco.codegame.compilation
Class InvalidSyntaxException
java.lang.Object
java.lang.Throwable
java.lang.Exception
dev.zemco.codegame.compilation.InvalidSyntaxException
- All Implemented Interfaces:
Serializable
Thrown when a source code contains an invalid syntax.
- Author:
- Erik Zemčík
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInvalidSyntaxException(String message, int linePosition) Creates an instance ofInvalidSyntaxException.InvalidSyntaxException(String message, Throwable cause, int linePosition) Creates an instance ofInvalidSyntaxException. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the zero-based line position where the syntax error is located.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InvalidSyntaxException
Creates an instance ofInvalidSyntaxException.- Parameters:
message- detail message containing information about the invalid syntaxlinePosition- zero-based line position where the syntax error is located- Throws:
IllegalArgumentException- iflinePositionis not a positive integer
-
InvalidSyntaxException
Creates an instance ofInvalidSyntaxException.- Parameters:
message- detail message containing information about the invalid syntaxcause- cause of the invalid syntax errorlinePosition- zero-based line position where the syntax error is located- Throws:
IllegalArgumentException- iflinePositionis not a positive integer
-
-
Method Details
-
getLinePosition
public int getLinePosition()Returns the zero-based line position where the syntax error is located.- Returns:
- zero-based line position
-