mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 00:34:20 +03:00
Add base type for exceptions
This commit is contained in:
parent
312a05576c
commit
cdf0219ca1
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class ArgumentsMismatchException extends RuntimeException {
|
||||
public final class ArgumentsMismatchException extends OwnLangRuntimeException {
|
||||
|
||||
public ArgumentsMismatchException() {
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class OperationIsNotSupportedException extends RuntimeException {
|
||||
public final class OperationIsNotSupportedException extends OwnLangRuntimeException {
|
||||
|
||||
public OperationIsNotSupportedException(Object operation) {
|
||||
super("Operation " + operation + " is not supported");
|
@ -0,0 +1,15 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
/**
|
||||
* Base type for all runtime exceptions
|
||||
*/
|
||||
public abstract class OwnLangRuntimeException extends RuntimeException {
|
||||
|
||||
public OwnLangRuntimeException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public OwnLangRuntimeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class PatternMatchingException extends RuntimeException {
|
||||
public final class PatternMatchingException extends OwnLangRuntimeException {
|
||||
|
||||
public PatternMatchingException() {
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public class StoppedException extends OwnLangRuntimeException {
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class TypeException extends RuntimeException {
|
||||
public final class TypeException extends OwnLangRuntimeException {
|
||||
|
||||
public TypeException(String message) {
|
||||
super(message);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class UnknownClassException extends RuntimeException {
|
||||
public final class UnknownClassException extends OwnLangRuntimeException {
|
||||
|
||||
private final String className;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class UnknownFunctionException extends RuntimeException {
|
||||
public final class UnknownFunctionException extends OwnLangRuntimeException {
|
||||
|
||||
private final String functionName;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class UnknownPropertyException extends RuntimeException {
|
||||
public final class UnknownPropertyException extends OwnLangRuntimeException {
|
||||
|
||||
private final String propertyName;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public final class VariableDoesNotExistsException extends RuntimeException {
|
||||
public final class VariableDoesNotExistsException extends OwnLangRuntimeException {
|
||||
|
||||
private final String variable;
|
||||
|
@ -6,7 +6,7 @@ import com.annimon.ownlang.parser.Pos;
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public final class LexerException extends RuntimeException {
|
||||
public final class LexerException extends OwnLangParserException {
|
||||
|
||||
public LexerException(String message) {
|
||||
super(message);
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
/**
|
||||
* Base type for all lexer and parser exceptions
|
||||
*/
|
||||
public abstract class OwnLangParserException extends RuntimeException {
|
||||
|
||||
public OwnLangParserException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public OwnLangParserException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import com.annimon.ownlang.parser.Range;
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public final class ParseException extends RuntimeException {
|
||||
public final class ParseException extends OwnLangParserException {
|
||||
|
||||
private final Range range;
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
package com.annimon.ownlang.exceptions;
|
||||
|
||||
public class StoppedException extends RuntimeException {
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user