mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 22:42:24 +00:00
Try representing errors as a table of string pointers with minimal per string overhead.
This commit is contained in:
parent
240c29c6dd
commit
002657dbeb
4 changed files with 395 additions and 188 deletions
|
|
@ -44,7 +44,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
ConstNotAlloc* = -1; (* for allocation of string and real constants *)
|
ConstNotAlloc* = -1; (* for allocation of string and real constants *)
|
||||||
TDAdrUndef* = -1; (* no type desc allocated *)
|
TDAdrUndef* = -1; (* no type desc allocated *)
|
||||||
|
|
||||||
MaxCases* = 128;
|
MaxCases* = 256;
|
||||||
MaxCaseRange* = 512;
|
MaxCaseRange* = 512;
|
||||||
|
|
||||||
MaxStruct* = 255;
|
MaxStruct* = 255;
|
||||||
|
|
@ -346,7 +346,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
|
||||||
WHILE ~S.eot & (ch # 0DX) DO buf[i] := ch; INC(i); Texts.Read(S, ch) END ;
|
WHILE ~S.eot & (ch # 0DX) DO buf[i] := ch; INC(i); Texts.Read(S, ch) END ;
|
||||||
buf[i] := 0X; LogWStr(buf);
|
buf[i] := 0X; LogWStr(buf);
|
||||||
END*)
|
END*)
|
||||||
LogWStr(errors.errors[n]);
|
errors.Write(n);
|
||||||
END LogErrMsg;
|
END LogErrMsg;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
207
src/compiler/errors-case.Mod
Normal file
207
src/compiler/errors-case.Mod
Normal file
|
|
@ -0,0 +1,207 @@
|
||||||
|
MODULE errors;
|
||||||
|
|
||||||
|
(* adr array 14172 bytes *)
|
||||||
|
(* str array 17724 bytes (original) *)
|
||||||
|
(* case stmt 19715 bytes *)
|
||||||
|
|
||||||
|
IMPORT Console;
|
||||||
|
|
||||||
|
PROCEDURE Write*(n: INTEGER);
|
||||||
|
BEGIN
|
||||||
|
CASE n OF
|
||||||
|
(* Incorrect use of the language Oberon *)
|
||||||
|
|0: Console.String("undeclared identifier")
|
||||||
|
|1: Console.String("multiply defined identifier")
|
||||||
|
|2: Console.String("illegal character in number")
|
||||||
|
|3: Console.String("illegal character in string")
|
||||||
|
|4: Console.String("identifier does not match procedure name")
|
||||||
|
|5: Console.String("comment not closed")
|
||||||
|
|
||||||
|
|9: Console.String("'=' expected")
|
||||||
|
|
||||||
|
|12: Console.String("type definition starts with incorrect symbol")
|
||||||
|
|13: Console.String("factor starts with incorrect symbol")
|
||||||
|
|14: Console.String("statement starts with incorrect symbol")
|
||||||
|
|15: Console.String("declaration followed by incorrect symbol")
|
||||||
|
|16: Console.String("MODULE expected")
|
||||||
|
|
||||||
|
|18: Console.String("'.' missing")
|
||||||
|
|19: Console.String("',' missing")
|
||||||
|
|20: Console.String("':' missing")
|
||||||
|
|
||||||
|
|22: Console.String("')' missing")
|
||||||
|
|23: Console.String("']' missing")
|
||||||
|
|24: Console.String("'}' missing")
|
||||||
|
|25: Console.String("OF missing")
|
||||||
|
|26: Console.String("THEN missing")
|
||||||
|
|27: Console.String("DO missing")
|
||||||
|
|28: Console.String("TO missing")
|
||||||
|
|
||||||
|
|30: Console.String("'(' missing")
|
||||||
|
|
||||||
|
|34: Console.String("':=' missing")
|
||||||
|
|35: Console.String("',' or OF expected")
|
||||||
|
|
||||||
|
|38: Console.String("identifier expected")
|
||||||
|
|39: Console.String("';' missing")
|
||||||
|
|
||||||
|
|41: Console.String("END missing")
|
||||||
|
|
||||||
|
|44: Console.String("UNTIL missing")
|
||||||
|
|
||||||
|
|46: Console.String("EXIT not within loop statement")
|
||||||
|
|47: Console.String("illegally marked identifier")
|
||||||
|
|
||||||
|
|50: Console.String("expression should be constant")
|
||||||
|
|51: Console.String("constant not an integer")
|
||||||
|
|52: Console.String("identifier does not denote a type")
|
||||||
|
|53: Console.String("identifier does not denote a record type")
|
||||||
|
|54: Console.String("result type of procedure is not a basic type")
|
||||||
|
|55: Console.String("procedure call of a function")
|
||||||
|
|56: Console.String("assignment to non-variable")
|
||||||
|
|57: Console.String("pointer not bound to record or array type")
|
||||||
|
|58: Console.String("recursive type definition")
|
||||||
|
|59: Console.String("illegal open array parameter")
|
||||||
|
|60: Console.String("wrong type of case label")
|
||||||
|
|61: Console.String("inadmissible type of case label")
|
||||||
|
|62: Console.String("case label defined more than once")
|
||||||
|
|63: Console.String("illegal value of constant")
|
||||||
|
|64: Console.String("more actual than formal parameters")
|
||||||
|
|65: Console.String("fewer actual than formal parameters")
|
||||||
|
|66: Console.String("element types of actual array and formal open array differ")
|
||||||
|
|67: Console.String("actual parameter corresponding to open array is not an array")
|
||||||
|
|68: Console.String("control variable must be integer")
|
||||||
|
|69: Console.String("parameter must be an integer constant")
|
||||||
|
|70: Console.String("pointer or VAR record required as formal receiver")
|
||||||
|
|71: Console.String("pointer expected as actual receiver")
|
||||||
|
|72: Console.String("procedure must be bound to a record of the same scope")
|
||||||
|
|73: Console.String("procedure must have level 0")
|
||||||
|
|74: Console.String("procedure unknown in base type")
|
||||||
|
|75: Console.String("invalid call of base procedure")
|
||||||
|
|76: Console.String("this variable (field) is read only")
|
||||||
|
|77: Console.String("object is not a record")
|
||||||
|
|78: Console.String("dereferenced object is not a variable")
|
||||||
|
|79: Console.String("indexed object is not a variable")
|
||||||
|
|80: Console.String("index expression is not an integer")
|
||||||
|
|81: Console.String("index out of specified bounds")
|
||||||
|
|82: Console.String("indexed variable is not an array")
|
||||||
|
|83: Console.String("undefined record field")
|
||||||
|
|84: Console.String("dereferenced variable is not a pointer")
|
||||||
|
|85: Console.String("guard or test type is not an extension of variable type")
|
||||||
|
|86: Console.String("guard or testtype is not a pointer")
|
||||||
|
|87: Console.String("guarded or tested variable is neither a pointer nor a VAR-parameter record")
|
||||||
|
|88: Console.String("open array not allowed as variable, record field or array element")
|
||||||
|
|
||||||
|
|92: Console.String("operand of IN not an integer, or not a set")
|
||||||
|
|93: Console.String("set element type is not an integer")
|
||||||
|
|94: Console.String("operand of & is not of type BOOLEAN")
|
||||||
|
|95: Console.String("operand of OR is not of type BOOLEAN")
|
||||||
|
|96: Console.String("operand not applicable to (unary) +")
|
||||||
|
|97: Console.String("operand not applicable to (unary) -")
|
||||||
|
|98: Console.String("operand of ~ is not of type BOOLEAN")
|
||||||
|
|99: Console.String("ASSERT fault")
|
||||||
|
|100: Console.String("incompatible operands of dyadic operator")
|
||||||
|
|101: Console.String("operand type inapplicable to *")
|
||||||
|
|102: Console.String("operand type inapplicable to /")
|
||||||
|
|103: Console.String("operand type inapplicable to DIV")
|
||||||
|
|104: Console.String("operand type inapplicable to MOD")
|
||||||
|
|105: Console.String("operand type inapplicable to +")
|
||||||
|
|106: Console.String("operand type inapplicable to -")
|
||||||
|
|107: Console.String("operand type inapplicable to = or #")
|
||||||
|
|108: Console.String("operand type inapplicable to relation")
|
||||||
|
|109: Console.String("overriding method must be exported")
|
||||||
|
|110: Console.String("operand is not a type")
|
||||||
|
|111: Console.String("operand inapplicable to (this) function")
|
||||||
|
|112: Console.String("operand is not a variable")
|
||||||
|
|113: Console.String("incompatible assignment")
|
||||||
|
|114: Console.String("string too long to be assigned")
|
||||||
|
|115: Console.String("parameter doesn't match")
|
||||||
|
|116: Console.String("number of parameters doesn't match")
|
||||||
|
|117: Console.String("result type doesn't match")
|
||||||
|
|118: Console.String("export mark doesn't match with forward declaration")
|
||||||
|
|119: Console.String("redefinition textually precedes procedure bound to base type")
|
||||||
|
|120: Console.String("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN")
|
||||||
|
|121: Console.String("called object is not a procedure (or is an interrupt procedure)")
|
||||||
|
|122: Console.String("actual VAR-parameter is not a variable")
|
||||||
|
|123: Console.String("type of actual parameter is not identical with that of formal VAR-parameter")
|
||||||
|
|124: Console.String("type of result expression differs from that of procedure")
|
||||||
|
|125: Console.String("type of case expression is neither INTEGER nor CHAR")
|
||||||
|
|126: Console.String("this expression cannot be a type or a procedure")
|
||||||
|
|127: Console.String("illegal use of object")
|
||||||
|
|128: Console.String("unsatisfied forward reference")
|
||||||
|
|129: Console.String("unsatisfied forward procedure")
|
||||||
|
|130: Console.String("WITH clause does not specify a variable")
|
||||||
|
|131: Console.String("LEN not applied to array")
|
||||||
|
|132: Console.String("dimension in LEN too large or negative")
|
||||||
|
|135: Console.String("SYSTEM not imported")
|
||||||
|
|150: Console.String("key inconsistency of imported module")
|
||||||
|
|151: Console.String("incorrect symbol file")
|
||||||
|
|152: Console.String("symbol file of imported module not found")
|
||||||
|
|153: Console.String("object or symbol file not opened (disk full?)")
|
||||||
|
|154: Console.String("recursive import not allowed")
|
||||||
|
|155: Console.String("generation of new symbol file not allowed")
|
||||||
|
|156: Console.String("parameter file not found")
|
||||||
|
|157: Console.String("syntax error in parameter file")
|
||||||
|
(* Limitations of implementation *)
|
||||||
|
|200: Console.String("not yet implemented")
|
||||||
|
|201: Console.String("lower bound of set range greater than higher bound")
|
||||||
|
|202: Console.String("set element greater than MAX(SET) or less than 0")
|
||||||
|
|203: Console.String("number too large")
|
||||||
|
|204: Console.String("product too large")
|
||||||
|
|205: Console.String("division by zero")
|
||||||
|
|206: Console.String("sum too large")
|
||||||
|
|207: Console.String("difference too large")
|
||||||
|
|208: Console.String("overflow in arithmetic shift")
|
||||||
|
|209: Console.String("case range too large")
|
||||||
|
|213: Console.String("too many cases in case statement")
|
||||||
|
|218: Console.String("illegal value of parameter (0 <= p < 256)")
|
||||||
|
|219: Console.String("machine registers cannot be accessed")
|
||||||
|
|220: Console.String("illegal value of parameter")
|
||||||
|
|221: Console.String("too many pointers in a record")
|
||||||
|
|222: Console.String("too many global pointers")
|
||||||
|
|223: Console.String("too many record types")
|
||||||
|
|224: Console.String("too many pointer types")
|
||||||
|
|225: Console.String("address of pointer variable too large (move forward in text)")
|
||||||
|
|226: Console.String("too many exported procedures")
|
||||||
|
|227: Console.String("too many imported modules")
|
||||||
|
|228: Console.String("too many exported structures")
|
||||||
|
|229: Console.String("too many nested records for import")
|
||||||
|
|230: Console.String("too many constants (strings) in module")
|
||||||
|
|231: Console.String("too many link table entries (external procedures)")
|
||||||
|
|232: Console.String("too many commands in module")
|
||||||
|
|233: Console.String("record extension hierarchy too high")
|
||||||
|
|234: Console.String("export of recursive type not allowed")
|
||||||
|
|240: Console.String("identifier too long")
|
||||||
|
|241: Console.String("string too long")
|
||||||
|
|242: Console.String("address overflow")
|
||||||
|
|244: Console.String("cyclic type definition not allowed")
|
||||||
|
|245: Console.String("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable")
|
||||||
|
(* Compiler Warnings *)
|
||||||
|
|301: Console.String("implicit type cast")
|
||||||
|
|306: Console.String("inappropriate symbol file ignored")
|
||||||
|
|307: Console.String("no ELSE symbol after CASE statement sequence may lead to trap") (* new warning, -- noch *)
|
||||||
|
ELSE END
|
||||||
|
END Write;
|
||||||
|
|
||||||
|
END errors.
|
||||||
|
(*
|
||||||
|
Run-time Error Messages
|
||||||
|
SYSTEM_halt
|
||||||
|
0 silent HALT(0)
|
||||||
|
1..255 HALT(n), cf. SYSTEM_halt
|
||||||
|
-1 assertion failed, cf. SYSTEM_assert
|
||||||
|
-2 invalid array index
|
||||||
|
-3 function procedure without RETURN statement
|
||||||
|
-4 invalid case in CASE statement
|
||||||
|
-5 type guard failed
|
||||||
|
-6 implicit type guard in record assignment failed
|
||||||
|
-7 invalid case in WITH statement
|
||||||
|
-8 value out of range
|
||||||
|
-9 (delayed) interrupt
|
||||||
|
-10 NIL access
|
||||||
|
-11 alignment error
|
||||||
|
-12 zero divide
|
||||||
|
-13 arithmetic overflow/underflow
|
||||||
|
-14 invalid function argument
|
||||||
|
-15 internal error
|
||||||
|
*)
|
||||||
|
|
@ -1,194 +1,192 @@
|
||||||
MODULE errors;
|
MODULE errors;
|
||||||
|
|
||||||
TYPE string* = ARRAY 128 OF CHAR;
|
(* errors.o 14172 bytes *)
|
||||||
|
(* original 17724 bytes *)
|
||||||
|
|
||||||
VAR errors- : ARRAY 350 OF string;
|
IMPORT Console, SYSTEM;
|
||||||
|
|
||||||
|
TYPE MsgPtr = POINTER[1] TO ARRAY 1024 OF CHAR;
|
||||||
|
|
||||||
|
VAR msg: ARRAY 350 OF MsgPtr; i: INTEGER;
|
||||||
|
|
||||||
|
PROCEDURE Write*(n: INTEGER);
|
||||||
|
BEGIN IF msg[n] # NIL THEN Console.String(msg[n]^) END
|
||||||
|
END Write;
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
|
FOR i := 0 TO LEN(msg)-1 DO msg[i] := NIL END;
|
||||||
|
|
||||||
(* Incorrect use of the language Oberon *)
|
(* Incorrect use of the language Oberon *)
|
||||||
errors[0] := "undeclared identifier";
|
msg[0] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("undeclared identifier"));
|
||||||
errors[1] := "multiply defined identifier";
|
msg[1] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("multiply defined identifier"));
|
||||||
errors[2] := "illegal character in number";
|
msg[2] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal character in number"));
|
||||||
errors[3] := "illegal character in string";
|
msg[3] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal character in string"));
|
||||||
errors[4] := "identifier does not match procedure name";
|
msg[4] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("identifier does not match procedure name"));
|
||||||
errors[5] := "comment not closed";
|
msg[5] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("comment not closed"));
|
||||||
errors[6] := "";
|
|
||||||
errors[7] := "";
|
msg[9] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("'=' expected"));
|
||||||
errors[8] := "";
|
|
||||||
errors[9] := "'=' expected";
|
msg[12] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("type definition starts with incorrect symbol"));
|
||||||
errors[10] :="";
|
msg[13] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("factor starts with incorrect symbol"));
|
||||||
errors[11] :="";
|
msg[14] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("statement starts with incorrect symbol"));
|
||||||
errors[12] := "type definition starts with incorrect symbol";
|
msg[15] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("declaration followed by incorrect symbol"));
|
||||||
errors[13] := "factor starts with incorrect symbol";
|
msg[16] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("MODULE expected"));
|
||||||
errors[14] := "statement starts with incorrect symbol";
|
|
||||||
errors[15] := "declaration followed by incorrect symbol";
|
msg[18] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("'.' missing"));
|
||||||
errors[16] := "MODULE expected";
|
msg[19] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("',' missing"));
|
||||||
errors[17] := "";
|
msg[20] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("':' missing"));
|
||||||
errors[18] := "'.' missing";
|
|
||||||
errors[19] := "',' missing";
|
msg[22] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("')' missing"));
|
||||||
errors[20] := "':' missing";
|
msg[23] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("']' missing"));
|
||||||
errors[21] := "";
|
msg[24] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("'}' missing"));
|
||||||
errors[22] := "')' missing";
|
msg[25] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("OF missing"));
|
||||||
errors[23] := "']' missing";
|
msg[26] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("THEN missing"));
|
||||||
errors[24] := "'}' missing";
|
msg[27] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("DO missing"));
|
||||||
errors[25] := "OF missing";
|
msg[28] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("TO missing"));
|
||||||
errors[26] := "THEN missing";
|
|
||||||
errors[27] := "DO missing";
|
msg[30] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("'(' missing"));
|
||||||
errors[28] := "TO missing";
|
|
||||||
errors[29] := "";
|
msg[34] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("':=' missing"));
|
||||||
errors[30] := "'(' missing";
|
msg[35] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("',' or OF expected"));
|
||||||
errors[31] := "";
|
|
||||||
errors[32] := "";
|
msg[38] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("identifier expected"));
|
||||||
errors[33] := "";
|
msg[39] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("';' missing"));
|
||||||
errors[34] := "':=' missing";
|
|
||||||
errors[35] := "',' or OF expected";
|
msg[41] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("END missing"));
|
||||||
errors[36] := "";
|
|
||||||
errors[37] := "";
|
msg[44] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("UNTIL missing"));
|
||||||
errors[38] := "identifier expected";
|
|
||||||
errors[39] := "';' missing";
|
msg[46] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("EXIT not within loop statement"));
|
||||||
errors[40] := "";
|
msg[47] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegally marked identifier"));
|
||||||
errors[41] := "END missing";
|
|
||||||
errors[42] := "";
|
msg[50] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("expression should be constant"));
|
||||||
errors[43] := "";
|
msg[51] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("constant not an integer"));
|
||||||
errors[44] := "UNTIL missing";
|
msg[52] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("identifier does not denote a type"));
|
||||||
errors[45] := "";
|
msg[53] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("identifier does not denote a record type"));
|
||||||
errors[46] := "EXIT not within loop statement";
|
msg[54] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("result type of procedure is not a basic type"));
|
||||||
errors[47] := "illegally marked identifier";
|
msg[55] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("procedure call of a function"));
|
||||||
errors[48] := "";
|
msg[56] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("assignment to non-variable"));
|
||||||
errors[49] := "";
|
msg[57] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("pointer not bound to record or array type"));
|
||||||
errors[50] := "expression should be constant";
|
msg[58] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("recursive type definition"));
|
||||||
errors[51] := "constant not an integer";
|
msg[59] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal open array parameter"));
|
||||||
errors[52] := "identifier does not denote a type";
|
msg[60] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("wrong type of case label"));
|
||||||
errors[53] := "identifier does not denote a record type";
|
msg[61] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("inadmissible type of case label"));
|
||||||
errors[54] := "result type of procedure is not a basic type";
|
msg[62] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("case label defined more than once"));
|
||||||
errors[55] := "procedure call of a function";
|
msg[63] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal value of constant"));
|
||||||
errors[56] := "assignment to non-variable";
|
msg[64] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("more actual than formal parameters"));
|
||||||
errors[57] := "pointer not bound to record or array type";
|
msg[65] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("fewer actual than formal parameters"));
|
||||||
errors[58] := "recursive type definition";
|
msg[66] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("element types of actual array and formal open array differ"));
|
||||||
errors[59] := "illegal open array parameter";
|
msg[67] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("actual parameter corresponding to open array is not an array"));
|
||||||
errors[60] := "wrong type of case label";
|
msg[68] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("control variable must be integer"));
|
||||||
errors[61] := "inadmissible type of case label";
|
msg[69] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("parameter must be an integer constant"));
|
||||||
errors[62] := "case label defined more than once";
|
msg[70] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("pointer or VAR record required as formal receiver"));
|
||||||
errors[63] := "illegal value of constant";
|
msg[71] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("pointer expected as actual receiver"));
|
||||||
errors[64] := "more actual than formal parameters";
|
msg[72] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("procedure must be bound to a record of the same scope"));
|
||||||
errors[65] := "fewer actual than formal parameters";
|
msg[73] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("procedure must have level 0"));
|
||||||
errors[66] := "element types of actual array and formal open array differ";
|
msg[74] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("procedure unknown in base type"));
|
||||||
errors[67] := "actual parameter corresponding to open array is not an array";
|
msg[75] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("invalid call of base procedure"));
|
||||||
errors[68] := "control variable must be integer";
|
msg[76] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("this variable (field) is read only"));
|
||||||
errors[69] := "parameter must be an integer constant";
|
msg[77] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("object is not a record"));
|
||||||
errors[70] := "pointer or VAR record required as formal receiver";
|
msg[78] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("dereferenced object is not a variable"));
|
||||||
errors[71] := "pointer expected as actual receiver";
|
msg[79] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("indexed object is not a variable"));
|
||||||
errors[72] := "procedure must be bound to a record of the same scope";
|
msg[80] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("index expression is not an integer"));
|
||||||
errors[73] := "procedure must have level 0";
|
msg[81] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("index out of specified bounds"));
|
||||||
errors[74] := "procedure unknown in base type";
|
msg[82] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("indexed variable is not an array"));
|
||||||
errors[75] := "invalid call of base procedure";
|
msg[83] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("undefined record field"));
|
||||||
errors[76] := "this variable (field) is read only";
|
msg[84] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("dereferenced variable is not a pointer"));
|
||||||
errors[77] := "object is not a record";
|
msg[85] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("guard or test type is not an extension of variable type"));
|
||||||
errors[78] := "dereferenced object is not a variable";
|
msg[86] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("guard or testtype is not a pointer"));
|
||||||
errors[79] := "indexed object is not a variable";
|
msg[87] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("guarded or tested variable is neither a pointer nor a VAR-parameter record"));
|
||||||
errors[80] := "index expression is not an integer";
|
msg[88] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("open array not allowed as variable, record field or array element"));
|
||||||
errors[81] := "index out of specified bounds";
|
|
||||||
errors[82] := "indexed variable is not an array";
|
msg[92] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand of IN not an integer, or not a set"));
|
||||||
errors[83] := "undefined record field";
|
msg[93] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("set element type is not an integer"));
|
||||||
errors[84] := "dereferenced variable is not a pointer";
|
msg[94] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand of & is not of type BOOLEAN"));
|
||||||
errors[85] := "guard or test type is not an extension of variable type";
|
msg[95] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand of OR is not of type BOOLEAN"));
|
||||||
errors[86] := "guard or testtype is not a pointer";
|
msg[96] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand not applicable to (unary) +"));
|
||||||
errors[87] := "guarded or tested variable is neither a pointer nor a VAR-parameter record";
|
msg[97] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand not applicable to (unary) -"));
|
||||||
errors[88] := "open array not allowed as variable, record field or array element";
|
msg[98] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand of ~ is not of type BOOLEAN"));
|
||||||
errors[89] := "";
|
msg[99] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("ASSERT fault"));
|
||||||
errors[90] := "";
|
msg[100] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("incompatible operands of dyadic operator"));
|
||||||
errors[91] := "";
|
msg[101] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to *"));
|
||||||
errors[92] := "operand of IN not an integer, or not a set";
|
msg[102] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to /"));
|
||||||
errors[93] := "set element type is not an integer";
|
msg[103] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to DIV"));
|
||||||
errors[94] := "operand of & is not of type BOOLEAN";
|
msg[104] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to MOD"));
|
||||||
errors[95] := "operand of OR is not of type BOOLEAN";
|
msg[105] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to +"));
|
||||||
errors[96] := "operand not applicable to (unary) +";
|
msg[106] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to -"));
|
||||||
errors[97] := "operand not applicable to (unary) -";
|
msg[107] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to = or #"));
|
||||||
errors[98] := "operand of ~ is not of type BOOLEAN";
|
msg[108] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand type inapplicable to relation"));
|
||||||
errors[99] := "ASSERT fault";
|
msg[109] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("overriding method must be exported"));
|
||||||
errors[100] := "incompatible operands of dyadic operator";
|
msg[110] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand is not a type"));
|
||||||
errors[101] := "operand type inapplicable to *";
|
msg[111] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand inapplicable to (this) function"));
|
||||||
errors[102] := "operand type inapplicable to /";
|
msg[112] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("operand is not a variable"));
|
||||||
errors[103] := "operand type inapplicable to DIV";
|
msg[113] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("incompatible assignment"));
|
||||||
errors[104] := "operand type inapplicable to MOD";
|
msg[114] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("string too long to be assigned"));
|
||||||
errors[105] := "operand type inapplicable to +";
|
msg[115] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("parameter doesn't match"));
|
||||||
errors[106] := "operand type inapplicable to -";
|
msg[116] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("number of parameters doesn't match"));
|
||||||
errors[107] := "operand type inapplicable to = or #";
|
msg[117] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("result type doesn't match"));
|
||||||
errors[108] := "operand type inapplicable to relation";
|
msg[118] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("export mark doesn't match with forward declaration"));
|
||||||
errors[109] := "overriding method must be exported";
|
msg[119] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("redefinition textually precedes procedure bound to base type"));
|
||||||
errors[110] := "operand is not a type";
|
msg[120] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN"));
|
||||||
errors[111] := "operand inapplicable to (this) function";
|
msg[121] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("called object is not a procedure (or is an interrupt procedure)"));
|
||||||
errors[112] := "operand is not a variable";
|
msg[122] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("actual VAR-parameter is not a variable"));
|
||||||
errors[113] := "incompatible assignment";
|
msg[123] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("type of actual parameter is not identical with that of formal VAR-parameter"));
|
||||||
errors[114] := "string too long to be assigned";
|
msg[124] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("type of result expression differs from that of procedure"));
|
||||||
errors[115] := "parameter doesn't match";
|
msg[125] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("type of case expression is neither INTEGER nor CHAR"));
|
||||||
errors[116] := "number of parameters doesn't match";
|
msg[126] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("this expression cannot be a type or a procedure"));
|
||||||
errors[117] := "result type doesn't match";
|
msg[127] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal use of object"));
|
||||||
errors[118] := "export mark doesn't match with forward declaration";
|
msg[128] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("unsatisfied forward reference"));
|
||||||
errors[119] := "redefinition textually precedes procedure bound to base type";
|
msg[129] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("unsatisfied forward procedure"));
|
||||||
errors[120] := "type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN";
|
msg[130] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("WITH clause does not specify a variable"));
|
||||||
errors[121] := "called object is not a procedure (or is an interrupt procedure)";
|
msg[131] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("LEN not applied to array"));
|
||||||
errors[122] := "actual VAR-parameter is not a variable";
|
msg[132] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("dimension in LEN too large or negative"));
|
||||||
errors[123] := "type of actual parameter is not identical with that of formal VAR-parameter";
|
msg[135] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("SYSTEM not imported"));
|
||||||
errors[124] := "type of result expression differs from that of procedure";
|
msg[150] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("key inconsistency of imported module"));
|
||||||
errors[125] := "type of case expression is neither INTEGER nor CHAR";
|
msg[151] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("incorrect symbol file"));
|
||||||
errors[126] := "this expression cannot be a type or a procedure";
|
msg[152] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("symbol file of imported module not found"));
|
||||||
errors[127] := "illegal use of object";
|
msg[153] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("object or symbol file not opened (disk full?)"));
|
||||||
errors[128] := "unsatisfied forward reference";
|
msg[154] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("recursive import not allowed"));
|
||||||
errors[129] := "unsatisfied forward procedure";
|
msg[155] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("generation of new symbol file not allowed"));
|
||||||
errors[130] := "WITH clause does not specify a variable";
|
msg[156] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("parameter file not found"));
|
||||||
errors[131] := "LEN not applied to array";
|
msg[157] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("syntax error in parameter file"));
|
||||||
errors[132] := "dimension in LEN too large or negative";
|
|
||||||
errors[135] := "SYSTEM not imported";
|
|
||||||
errors[150] := "key inconsistency of imported module";
|
|
||||||
errors[151] := "incorrect symbol file";
|
|
||||||
errors[152] := "symbol file of imported module not found";
|
|
||||||
errors[153] := "object or symbol file not opened (disk full?)";
|
|
||||||
errors[154] := "recursive import not allowed";
|
|
||||||
errors[155] := "generation of new symbol file not allowed";
|
|
||||||
errors[156] := "parameter file not found";
|
|
||||||
errors[157] := "syntax error in parameter file";
|
|
||||||
(* Limitations of implementation*)
|
(* Limitations of implementation*)
|
||||||
errors[200] := "not yet implemented";
|
msg[200] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("not yet implemented"));
|
||||||
errors[201] := "lower bound of set range greater than higher bound";
|
msg[201] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("lower bound of set range greater than higher bound"));
|
||||||
errors[202] := "set element greater than MAX(SET) or less than 0";
|
msg[202] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("set element greater than MAX(SET) or less than 0"));
|
||||||
errors[203] := "number too large";
|
msg[203] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("number too large"));
|
||||||
errors[204] := "product too large";
|
msg[204] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("product too large"));
|
||||||
errors[205] := "division by zero";
|
msg[205] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("division by zero"));
|
||||||
errors[206] := "sum too large";
|
msg[206] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("sum too large"));
|
||||||
errors[207] := "difference too large";
|
msg[207] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("difference too large"));
|
||||||
errors[208] := "overflow in arithmetic shift";
|
msg[208] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("overflow in arithmetic shift"));
|
||||||
errors[209] := "case range too large";
|
msg[209] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("case range too large"));
|
||||||
errors[213] := "too many cases in case statement";
|
msg[213] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many cases in case statement"));
|
||||||
errors[218] := "illegal value of parameter (0 <= p < 256)";
|
msg[218] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal value of parameter (0 <= p < 256)"));
|
||||||
errors[219] := "machine registers cannot be accessed";
|
msg[219] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("machine registers cannot be accessed"));
|
||||||
errors[220] := "illegal value of parameter";
|
msg[220] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("illegal value of parameter"));
|
||||||
errors[221] := "too many pointers in a record";
|
msg[221] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many pointers in a record"));
|
||||||
errors[222] := "too many global pointers";
|
msg[222] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many global pointers"));
|
||||||
errors[223] := "too many record types";
|
msg[223] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many record types"));
|
||||||
errors[224] := "too many pointer types";
|
msg[224] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many pointer types"));
|
||||||
errors[225] := "address of pointer variable too large (move forward in text)";
|
msg[225] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("address of pointer variable too large (move forward in text)"));
|
||||||
errors[226] := "too many exported procedures";
|
msg[226] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many exported procedures"));
|
||||||
errors[227] := "too many imported modules";
|
msg[227] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many imported modules"));
|
||||||
errors[228] := "too many exported structures";
|
msg[228] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many exported structures"));
|
||||||
errors[229] := "too many nested records for import";
|
msg[229] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many nested records for import"));
|
||||||
errors[230] := "too many constants (strings) in module";
|
msg[230] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many constants (strings) in module"));
|
||||||
errors[231] := "too many link table entries (external procedures)";
|
msg[231] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many link table entries (external procedures)"));
|
||||||
errors[232] := "too many commands in module";
|
msg[232] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("too many commands in module"));
|
||||||
errors[233] := "record extension hierarchy too high";
|
msg[233] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("record extension hierarchy too high"));
|
||||||
errors[234] := "export of recursive type not allowed";
|
msg[234] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("export of recursive type not allowed"));
|
||||||
errors[240] := "identifier too long";
|
msg[240] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("identifier too long"));
|
||||||
errors[241] := "string too long";
|
msg[241] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("string too long"));
|
||||||
errors[242] := "address overflow";
|
msg[242] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("address overflow"));
|
||||||
errors[244] := "cyclic type definition not allowed";
|
msg[244] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("cyclic type definition not allowed"));
|
||||||
errors[245] := "guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable";
|
msg[245] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable"));
|
||||||
(* Compiler Warnings *)
|
(* Compiler Warnings *)
|
||||||
|
msg[301] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("implicit type cast"));
|
||||||
errors[301] := "implicit type cast";
|
msg[306] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("inappropriate symbol file ignored"));
|
||||||
errors[306] := "inappropriate symbol file ignored";
|
msg[307] := SYSTEM.VAL(MsgPtr, SYSTEM.ADR("no ELSE symbol after CASE statement sequence may lead to trap")); (* new warning, -- noch *)
|
||||||
errors[307] := "no ELSE symbol after CASE statement sequence may lead to trap"; (* new warning, -- noch *)
|
|
||||||
|
|
||||||
END errors.
|
END errors.
|
||||||
(*
|
(*
|
||||||
Run-time Error Messages
|
Run-time Error Messages
|
||||||
|
|
@ -211,4 +209,3 @@ Run-time Error Messages
|
||||||
-14 invalid function argument
|
-14 invalid function argument
|
||||||
-15 internal error
|
-15 internal error
|
||||||
*)
|
*)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,9 @@ assemble:
|
||||||
cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c
|
cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c
|
||||||
cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c
|
cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c
|
||||||
cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c
|
cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c
|
||||||
|
|
||||||
|
cd $(BUILDDIR) && $(COMPILE) -c -gstabs -g1 -Wa,-acdhln=errors.s errors.c
|
||||||
|
|
||||||
cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c
|
cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c
|
||||||
cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c
|
cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue