mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 17:48:03 +00:00
Added Exceptions classes
This commit is contained in:
parent
72733f4612
commit
0e035aac8b
@ -0,0 +1,10 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class FieldAlreadyDeclaredException extends RuntimeException{
|
||||
|
||||
public FieldAlreadyDeclaredException(String name) {
|
||||
super("Field " + name + " already declared");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class LocalVariableAlreadDeclaredException extends RuntimeException {
|
||||
public LocalVariableAlreadDeclaredException(String name){
|
||||
super("local Variable " + name + " already declared");
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class NotFoundMethodOrConstructor extends RuntimeException {
|
||||
|
||||
public NotFoundMethodOrConstructor() {
|
||||
super("Method or constructor not found in class");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class NotMatchConstructorException extends RuntimeException {
|
||||
|
||||
public NotMatchConstructorException(String constructorName) {
|
||||
super(constructorName);
|
||||
}
|
||||
|
||||
public NotMatchConstructorException() {
|
||||
super("Not matching constructor found");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class ParameterAlreadyExistsException extends RuntimeException{
|
||||
public ParameterAlreadyExistsException(String paraName) {
|
||||
super("Parameter '" + paraName + "' already exists");
|
||||
}
|
||||
public ParameterAlreadyExistsException(String paraName, String methodOrConstructorName) {
|
||||
super("Parameter '" + paraName + "' already exists in " + methodOrConstructorName);
|
||||
}
|
||||
public ParameterAlreadyExistsException() {
|
||||
super("Parameter already exists");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class TypeMismatchException extends RuntimeException{
|
||||
|
||||
public TypeMismatchException(String operator) {
|
||||
super("Type mismatch in operator: " + operator);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package de.maishai.typedast.ExceptionHandler;
|
||||
|
||||
public class VariableNotDeclaredException extends RuntimeException{
|
||||
|
||||
public VariableNotDeclaredException(String variableName) {
|
||||
super("Variable '" + variableName + "' not declared");
|
||||
}
|
||||
public VariableNotDeclaredException(String variableName, String methodName) {
|
||||
super("Variable '" + variableName + "' not declared in method '" + methodName + "'");
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user