Commit | Line | Data |
---|---|---|
c1b567d8 MW |
1 | REM >ErrorGen |
2 | REM | |
3 | REM Generation of error tables | |
4 | REM | |
5 | REM © 1995 Straylight | |
6 | REM | |
7 | ||
8 | ON ERROR PRINTREPORT$;" ["+STR$ERL+"]":CLOSE #0:END | |
9 | ||
10 | DIM errMsg$(256),errName$(256) | |
11 | tab$=CHR$(9) | |
12 | ||
13 | REM --- Generate the token table --- | |
14 | ||
15 | RESTORE | |
16 | curr%=0 | |
17 | READ errMsg$(curr%),errName$(curr%) | |
18 | WHILE errMsg$(curr%)<>"***" | |
19 | curr%+=1 | |
20 | READ errMsg$(curr%),errName$(curr%) | |
21 | ENDWHILE | |
22 | ||
23 | C=OPENOUT("sh.errTable") | |
24 | BPUT#C,";" | |
25 | BPUT#C,"; errTable.sh" | |
26 | BPUT#C,";" | |
27 | BPUT#C,"; Define error messages table (generated)" | |
28 | BPUT#C,";" | |
29 | BPUT#C,"; © 1995 Straylight" | |
30 | BPUT#C,";" | |
31 | BPUT#C,"" | |
32 | BPUT#C,tab$+tab$+"["+tab$+":LNOT::DEF:errTable__dfn" | |
33 | BPUT#C,tab$+tab$+"GBLL"+tab$+"errTable__dfn" | |
34 | BPUT#C,"" | |
35 | ||
36 | curr%=0 | |
37 | BPUT#C,"errTable" | |
38 | WHILE errMsg$(curr%)<>"***" | |
39 | BPUT#C,tab$+tab$+"DCD"+tab$+"err__msg"+STR$curr%+"-errTable" | |
40 | curr%+=1 | |
41 | ENDWHILE | |
42 | BPUT#C,"" | |
43 | ||
44 | curr%=0 | |
45 | WHILE errMsg$(curr%)<>"***" | |
46 | BPUT#C,"err__msg"+STR$curr%+tab$+"DCB"+tab$+""""+errMsg$(curr%)+""",0" | |
47 | curr%+=1 | |
48 | ENDWHILE | |
49 | BPUT#C,"" | |
50 | BPUT#C,tab$+tab$+"]" | |
51 | BPUT#C,"" | |
52 | BPUT#C,tab$+tab$+"END" | |
53 | CLOSE#C | |
54 | OSCLI "Settype sh.errTable FFF" | |
55 | ||
56 | REM -- Generate the error numbers --- | |
57 | ||
58 | RESTORE | |
59 | C=OPENOUT("sh.errNum") | |
60 | BPUT#C,";" | |
61 | BPUT#C,"; errNum.sh" | |
62 | BPUT#C,";" | |
63 | BPUT#C,"; Define error numbers (generated)" | |
64 | BPUT#C,";" | |
65 | BPUT#C,"; © 1995 Straylight" | |
66 | BPUT#C,";" | |
67 | BPUT#C,"" | |
68 | BPUT#C,tab$+tab$+"["+tab$+":LNOT::DEF:errNum__dfn" | |
69 | BPUT#C,tab$+tab$+"GBLL"+tab$+"errNum__dfn" | |
70 | BPUT#C,"" | |
71 | ||
72 | curr%=0 | |
73 | BPUT#C,tab$+tab$+"^"+tab$+"0" | |
74 | WHILE errMsg$(curr%)<>"***" | |
75 | BPUT#C,errName$(curr%); | |
76 | IF LEN(errName$(curr%))>7 THEN BPUT#C,tab$; ELSE BPUT#C,tab$+tab$; | |
77 | BPUT#C,"#"+tab$+"1" | |
78 | curr%+=1 | |
79 | ENDWHILE | |
80 | BPUT#C,"" | |
81 | BPUT#C,tab$+tab$+"]" | |
82 | BPUT#C,"" | |
83 | BPUT#C,tab$+tab$+"END" | |
84 | CLOSE#C | |
85 | OSCLI "Settype sh.errNum FFF" | |
86 | ||
87 | END | |
88 | ||
89 | DATA "Type mismatch: Number needed",err_numNeeded | |
90 | DATA "Type mismatch: String needed",err_strNeeded | |
91 | DATA "Whole array reference is invalid in this context",err_arrayBad | |
92 | DATA "Missing )",err_expBracket | |
93 | DATA "Missing #",err_expHash | |
94 | DATA "Missing """"",err_expQuote | |
95 | DATA "Missing =",err_expEq | |
96 | DATA "Missing ,",err_expComma | |
97 | DATA "Bad hex",err_badHex | |
98 | DATA "Bad binary",err_badBinary | |
99 | DATA "Unknown or missing variable",err_unknown | |
100 | DATA "Division by zero",err_divZero | |
101 | DATA "Out of memory",err_noMem | |
102 | DATA "Syntax error",err_syntax | |
103 | DATA "Mistake",err_mistake | |
104 | DATA "String too long",err_strTooLong | |
105 | ||
106 | DATA "Missing = in FOR",err_eqInFor | |
107 | DATA "Bad FOR control variable",err_badForVar | |
108 | DATA "Missing TO",err_expTo | |
109 | DATA "The step cannot be zero",err_zStep | |
110 | DATA "Not in a FOR loop",err_noFor | |
111 | ||
112 | DATA "Not in a REPEAT loop",err_noRepeat | |
113 | ||
114 | DATA "Missing ENDWHILE",err_expEndwhile | |
115 | DATA "Not in a WHILE loop",err_noWhile | |
116 | ||
117 | DATA "Missing ENDIF",err_expEndif | |
118 | ||
119 | DATA "Missing OF",err_expOf | |
120 | DATA "CASE..OF statement must be the last thing on a line",err_afterCase | |
121 | DATA "Missing ENDCASE",err_expEndcase | |
122 | ||
123 | DATA "Missing label",err_expLabel | |
124 | DATA "Unknown label",err_noLabel | |
125 | ||
126 | DATA "Bad DIM statement",err_badDim | |
127 | DATA "No end of dimension list )",err_dimKet | |
128 | DATA "Arrays cannot be redimensioned",err_reDim | |
129 | DATA "Incorrect number of subscripts",err_numSubs | |
130 | DATA "Subscript out of range",err_subRange | |
131 | DATA "Unknown array",err_ukArray | |
132 | ||
133 | DATA "Can't use RGET while in a WATCHFOR state",err_rgetInWatch | |
134 | DATA "Can't use RGET$ while in a WATCHFOR state",err_rgetSInWatch | |
135 | DATA "Can't use LGET while in a WATCHFOR state",err_lgetInWatch | |
136 | DATA "Can't use LGET$ while in a WATCHFOR state",err_lgetSInWatch | |
137 | DATA "Can't use RINKEY while in a WATCHFOR state",err_rinkeyInWatch | |
138 | DATA "Can't use RINKEY$ while in a WATCHFOR state",err_rinkeySInWatch | |
139 | DATA "Can't use LINKEY while in a WATCHFOR state",err_linkeyInWatch | |
140 | DATA "Can't use LINKEY$ while in a WATCHFOR state",err_linkeySInWatch | |
141 | ||
142 | DATA "Wrong number of arguments passed to STRING$",err_stringSArgs | |
143 | DATA "Wrong number of arguments passed to LEFT$",err_leftSArgs | |
144 | DATA "Wrong number of arguments passed to RIGHT$",err_rightSArgs | |
145 | DATA "Wrong number of arguments passed to MID$",err_midSArgs | |
146 | DATA "Wrong number of arguments passed to INSTR",err_instrSArgs | |
147 | ||
148 | DATA "Arguments of function/procedure incorrect",err_badArgs | |
149 | DATA "No such function/procedure",err_noProc | |
150 | DATA "Bad call of function/procedure",err_badCall | |
151 | ||
152 | DATA "Not in a subroutine",err_notInSub | |
153 | DATA "Not in a procedure",err_notInProc | |
154 | DATA "Not in a function",err_notInFn | |
155 | ||
156 | DATA "Too many strings passed to WATCHFOR",err_WFTooMany | |
157 | ||
158 | DATA "Too many input parameters to SYS/SYSCALL",err_sysTooManyI | |
159 | DATA "Too many output parameters to SYS/SYSCALL",err_sysTooManyO | |
160 | ||
161 | DATA "Out of DATA",err_outOfDATA | |
162 | ||
163 | DATA "mem_realloc not implemented",err_realloc | |
164 | DATA "Not yet implemented",err_lazy | |
165 | DATA "The script interpreter has gone wrong",err_erk | |
166 | DATA ***,*** | |
167 |