-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorRuntimeMsg.java
More file actions
78 lines (63 loc) · 2.95 KB
/
Copy patherrorRuntimeMsg.java
File metadata and controls
78 lines (63 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Copyright (c) 2025 - 2026 PCazzaniga (github.com)
*
* errorRuntimeMsg.java is part of SIMPLE.
*
* SIMPLE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SIMPLE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SIMPLE. If not, see <http://www.gnu.org/licenses/>.
*/
class errorRuntimeMsg {
private static final String prefix = "[RUNTIME ERROR] ";
public static String accessOverSize(int position, int size) {
return prefix + "Attempting to access position " + position + " out of structure's size " + size + ".";
}
public static String accessUnderSize(int position) {
return prefix + "Attempting to access structure at invalid position " + position + ".";
}
public static String divisionByZero() {
return prefix + "Attempting to divide by a value equal to zero.";
}
public static String inputAgain() {
return prefix + "Input unsuccessful. Enter an input again.";
}
public static String inputInterrupted() {
return prefix + "Program execution interrupted at input.";
}
public static String inputMismatchedType(typeVisitor.dataType gotType, typeVisitor.dataType wantType) {
return prefix + "Attempting to input value of mismatched type " + gotType + " but type " + wantType + " is expected.";
}
public static String inputTooManyAttempts(int maxLoop){
return prefix + "Unsuccessful input attempts over limit of " + maxLoop +
". If this is not user error then program may be broken.";
}
public static String loopNegative(int limit) {
return prefix + "Attempting to execute quantified loop using negative value " + limit + ".";
}
public static String loopOverLimit(int maxLoop) {
return prefix + "Attempting to execute conditional loop over iteration limit of " + maxLoop +
". Program may be stuck in an infinite loop.";
}
public static String modulusByZero() {
return prefix + "Attempting to calculate modulus using a value equal to zero.";
}
public static String noMain() {
return prefix + "Attempting to execute file with no Main procedure.";
}
public static String recursionOverLimit(String funName, int maxRec) {
return prefix + "Attempting to execute function " + funName + " over recursion limit of " + maxRec +
". Program may be stuck in an infinite call loop.";
}
public static String unexpectedInputRequest(int line) {
return prefix + "Unable to determine expected type from input at line " + line + ". Missing record from validation.";
}
}