Restore text file based error support as prototyped in the ErrorExperiment branch.

This commit is contained in:
David Brown 2016-11-14 21:00:34 +00:00
parent f7feea0ad1
commit 377bc73774
36 changed files with 393 additions and 1479 deletions

4
.gitignore vendored
View file

@ -10,6 +10,7 @@
/*.sym
/*.asm
/*.mod
/Errors.txt
/olang
/src/test/**/*.exe
/src/test/**/*.c
@ -24,6 +25,9 @@
/src/test/confidence/**/*.asm
/src/test/confidence/**/*.s
/src/test/confidence/**/*.map
/bootstrap/*/SYSTEM.[ch]
/bootstrap/*/Errors.Txt
/bootstrap/*/WindowsWrapper.h
/.DS_store
**/.DS_store
**/*.dSYM

View file

@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code);
export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_errch (CHAR c);
export void Modules_errint (INT32 l);
static void Modules_errposint (INT32 l);
export void Modules_errstring (CHAR *s, LONGINT s__len);
static void Modules_errint (INT32 l);
static void Modules_errstring (CHAR *s, LONGINT s__len);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
@ -169,7 +168,7 @@ static void Modules_errch (CHAR c)
e = Platform_Write(1, (ADDRESS)&c, 1);
}
void Modules_errstring (CHAR *s, LONGINT s__len)
static void Modules_errstring (CHAR *s, LONGINT s__len)
{
INT32 i;
__DUP(s, s__len, CHAR);
@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len)
__DEL(s);
}
static void Modules_errposint (INT32 l)
{
if (l > 10) {
Modules_errposint(__DIV(l, 10));
}
Modules_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
void Modules_errint (INT32 l)
static void Modules_errint (INT32 l)
{
if (l < 0) {
Modules_errch('-');
l = -l;
}
Modules_errposint(l);
if (l >= 10) {
Modules_errint(__DIV(l, 10));
}
Modules_errch((CHAR)((int)__MOD(l, 10) + 48));
}
static void Modules_DisplayHaltCode (INT32 code)

View file

@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import void Modules_Halt (INT32 code);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
import void Modules_errint (INT32 l);
import void Modules_errstring (CHAR *s, LONGINT s__len);
import void *Modules__init(void);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
#endif // Modules

View file

@ -13,7 +13,6 @@
#include "Strings.h"
#include "Texts.h"
#include "VT100.h"
#include "errors.h"
typedef
CHAR OPM_FileName[32];
@ -37,7 +36,7 @@ export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Text OPM_Log, OPM_Errors;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
static void OPM_LogErrMsg (INT16 n)
{
INT16 l;
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
INT16 i;
CHAR buf[1024];
CHAR c;
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
VT100_SetAttr((CHAR*)"31m", 4);
@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n)
}
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
if (OPM_Errors == NIL) {
__NEW(OPM_Errors, Texts_TextDesc);
Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11);
}
Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0);
do {
l = S.line;
Texts_Scan(&S, Texts_Scanner__typ);
} while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot));
if (!S.eot) {
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
while ((!S.eot && c >= ' ')) {
Out_Char(c);
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
}
}
}
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*))
{
__ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P);
P(OPM_Log);
P(OPM_Errors);
__ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P);
__ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P);
__ENUMR(OPM_R, Files_Rider__typ, 20, 3, P);
@ -1064,7 +1077,6 @@ export void *OPM__init(void)
__MODULE_IMPORT(Strings);
__MODULE_IMPORT(Texts);
__MODULE_IMPORT(VT100);
__MODULE_IMPORT(errors);
__REGMOD("OPM", EnumPtrs);
__REGCMD("CloseFiles", OPM_CloseFiles);
__REGCMD("CloseOldSym", OPM_CloseOldSym);

View file

@ -1,205 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
export errors_string errors_errors[350];
export void *errors__init(void)
{
__DEFMOD;
__REGMOD("errors", 0);
/* BEGIN */
__MOVE("undeclared identifier", errors_errors[0], 22);
__MOVE("multiply defined identifier", errors_errors[1], 28);
__MOVE("illegal character in number", errors_errors[2], 28);
__MOVE("illegal character in string", errors_errors[3], 28);
__MOVE("identifier does not match procedure name", errors_errors[4], 41);
__MOVE("comment not closed", errors_errors[5], 19);
errors_errors[6][0] = 0x00;
errors_errors[7][0] = 0x00;
errors_errors[8][0] = 0x00;
__MOVE("'=' expected", errors_errors[9], 13);
errors_errors[10][0] = 0x00;
errors_errors[11][0] = 0x00;
__MOVE("type definition starts with incorrect symbol", errors_errors[12], 45);
__MOVE("factor starts with incorrect symbol", errors_errors[13], 36);
__MOVE("statement starts with incorrect symbol", errors_errors[14], 39);
__MOVE("declaration followed by incorrect symbol", errors_errors[15], 41);
__MOVE("MODULE expected", errors_errors[16], 16);
errors_errors[17][0] = 0x00;
__MOVE("'.' missing", errors_errors[18], 12);
__MOVE("',' missing", errors_errors[19], 12);
__MOVE("':' missing", errors_errors[20], 12);
errors_errors[21][0] = 0x00;
__MOVE("')' missing", errors_errors[22], 12);
__MOVE("']' missing", errors_errors[23], 12);
__MOVE("'}' missing", errors_errors[24], 12);
__MOVE("OF missing", errors_errors[25], 11);
__MOVE("THEN missing", errors_errors[26], 13);
__MOVE("DO missing", errors_errors[27], 11);
__MOVE("TO missing", errors_errors[28], 11);
errors_errors[29][0] = 0x00;
__MOVE("'(' missing", errors_errors[30], 12);
errors_errors[31][0] = 0x00;
errors_errors[32][0] = 0x00;
errors_errors[33][0] = 0x00;
__MOVE("':=' missing", errors_errors[34], 13);
__MOVE("',' or OF expected", errors_errors[35], 19);
errors_errors[36][0] = 0x00;
errors_errors[37][0] = 0x00;
__MOVE("identifier expected", errors_errors[38], 20);
__MOVE("';' missing", errors_errors[39], 12);
errors_errors[40][0] = 0x00;
__MOVE("END missing", errors_errors[41], 12);
errors_errors[42][0] = 0x00;
errors_errors[43][0] = 0x00;
__MOVE("UNTIL missing", errors_errors[44], 14);
errors_errors[45][0] = 0x00;
__MOVE("EXIT not within loop statement", errors_errors[46], 31);
__MOVE("illegally marked identifier", errors_errors[47], 28);
errors_errors[48][0] = 0x00;
errors_errors[49][0] = 0x00;
__MOVE("expression should be constant", errors_errors[50], 30);
__MOVE("constant not an integer", errors_errors[51], 24);
__MOVE("identifier does not denote a type", errors_errors[52], 34);
__MOVE("identifier does not denote a record type", errors_errors[53], 41);
__MOVE("result type of procedure is not a basic type", errors_errors[54], 45);
__MOVE("procedure call of a function", errors_errors[55], 29);
__MOVE("assignment to non-variable", errors_errors[56], 27);
__MOVE("pointer not bound to record or array type", errors_errors[57], 42);
__MOVE("recursive type definition", errors_errors[58], 26);
__MOVE("illegal open array parameter", errors_errors[59], 29);
__MOVE("wrong type of case label", errors_errors[60], 25);
__MOVE("inadmissible type of case label", errors_errors[61], 32);
__MOVE("case label defined more than once", errors_errors[62], 34);
__MOVE("illegal value of constant", errors_errors[63], 26);
__MOVE("more actual than formal parameters", errors_errors[64], 35);
__MOVE("fewer actual than formal parameters", errors_errors[65], 36);
__MOVE("element types of actual array and formal open array differ", errors_errors[66], 59);
__MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61);
__MOVE("control variable must be integer", errors_errors[68], 33);
__MOVE("parameter must be an integer constant", errors_errors[69], 38);
__MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50);
__MOVE("pointer expected as actual receiver", errors_errors[71], 36);
__MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54);
__MOVE("procedure must have level 0", errors_errors[73], 28);
__MOVE("procedure unknown in base type", errors_errors[74], 31);
__MOVE("invalid call of base procedure", errors_errors[75], 31);
__MOVE("this variable (field) is read only", errors_errors[76], 35);
__MOVE("object is not a record", errors_errors[77], 23);
__MOVE("dereferenced object is not a variable", errors_errors[78], 38);
__MOVE("indexed object is not a variable", errors_errors[79], 33);
__MOVE("index expression is not an integer", errors_errors[80], 35);
__MOVE("index out of specified bounds", errors_errors[81], 30);
__MOVE("indexed variable is not an array", errors_errors[82], 33);
__MOVE("undefined record field", errors_errors[83], 23);
__MOVE("dereferenced variable is not a pointer", errors_errors[84], 39);
__MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56);
__MOVE("guard or testtype is not a pointer", errors_errors[86], 35);
__MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75);
__MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66);
errors_errors[89][0] = 0x00;
errors_errors[90][0] = 0x00;
errors_errors[91][0] = 0x00;
__MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43);
__MOVE("set element type is not an integer", errors_errors[93], 35);
__MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36);
__MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37);
__MOVE("operand not applicable to (unary) +", errors_errors[96], 36);
__MOVE("operand not applicable to (unary) -", errors_errors[97], 36);
__MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36);
__MOVE("ASSERT fault", errors_errors[99], 13);
__MOVE("incompatible operands of dyadic operator", errors_errors[100], 41);
__MOVE("operand type inapplicable to *", errors_errors[101], 31);
__MOVE("operand type inapplicable to /", errors_errors[102], 31);
__MOVE("operand type inapplicable to DIV", errors_errors[103], 33);
__MOVE("operand type inapplicable to MOD", errors_errors[104], 33);
__MOVE("operand type inapplicable to +", errors_errors[105], 31);
__MOVE("operand type inapplicable to -", errors_errors[106], 31);
__MOVE("operand type inapplicable to = or #", errors_errors[107], 36);
__MOVE("operand type inapplicable to relation", errors_errors[108], 38);
__MOVE("overriding method must be exported", errors_errors[109], 35);
__MOVE("operand is not a type", errors_errors[110], 22);
__MOVE("operand inapplicable to (this) function", errors_errors[111], 40);
__MOVE("operand is not a variable", errors_errors[112], 26);
__MOVE("incompatible assignment", errors_errors[113], 24);
__MOVE("string too long to be assigned", errors_errors[114], 31);
__MOVE("parameter doesn't match", errors_errors[115], 24);
__MOVE("number of parameters doesn't match", errors_errors[116], 35);
__MOVE("result type doesn't match", errors_errors[117], 26);
__MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51);
__MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61);
__MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71);
__MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64);
__MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39);
__MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76);
__MOVE("type of result expression differs from that of procedure", errors_errors[124], 57);
__MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52);
__MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48);
__MOVE("illegal use of object", errors_errors[127], 22);
__MOVE("unsatisfied forward reference", errors_errors[128], 30);
__MOVE("unsatisfied forward procedure", errors_errors[129], 30);
__MOVE("WITH clause does not specify a variable", errors_errors[130], 40);
__MOVE("LEN not applied to array", errors_errors[131], 25);
__MOVE("dimension in LEN too large or negative", errors_errors[132], 39);
__MOVE("SYSTEM not imported", errors_errors[135], 20);
__MOVE("key inconsistency of imported module", errors_errors[150], 37);
__MOVE("incorrect symbol file", errors_errors[151], 22);
__MOVE("symbol file of imported module not found", errors_errors[152], 41);
__MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46);
__MOVE("recursive import not allowed", errors_errors[154], 29);
__MOVE("generation of new symbol file not allowed", errors_errors[155], 42);
__MOVE("parameter file not found", errors_errors[156], 25);
__MOVE("syntax error in parameter file", errors_errors[157], 31);
__MOVE("not yet implemented", errors_errors[200], 20);
__MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51);
__MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49);
__MOVE("number too large", errors_errors[203], 17);
__MOVE("product too large", errors_errors[204], 18);
__MOVE("division by zero", errors_errors[205], 17);
__MOVE("sum too large", errors_errors[206], 14);
__MOVE("difference too large", errors_errors[207], 21);
__MOVE("overflow in arithmetic shift", errors_errors[208], 29);
__MOVE("case range too large", errors_errors[209], 21);
__MOVE("too many cases in case statement", errors_errors[213], 33);
__MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42);
__MOVE("machine registers cannot be accessed", errors_errors[219], 37);
__MOVE("illegal value of parameter", errors_errors[220], 27);
__MOVE("too many pointers in a record", errors_errors[221], 30);
__MOVE("too many global pointers", errors_errors[222], 25);
__MOVE("too many record types", errors_errors[223], 22);
__MOVE("too many pointer types", errors_errors[224], 23);
__MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61);
__MOVE("too many exported procedures", errors_errors[226], 29);
__MOVE("too many imported modules", errors_errors[227], 26);
__MOVE("too many exported structures", errors_errors[228], 29);
__MOVE("too many nested records for import", errors_errors[229], 35);
__MOVE("too many constants (strings) in module", errors_errors[230], 39);
__MOVE("too many link table entries (external procedures)", errors_errors[231], 50);
__MOVE("too many commands in module", errors_errors[232], 28);
__MOVE("record extension hierarchy too high", errors_errors[233], 36);
__MOVE("export of recursive type not allowed", errors_errors[234], 37);
__MOVE("identifier too long", errors_errors[240], 20);
__MOVE("string too long", errors_errors[241], 16);
__MOVE("address overflow", errors_errors[242], 17);
__MOVE("cyclic type definition not allowed", errors_errors[244], 35);
__MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100);
__MOVE("implicit type cast", errors_errors[301], 19);
__MOVE("inappropriate symbol file ignored", errors_errors[306], 34);
__MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62);
__MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62);
__ENDMOD;
}

View file

@ -1,18 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
import errors_string errors_errors[350];
import void *errors__init(void);
#endif // errors

View file

@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code);
export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_errch (CHAR c);
export void Modules_errint (INT32 l);
static void Modules_errposint (INT32 l);
export void Modules_errstring (CHAR *s, LONGINT s__len);
static void Modules_errint (INT32 l);
static void Modules_errstring (CHAR *s, LONGINT s__len);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
@ -169,7 +168,7 @@ static void Modules_errch (CHAR c)
e = Platform_Write(1, (ADDRESS)&c, 1);
}
void Modules_errstring (CHAR *s, LONGINT s__len)
static void Modules_errstring (CHAR *s, LONGINT s__len)
{
INT32 i;
__DUP(s, s__len, CHAR);
@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len)
__DEL(s);
}
static void Modules_errposint (INT32 l)
{
if (l > 10) {
Modules_errposint(__DIV(l, 10));
}
Modules_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
void Modules_errint (INT32 l)
static void Modules_errint (INT32 l)
{
if (l < 0) {
Modules_errch('-');
l = -l;
}
Modules_errposint(l);
if (l >= 10) {
Modules_errint(__DIV(l, 10));
}
Modules_errch((CHAR)((int)__MOD(l, 10) + 48));
}
static void Modules_DisplayHaltCode (INT32 code)

View file

@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import void Modules_Halt (INT32 code);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
import void Modules_errint (INT32 l);
import void Modules_errstring (CHAR *s, LONGINT s__len);
import void *Modules__init(void);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
#endif // Modules

View file

@ -13,7 +13,6 @@
#include "Strings.h"
#include "Texts.h"
#include "VT100.h"
#include "errors.h"
typedef
CHAR OPM_FileName[32];
@ -37,7 +36,7 @@ export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Text OPM_Log, OPM_Errors;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
static void OPM_LogErrMsg (INT16 n)
{
INT16 l;
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
INT16 i;
CHAR buf[1024];
CHAR c;
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
VT100_SetAttr((CHAR*)"31m", 4);
@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n)
}
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
if (OPM_Errors == NIL) {
__NEW(OPM_Errors, Texts_TextDesc);
Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11);
}
Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0);
do {
l = S.line;
Texts_Scan(&S, Texts_Scanner__typ);
} while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot));
if (!S.eot) {
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
while ((!S.eot && c >= ' ')) {
Out_Char(c);
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
}
}
}
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*))
{
__ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P);
P(OPM_Log);
P(OPM_Errors);
__ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P);
__ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P);
__ENUMR(OPM_R, Files_Rider__typ, 20, 3, P);
@ -1064,7 +1077,6 @@ export void *OPM__init(void)
__MODULE_IMPORT(Strings);
__MODULE_IMPORT(Texts);
__MODULE_IMPORT(VT100);
__MODULE_IMPORT(errors);
__REGMOD("OPM", EnumPtrs);
__REGCMD("CloseFiles", OPM_CloseFiles);
__REGCMD("CloseOldSym", OPM_CloseOldSym);

View file

@ -1,205 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
export errors_string errors_errors[350];
export void *errors__init(void)
{
__DEFMOD;
__REGMOD("errors", 0);
/* BEGIN */
__MOVE("undeclared identifier", errors_errors[0], 22);
__MOVE("multiply defined identifier", errors_errors[1], 28);
__MOVE("illegal character in number", errors_errors[2], 28);
__MOVE("illegal character in string", errors_errors[3], 28);
__MOVE("identifier does not match procedure name", errors_errors[4], 41);
__MOVE("comment not closed", errors_errors[5], 19);
errors_errors[6][0] = 0x00;
errors_errors[7][0] = 0x00;
errors_errors[8][0] = 0x00;
__MOVE("'=' expected", errors_errors[9], 13);
errors_errors[10][0] = 0x00;
errors_errors[11][0] = 0x00;
__MOVE("type definition starts with incorrect symbol", errors_errors[12], 45);
__MOVE("factor starts with incorrect symbol", errors_errors[13], 36);
__MOVE("statement starts with incorrect symbol", errors_errors[14], 39);
__MOVE("declaration followed by incorrect symbol", errors_errors[15], 41);
__MOVE("MODULE expected", errors_errors[16], 16);
errors_errors[17][0] = 0x00;
__MOVE("'.' missing", errors_errors[18], 12);
__MOVE("',' missing", errors_errors[19], 12);
__MOVE("':' missing", errors_errors[20], 12);
errors_errors[21][0] = 0x00;
__MOVE("')' missing", errors_errors[22], 12);
__MOVE("']' missing", errors_errors[23], 12);
__MOVE("'}' missing", errors_errors[24], 12);
__MOVE("OF missing", errors_errors[25], 11);
__MOVE("THEN missing", errors_errors[26], 13);
__MOVE("DO missing", errors_errors[27], 11);
__MOVE("TO missing", errors_errors[28], 11);
errors_errors[29][0] = 0x00;
__MOVE("'(' missing", errors_errors[30], 12);
errors_errors[31][0] = 0x00;
errors_errors[32][0] = 0x00;
errors_errors[33][0] = 0x00;
__MOVE("':=' missing", errors_errors[34], 13);
__MOVE("',' or OF expected", errors_errors[35], 19);
errors_errors[36][0] = 0x00;
errors_errors[37][0] = 0x00;
__MOVE("identifier expected", errors_errors[38], 20);
__MOVE("';' missing", errors_errors[39], 12);
errors_errors[40][0] = 0x00;
__MOVE("END missing", errors_errors[41], 12);
errors_errors[42][0] = 0x00;
errors_errors[43][0] = 0x00;
__MOVE("UNTIL missing", errors_errors[44], 14);
errors_errors[45][0] = 0x00;
__MOVE("EXIT not within loop statement", errors_errors[46], 31);
__MOVE("illegally marked identifier", errors_errors[47], 28);
errors_errors[48][0] = 0x00;
errors_errors[49][0] = 0x00;
__MOVE("expression should be constant", errors_errors[50], 30);
__MOVE("constant not an integer", errors_errors[51], 24);
__MOVE("identifier does not denote a type", errors_errors[52], 34);
__MOVE("identifier does not denote a record type", errors_errors[53], 41);
__MOVE("result type of procedure is not a basic type", errors_errors[54], 45);
__MOVE("procedure call of a function", errors_errors[55], 29);
__MOVE("assignment to non-variable", errors_errors[56], 27);
__MOVE("pointer not bound to record or array type", errors_errors[57], 42);
__MOVE("recursive type definition", errors_errors[58], 26);
__MOVE("illegal open array parameter", errors_errors[59], 29);
__MOVE("wrong type of case label", errors_errors[60], 25);
__MOVE("inadmissible type of case label", errors_errors[61], 32);
__MOVE("case label defined more than once", errors_errors[62], 34);
__MOVE("illegal value of constant", errors_errors[63], 26);
__MOVE("more actual than formal parameters", errors_errors[64], 35);
__MOVE("fewer actual than formal parameters", errors_errors[65], 36);
__MOVE("element types of actual array and formal open array differ", errors_errors[66], 59);
__MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61);
__MOVE("control variable must be integer", errors_errors[68], 33);
__MOVE("parameter must be an integer constant", errors_errors[69], 38);
__MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50);
__MOVE("pointer expected as actual receiver", errors_errors[71], 36);
__MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54);
__MOVE("procedure must have level 0", errors_errors[73], 28);
__MOVE("procedure unknown in base type", errors_errors[74], 31);
__MOVE("invalid call of base procedure", errors_errors[75], 31);
__MOVE("this variable (field) is read only", errors_errors[76], 35);
__MOVE("object is not a record", errors_errors[77], 23);
__MOVE("dereferenced object is not a variable", errors_errors[78], 38);
__MOVE("indexed object is not a variable", errors_errors[79], 33);
__MOVE("index expression is not an integer", errors_errors[80], 35);
__MOVE("index out of specified bounds", errors_errors[81], 30);
__MOVE("indexed variable is not an array", errors_errors[82], 33);
__MOVE("undefined record field", errors_errors[83], 23);
__MOVE("dereferenced variable is not a pointer", errors_errors[84], 39);
__MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56);
__MOVE("guard or testtype is not a pointer", errors_errors[86], 35);
__MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75);
__MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66);
errors_errors[89][0] = 0x00;
errors_errors[90][0] = 0x00;
errors_errors[91][0] = 0x00;
__MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43);
__MOVE("set element type is not an integer", errors_errors[93], 35);
__MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36);
__MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37);
__MOVE("operand not applicable to (unary) +", errors_errors[96], 36);
__MOVE("operand not applicable to (unary) -", errors_errors[97], 36);
__MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36);
__MOVE("ASSERT fault", errors_errors[99], 13);
__MOVE("incompatible operands of dyadic operator", errors_errors[100], 41);
__MOVE("operand type inapplicable to *", errors_errors[101], 31);
__MOVE("operand type inapplicable to /", errors_errors[102], 31);
__MOVE("operand type inapplicable to DIV", errors_errors[103], 33);
__MOVE("operand type inapplicable to MOD", errors_errors[104], 33);
__MOVE("operand type inapplicable to +", errors_errors[105], 31);
__MOVE("operand type inapplicable to -", errors_errors[106], 31);
__MOVE("operand type inapplicable to = or #", errors_errors[107], 36);
__MOVE("operand type inapplicable to relation", errors_errors[108], 38);
__MOVE("overriding method must be exported", errors_errors[109], 35);
__MOVE("operand is not a type", errors_errors[110], 22);
__MOVE("operand inapplicable to (this) function", errors_errors[111], 40);
__MOVE("operand is not a variable", errors_errors[112], 26);
__MOVE("incompatible assignment", errors_errors[113], 24);
__MOVE("string too long to be assigned", errors_errors[114], 31);
__MOVE("parameter doesn't match", errors_errors[115], 24);
__MOVE("number of parameters doesn't match", errors_errors[116], 35);
__MOVE("result type doesn't match", errors_errors[117], 26);
__MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51);
__MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61);
__MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71);
__MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64);
__MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39);
__MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76);
__MOVE("type of result expression differs from that of procedure", errors_errors[124], 57);
__MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52);
__MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48);
__MOVE("illegal use of object", errors_errors[127], 22);
__MOVE("unsatisfied forward reference", errors_errors[128], 30);
__MOVE("unsatisfied forward procedure", errors_errors[129], 30);
__MOVE("WITH clause does not specify a variable", errors_errors[130], 40);
__MOVE("LEN not applied to array", errors_errors[131], 25);
__MOVE("dimension in LEN too large or negative", errors_errors[132], 39);
__MOVE("SYSTEM not imported", errors_errors[135], 20);
__MOVE("key inconsistency of imported module", errors_errors[150], 37);
__MOVE("incorrect symbol file", errors_errors[151], 22);
__MOVE("symbol file of imported module not found", errors_errors[152], 41);
__MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46);
__MOVE("recursive import not allowed", errors_errors[154], 29);
__MOVE("generation of new symbol file not allowed", errors_errors[155], 42);
__MOVE("parameter file not found", errors_errors[156], 25);
__MOVE("syntax error in parameter file", errors_errors[157], 31);
__MOVE("not yet implemented", errors_errors[200], 20);
__MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51);
__MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49);
__MOVE("number too large", errors_errors[203], 17);
__MOVE("product too large", errors_errors[204], 18);
__MOVE("division by zero", errors_errors[205], 17);
__MOVE("sum too large", errors_errors[206], 14);
__MOVE("difference too large", errors_errors[207], 21);
__MOVE("overflow in arithmetic shift", errors_errors[208], 29);
__MOVE("case range too large", errors_errors[209], 21);
__MOVE("too many cases in case statement", errors_errors[213], 33);
__MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42);
__MOVE("machine registers cannot be accessed", errors_errors[219], 37);
__MOVE("illegal value of parameter", errors_errors[220], 27);
__MOVE("too many pointers in a record", errors_errors[221], 30);
__MOVE("too many global pointers", errors_errors[222], 25);
__MOVE("too many record types", errors_errors[223], 22);
__MOVE("too many pointer types", errors_errors[224], 23);
__MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61);
__MOVE("too many exported procedures", errors_errors[226], 29);
__MOVE("too many imported modules", errors_errors[227], 26);
__MOVE("too many exported structures", errors_errors[228], 29);
__MOVE("too many nested records for import", errors_errors[229], 35);
__MOVE("too many constants (strings) in module", errors_errors[230], 39);
__MOVE("too many link table entries (external procedures)", errors_errors[231], 50);
__MOVE("too many commands in module", errors_errors[232], 28);
__MOVE("record extension hierarchy too high", errors_errors[233], 36);
__MOVE("export of recursive type not allowed", errors_errors[234], 37);
__MOVE("identifier too long", errors_errors[240], 20);
__MOVE("string too long", errors_errors[241], 16);
__MOVE("address overflow", errors_errors[242], 17);
__MOVE("cyclic type definition not allowed", errors_errors[244], 35);
__MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100);
__MOVE("implicit type cast", errors_errors[301], 19);
__MOVE("inappropriate symbol file ignored", errors_errors[306], 34);
__MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62);
__MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62);
__ENDMOD;
}

View file

@ -1,18 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
import errors_string errors_errors[350];
import void *errors__init(void);
#endif // errors

View file

@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code);
export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_errch (CHAR c);
export void Modules_errint (INT32 l);
static void Modules_errposint (INT32 l);
export void Modules_errstring (CHAR *s, LONGINT s__len);
static void Modules_errint (INT32 l);
static void Modules_errstring (CHAR *s, LONGINT s__len);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
@ -169,7 +168,7 @@ static void Modules_errch (CHAR c)
e = Platform_Write(1, (ADDRESS)&c, 1);
}
void Modules_errstring (CHAR *s, LONGINT s__len)
static void Modules_errstring (CHAR *s, LONGINT s__len)
{
INT32 i;
__DUP(s, s__len, CHAR);
@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len)
__DEL(s);
}
static void Modules_errposint (INT32 l)
{
if (l > 10) {
Modules_errposint(__DIV(l, 10));
}
Modules_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
void Modules_errint (INT32 l)
static void Modules_errint (INT32 l)
{
if (l < 0) {
Modules_errch('-');
l = -l;
}
Modules_errposint(l);
if (l >= 10) {
Modules_errint(__DIV(l, 10));
}
Modules_errch((CHAR)((int)__MOD(l, 10) + 48));
}
static void Modules_DisplayHaltCode (INT32 code)

View file

@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import void Modules_Halt (INT32 code);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
import void Modules_errint (INT32 l);
import void Modules_errstring (CHAR *s, LONGINT s__len);
import void *Modules__init(void);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
#endif // Modules

View file

@ -13,7 +13,6 @@
#include "Strings.h"
#include "Texts.h"
#include "VT100.h"
#include "errors.h"
typedef
CHAR OPM_FileName[32];
@ -37,7 +36,7 @@ export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Text OPM_Log, OPM_Errors;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
static void OPM_LogErrMsg (INT16 n)
{
INT16 l;
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
INT16 i;
CHAR buf[1024];
CHAR c;
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
VT100_SetAttr((CHAR*)"31m", 4);
@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n)
}
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
if (OPM_Errors == NIL) {
__NEW(OPM_Errors, Texts_TextDesc);
Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11);
}
Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0);
do {
l = S.line;
Texts_Scan(&S, Texts_Scanner__typ);
} while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot));
if (!S.eot) {
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
while ((!S.eot && c >= ' ')) {
Out_Char(c);
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
}
}
}
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*))
{
__ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P);
P(OPM_Log);
P(OPM_Errors);
__ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P);
__ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P);
__ENUMR(OPM_R, Files_Rider__typ, 24, 3, P);
@ -1064,7 +1077,6 @@ export void *OPM__init(void)
__MODULE_IMPORT(Strings);
__MODULE_IMPORT(Texts);
__MODULE_IMPORT(VT100);
__MODULE_IMPORT(errors);
__REGMOD("OPM", EnumPtrs);
__REGCMD("CloseFiles", OPM_CloseFiles);
__REGCMD("CloseOldSym", OPM_CloseOldSym);

View file

@ -1,205 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
export errors_string errors_errors[350];
export void *errors__init(void)
{
__DEFMOD;
__REGMOD("errors", 0);
/* BEGIN */
__MOVE("undeclared identifier", errors_errors[0], 22);
__MOVE("multiply defined identifier", errors_errors[1], 28);
__MOVE("illegal character in number", errors_errors[2], 28);
__MOVE("illegal character in string", errors_errors[3], 28);
__MOVE("identifier does not match procedure name", errors_errors[4], 41);
__MOVE("comment not closed", errors_errors[5], 19);
errors_errors[6][0] = 0x00;
errors_errors[7][0] = 0x00;
errors_errors[8][0] = 0x00;
__MOVE("'=' expected", errors_errors[9], 13);
errors_errors[10][0] = 0x00;
errors_errors[11][0] = 0x00;
__MOVE("type definition starts with incorrect symbol", errors_errors[12], 45);
__MOVE("factor starts with incorrect symbol", errors_errors[13], 36);
__MOVE("statement starts with incorrect symbol", errors_errors[14], 39);
__MOVE("declaration followed by incorrect symbol", errors_errors[15], 41);
__MOVE("MODULE expected", errors_errors[16], 16);
errors_errors[17][0] = 0x00;
__MOVE("'.' missing", errors_errors[18], 12);
__MOVE("',' missing", errors_errors[19], 12);
__MOVE("':' missing", errors_errors[20], 12);
errors_errors[21][0] = 0x00;
__MOVE("')' missing", errors_errors[22], 12);
__MOVE("']' missing", errors_errors[23], 12);
__MOVE("'}' missing", errors_errors[24], 12);
__MOVE("OF missing", errors_errors[25], 11);
__MOVE("THEN missing", errors_errors[26], 13);
__MOVE("DO missing", errors_errors[27], 11);
__MOVE("TO missing", errors_errors[28], 11);
errors_errors[29][0] = 0x00;
__MOVE("'(' missing", errors_errors[30], 12);
errors_errors[31][0] = 0x00;
errors_errors[32][0] = 0x00;
errors_errors[33][0] = 0x00;
__MOVE("':=' missing", errors_errors[34], 13);
__MOVE("',' or OF expected", errors_errors[35], 19);
errors_errors[36][0] = 0x00;
errors_errors[37][0] = 0x00;
__MOVE("identifier expected", errors_errors[38], 20);
__MOVE("';' missing", errors_errors[39], 12);
errors_errors[40][0] = 0x00;
__MOVE("END missing", errors_errors[41], 12);
errors_errors[42][0] = 0x00;
errors_errors[43][0] = 0x00;
__MOVE("UNTIL missing", errors_errors[44], 14);
errors_errors[45][0] = 0x00;
__MOVE("EXIT not within loop statement", errors_errors[46], 31);
__MOVE("illegally marked identifier", errors_errors[47], 28);
errors_errors[48][0] = 0x00;
errors_errors[49][0] = 0x00;
__MOVE("expression should be constant", errors_errors[50], 30);
__MOVE("constant not an integer", errors_errors[51], 24);
__MOVE("identifier does not denote a type", errors_errors[52], 34);
__MOVE("identifier does not denote a record type", errors_errors[53], 41);
__MOVE("result type of procedure is not a basic type", errors_errors[54], 45);
__MOVE("procedure call of a function", errors_errors[55], 29);
__MOVE("assignment to non-variable", errors_errors[56], 27);
__MOVE("pointer not bound to record or array type", errors_errors[57], 42);
__MOVE("recursive type definition", errors_errors[58], 26);
__MOVE("illegal open array parameter", errors_errors[59], 29);
__MOVE("wrong type of case label", errors_errors[60], 25);
__MOVE("inadmissible type of case label", errors_errors[61], 32);
__MOVE("case label defined more than once", errors_errors[62], 34);
__MOVE("illegal value of constant", errors_errors[63], 26);
__MOVE("more actual than formal parameters", errors_errors[64], 35);
__MOVE("fewer actual than formal parameters", errors_errors[65], 36);
__MOVE("element types of actual array and formal open array differ", errors_errors[66], 59);
__MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61);
__MOVE("control variable must be integer", errors_errors[68], 33);
__MOVE("parameter must be an integer constant", errors_errors[69], 38);
__MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50);
__MOVE("pointer expected as actual receiver", errors_errors[71], 36);
__MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54);
__MOVE("procedure must have level 0", errors_errors[73], 28);
__MOVE("procedure unknown in base type", errors_errors[74], 31);
__MOVE("invalid call of base procedure", errors_errors[75], 31);
__MOVE("this variable (field) is read only", errors_errors[76], 35);
__MOVE("object is not a record", errors_errors[77], 23);
__MOVE("dereferenced object is not a variable", errors_errors[78], 38);
__MOVE("indexed object is not a variable", errors_errors[79], 33);
__MOVE("index expression is not an integer", errors_errors[80], 35);
__MOVE("index out of specified bounds", errors_errors[81], 30);
__MOVE("indexed variable is not an array", errors_errors[82], 33);
__MOVE("undefined record field", errors_errors[83], 23);
__MOVE("dereferenced variable is not a pointer", errors_errors[84], 39);
__MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56);
__MOVE("guard or testtype is not a pointer", errors_errors[86], 35);
__MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75);
__MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66);
errors_errors[89][0] = 0x00;
errors_errors[90][0] = 0x00;
errors_errors[91][0] = 0x00;
__MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43);
__MOVE("set element type is not an integer", errors_errors[93], 35);
__MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36);
__MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37);
__MOVE("operand not applicable to (unary) +", errors_errors[96], 36);
__MOVE("operand not applicable to (unary) -", errors_errors[97], 36);
__MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36);
__MOVE("ASSERT fault", errors_errors[99], 13);
__MOVE("incompatible operands of dyadic operator", errors_errors[100], 41);
__MOVE("operand type inapplicable to *", errors_errors[101], 31);
__MOVE("operand type inapplicable to /", errors_errors[102], 31);
__MOVE("operand type inapplicable to DIV", errors_errors[103], 33);
__MOVE("operand type inapplicable to MOD", errors_errors[104], 33);
__MOVE("operand type inapplicable to +", errors_errors[105], 31);
__MOVE("operand type inapplicable to -", errors_errors[106], 31);
__MOVE("operand type inapplicable to = or #", errors_errors[107], 36);
__MOVE("operand type inapplicable to relation", errors_errors[108], 38);
__MOVE("overriding method must be exported", errors_errors[109], 35);
__MOVE("operand is not a type", errors_errors[110], 22);
__MOVE("operand inapplicable to (this) function", errors_errors[111], 40);
__MOVE("operand is not a variable", errors_errors[112], 26);
__MOVE("incompatible assignment", errors_errors[113], 24);
__MOVE("string too long to be assigned", errors_errors[114], 31);
__MOVE("parameter doesn't match", errors_errors[115], 24);
__MOVE("number of parameters doesn't match", errors_errors[116], 35);
__MOVE("result type doesn't match", errors_errors[117], 26);
__MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51);
__MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61);
__MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71);
__MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64);
__MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39);
__MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76);
__MOVE("type of result expression differs from that of procedure", errors_errors[124], 57);
__MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52);
__MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48);
__MOVE("illegal use of object", errors_errors[127], 22);
__MOVE("unsatisfied forward reference", errors_errors[128], 30);
__MOVE("unsatisfied forward procedure", errors_errors[129], 30);
__MOVE("WITH clause does not specify a variable", errors_errors[130], 40);
__MOVE("LEN not applied to array", errors_errors[131], 25);
__MOVE("dimension in LEN too large or negative", errors_errors[132], 39);
__MOVE("SYSTEM not imported", errors_errors[135], 20);
__MOVE("key inconsistency of imported module", errors_errors[150], 37);
__MOVE("incorrect symbol file", errors_errors[151], 22);
__MOVE("symbol file of imported module not found", errors_errors[152], 41);
__MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46);
__MOVE("recursive import not allowed", errors_errors[154], 29);
__MOVE("generation of new symbol file not allowed", errors_errors[155], 42);
__MOVE("parameter file not found", errors_errors[156], 25);
__MOVE("syntax error in parameter file", errors_errors[157], 31);
__MOVE("not yet implemented", errors_errors[200], 20);
__MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51);
__MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49);
__MOVE("number too large", errors_errors[203], 17);
__MOVE("product too large", errors_errors[204], 18);
__MOVE("division by zero", errors_errors[205], 17);
__MOVE("sum too large", errors_errors[206], 14);
__MOVE("difference too large", errors_errors[207], 21);
__MOVE("overflow in arithmetic shift", errors_errors[208], 29);
__MOVE("case range too large", errors_errors[209], 21);
__MOVE("too many cases in case statement", errors_errors[213], 33);
__MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42);
__MOVE("machine registers cannot be accessed", errors_errors[219], 37);
__MOVE("illegal value of parameter", errors_errors[220], 27);
__MOVE("too many pointers in a record", errors_errors[221], 30);
__MOVE("too many global pointers", errors_errors[222], 25);
__MOVE("too many record types", errors_errors[223], 22);
__MOVE("too many pointer types", errors_errors[224], 23);
__MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61);
__MOVE("too many exported procedures", errors_errors[226], 29);
__MOVE("too many imported modules", errors_errors[227], 26);
__MOVE("too many exported structures", errors_errors[228], 29);
__MOVE("too many nested records for import", errors_errors[229], 35);
__MOVE("too many constants (strings) in module", errors_errors[230], 39);
__MOVE("too many link table entries (external procedures)", errors_errors[231], 50);
__MOVE("too many commands in module", errors_errors[232], 28);
__MOVE("record extension hierarchy too high", errors_errors[233], 36);
__MOVE("export of recursive type not allowed", errors_errors[234], 37);
__MOVE("identifier too long", errors_errors[240], 20);
__MOVE("string too long", errors_errors[241], 16);
__MOVE("address overflow", errors_errors[242], 17);
__MOVE("cyclic type definition not allowed", errors_errors[244], 35);
__MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100);
__MOVE("implicit type cast", errors_errors[301], 19);
__MOVE("inappropriate symbol file ignored", errors_errors[306], 34);
__MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62);
__MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62);
__ENDMOD;
}

View file

@ -1,18 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
import errors_string errors_errors[350];
import void *errors__init(void);
#endif // errors

View file

@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code);
export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_errch (CHAR c);
export void Modules_errint (INT32 l);
static void Modules_errposint (INT32 l);
export void Modules_errstring (CHAR *s, LONGINT s__len);
static void Modules_errint (INT32 l);
static void Modules_errstring (CHAR *s, LONGINT s__len);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
@ -169,7 +168,7 @@ static void Modules_errch (CHAR c)
e = Platform_Write(1, (ADDRESS)&c, 1);
}
void Modules_errstring (CHAR *s, LONGINT s__len)
static void Modules_errstring (CHAR *s, LONGINT s__len)
{
INT32 i;
__DUP(s, s__len, CHAR);
@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len)
__DEL(s);
}
static void Modules_errposint (INT32 l)
{
if (l > 10) {
Modules_errposint(__DIV(l, 10));
}
Modules_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
void Modules_errint (INT32 l)
static void Modules_errint (INT32 l)
{
if (l < 0) {
Modules_errch('-');
l = -l;
}
Modules_errposint(l);
if (l >= 10) {
Modules_errint(__DIV(l, 10));
}
Modules_errch((CHAR)((int)__MOD(l, 10) + 48));
}
static void Modules_DisplayHaltCode (INT32 code)

View file

@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import void Modules_Halt (INT32 code);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
import void Modules_errint (INT32 l);
import void Modules_errstring (CHAR *s, LONGINT s__len);
import void *Modules__init(void);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
#endif // Modules

View file

@ -13,7 +13,6 @@
#include "Strings.h"
#include "Texts.h"
#include "VT100.h"
#include "errors.h"
typedef
CHAR OPM_FileName[32];
@ -37,7 +36,7 @@ export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Text OPM_Log, OPM_Errors;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
static void OPM_LogErrMsg (INT16 n)
{
INT16 l;
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
INT16 i;
CHAR buf[1024];
CHAR c;
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
VT100_SetAttr((CHAR*)"31m", 4);
@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n)
}
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
if (OPM_Errors == NIL) {
__NEW(OPM_Errors, Texts_TextDesc);
Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11);
}
Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0);
do {
l = S.line;
Texts_Scan(&S, Texts_Scanner__typ);
} while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot));
if (!S.eot) {
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
while ((!S.eot && c >= ' ')) {
Out_Char(c);
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
}
}
}
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*))
{
__ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P);
P(OPM_Log);
P(OPM_Errors);
__ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P);
__ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P);
__ENUMR(OPM_R, Files_Rider__typ, 20, 3, P);
@ -1064,7 +1077,6 @@ export void *OPM__init(void)
__MODULE_IMPORT(Strings);
__MODULE_IMPORT(Texts);
__MODULE_IMPORT(VT100);
__MODULE_IMPORT(errors);
__REGMOD("OPM", EnumPtrs);
__REGCMD("CloseFiles", OPM_CloseFiles);
__REGCMD("CloseOldSym", OPM_CloseOldSym);

View file

@ -1,205 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
export errors_string errors_errors[350];
export void *errors__init(void)
{
__DEFMOD;
__REGMOD("errors", 0);
/* BEGIN */
__MOVE("undeclared identifier", errors_errors[0], 22);
__MOVE("multiply defined identifier", errors_errors[1], 28);
__MOVE("illegal character in number", errors_errors[2], 28);
__MOVE("illegal character in string", errors_errors[3], 28);
__MOVE("identifier does not match procedure name", errors_errors[4], 41);
__MOVE("comment not closed", errors_errors[5], 19);
errors_errors[6][0] = 0x00;
errors_errors[7][0] = 0x00;
errors_errors[8][0] = 0x00;
__MOVE("'=' expected", errors_errors[9], 13);
errors_errors[10][0] = 0x00;
errors_errors[11][0] = 0x00;
__MOVE("type definition starts with incorrect symbol", errors_errors[12], 45);
__MOVE("factor starts with incorrect symbol", errors_errors[13], 36);
__MOVE("statement starts with incorrect symbol", errors_errors[14], 39);
__MOVE("declaration followed by incorrect symbol", errors_errors[15], 41);
__MOVE("MODULE expected", errors_errors[16], 16);
errors_errors[17][0] = 0x00;
__MOVE("'.' missing", errors_errors[18], 12);
__MOVE("',' missing", errors_errors[19], 12);
__MOVE("':' missing", errors_errors[20], 12);
errors_errors[21][0] = 0x00;
__MOVE("')' missing", errors_errors[22], 12);
__MOVE("']' missing", errors_errors[23], 12);
__MOVE("'}' missing", errors_errors[24], 12);
__MOVE("OF missing", errors_errors[25], 11);
__MOVE("THEN missing", errors_errors[26], 13);
__MOVE("DO missing", errors_errors[27], 11);
__MOVE("TO missing", errors_errors[28], 11);
errors_errors[29][0] = 0x00;
__MOVE("'(' missing", errors_errors[30], 12);
errors_errors[31][0] = 0x00;
errors_errors[32][0] = 0x00;
errors_errors[33][0] = 0x00;
__MOVE("':=' missing", errors_errors[34], 13);
__MOVE("',' or OF expected", errors_errors[35], 19);
errors_errors[36][0] = 0x00;
errors_errors[37][0] = 0x00;
__MOVE("identifier expected", errors_errors[38], 20);
__MOVE("';' missing", errors_errors[39], 12);
errors_errors[40][0] = 0x00;
__MOVE("END missing", errors_errors[41], 12);
errors_errors[42][0] = 0x00;
errors_errors[43][0] = 0x00;
__MOVE("UNTIL missing", errors_errors[44], 14);
errors_errors[45][0] = 0x00;
__MOVE("EXIT not within loop statement", errors_errors[46], 31);
__MOVE("illegally marked identifier", errors_errors[47], 28);
errors_errors[48][0] = 0x00;
errors_errors[49][0] = 0x00;
__MOVE("expression should be constant", errors_errors[50], 30);
__MOVE("constant not an integer", errors_errors[51], 24);
__MOVE("identifier does not denote a type", errors_errors[52], 34);
__MOVE("identifier does not denote a record type", errors_errors[53], 41);
__MOVE("result type of procedure is not a basic type", errors_errors[54], 45);
__MOVE("procedure call of a function", errors_errors[55], 29);
__MOVE("assignment to non-variable", errors_errors[56], 27);
__MOVE("pointer not bound to record or array type", errors_errors[57], 42);
__MOVE("recursive type definition", errors_errors[58], 26);
__MOVE("illegal open array parameter", errors_errors[59], 29);
__MOVE("wrong type of case label", errors_errors[60], 25);
__MOVE("inadmissible type of case label", errors_errors[61], 32);
__MOVE("case label defined more than once", errors_errors[62], 34);
__MOVE("illegal value of constant", errors_errors[63], 26);
__MOVE("more actual than formal parameters", errors_errors[64], 35);
__MOVE("fewer actual than formal parameters", errors_errors[65], 36);
__MOVE("element types of actual array and formal open array differ", errors_errors[66], 59);
__MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61);
__MOVE("control variable must be integer", errors_errors[68], 33);
__MOVE("parameter must be an integer constant", errors_errors[69], 38);
__MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50);
__MOVE("pointer expected as actual receiver", errors_errors[71], 36);
__MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54);
__MOVE("procedure must have level 0", errors_errors[73], 28);
__MOVE("procedure unknown in base type", errors_errors[74], 31);
__MOVE("invalid call of base procedure", errors_errors[75], 31);
__MOVE("this variable (field) is read only", errors_errors[76], 35);
__MOVE("object is not a record", errors_errors[77], 23);
__MOVE("dereferenced object is not a variable", errors_errors[78], 38);
__MOVE("indexed object is not a variable", errors_errors[79], 33);
__MOVE("index expression is not an integer", errors_errors[80], 35);
__MOVE("index out of specified bounds", errors_errors[81], 30);
__MOVE("indexed variable is not an array", errors_errors[82], 33);
__MOVE("undefined record field", errors_errors[83], 23);
__MOVE("dereferenced variable is not a pointer", errors_errors[84], 39);
__MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56);
__MOVE("guard or testtype is not a pointer", errors_errors[86], 35);
__MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75);
__MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66);
errors_errors[89][0] = 0x00;
errors_errors[90][0] = 0x00;
errors_errors[91][0] = 0x00;
__MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43);
__MOVE("set element type is not an integer", errors_errors[93], 35);
__MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36);
__MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37);
__MOVE("operand not applicable to (unary) +", errors_errors[96], 36);
__MOVE("operand not applicable to (unary) -", errors_errors[97], 36);
__MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36);
__MOVE("ASSERT fault", errors_errors[99], 13);
__MOVE("incompatible operands of dyadic operator", errors_errors[100], 41);
__MOVE("operand type inapplicable to *", errors_errors[101], 31);
__MOVE("operand type inapplicable to /", errors_errors[102], 31);
__MOVE("operand type inapplicable to DIV", errors_errors[103], 33);
__MOVE("operand type inapplicable to MOD", errors_errors[104], 33);
__MOVE("operand type inapplicable to +", errors_errors[105], 31);
__MOVE("operand type inapplicable to -", errors_errors[106], 31);
__MOVE("operand type inapplicable to = or #", errors_errors[107], 36);
__MOVE("operand type inapplicable to relation", errors_errors[108], 38);
__MOVE("overriding method must be exported", errors_errors[109], 35);
__MOVE("operand is not a type", errors_errors[110], 22);
__MOVE("operand inapplicable to (this) function", errors_errors[111], 40);
__MOVE("operand is not a variable", errors_errors[112], 26);
__MOVE("incompatible assignment", errors_errors[113], 24);
__MOVE("string too long to be assigned", errors_errors[114], 31);
__MOVE("parameter doesn't match", errors_errors[115], 24);
__MOVE("number of parameters doesn't match", errors_errors[116], 35);
__MOVE("result type doesn't match", errors_errors[117], 26);
__MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51);
__MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61);
__MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71);
__MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64);
__MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39);
__MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76);
__MOVE("type of result expression differs from that of procedure", errors_errors[124], 57);
__MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52);
__MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48);
__MOVE("illegal use of object", errors_errors[127], 22);
__MOVE("unsatisfied forward reference", errors_errors[128], 30);
__MOVE("unsatisfied forward procedure", errors_errors[129], 30);
__MOVE("WITH clause does not specify a variable", errors_errors[130], 40);
__MOVE("LEN not applied to array", errors_errors[131], 25);
__MOVE("dimension in LEN too large or negative", errors_errors[132], 39);
__MOVE("SYSTEM not imported", errors_errors[135], 20);
__MOVE("key inconsistency of imported module", errors_errors[150], 37);
__MOVE("incorrect symbol file", errors_errors[151], 22);
__MOVE("symbol file of imported module not found", errors_errors[152], 41);
__MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46);
__MOVE("recursive import not allowed", errors_errors[154], 29);
__MOVE("generation of new symbol file not allowed", errors_errors[155], 42);
__MOVE("parameter file not found", errors_errors[156], 25);
__MOVE("syntax error in parameter file", errors_errors[157], 31);
__MOVE("not yet implemented", errors_errors[200], 20);
__MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51);
__MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49);
__MOVE("number too large", errors_errors[203], 17);
__MOVE("product too large", errors_errors[204], 18);
__MOVE("division by zero", errors_errors[205], 17);
__MOVE("sum too large", errors_errors[206], 14);
__MOVE("difference too large", errors_errors[207], 21);
__MOVE("overflow in arithmetic shift", errors_errors[208], 29);
__MOVE("case range too large", errors_errors[209], 21);
__MOVE("too many cases in case statement", errors_errors[213], 33);
__MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42);
__MOVE("machine registers cannot be accessed", errors_errors[219], 37);
__MOVE("illegal value of parameter", errors_errors[220], 27);
__MOVE("too many pointers in a record", errors_errors[221], 30);
__MOVE("too many global pointers", errors_errors[222], 25);
__MOVE("too many record types", errors_errors[223], 22);
__MOVE("too many pointer types", errors_errors[224], 23);
__MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61);
__MOVE("too many exported procedures", errors_errors[226], 29);
__MOVE("too many imported modules", errors_errors[227], 26);
__MOVE("too many exported structures", errors_errors[228], 29);
__MOVE("too many nested records for import", errors_errors[229], 35);
__MOVE("too many constants (strings) in module", errors_errors[230], 39);
__MOVE("too many link table entries (external procedures)", errors_errors[231], 50);
__MOVE("too many commands in module", errors_errors[232], 28);
__MOVE("record extension hierarchy too high", errors_errors[233], 36);
__MOVE("export of recursive type not allowed", errors_errors[234], 37);
__MOVE("identifier too long", errors_errors[240], 20);
__MOVE("string too long", errors_errors[241], 16);
__MOVE("address overflow", errors_errors[242], 17);
__MOVE("cyclic type definition not allowed", errors_errors[244], 35);
__MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100);
__MOVE("implicit type cast", errors_errors[301], 19);
__MOVE("inappropriate symbol file ignored", errors_errors[306], 34);
__MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62);
__MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62);
__ENDMOD;
}

View file

@ -1,18 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
import errors_string errors_errors[350];
import void *errors__init(void);
#endif // errors

View file

@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code);
export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_errch (CHAR c);
export void Modules_errint (INT32 l);
static void Modules_errposint (INT32 l);
export void Modules_errstring (CHAR *s, LONGINT s__len);
static void Modules_errint (INT32 l);
static void Modules_errstring (CHAR *s, LONGINT s__len);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
@ -169,7 +168,7 @@ static void Modules_errch (CHAR c)
e = Platform_Write(1, (ADDRESS)&c, 1);
}
void Modules_errstring (CHAR *s, LONGINT s__len)
static void Modules_errstring (CHAR *s, LONGINT s__len)
{
INT32 i;
__DUP(s, s__len, CHAR);
@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len)
__DEL(s);
}
static void Modules_errposint (INT32 l)
{
if (l > 10) {
Modules_errposint(__DIV(l, 10));
}
Modules_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
void Modules_errint (INT32 l)
static void Modules_errint (INT32 l)
{
if (l < 0) {
Modules_errch('-');
l = -l;
}
Modules_errposint(l);
if (l >= 10) {
Modules_errint(__DIV(l, 10));
}
Modules_errch((CHAR)((int)__MOD(l, 10) + 48));
}
static void Modules_DisplayHaltCode (INT32 code)

View file

@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import void Modules_Halt (INT32 code);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
import void Modules_errint (INT32 l);
import void Modules_errstring (CHAR *s, LONGINT s__len);
import void *Modules__init(void);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
#endif // Modules

View file

@ -13,7 +13,6 @@
#include "Strings.h"
#include "Texts.h"
#include "VT100.h"
#include "errors.h"
typedef
CHAR OPM_FileName[32];
@ -37,7 +36,7 @@ export CHAR OPM_modName[32];
export CHAR OPM_objname[64];
static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static Texts_Reader OPM_inR;
static Texts_Text OPM_Log;
static Texts_Text OPM_Log, OPM_Errors;
static Files_Rider OPM_oldSF, OPM_newSF;
static Files_Rider OPM_R[3];
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
static void OPM_LogErrMsg (INT16 n)
{
INT16 l;
Texts_Scanner S;
Texts_Text T = NIL;
CHAR ch;
INT16 i;
CHAR buf[1024];
CHAR c;
if (n >= 0) {
if (!__IN(16, OPM_Options, 32)) {
VT100_SetAttr((CHAR*)"31m", 4);
@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n)
}
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
if (OPM_Errors == NIL) {
__NEW(OPM_Errors, Texts_TextDesc);
Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11);
}
Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0);
do {
l = S.line;
Texts_Scan(&S, Texts_Scanner__typ);
} while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot));
if (!S.eot) {
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
while ((!S.eot && c >= ' ')) {
Out_Char(c);
Texts_Read((void*)&S, Texts_Scanner__typ, &c);
}
}
}
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos)
@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*))
{
__ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P);
P(OPM_Log);
P(OPM_Errors);
__ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P);
__ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P);
__ENUMR(OPM_R, Files_Rider__typ, 24, 3, P);
@ -1064,7 +1077,6 @@ export void *OPM__init(void)
__MODULE_IMPORT(Strings);
__MODULE_IMPORT(Texts);
__MODULE_IMPORT(VT100);
__MODULE_IMPORT(errors);
__REGMOD("OPM", EnumPtrs);
__REGCMD("CloseFiles", OPM_CloseFiles);
__REGCMD("CloseOldSym", OPM_CloseOldSym);

View file

@ -1,205 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
#define LONGINT INT32
#define SET UINT32
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
export errors_string errors_errors[350];
export void *errors__init(void)
{
__DEFMOD;
__REGMOD("errors", 0);
/* BEGIN */
__MOVE("undeclared identifier", errors_errors[0], 22);
__MOVE("multiply defined identifier", errors_errors[1], 28);
__MOVE("illegal character in number", errors_errors[2], 28);
__MOVE("illegal character in string", errors_errors[3], 28);
__MOVE("identifier does not match procedure name", errors_errors[4], 41);
__MOVE("comment not closed", errors_errors[5], 19);
errors_errors[6][0] = 0x00;
errors_errors[7][0] = 0x00;
errors_errors[8][0] = 0x00;
__MOVE("'=' expected", errors_errors[9], 13);
errors_errors[10][0] = 0x00;
errors_errors[11][0] = 0x00;
__MOVE("type definition starts with incorrect symbol", errors_errors[12], 45);
__MOVE("factor starts with incorrect symbol", errors_errors[13], 36);
__MOVE("statement starts with incorrect symbol", errors_errors[14], 39);
__MOVE("declaration followed by incorrect symbol", errors_errors[15], 41);
__MOVE("MODULE expected", errors_errors[16], 16);
errors_errors[17][0] = 0x00;
__MOVE("'.' missing", errors_errors[18], 12);
__MOVE("',' missing", errors_errors[19], 12);
__MOVE("':' missing", errors_errors[20], 12);
errors_errors[21][0] = 0x00;
__MOVE("')' missing", errors_errors[22], 12);
__MOVE("']' missing", errors_errors[23], 12);
__MOVE("'}' missing", errors_errors[24], 12);
__MOVE("OF missing", errors_errors[25], 11);
__MOVE("THEN missing", errors_errors[26], 13);
__MOVE("DO missing", errors_errors[27], 11);
__MOVE("TO missing", errors_errors[28], 11);
errors_errors[29][0] = 0x00;
__MOVE("'(' missing", errors_errors[30], 12);
errors_errors[31][0] = 0x00;
errors_errors[32][0] = 0x00;
errors_errors[33][0] = 0x00;
__MOVE("':=' missing", errors_errors[34], 13);
__MOVE("',' or OF expected", errors_errors[35], 19);
errors_errors[36][0] = 0x00;
errors_errors[37][0] = 0x00;
__MOVE("identifier expected", errors_errors[38], 20);
__MOVE("';' missing", errors_errors[39], 12);
errors_errors[40][0] = 0x00;
__MOVE("END missing", errors_errors[41], 12);
errors_errors[42][0] = 0x00;
errors_errors[43][0] = 0x00;
__MOVE("UNTIL missing", errors_errors[44], 14);
errors_errors[45][0] = 0x00;
__MOVE("EXIT not within loop statement", errors_errors[46], 31);
__MOVE("illegally marked identifier", errors_errors[47], 28);
errors_errors[48][0] = 0x00;
errors_errors[49][0] = 0x00;
__MOVE("expression should be constant", errors_errors[50], 30);
__MOVE("constant not an integer", errors_errors[51], 24);
__MOVE("identifier does not denote a type", errors_errors[52], 34);
__MOVE("identifier does not denote a record type", errors_errors[53], 41);
__MOVE("result type of procedure is not a basic type", errors_errors[54], 45);
__MOVE("procedure call of a function", errors_errors[55], 29);
__MOVE("assignment to non-variable", errors_errors[56], 27);
__MOVE("pointer not bound to record or array type", errors_errors[57], 42);
__MOVE("recursive type definition", errors_errors[58], 26);
__MOVE("illegal open array parameter", errors_errors[59], 29);
__MOVE("wrong type of case label", errors_errors[60], 25);
__MOVE("inadmissible type of case label", errors_errors[61], 32);
__MOVE("case label defined more than once", errors_errors[62], 34);
__MOVE("illegal value of constant", errors_errors[63], 26);
__MOVE("more actual than formal parameters", errors_errors[64], 35);
__MOVE("fewer actual than formal parameters", errors_errors[65], 36);
__MOVE("element types of actual array and formal open array differ", errors_errors[66], 59);
__MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61);
__MOVE("control variable must be integer", errors_errors[68], 33);
__MOVE("parameter must be an integer constant", errors_errors[69], 38);
__MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50);
__MOVE("pointer expected as actual receiver", errors_errors[71], 36);
__MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54);
__MOVE("procedure must have level 0", errors_errors[73], 28);
__MOVE("procedure unknown in base type", errors_errors[74], 31);
__MOVE("invalid call of base procedure", errors_errors[75], 31);
__MOVE("this variable (field) is read only", errors_errors[76], 35);
__MOVE("object is not a record", errors_errors[77], 23);
__MOVE("dereferenced object is not a variable", errors_errors[78], 38);
__MOVE("indexed object is not a variable", errors_errors[79], 33);
__MOVE("index expression is not an integer", errors_errors[80], 35);
__MOVE("index out of specified bounds", errors_errors[81], 30);
__MOVE("indexed variable is not an array", errors_errors[82], 33);
__MOVE("undefined record field", errors_errors[83], 23);
__MOVE("dereferenced variable is not a pointer", errors_errors[84], 39);
__MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56);
__MOVE("guard or testtype is not a pointer", errors_errors[86], 35);
__MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75);
__MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66);
errors_errors[89][0] = 0x00;
errors_errors[90][0] = 0x00;
errors_errors[91][0] = 0x00;
__MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43);
__MOVE("set element type is not an integer", errors_errors[93], 35);
__MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36);
__MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37);
__MOVE("operand not applicable to (unary) +", errors_errors[96], 36);
__MOVE("operand not applicable to (unary) -", errors_errors[97], 36);
__MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36);
__MOVE("ASSERT fault", errors_errors[99], 13);
__MOVE("incompatible operands of dyadic operator", errors_errors[100], 41);
__MOVE("operand type inapplicable to *", errors_errors[101], 31);
__MOVE("operand type inapplicable to /", errors_errors[102], 31);
__MOVE("operand type inapplicable to DIV", errors_errors[103], 33);
__MOVE("operand type inapplicable to MOD", errors_errors[104], 33);
__MOVE("operand type inapplicable to +", errors_errors[105], 31);
__MOVE("operand type inapplicable to -", errors_errors[106], 31);
__MOVE("operand type inapplicable to = or #", errors_errors[107], 36);
__MOVE("operand type inapplicable to relation", errors_errors[108], 38);
__MOVE("overriding method must be exported", errors_errors[109], 35);
__MOVE("operand is not a type", errors_errors[110], 22);
__MOVE("operand inapplicable to (this) function", errors_errors[111], 40);
__MOVE("operand is not a variable", errors_errors[112], 26);
__MOVE("incompatible assignment", errors_errors[113], 24);
__MOVE("string too long to be assigned", errors_errors[114], 31);
__MOVE("parameter doesn't match", errors_errors[115], 24);
__MOVE("number of parameters doesn't match", errors_errors[116], 35);
__MOVE("result type doesn't match", errors_errors[117], 26);
__MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51);
__MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61);
__MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71);
__MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64);
__MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39);
__MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76);
__MOVE("type of result expression differs from that of procedure", errors_errors[124], 57);
__MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52);
__MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48);
__MOVE("illegal use of object", errors_errors[127], 22);
__MOVE("unsatisfied forward reference", errors_errors[128], 30);
__MOVE("unsatisfied forward procedure", errors_errors[129], 30);
__MOVE("WITH clause does not specify a variable", errors_errors[130], 40);
__MOVE("LEN not applied to array", errors_errors[131], 25);
__MOVE("dimension in LEN too large or negative", errors_errors[132], 39);
__MOVE("SYSTEM not imported", errors_errors[135], 20);
__MOVE("key inconsistency of imported module", errors_errors[150], 37);
__MOVE("incorrect symbol file", errors_errors[151], 22);
__MOVE("symbol file of imported module not found", errors_errors[152], 41);
__MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46);
__MOVE("recursive import not allowed", errors_errors[154], 29);
__MOVE("generation of new symbol file not allowed", errors_errors[155], 42);
__MOVE("parameter file not found", errors_errors[156], 25);
__MOVE("syntax error in parameter file", errors_errors[157], 31);
__MOVE("not yet implemented", errors_errors[200], 20);
__MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51);
__MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49);
__MOVE("number too large", errors_errors[203], 17);
__MOVE("product too large", errors_errors[204], 18);
__MOVE("division by zero", errors_errors[205], 17);
__MOVE("sum too large", errors_errors[206], 14);
__MOVE("difference too large", errors_errors[207], 21);
__MOVE("overflow in arithmetic shift", errors_errors[208], 29);
__MOVE("case range too large", errors_errors[209], 21);
__MOVE("too many cases in case statement", errors_errors[213], 33);
__MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42);
__MOVE("machine registers cannot be accessed", errors_errors[219], 37);
__MOVE("illegal value of parameter", errors_errors[220], 27);
__MOVE("too many pointers in a record", errors_errors[221], 30);
__MOVE("too many global pointers", errors_errors[222], 25);
__MOVE("too many record types", errors_errors[223], 22);
__MOVE("too many pointer types", errors_errors[224], 23);
__MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61);
__MOVE("too many exported procedures", errors_errors[226], 29);
__MOVE("too many imported modules", errors_errors[227], 26);
__MOVE("too many exported structures", errors_errors[228], 29);
__MOVE("too many nested records for import", errors_errors[229], 35);
__MOVE("too many constants (strings) in module", errors_errors[230], 39);
__MOVE("too many link table entries (external procedures)", errors_errors[231], 50);
__MOVE("too many commands in module", errors_errors[232], 28);
__MOVE("record extension hierarchy too high", errors_errors[233], 36);
__MOVE("export of recursive type not allowed", errors_errors[234], 37);
__MOVE("identifier too long", errors_errors[240], 20);
__MOVE("string too long", errors_errors[241], 16);
__MOVE("address overflow", errors_errors[242], 17);
__MOVE("cyclic type definition not allowed", errors_errors[244], 35);
__MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100);
__MOVE("implicit type cast", errors_errors[301], 19);
__MOVE("inappropriate symbol file ignored", errors_errors[306], 34);
__MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62);
__MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62);
__ENDMOD;
}

View file

@ -1,18 +0,0 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h
#include "SYSTEM.h"
typedef
CHAR errors_string[128];
import errors_string errors_errors[350];
import void *errors__init(void);
#endif // errors

View file

@ -170,6 +170,11 @@ assemble:
@make -f src/tools/make/oberon.mk -s assemble MODEL=2
compilerfromsavedsource:
@make -f src/tools/make/oberon.mk -s compilerfromsavedsource
# compile: compiler only, without cleaning
compiler: configuration
@make -f src/tools/make/oberon.mk -s translate MODEL=2

View file

@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added
*)
IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, VT100, Strings;
IMPORT SYSTEM, Texts, Files, Platform, Out, Configuration, VT100, Strings;
CONST
OptionChar* = "-";
@ -111,7 +111,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
lasterrpos: LONGINT;
inR: Texts.Reader;
Log: Texts.Text;
Log, Errors: Texts.Text;
oldSF, newSF: Files.Rider;
R: ARRAY 3 OF Files.Rider;
@ -420,10 +420,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
PROCEDURE LogErrMsg(n: INTEGER);
VAR
S: Texts.Scanner; T: Texts.Text;
ch: CHAR; i: INTEGER;
buf: ARRAY 1024 OF CHAR;
VAR l: INTEGER; S: Texts.Scanner; c: CHAR;
BEGIN
IF n >= 0 THEN
IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END;
@ -436,6 +433,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
END ;
LogWNum(n, 1);
LogWStr(" ");
IF Errors = NIL THEN NEW(Errors); Texts.Open(Errors, "Errors.Txt") END;
Texts.OpenScanner(S, Errors, 0);
REPEAT l := S.line; Texts.Scan(S)
UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot;
IF ~S.eot THEN
Texts.Read(S, c);
WHILE ~S.eot & (c >= ' ') DO Out.Char(c); Texts.Read(S, c) END
END
(* ---
VAR T: Texts.Text; S: Texts.Scanner;
PROCEDURE Write*(n: INTEGER);
VAR l: INTEGER; c: CHAR;
BEGIN
IF T = NIL THEN NEW(T); Texts.Open(T, "VishapOberonErrors.txt") END;
Texts.OpenScanner(S, T, 0);
REPEAT l := S.line; Texts.Scan(S)
UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot;
IF ~S.eot THEN Texts.Read(S, c);
WHILE ~S.eot & (c >= ' ') DO Console.Char(c); Texts.Read(S, c) END
END
END Write;
(*NEW(T); Texts.Open(T, "vocErrors.Text"); Texts.OpenScanner(S, T, 0);
REPEAT S.line := 0;
REPEAT Texts.Scan(S) UNTIL S.eot OR (S.line # 0)
@ -445,6 +468,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
buf[i] := 0X; LogWStr(buf);
END*)
LogWStr(errors.errors[n]);
--- *)
END LogErrMsg;

View file

@ -1,215 +0,0 @@
MODULE errors;
TYPE string* = ARRAY 128 OF CHAR;
VAR errors- : ARRAY 350 OF string;
BEGIN
(* Incorrect use of the language Oberon *)
errors[0] := "undeclared identifier";
errors[1] := "multiply defined identifier";
errors[2] := "illegal character in number";
errors[3] := "illegal character in string";
errors[4] := "identifier does not match procedure name";
errors[5] := "comment not closed";
errors[6] := "";
errors[7] := "";
errors[8] := "";
errors[9] := "'=' expected";
errors[10] :="";
errors[11] :="";
errors[12] := "type definition starts with incorrect symbol";
errors[13] := "factor starts with incorrect symbol";
errors[14] := "statement starts with incorrect symbol";
errors[15] := "declaration followed by incorrect symbol";
errors[16] := "MODULE expected";
errors[17] := "";
errors[18] := "'.' missing";
errors[19] := "',' missing";
errors[20] := "':' missing";
errors[21] := "";
errors[22] := "')' missing";
errors[23] := "']' missing";
errors[24] := "'}' missing";
errors[25] := "OF missing";
errors[26] := "THEN missing";
errors[27] := "DO missing";
errors[28] := "TO missing";
errors[29] := "";
errors[30] := "'(' missing";
errors[31] := "";
errors[32] := "";
errors[33] := "";
errors[34] := "':=' missing";
errors[35] := "',' or OF expected";
errors[36] := "";
errors[37] := "";
errors[38] := "identifier expected";
errors[39] := "';' missing";
errors[40] := "";
errors[41] := "END missing";
errors[42] := "";
errors[43] := "";
errors[44] := "UNTIL missing";
errors[45] := "";
errors[46] := "EXIT not within loop statement";
errors[47] := "illegally marked identifier";
errors[48] := "";
errors[49] := "";
errors[50] := "expression should be constant";
errors[51] := "constant not an integer";
errors[52] := "identifier does not denote a type";
errors[53] := "identifier does not denote a record type";
errors[54] := "result type of procedure is not a basic type";
errors[55] := "procedure call of a function";
errors[56] := "assignment to non-variable";
errors[57] := "pointer not bound to record or array type";
errors[58] := "recursive type definition";
errors[59] := "illegal open array parameter";
errors[60] := "wrong type of case label";
errors[61] := "inadmissible type of case label";
errors[62] := "case label defined more than once";
errors[63] := "illegal value of constant";
errors[64] := "more actual than formal parameters";
errors[65] := "fewer actual than formal parameters";
errors[66] := "element types of actual array and formal open array differ";
errors[67] := "actual parameter corresponding to open array is not an array";
errors[68] := "control variable must be integer";
errors[69] := "parameter must be an integer constant";
errors[70] := "pointer or VAR record required as formal receiver";
errors[71] := "pointer expected as actual receiver";
errors[72] := "procedure must be bound to a record of the same scope";
errors[73] := "procedure must have level 0";
errors[74] := "procedure unknown in base type";
errors[75] := "invalid call of base procedure";
errors[76] := "this variable (field) is read only";
errors[77] := "object is not a record";
errors[78] := "dereferenced object is not a variable";
errors[79] := "indexed object is not a variable";
errors[80] := "index expression is not an integer";
errors[81] := "index out of specified bounds";
errors[82] := "indexed variable is not an array";
errors[83] := "undefined record field";
errors[84] := "dereferenced variable is not a pointer";
errors[85] := "guard or test type is not an extension of variable type";
errors[86] := "guard or testtype is not a pointer";
errors[87] := "guarded or tested variable is neither a pointer nor a VAR-parameter record";
errors[88] := "open array not allowed as variable, record field or array element";
errors[89] := "";
errors[90] := "";
errors[91] := "";
errors[92] := "operand of IN not an integer, or not a set";
errors[93] := "set element type is not an integer";
errors[94] := "operand of & is not of type BOOLEAN";
errors[95] := "operand of OR is not of type BOOLEAN";
errors[96] := "operand not applicable to (unary) +";
errors[97] := "operand not applicable to (unary) -";
errors[98] := "operand of ~ is not of type BOOLEAN";
errors[99] := "ASSERT fault";
errors[100] := "incompatible operands of dyadic operator";
errors[101] := "operand type inapplicable to *";
errors[102] := "operand type inapplicable to /";
errors[103] := "operand type inapplicable to DIV";
errors[104] := "operand type inapplicable to MOD";
errors[105] := "operand type inapplicable to +";
errors[106] := "operand type inapplicable to -";
errors[107] := "operand type inapplicable to = or #";
errors[108] := "operand type inapplicable to relation";
errors[109] := "overriding method must be exported";
errors[110] := "operand is not a type";
errors[111] := "operand inapplicable to (this) function";
errors[112] := "operand is not a variable";
errors[113] := "incompatible assignment";
errors[114] := "string too long to be assigned";
errors[115] := "parameter doesn't match";
errors[116] := "number of parameters doesn't match";
errors[117] := "result type doesn't match";
errors[118] := "export mark doesn't match with forward declaration";
errors[119] := "redefinition textually precedes procedure bound to base type";
errors[120] := "type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN";
errors[121] := "called object is not a procedure (or is an interrupt procedure)";
errors[122] := "actual VAR-parameter is not a variable";
errors[123] := "type of actual parameter is not identical with that of formal VAR-parameter";
errors[124] := "type of result expression differs from that of procedure";
errors[125] := "type of case expression is neither INTEGER nor CHAR";
errors[126] := "this expression cannot be a type or a procedure";
errors[127] := "illegal use of object";
errors[128] := "unsatisfied forward reference";
errors[129] := "unsatisfied forward procedure";
errors[130] := "WITH clause does not specify a variable";
errors[131] := "LEN not applied to array";
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*)
errors[200] := "not yet implemented";
errors[201] := "lower bound of set range greater than higher bound";
errors[202] := "set element greater than MAX(SET) or less than 0";
errors[203] := "number too large";
errors[204] := "product too large";
errors[205] := "division by zero";
errors[206] := "sum too large";
errors[207] := "difference too large";
errors[208] := "overflow in arithmetic shift";
errors[209] := "case range too large";
errors[213] := "too many cases in case statement";
errors[218] := "illegal value of parameter (0 <= p < 256)";
errors[219] := "machine registers cannot be accessed";
errors[220] := "illegal value of parameter";
errors[221] := "too many pointers in a record";
errors[222] := "too many global pointers";
errors[223] := "too many record types";
errors[224] := "too many pointer types";
errors[225] := "address of pointer variable too large (move forward in text)";
errors[226] := "too many exported procedures";
errors[227] := "too many imported modules";
errors[228] := "too many exported structures";
errors[229] := "too many nested records for import";
errors[230] := "too many constants (strings) in module";
errors[231] := "too many link table entries (external procedures)";
errors[232] := "too many commands in module";
errors[233] := "record extension hierarchy too high";
errors[234] := "export of recursive type not allowed";
errors[240] := "identifier too long";
errors[241] := "string too long";
errors[242] := "address overflow";
errors[244] := "cyclic type definition not allowed";
errors[245] := "guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable";
(* Compiler Warnings *)
errors[301] := "implicit type cast";
errors[306] := "inappropriate symbol file ignored";
errors[307] := "no ELSE symbol after CASE statement sequence may lead to trap"; (* new warning, -- noch *)
errors[308] := "SYSTEM.VAL result includes memory past end of source variable"; (* DCWB *)
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
*)

194
src/runtime/Errors.Txt Normal file
View file

@ -0,0 +1,194 @@
The first line of this file is ignored.
Any line not starting /^ *[0-9]/ is ignored.
There should be only one space between the number and the message text.
Compiler error messages
0 undeclared identifier
1 multiply defined identifier
2 illegal character in number
3 illegal character in string
4 identifier does not match procedure name
5 comment not closed
9 '=' expected
12 type definition starts with incorrect symbol
13 factor starts with incorrect symbol
14 statement starts with incorrect symbol
15 declaration followed by incorrect symbol
16 MODULE expected
18 '.' missing
19 ',' missing
20 ':' missing
22 ')' missing
23 ']' missing
24 '}' missing
25 OF missing
26 THEN missing
27 DO missing
28 TO missing
30 '(' missing
34 ':=' missing
35 ',' or OF expected
38 identifier expected
39 ';' missing
41 END missing
44 UNTIL missing
46 EXIT not within loop statement
47 illegally marked identifier
50 expression should be constant
51 constant not an integer
52 identifier does not denote a type
53 identifier does not denote a record type
54 result type of procedure is not a basic type
55 procedure call of a function
56 assignment to non-variable
57 pointer not bound to record or array type
58 recursive type definition
59 illegal open array parameter
60 wrong type of case label
61 inadmissible type of case label
62 case label defined more than once
63 illegal value of constant
64 more actual than formal parameters
65 fewer actual than formal parameters
66 element types of actual array and formal open array differ
67 actual parameter corresponding to open array is not an array
68 control variable must be integer
69 parameter must be an integer constant
70 pointer or VAR record required as formal receiver
71 pointer expected as actual receiver
72 procedure must be bound to a record of the same scope
73 procedure must have level 0
74 procedure unknown in base type
75 invalid call of base procedure
76 this variable (field) is read only
77 object is not a record
78 dereferenced object is not a variable
79 indexed object is not a variable
80 index expression is not an integer
81 index out of specified bounds
82 indexed variable is not an array
83 undefined record field
84 dereferenced variable is not a pointer
85 guard or test type is not an extension of variable type
86 guard or testtype is not a pointer
87 guarded or tested variable is neither a pointer nor a VAR-parameter record
88 open array not allowed as variable, record field or array element
92 operand of IN not an integer, or not a set
93 set element type is not an integer
94 operand of & is not of type BOOLEAN
95 operand of OR is not of type BOOLEAN
96 operand not applicable to (unary) +
97 operand not applicable to (unary) -
98 operand of ~ is not of type BOOLEAN
99 ASSERT fault
100 incompatible operands of dyadic operator
101 operand type inapplicable to *
102 operand type inapplicable to /
103 operand type inapplicable to DIV
104 operand type inapplicable to MOD
105 operand type inapplicable to +
106 operand type inapplicable to -
107 operand type inapplicable to = or #
108 operand type inapplicable to relation
109 overriding method must be exported
110 operand is not a type
111 operand inapplicable to (this) function
112 operand is not a variable
113 incompatible assignment
114 string too long to be assigned
115 parameter doesn't match
116 number of parameters doesn't match
117 result type doesn't match
118 export mark doesn't match with forward declaration
119 redefinition textually precedes procedure bound to base type
120 type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN
121 called object is not a procedure (or is an interrupt procedure)
122 actual VAR-parameter is not a variable
123 type of actual parameter is not identical with that of formal VAR-parameter
124 type of result expression differs from that of procedure
125 type of case expression is neither INTEGER nor CHAR
126 this expression cannot be a type or a procedure
127 illegal use of object
128 unsatisfied forward reference
129 unsatisfied forward procedure
130 WITH clause does not specify a variable
131 LEN not applied to array
132 dimension in LEN too large or negative
135 SYSTEM not imported
150 key inconsistency of imported module
151 incorrect symbol file
152 symbol file of imported module not found
153 object or symbol file not opened (disk full?)
154 recursive import not allowed
155 generation of new symbol file not allowed
156 parameter file not found
157 syntax error in parameter file
Limitations of implementation
200 not yet implemented
201 lower bound of set range greater than higher bound
202 set element greater than MAX(SET) or less than 0
203 number too large
204 product too large
205 division by zero
206 sum too large
207 difference too large
208 overflow in arithmetic shift
209 case range too large
213 too many cases in case statement
218 illegal value of parameter (0 <= p < 256)
219 machine registers cannot be accessed
220 illegal value of parameter
221 too many pointers in a record
222 too many global pointers
223 too many record types
224 too many pointer types
225 address of pointer variable too large (move forward in text)
226 too many exported procedures
227 too many imported modules
228 too many exported structures
229 too many nested records for import
230 too many constants (strings) in module
231 too many link table entries (external procedures)
232 too many commands in module
233 record extension hierarchy too high
234 export of recursive type not allowed
240 identifier too long
241 string too long
242 address overflow
244 cyclic type definition not allowed
245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable
Compiler Warnings
301 implicit type cast
306 inappropriate symbol file ignored
307 no ELSE symbol after CASE statement sequence may lead to trap
Run-time Error Messages
-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

View file

@ -61,16 +61,18 @@ assemble:
cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c
cd $(BUILDDIR) && $(COMPILE) -c Out.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
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) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \
SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \
Reals.o Texts.o VT100.o errors.o OPM.o extTools.o OPS.o OPT.o \
OPC.o OPV.o OPB.o OPP.o
SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o \
Modules.o Files.o Reals.o Texts.o VT100.o extTools.o \
OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o
cp src/runtime/*.[ch] $(BUILDDIR)
cp src/runtime/*.Txt $(BUILDDIR)
cp src/runtime/*.Txt $(ROOTDIR)
@printf "$(OBECOMP) created.\n"
@ -111,7 +113,6 @@ translate:
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod
@ -123,6 +124,7 @@ translate:
cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod
cp src/runtime/*.[ch] $(BUILDDIR)
cp src/runtime/*.Txt $(BUILDDIR)
@printf "$(BUILDDIR) filled with compiler C source.\n"
@ -134,7 +136,7 @@ browsercmd:
@cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod
@cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \
Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \
Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \
Files.o Reals.o Modules.o VT100.o Configuration.o Strings.o \
OPC.o
@ -168,6 +170,9 @@ install:
@mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/"
@mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/"
@cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/2/sym/"
@cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/C/sym/"
@mkdir -p "$(INSTALLDIR)/lib"
@cp $(BUILDDIR)/2/lib$(ONAME)* "$(INSTALLDIR)/lib/"
@cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/"
@ -366,8 +371,9 @@ library:
@printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n"
rm -rf $(BUILDDIR)/$(MODEL)
mkdir -p $(BUILDDIR)/$(MODEL)
cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL)
cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c
#cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL)
#cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c
cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL)
@make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL)
@printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n"
ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o