mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 05:12:26 +00:00
Clean option handling and add size model and target machine options.
This commit is contained in:
parent
1c94abedc6
commit
76b6a8fc23
202 changed files with 1178 additions and 1313 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Console__h
|
#ifndef Console__h
|
||||||
#define Console__h
|
#define Console__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPT_Struct y = NIL;
|
OPT_Struct y = NIL;
|
||||||
int16 f, g;
|
int16 f, g;
|
||||||
OPT_Struct p = NIL, q = NIL;
|
OPT_Struct p = NIL, q = NIL;
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
|
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
|
@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
y = ynode->typ;
|
y = ynode->typ;
|
||||||
f = x->form;
|
f = x->form;
|
||||||
g = y->form;
|
g = y->form;
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
OPM_LogWStr((CHAR*)"y.form = ", 10);
|
OPM_LogWStr((CHAR*)"y.form = ", 10);
|
||||||
OPM_LogWNum(y->form, 0);
|
OPM_LogWNum(y->form, 0);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
|
|
||||||
static int16 OPC_indentLevel;
|
static int16 OPC_indentLevel;
|
||||||
static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi;
|
|
||||||
static int8 OPC_hashtab[105];
|
static int8 OPC_hashtab[105];
|
||||||
static CHAR OPC_keytab[50][9];
|
static CHAR OPC_keytab[50][9];
|
||||||
static BOOLEAN OPC_GlbPtrs;
|
static BOOLEAN OPC_GlbPtrs;
|
||||||
|
|
@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj);
|
||||||
void OPC_Init (void)
|
void OPC_Init (void)
|
||||||
{
|
{
|
||||||
OPC_indentLevel = 0;
|
OPC_indentLevel = 0;
|
||||||
OPC_ptrinit = __IN(5, OPM_opt, 32);
|
__MOVE("__init(void)", OPC_BodyNameExt, 13);
|
||||||
OPC_mainprog = OPM_mainProg || OPM_mainLinkStat;
|
|
||||||
OPC_ansi = __IN(6, OPM_opt, 32);
|
|
||||||
if (OPC_ansi) {
|
|
||||||
__MOVE("__init(void)", OPC_BodyNameExt, 13);
|
|
||||||
} else {
|
|
||||||
__MOVE("__init()", OPC_BodyNameExt, 9);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPC_Indent (int16 count)
|
void OPC_Indent (int16 count)
|
||||||
|
|
@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef)
|
||||||
openClause = 0;
|
openClause = 0;
|
||||||
}
|
}
|
||||||
if (form == 12) {
|
if (form == 12) {
|
||||||
if (OPC_ansi) {
|
OPM_Write(')');
|
||||||
OPM_Write(')');
|
OPC_AnsiParamList(typ->link, 0);
|
||||||
OPC_AnsiParamList(typ->link, 0);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)")()", 4);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} else if (comp == 2) {
|
} else if (comp == 2) {
|
||||||
OPM_Write('[');
|
OPM_Write('[');
|
||||||
|
|
@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj)
|
||||||
if (obj->typ != OPT_notyp) {
|
if (obj->typ != OPT_notyp) {
|
||||||
OPC_DefineType(obj->typ);
|
OPC_DefineType(obj->typ);
|
||||||
}
|
}
|
||||||
if (OPC_ansi) {
|
par = obj->link;
|
||||||
par = obj->link;
|
while (par != NIL) {
|
||||||
while (par != NIL) {
|
OPC_DefineType(par->typ);
|
||||||
OPC_DefineType(par->typ);
|
par = par->link;
|
||||||
par = par->link;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
|
||||||
OPC_Ident(obj->typ->strobj);
|
OPC_Ident(obj->typ->strobj);
|
||||||
}
|
}
|
||||||
OPM_WriteString((CHAR*)"(*)", 4);
|
OPM_WriteString((CHAR*)"(*)", 4);
|
||||||
if (OPC_ansi) {
|
OPC_AnsiParamList(obj->link, 0);
|
||||||
OPC_AnsiParamList(obj->link, 0);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"()", 3);
|
|
||||||
}
|
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
OPC_DeclareParams(obj->link, 1);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis)
|
||||||
OPC_Ident(obj);
|
OPC_Ident(obj);
|
||||||
OPM_WriteString((CHAR*)"__typ", 6);
|
OPM_WriteString((CHAR*)"__typ", 6);
|
||||||
base = NIL;
|
base = NIL;
|
||||||
} else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) {
|
} else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) {
|
||||||
OPM_WriteString((CHAR*)" = NIL", 7);
|
OPM_WriteString((CHAR*)" = NIL", 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define)
|
||||||
OPM_Write(' ');
|
OPM_Write(' ');
|
||||||
OPC_Ident(proc);
|
OPC_Ident(proc);
|
||||||
OPM_Write(' ');
|
OPM_Write(' ');
|
||||||
if (OPC_ansi) {
|
OPC_AnsiParamList(proc->link, 1);
|
||||||
OPC_AnsiParamList(proc->link, 1);
|
if (!define) {
|
||||||
if (!define) {
|
OPM_Write(';');
|
||||||
OPM_Write(';');
|
|
||||||
}
|
|
||||||
OPM_WriteLn();
|
|
||||||
} else if (define) {
|
|
||||||
OPC_DeclareParams(proc->link, 0);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPC_Indent(1);
|
|
||||||
OPC_IdentList(proc->link, 2);
|
|
||||||
OPC_Indent(-1);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"();", 4);
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
}
|
||||||
|
OPM_WriteLn();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
|
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
|
||||||
|
|
@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void)
|
||||||
case 5:
|
case 5:
|
||||||
OPM_Write('p');
|
OPM_Write('p');
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
OPM_Write('k');
|
|
||||||
break;
|
|
||||||
case 7:
|
case 7:
|
||||||
OPM_Write('a');
|
OPM_Write('a');
|
||||||
break;
|
break;
|
||||||
|
|
@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var)
|
||||||
if (OPC_NofPtrs(typ) > 0) {
|
if (OPC_NofPtrs(typ) > 0) {
|
||||||
if (!OPC_GlbPtrs) {
|
if (!OPC_GlbPtrs) {
|
||||||
OPC_GlbPtrs = 1;
|
OPC_GlbPtrs = 1;
|
||||||
OPM_WriteString((CHAR*)"static ", 8);
|
OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39);
|
||||||
if (OPC_ansi) {
|
|
||||||
OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPM_Write(0x09);
|
|
||||||
OPM_WriteString((CHAR*)"void (*P)();", 13);
|
|
||||||
}
|
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
OPC_BegBlk();
|
OPC_BegBlk();
|
||||||
}
|
}
|
||||||
|
|
@ -1451,17 +1411,9 @@ void OPC_EnterBody (void)
|
||||||
{
|
{
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
OPM_WriteString((CHAR*)"export ", 8);
|
OPM_WriteString((CHAR*)"export ", 8);
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
if (OPC_ansi) {
|
OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32);
|
||||||
OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32);
|
OPM_WriteLn();
|
||||||
OPM_WriteLn();
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"main(argc, argv)", 17);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPM_Write(0x09);
|
|
||||||
OPM_WriteString((CHAR*)"int argc; char **argv;", 23);
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"void *", 7);
|
OPM_WriteString((CHAR*)"void *", 7);
|
||||||
OPM_WriteString(OPM_modName, 32);
|
OPM_WriteString(OPM_modName, 32);
|
||||||
|
|
@ -1470,20 +1422,20 @@ void OPC_EnterBody (void)
|
||||||
}
|
}
|
||||||
OPC_BegBlk();
|
OPC_BegBlk();
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19);
|
OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__DEFMOD", 9);
|
OPM_WriteString((CHAR*)"__DEFMOD", 9);
|
||||||
}
|
}
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
if ((OPC_mainprog && 0)) {
|
if ((__IN(10, OPM_opt, 32) && 0)) {
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94);
|
OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94);
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
}
|
}
|
||||||
OPC_InitImports(OPT_topScope->right);
|
OPC_InitImports(OPT_topScope->right);
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__REGMAIN(\"", 12);
|
OPM_WriteString((CHAR*)"__REGMAIN(\"", 12);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__REGMOD(\"", 11);
|
OPM_WriteString((CHAR*)"__REGMOD(\"", 11);
|
||||||
|
|
@ -1503,7 +1455,7 @@ void OPC_EnterBody (void)
|
||||||
void OPC_ExitBody (void)
|
void OPC_ExitBody (void)
|
||||||
{
|
{
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__FINI;", 8);
|
OPM_WriteString((CHAR*)"__FINI;", 8);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__ENDMOD;", 10);
|
OPM_WriteString((CHAR*)"__ENDMOD;", 10);
|
||||||
|
|
@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc)
|
||||||
}
|
}
|
||||||
var = var->link;
|
var = var->link;
|
||||||
}
|
}
|
||||||
if (!OPC_ansi) {
|
|
||||||
var = proc->link;
|
|
||||||
while (var != NIL) {
|
|
||||||
if ((var->typ->form == 5 && var->mode == 1)) {
|
|
||||||
OPC_BegStat();
|
|
||||||
OPC_Ident(var->typ->strobj);
|
|
||||||
OPM_Write(' ');
|
|
||||||
OPC_Ident(var);
|
|
||||||
OPM_WriteString((CHAR*)" = _", 5);
|
|
||||||
OPC_Ident(var);
|
|
||||||
OPC_EndStat();
|
|
||||||
}
|
|
||||||
var = var->link;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var = proc->link;
|
var = proc->link;
|
||||||
while (var != NIL) {
|
while (var != NIL) {
|
||||||
if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) {
|
if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) {
|
||||||
|
|
@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
||||||
array = array->BaseTyp;
|
array = array->BaseTyp;
|
||||||
dim -= 1;
|
dim -= 1;
|
||||||
}
|
}
|
||||||
if (OPC_ansi) {
|
OPM_WriteInt(array->n);
|
||||||
OPM_WriteInt(array->n);
|
|
||||||
} else {
|
|
||||||
OPC_IntLiteral(array->n, OPM_AddressSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF;
|
||||||
static Files_Rider OPM_R[3];
|
static Files_Rider OPM_R[3];
|
||||||
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
||||||
static int16 OPM_S;
|
static int16 OPM_S;
|
||||||
export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
|
|
||||||
static CHAR OPM_OBERON[1024];
|
static CHAR OPM_OBERON[1024];
|
||||||
static CHAR OPM_MODULES[1024];
|
static CHAR OPM_MODULES[1024];
|
||||||
|
|
||||||
|
|
@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n)
|
||||||
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
{
|
{
|
||||||
int16 i;
|
int16 i;
|
||||||
|
__DUP(s, s__len, CHAR);
|
||||||
i = 1;
|
i = 1;
|
||||||
while (s[__X(i, s__len)] != 0x00) {
|
while (s[__X(i, s__len)] != 0x00) {
|
||||||
switch (s[__X(i, s__len)]) {
|
switch (s[__X(i, s__len)]) {
|
||||||
case 'a':
|
|
||||||
*opt = *opt ^ 0x80;
|
|
||||||
break;
|
|
||||||
case 'c':
|
|
||||||
*opt = *opt ^ 0x4000;
|
|
||||||
break;
|
|
||||||
case 'e':
|
|
||||||
*opt = *opt ^ 0x0200;
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
*opt = *opt ^ 0x010000;
|
|
||||||
break;
|
|
||||||
case 'k':
|
|
||||||
*opt = *opt ^ 0x40;
|
|
||||||
break;
|
|
||||||
case 'm':
|
|
||||||
*opt = *opt ^ 0x0400;
|
|
||||||
break;
|
|
||||||
case 'p':
|
case 'p':
|
||||||
*opt = *opt ^ 0x20;
|
*opt = *opt ^ 0x20;
|
||||||
break;
|
break;
|
||||||
|
case 'a':
|
||||||
|
*opt = *opt ^ 0x80;
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
*opt = *opt ^ 0x04;
|
*opt = *opt ^ 0x04;
|
||||||
break;
|
break;
|
||||||
case 's':
|
|
||||||
*opt = *opt ^ 0x10;
|
|
||||||
break;
|
|
||||||
case 't':
|
case 't':
|
||||||
*opt = *opt ^ 0x08;
|
*opt = *opt ^ 0x08;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
*opt = *opt ^ 0x01;
|
*opt = *opt ^ 0x01;
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
*opt = *opt ^ 0x0200;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
*opt = *opt ^ 0x10;
|
||||||
|
break;
|
||||||
|
case 'F':
|
||||||
|
*opt = *opt ^ 0x020000;
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
*opt = *opt ^ 0x0400;
|
||||||
|
break;
|
||||||
|
case 'M':
|
||||||
|
*opt = *opt ^ 0x8000;
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
*opt = *opt ^ 0x2000;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
*opt = *opt ^ 0x4000;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
*opt = *opt ^ 0x010000;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
*opt = *opt ^ 0x040000;
|
||||||
|
break;
|
||||||
|
case 'O':
|
||||||
|
if (i + 1 >= Strings_Length(s, s__len)) {
|
||||||
|
OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51);
|
||||||
|
OPM_LogWLn();
|
||||||
|
} else {
|
||||||
|
switch (s[__X(i + 1, s__len)]) {
|
||||||
|
case '2':
|
||||||
|
OPM_ShortintSize = 1;
|
||||||
|
OPM_IntegerSize = 2;
|
||||||
|
OPM_LongintSize = 4;
|
||||||
|
OPM_SetSize = 4;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
OPM_ShortintSize = 1;
|
||||||
|
OPM_IntegerSize = 4;
|
||||||
|
OPM_LongintSize = 8;
|
||||||
|
OPM_SetSize = 8;
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
OPM_ShortintSize = 2;
|
||||||
|
OPM_IntegerSize = 4;
|
||||||
|
OPM_LongintSize = 8;
|
||||||
|
OPM_SetSize = 8;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48);
|
||||||
|
OPM_LogWLn();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'A':
|
||||||
|
if (i + 2 >= Strings_Length(s, s__len)) {
|
||||||
|
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
|
||||||
|
OPM_LogWLn();
|
||||||
|
} else {
|
||||||
|
OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48;
|
||||||
|
OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48;
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
}
|
}
|
||||||
Files_SetSearchPath((CHAR*)"", 1);
|
Files_SetSearchPath((CHAR*)"", 1);
|
||||||
break;
|
break;
|
||||||
case 'F':
|
|
||||||
*opt = *opt ^ 0x020000;
|
|
||||||
break;
|
|
||||||
case 'M':
|
|
||||||
*opt = *opt ^ 0x8000;
|
|
||||||
break;
|
|
||||||
case 'S':
|
|
||||||
*opt = *opt ^ 0x2000;
|
|
||||||
break;
|
|
||||||
case 'V':
|
|
||||||
*opt = *opt ^ 0x040000;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
OPM_LogWStr((CHAR*)" warning: option ", 19);
|
OPM_LogWStr((CHAR*)" warning: option ", 19);
|
||||||
OPM_LogW('-');
|
OPM_LogW('-');
|
||||||
|
|
@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
__DEL(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN OPM_OpenPar (void)
|
BOOLEAN OPM_OpenPar (void)
|
||||||
|
|
@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void)
|
||||||
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
|
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" m - generate code for main module", 36);
|
OPM_LogWStr((CHAR*)" Run time safety", 18);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63);
|
OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" s - generate new symbol file", 31);
|
OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43);
|
OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" r - check value ranges", 25);
|
OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" x - turn off array indices check", 35);
|
OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80);
|
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48);
|
OPM_LogWStr((CHAR*)" Symbol file management", 25);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101);
|
OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67);
|
OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" c - don't call linker", 24);
|
OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" f - don't use color output", 29);
|
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57);
|
OPM_LogWStr((CHAR*)" C compiler and linker control", 32);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" V - verbose output", 21);
|
OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -c Don't link.", 21);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Miscellaneous", 16);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Size model for elementary types", 34);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
|
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
|
||||||
|
|
@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void)
|
||||||
OPM_S = 1;
|
OPM_S = 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
OPM_glbopt = 0xe9;
|
OPM_glbopt = 0xa9;
|
||||||
while (s[0] == '-') {
|
while (s[0] == '-') {
|
||||||
OPM_ScanOptions((void*)s, 256, &OPM_glbopt);
|
OPM_ScanOptions(s, 256, &OPM_glbopt);
|
||||||
OPM_S += 1;
|
OPM_S += 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
|
|
@ -308,20 +377,14 @@ void OPM_InitOptions (void)
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
while (s[0] == '-') {
|
while (s[0] == '-') {
|
||||||
OPM_ScanOptions((void*)s, 256, &OPM_opt);
|
OPM_ScanOptions(s, 256, &OPM_opt);
|
||||||
OPM_S += 1;
|
OPM_S += 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
}
|
}
|
||||||
OPM_dontAsm = __IN(13, OPM_opt, 32);
|
if (__IN(15, OPM_opt, 32)) {
|
||||||
OPM_dontLink = __IN(14, OPM_opt, 32);
|
|
||||||
OPM_mainProg = __IN(10, OPM_opt, 32);
|
|
||||||
OPM_mainLinkStat = __IN(15, OPM_opt, 32);
|
|
||||||
OPM_notColorOutput = __IN(16, OPM_opt, 32);
|
|
||||||
OPM_forceNewSym = __IN(17, OPM_opt, 32);
|
|
||||||
OPM_Verbose = __IN(18, OPM_opt, 32);
|
|
||||||
if (OPM_mainLinkStat) {
|
|
||||||
OPM_glbopt |= __SETOF(10,32);
|
OPM_glbopt |= __SETOF(10,32);
|
||||||
|
OPM_opt |= __SETOF(10,32);
|
||||||
}
|
}
|
||||||
OPM_GetProperties();
|
OPM_GetProperties();
|
||||||
}
|
}
|
||||||
|
|
@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n)
|
||||||
int16 i;
|
int16 i;
|
||||||
CHAR buf[1024];
|
CHAR buf[1024];
|
||||||
if (n >= 0) {
|
if (n >= 0) {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"31m", 4);
|
vt100_SetAttr((CHAR*)"31m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" err ", 7);
|
OPM_LogWStr((CHAR*)" err ", 7);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"35m", 4);
|
vt100_SetAttr((CHAR*)"35m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||||
n = -n;
|
n = -n;
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos)
|
||||||
OPM_LogW(' ');
|
OPM_LogW(' ');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogW('^');
|
OPM_LogW('^');
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
Files_Close(f);
|
Files_Close(f);
|
||||||
|
|
@ -682,7 +745,7 @@ static void OPM_GetProperties (void)
|
||||||
OPM_MinLReal = -OPM_MaxLReal;
|
OPM_MinLReal = -OPM_MaxLReal;
|
||||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||||
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
OPM_VerboseListSizes();
|
OPM_VerboseListSizes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
|
||||||
import CHAR OPM_modName[32];
|
import CHAR OPM_modName[32];
|
||||||
import CHAR OPM_objname[64];
|
import CHAR OPM_objname[64];
|
||||||
import SET OPM_opt, OPM_glbopt;
|
import SET OPM_opt, OPM_glbopt;
|
||||||
import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
|
|
||||||
|
|
||||||
|
|
||||||
import void OPM_CloseFiles (void);
|
import void OPM_CloseFiles (void);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
|
||||||
}
|
}
|
||||||
OPT_OutObj(OPT_topScope->right);
|
OPT_OutObj(OPT_topScope->right);
|
||||||
*ext = (OPT_sfpresent && OPT_symExtended);
|
*ext = (OPT_sfpresent && OPT_symExtended);
|
||||||
*new = !OPT_sfpresent || OPT_symNew;
|
*new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32);
|
||||||
if (OPM_forceNewSym) {
|
|
||||||
*new = 1;
|
|
||||||
}
|
|
||||||
if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) {
|
if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) {
|
||||||
*new = 1;
|
*new = 1;
|
||||||
if (!OPT_extsf) {
|
if (!OPT_extsf) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -16,7 +16,6 @@ typedef
|
||||||
} OPV_ExitInfo;
|
} OPV_ExitInfo;
|
||||||
|
|
||||||
|
|
||||||
static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi;
|
|
||||||
static int16 OPV_stamp;
|
static int16 OPV_stamp;
|
||||||
static int32 OPV_recno;
|
static int32 OPV_recno;
|
||||||
static OPV_ExitInfo OPV_exit;
|
static OPV_ExitInfo OPV_exit;
|
||||||
|
|
@ -130,10 +129,6 @@ void OPV_Init (void)
|
||||||
OPV_stamp = 0;
|
OPV_stamp = 0;
|
||||||
OPV_recno = 0;
|
OPV_recno = 0;
|
||||||
OPV_nofExitLabels = 0;
|
OPV_nofExitLabels = 0;
|
||||||
OPV_assert = __IN(7, OPM_opt, 32);
|
|
||||||
OPV_inxchk = __IN(0, OPM_opt, 32);
|
|
||||||
OPV_mainprog = __IN(10, OPM_opt, 32);
|
|
||||||
OPV_ansi = __IN(6, OPM_opt, 32);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPV_GetTProcNum (OPT_Object obj)
|
static void OPV_GetTProcNum (OPT_Object obj)
|
||||||
|
|
@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n)
|
||||||
|
|
||||||
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
|
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
|
||||||
{
|
{
|
||||||
if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) {
|
if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) {
|
||||||
OPV_expr(n->right, prec);
|
OPV_expr(n->right, prec);
|
||||||
} else {
|
} else {
|
||||||
if (OPV_SideEffects(n->right)) {
|
if (OPV_SideEffects(n->right)) {
|
||||||
|
|
@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec)
|
||||||
|
|
||||||
static void OPV_ParIntLiteral (int64 n, int32 size)
|
static void OPV_ParIntLiteral (int64 n, int32 size)
|
||||||
{
|
{
|
||||||
if (OPV_ansi) {
|
OPM_WriteInt(n);
|
||||||
OPM_WriteInt(n);
|
|
||||||
} else {
|
|
||||||
OPC_IntLiteral(n, size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
|
|
@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
}
|
}
|
||||||
if (!__IN(n->typ->comp, 0x0c, 32)) {
|
if (!__IN(n->typ->comp, 0x0c, 32)) {
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
if ((OPV_ansi && typ != n->typ)) {
|
if (typ != n->typ) {
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
OPM_Write('&');
|
OPM_Write('&');
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (OPV_ansi) {
|
} else {
|
||||||
if ((__IN(comp, 0x0c, 32) && n->class == 7)) {
|
if ((__IN(comp, 0x0c, 32) && n->class == 7)) {
|
||||||
OPM_WriteString((CHAR*)"(CHAR*)", 8);
|
OPM_WriteString((CHAR*)"(CHAR*)", 8);
|
||||||
} else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) {
|
} else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) {
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ((__IN(form, 0x60, 32) && n->typ->form == 4)) {
|
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
|
||||||
prec = 9;
|
|
||||||
} else if (form == 4) {
|
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (OPV_ansi) {
|
} else {
|
||||||
if ((((mode == 2 && typ != n->typ)) && prec == -1)) {
|
if ((((mode == 2 && typ != n->typ)) && prec == -1)) {
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
|
|
@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
|
||||||
case 20:
|
case 20:
|
||||||
if (n->subcl != 32) {
|
if (n->subcl != 32) {
|
||||||
OPV_IfStat(n, 0, outerProc);
|
OPV_IfStat(n, 0, outerProc);
|
||||||
} else if (OPV_assert) {
|
} else if (__IN(7, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__ASSERT(", 10);
|
OPM_WriteString((CHAR*)"__ASSERT(", 10);
|
||||||
OPV_expr(n->left->left->left, -1);
|
OPV_expr(n->left->left->left, -1);
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
|
|
@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
|
||||||
break;
|
break;
|
||||||
case 26:
|
case 26:
|
||||||
if (OPM_level == 0) {
|
if (OPM_level == 0) {
|
||||||
if (OPV_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__FINI", 7);
|
OPM_WriteString((CHAR*)"__FINI", 7);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__ENDMOD", 9);
|
OPM_WriteString((CHAR*)"__ENDMOD", 9);
|
||||||
|
|
@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
|
||||||
|
|
||||||
void OPV_Module (OPT_Node prog)
|
void OPV_Module (OPT_Node prog)
|
||||||
{
|
{
|
||||||
if (!OPV_mainprog) {
|
if (!__IN(10, OPM_opt, 32)) {
|
||||||
OPC_GenHdr(prog->right);
|
OPC_GenHdr(prog->right);
|
||||||
OPC_GenHdrIncludes();
|
OPC_GenHdrIncludes();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPV__h
|
#ifndef OPV__h
|
||||||
#define OPV__h
|
#define OPV__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Platform__h
|
#ifndef Platform__h
|
||||||
#define Platform__h
|
#define Platform__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Reals__h
|
#ifndef Reals__h
|
||||||
#define Reals__h
|
#define Reals__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Strings__h
|
#ifndef Strings__h
|
||||||
#define Strings__h
|
#define Strings__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Texts__h
|
#ifndef Texts__h
|
||||||
#define Texts__h
|
#define Texts__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done)
|
||||||
OPC_Init();
|
OPC_Init();
|
||||||
OPV_Module(p);
|
OPV_Module(p);
|
||||||
if (OPM_noerr) {
|
if (OPM_noerr) {
|
||||||
if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
||||||
OPM_DeleteNewSym();
|
OPM_DeleteNewSym();
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" Main program.", 16);
|
OPM_LogWStr((CHAR*)" Main program.", 16);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (new) {
|
if (new) {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
OPM_RegisterNewSym();
|
OPM_RegisterNewSym();
|
||||||
|
|
@ -111,17 +111,17 @@ void Vishap_Translate (void)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
Platform_Exit(1);
|
Platform_Exit(1);
|
||||||
}
|
}
|
||||||
if (!OPM_dontAsm) {
|
if (!__IN(13, OPM_opt, 32)) {
|
||||||
if (OPM_dontLink) {
|
if (__IN(14, OPM_opt, 32)) {
|
||||||
extTools_Assemble(OPM_modName, 32);
|
extTools_Assemble(OPM_modName, 32);
|
||||||
} else {
|
} else {
|
||||||
if (!(OPM_mainProg || OPM_mainLinkStat)) {
|
if (!__IN(10, OPM_opt, 32)) {
|
||||||
extTools_Assemble(OPM_modName, 32);
|
extTools_Assemble(OPM_modName, 32);
|
||||||
Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048);
|
Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048);
|
||||||
Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048);
|
Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048);
|
||||||
Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048);
|
Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048);
|
||||||
} else {
|
} else {
|
||||||
extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048);
|
extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef errors__h
|
#ifndef errors__h
|
||||||
#define errors__h
|
#define errors__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
|
||||||
int16 r, status, exitcode;
|
int16 r, status, exitcode;
|
||||||
__DUP(title, title__len, CHAR);
|
__DUP(title, title__len, CHAR);
|
||||||
__DUP(cmd, cmd__len, CHAR);
|
__DUP(cmd, cmd__len, CHAR);
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
Console_String(title, title__len);
|
Console_String(title, title__len);
|
||||||
Console_String(cmd, cmd__len);
|
Console_String(cmd, cmd__len);
|
||||||
Console_Ln();
|
Console_Ln();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef extTools__h
|
#ifndef extTools__h
|
||||||
#define extTools__h
|
#define extTools__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef vt100__h
|
#ifndef vt100__h
|
||||||
#define vt100__h
|
#define vt100__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Console__h
|
#ifndef Console__h
|
||||||
#define Console__h
|
#define Console__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPT_Struct y = NIL;
|
OPT_Struct y = NIL;
|
||||||
int16 f, g;
|
int16 f, g;
|
||||||
OPT_Struct p = NIL, q = NIL;
|
OPT_Struct p = NIL, q = NIL;
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
|
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
|
@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
y = ynode->typ;
|
y = ynode->typ;
|
||||||
f = x->form;
|
f = x->form;
|
||||||
g = y->form;
|
g = y->form;
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
OPM_LogWStr((CHAR*)"y.form = ", 10);
|
OPM_LogWStr((CHAR*)"y.form = ", 10);
|
||||||
OPM_LogWNum(y->form, 0);
|
OPM_LogWNum(y->form, 0);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
|
|
||||||
static int16 OPC_indentLevel;
|
static int16 OPC_indentLevel;
|
||||||
static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi;
|
|
||||||
static int8 OPC_hashtab[105];
|
static int8 OPC_hashtab[105];
|
||||||
static CHAR OPC_keytab[50][9];
|
static CHAR OPC_keytab[50][9];
|
||||||
static BOOLEAN OPC_GlbPtrs;
|
static BOOLEAN OPC_GlbPtrs;
|
||||||
|
|
@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj);
|
||||||
void OPC_Init (void)
|
void OPC_Init (void)
|
||||||
{
|
{
|
||||||
OPC_indentLevel = 0;
|
OPC_indentLevel = 0;
|
||||||
OPC_ptrinit = __IN(5, OPM_opt, 32);
|
__MOVE("__init(void)", OPC_BodyNameExt, 13);
|
||||||
OPC_mainprog = OPM_mainProg || OPM_mainLinkStat;
|
|
||||||
OPC_ansi = __IN(6, OPM_opt, 32);
|
|
||||||
if (OPC_ansi) {
|
|
||||||
__MOVE("__init(void)", OPC_BodyNameExt, 13);
|
|
||||||
} else {
|
|
||||||
__MOVE("__init()", OPC_BodyNameExt, 9);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPC_Indent (int16 count)
|
void OPC_Indent (int16 count)
|
||||||
|
|
@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef)
|
||||||
openClause = 0;
|
openClause = 0;
|
||||||
}
|
}
|
||||||
if (form == 12) {
|
if (form == 12) {
|
||||||
if (OPC_ansi) {
|
OPM_Write(')');
|
||||||
OPM_Write(')');
|
OPC_AnsiParamList(typ->link, 0);
|
||||||
OPC_AnsiParamList(typ->link, 0);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)")()", 4);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} else if (comp == 2) {
|
} else if (comp == 2) {
|
||||||
OPM_Write('[');
|
OPM_Write('[');
|
||||||
|
|
@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj)
|
||||||
if (obj->typ != OPT_notyp) {
|
if (obj->typ != OPT_notyp) {
|
||||||
OPC_DefineType(obj->typ);
|
OPC_DefineType(obj->typ);
|
||||||
}
|
}
|
||||||
if (OPC_ansi) {
|
par = obj->link;
|
||||||
par = obj->link;
|
while (par != NIL) {
|
||||||
while (par != NIL) {
|
OPC_DefineType(par->typ);
|
||||||
OPC_DefineType(par->typ);
|
par = par->link;
|
||||||
par = par->link;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
|
||||||
OPC_Ident(obj->typ->strobj);
|
OPC_Ident(obj->typ->strobj);
|
||||||
}
|
}
|
||||||
OPM_WriteString((CHAR*)"(*)", 4);
|
OPM_WriteString((CHAR*)"(*)", 4);
|
||||||
if (OPC_ansi) {
|
OPC_AnsiParamList(obj->link, 0);
|
||||||
OPC_AnsiParamList(obj->link, 0);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"()", 3);
|
|
||||||
}
|
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
OPC_DeclareParams(obj->link, 1);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis)
|
||||||
OPC_Ident(obj);
|
OPC_Ident(obj);
|
||||||
OPM_WriteString((CHAR*)"__typ", 6);
|
OPM_WriteString((CHAR*)"__typ", 6);
|
||||||
base = NIL;
|
base = NIL;
|
||||||
} else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) {
|
} else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) {
|
||||||
OPM_WriteString((CHAR*)" = NIL", 7);
|
OPM_WriteString((CHAR*)" = NIL", 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define)
|
||||||
OPM_Write(' ');
|
OPM_Write(' ');
|
||||||
OPC_Ident(proc);
|
OPC_Ident(proc);
|
||||||
OPM_Write(' ');
|
OPM_Write(' ');
|
||||||
if (OPC_ansi) {
|
OPC_AnsiParamList(proc->link, 1);
|
||||||
OPC_AnsiParamList(proc->link, 1);
|
if (!define) {
|
||||||
if (!define) {
|
OPM_Write(';');
|
||||||
OPM_Write(';');
|
|
||||||
}
|
|
||||||
OPM_WriteLn();
|
|
||||||
} else if (define) {
|
|
||||||
OPC_DeclareParams(proc->link, 0);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPC_Indent(1);
|
|
||||||
OPC_IdentList(proc->link, 2);
|
|
||||||
OPC_Indent(-1);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"();", 4);
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
}
|
||||||
|
OPM_WriteLn();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
|
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
|
||||||
|
|
@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void)
|
||||||
case 5:
|
case 5:
|
||||||
OPM_Write('p');
|
OPM_Write('p');
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
OPM_Write('k');
|
|
||||||
break;
|
|
||||||
case 7:
|
case 7:
|
||||||
OPM_Write('a');
|
OPM_Write('a');
|
||||||
break;
|
break;
|
||||||
|
|
@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var)
|
||||||
if (OPC_NofPtrs(typ) > 0) {
|
if (OPC_NofPtrs(typ) > 0) {
|
||||||
if (!OPC_GlbPtrs) {
|
if (!OPC_GlbPtrs) {
|
||||||
OPC_GlbPtrs = 1;
|
OPC_GlbPtrs = 1;
|
||||||
OPM_WriteString((CHAR*)"static ", 8);
|
OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39);
|
||||||
if (OPC_ansi) {
|
|
||||||
OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPM_Write(0x09);
|
|
||||||
OPM_WriteString((CHAR*)"void (*P)();", 13);
|
|
||||||
}
|
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
OPC_BegBlk();
|
OPC_BegBlk();
|
||||||
}
|
}
|
||||||
|
|
@ -1451,17 +1411,9 @@ void OPC_EnterBody (void)
|
||||||
{
|
{
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
OPM_WriteString((CHAR*)"export ", 8);
|
OPM_WriteString((CHAR*)"export ", 8);
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
if (OPC_ansi) {
|
OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32);
|
||||||
OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32);
|
OPM_WriteLn();
|
||||||
OPM_WriteLn();
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"main(argc, argv)", 17);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPM_Write(0x09);
|
|
||||||
OPM_WriteString((CHAR*)"int argc; char **argv;", 23);
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"void *", 7);
|
OPM_WriteString((CHAR*)"void *", 7);
|
||||||
OPM_WriteString(OPM_modName, 32);
|
OPM_WriteString(OPM_modName, 32);
|
||||||
|
|
@ -1470,20 +1422,20 @@ void OPC_EnterBody (void)
|
||||||
}
|
}
|
||||||
OPC_BegBlk();
|
OPC_BegBlk();
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19);
|
OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__DEFMOD", 9);
|
OPM_WriteString((CHAR*)"__DEFMOD", 9);
|
||||||
}
|
}
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
if ((OPC_mainprog && 0)) {
|
if ((__IN(10, OPM_opt, 32) && 0)) {
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94);
|
OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94);
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
}
|
}
|
||||||
OPC_InitImports(OPT_topScope->right);
|
OPC_InitImports(OPT_topScope->right);
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__REGMAIN(\"", 12);
|
OPM_WriteString((CHAR*)"__REGMAIN(\"", 12);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__REGMOD(\"", 11);
|
OPM_WriteString((CHAR*)"__REGMOD(\"", 11);
|
||||||
|
|
@ -1503,7 +1455,7 @@ void OPC_EnterBody (void)
|
||||||
void OPC_ExitBody (void)
|
void OPC_ExitBody (void)
|
||||||
{
|
{
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__FINI;", 8);
|
OPM_WriteString((CHAR*)"__FINI;", 8);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__ENDMOD;", 10);
|
OPM_WriteString((CHAR*)"__ENDMOD;", 10);
|
||||||
|
|
@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc)
|
||||||
}
|
}
|
||||||
var = var->link;
|
var = var->link;
|
||||||
}
|
}
|
||||||
if (!OPC_ansi) {
|
|
||||||
var = proc->link;
|
|
||||||
while (var != NIL) {
|
|
||||||
if ((var->typ->form == 5 && var->mode == 1)) {
|
|
||||||
OPC_BegStat();
|
|
||||||
OPC_Ident(var->typ->strobj);
|
|
||||||
OPM_Write(' ');
|
|
||||||
OPC_Ident(var);
|
|
||||||
OPM_WriteString((CHAR*)" = _", 5);
|
|
||||||
OPC_Ident(var);
|
|
||||||
OPC_EndStat();
|
|
||||||
}
|
|
||||||
var = var->link;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var = proc->link;
|
var = proc->link;
|
||||||
while (var != NIL) {
|
while (var != NIL) {
|
||||||
if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) {
|
if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) {
|
||||||
|
|
@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
||||||
array = array->BaseTyp;
|
array = array->BaseTyp;
|
||||||
dim -= 1;
|
dim -= 1;
|
||||||
}
|
}
|
||||||
if (OPC_ansi) {
|
OPM_WriteInt(array->n);
|
||||||
OPM_WriteInt(array->n);
|
|
||||||
} else {
|
|
||||||
OPC_IntLiteral(array->n, OPM_AddressSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF;
|
||||||
static Files_Rider OPM_R[3];
|
static Files_Rider OPM_R[3];
|
||||||
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
||||||
static int16 OPM_S;
|
static int16 OPM_S;
|
||||||
export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
|
|
||||||
static CHAR OPM_OBERON[1024];
|
static CHAR OPM_OBERON[1024];
|
||||||
static CHAR OPM_MODULES[1024];
|
static CHAR OPM_MODULES[1024];
|
||||||
|
|
||||||
|
|
@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n)
|
||||||
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
{
|
{
|
||||||
int16 i;
|
int16 i;
|
||||||
|
__DUP(s, s__len, CHAR);
|
||||||
i = 1;
|
i = 1;
|
||||||
while (s[__X(i, s__len)] != 0x00) {
|
while (s[__X(i, s__len)] != 0x00) {
|
||||||
switch (s[__X(i, s__len)]) {
|
switch (s[__X(i, s__len)]) {
|
||||||
case 'a':
|
|
||||||
*opt = *opt ^ 0x80;
|
|
||||||
break;
|
|
||||||
case 'c':
|
|
||||||
*opt = *opt ^ 0x4000;
|
|
||||||
break;
|
|
||||||
case 'e':
|
|
||||||
*opt = *opt ^ 0x0200;
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
*opt = *opt ^ 0x010000;
|
|
||||||
break;
|
|
||||||
case 'k':
|
|
||||||
*opt = *opt ^ 0x40;
|
|
||||||
break;
|
|
||||||
case 'm':
|
|
||||||
*opt = *opt ^ 0x0400;
|
|
||||||
break;
|
|
||||||
case 'p':
|
case 'p':
|
||||||
*opt = *opt ^ 0x20;
|
*opt = *opt ^ 0x20;
|
||||||
break;
|
break;
|
||||||
|
case 'a':
|
||||||
|
*opt = *opt ^ 0x80;
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
*opt = *opt ^ 0x04;
|
*opt = *opt ^ 0x04;
|
||||||
break;
|
break;
|
||||||
case 's':
|
|
||||||
*opt = *opt ^ 0x10;
|
|
||||||
break;
|
|
||||||
case 't':
|
case 't':
|
||||||
*opt = *opt ^ 0x08;
|
*opt = *opt ^ 0x08;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
*opt = *opt ^ 0x01;
|
*opt = *opt ^ 0x01;
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
*opt = *opt ^ 0x0200;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
*opt = *opt ^ 0x10;
|
||||||
|
break;
|
||||||
|
case 'F':
|
||||||
|
*opt = *opt ^ 0x020000;
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
*opt = *opt ^ 0x0400;
|
||||||
|
break;
|
||||||
|
case 'M':
|
||||||
|
*opt = *opt ^ 0x8000;
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
*opt = *opt ^ 0x2000;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
*opt = *opt ^ 0x4000;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
*opt = *opt ^ 0x010000;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
*opt = *opt ^ 0x040000;
|
||||||
|
break;
|
||||||
|
case 'O':
|
||||||
|
if (i + 1 >= Strings_Length(s, s__len)) {
|
||||||
|
OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51);
|
||||||
|
OPM_LogWLn();
|
||||||
|
} else {
|
||||||
|
switch (s[__X(i + 1, s__len)]) {
|
||||||
|
case '2':
|
||||||
|
OPM_ShortintSize = 1;
|
||||||
|
OPM_IntegerSize = 2;
|
||||||
|
OPM_LongintSize = 4;
|
||||||
|
OPM_SetSize = 4;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
OPM_ShortintSize = 1;
|
||||||
|
OPM_IntegerSize = 4;
|
||||||
|
OPM_LongintSize = 8;
|
||||||
|
OPM_SetSize = 8;
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
OPM_ShortintSize = 2;
|
||||||
|
OPM_IntegerSize = 4;
|
||||||
|
OPM_LongintSize = 8;
|
||||||
|
OPM_SetSize = 8;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48);
|
||||||
|
OPM_LogWLn();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'A':
|
||||||
|
if (i + 2 >= Strings_Length(s, s__len)) {
|
||||||
|
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
|
||||||
|
OPM_LogWLn();
|
||||||
|
} else {
|
||||||
|
OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48;
|
||||||
|
OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48;
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
}
|
}
|
||||||
Files_SetSearchPath((CHAR*)"", 1);
|
Files_SetSearchPath((CHAR*)"", 1);
|
||||||
break;
|
break;
|
||||||
case 'F':
|
|
||||||
*opt = *opt ^ 0x020000;
|
|
||||||
break;
|
|
||||||
case 'M':
|
|
||||||
*opt = *opt ^ 0x8000;
|
|
||||||
break;
|
|
||||||
case 'S':
|
|
||||||
*opt = *opt ^ 0x2000;
|
|
||||||
break;
|
|
||||||
case 'V':
|
|
||||||
*opt = *opt ^ 0x040000;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
OPM_LogWStr((CHAR*)" warning: option ", 19);
|
OPM_LogWStr((CHAR*)" warning: option ", 19);
|
||||||
OPM_LogW('-');
|
OPM_LogW('-');
|
||||||
|
|
@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
__DEL(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN OPM_OpenPar (void)
|
BOOLEAN OPM_OpenPar (void)
|
||||||
|
|
@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void)
|
||||||
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
|
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" m - generate code for main module", 36);
|
OPM_LogWStr((CHAR*)" Run time safety", 18);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63);
|
OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" s - generate new symbol file", 31);
|
OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43);
|
OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" r - check value ranges", 25);
|
OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" x - turn off array indices check", 35);
|
OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80);
|
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48);
|
OPM_LogWStr((CHAR*)" Symbol file management", 25);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101);
|
OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67);
|
OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" c - don't call linker", 24);
|
OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" f - don't use color output", 29);
|
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57);
|
OPM_LogWStr((CHAR*)" C compiler and linker control", 32);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" V - verbose output", 21);
|
OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -c Don't link.", 21);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Miscellaneous", 16);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Size model for elementary types", 34);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
|
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
|
||||||
|
|
@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void)
|
||||||
OPM_S = 1;
|
OPM_S = 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
OPM_glbopt = 0xe9;
|
OPM_glbopt = 0xa9;
|
||||||
while (s[0] == '-') {
|
while (s[0] == '-') {
|
||||||
OPM_ScanOptions((void*)s, 256, &OPM_glbopt);
|
OPM_ScanOptions(s, 256, &OPM_glbopt);
|
||||||
OPM_S += 1;
|
OPM_S += 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
|
|
@ -308,20 +377,14 @@ void OPM_InitOptions (void)
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
while (s[0] == '-') {
|
while (s[0] == '-') {
|
||||||
OPM_ScanOptions((void*)s, 256, &OPM_opt);
|
OPM_ScanOptions(s, 256, &OPM_opt);
|
||||||
OPM_S += 1;
|
OPM_S += 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
}
|
}
|
||||||
OPM_dontAsm = __IN(13, OPM_opt, 32);
|
if (__IN(15, OPM_opt, 32)) {
|
||||||
OPM_dontLink = __IN(14, OPM_opt, 32);
|
|
||||||
OPM_mainProg = __IN(10, OPM_opt, 32);
|
|
||||||
OPM_mainLinkStat = __IN(15, OPM_opt, 32);
|
|
||||||
OPM_notColorOutput = __IN(16, OPM_opt, 32);
|
|
||||||
OPM_forceNewSym = __IN(17, OPM_opt, 32);
|
|
||||||
OPM_Verbose = __IN(18, OPM_opt, 32);
|
|
||||||
if (OPM_mainLinkStat) {
|
|
||||||
OPM_glbopt |= __SETOF(10,32);
|
OPM_glbopt |= __SETOF(10,32);
|
||||||
|
OPM_opt |= __SETOF(10,32);
|
||||||
}
|
}
|
||||||
OPM_GetProperties();
|
OPM_GetProperties();
|
||||||
}
|
}
|
||||||
|
|
@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n)
|
||||||
int16 i;
|
int16 i;
|
||||||
CHAR buf[1024];
|
CHAR buf[1024];
|
||||||
if (n >= 0) {
|
if (n >= 0) {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"31m", 4);
|
vt100_SetAttr((CHAR*)"31m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" err ", 7);
|
OPM_LogWStr((CHAR*)" err ", 7);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"35m", 4);
|
vt100_SetAttr((CHAR*)"35m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||||
n = -n;
|
n = -n;
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos)
|
||||||
OPM_LogW(' ');
|
OPM_LogW(' ');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogW('^');
|
OPM_LogW('^');
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
Files_Close(f);
|
Files_Close(f);
|
||||||
|
|
@ -682,7 +745,7 @@ static void OPM_GetProperties (void)
|
||||||
OPM_MinLReal = -OPM_MaxLReal;
|
OPM_MinLReal = -OPM_MaxLReal;
|
||||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||||
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
OPM_VerboseListSizes();
|
OPM_VerboseListSizes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
|
||||||
import CHAR OPM_modName[32];
|
import CHAR OPM_modName[32];
|
||||||
import CHAR OPM_objname[64];
|
import CHAR OPM_objname[64];
|
||||||
import SET OPM_opt, OPM_glbopt;
|
import SET OPM_opt, OPM_glbopt;
|
||||||
import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
|
|
||||||
|
|
||||||
|
|
||||||
import void OPM_CloseFiles (void);
|
import void OPM_CloseFiles (void);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
|
||||||
}
|
}
|
||||||
OPT_OutObj(OPT_topScope->right);
|
OPT_OutObj(OPT_topScope->right);
|
||||||
*ext = (OPT_sfpresent && OPT_symExtended);
|
*ext = (OPT_sfpresent && OPT_symExtended);
|
||||||
*new = !OPT_sfpresent || OPT_symNew;
|
*new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32);
|
||||||
if (OPM_forceNewSym) {
|
|
||||||
*new = 1;
|
|
||||||
}
|
|
||||||
if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) {
|
if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) {
|
||||||
*new = 1;
|
*new = 1;
|
||||||
if (!OPT_extsf) {
|
if (!OPT_extsf) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -16,7 +16,6 @@ typedef
|
||||||
} OPV_ExitInfo;
|
} OPV_ExitInfo;
|
||||||
|
|
||||||
|
|
||||||
static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi;
|
|
||||||
static int16 OPV_stamp;
|
static int16 OPV_stamp;
|
||||||
static int32 OPV_recno;
|
static int32 OPV_recno;
|
||||||
static OPV_ExitInfo OPV_exit;
|
static OPV_ExitInfo OPV_exit;
|
||||||
|
|
@ -130,10 +129,6 @@ void OPV_Init (void)
|
||||||
OPV_stamp = 0;
|
OPV_stamp = 0;
|
||||||
OPV_recno = 0;
|
OPV_recno = 0;
|
||||||
OPV_nofExitLabels = 0;
|
OPV_nofExitLabels = 0;
|
||||||
OPV_assert = __IN(7, OPM_opt, 32);
|
|
||||||
OPV_inxchk = __IN(0, OPM_opt, 32);
|
|
||||||
OPV_mainprog = __IN(10, OPM_opt, 32);
|
|
||||||
OPV_ansi = __IN(6, OPM_opt, 32);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPV_GetTProcNum (OPT_Object obj)
|
static void OPV_GetTProcNum (OPT_Object obj)
|
||||||
|
|
@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n)
|
||||||
|
|
||||||
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
|
static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim)
|
||||||
{
|
{
|
||||||
if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) {
|
if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) {
|
||||||
OPV_expr(n->right, prec);
|
OPV_expr(n->right, prec);
|
||||||
} else {
|
} else {
|
||||||
if (OPV_SideEffects(n->right)) {
|
if (OPV_SideEffects(n->right)) {
|
||||||
|
|
@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec)
|
||||||
|
|
||||||
static void OPV_ParIntLiteral (int64 n, int32 size)
|
static void OPV_ParIntLiteral (int64 n, int32 size)
|
||||||
{
|
{
|
||||||
if (OPV_ansi) {
|
OPM_WriteInt(n);
|
||||||
OPM_WriteInt(n);
|
|
||||||
} else {
|
|
||||||
OPC_IntLiteral(n, size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
|
|
@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
}
|
}
|
||||||
if (!__IN(n->typ->comp, 0x0c, 32)) {
|
if (!__IN(n->typ->comp, 0x0c, 32)) {
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
if ((OPV_ansi && typ != n->typ)) {
|
if (typ != n->typ) {
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
OPM_Write('&');
|
OPM_Write('&');
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (OPV_ansi) {
|
} else {
|
||||||
if ((__IN(comp, 0x0c, 32) && n->class == 7)) {
|
if ((__IN(comp, 0x0c, 32) && n->class == 7)) {
|
||||||
OPM_WriteString((CHAR*)"(CHAR*)", 8);
|
OPM_WriteString((CHAR*)"(CHAR*)", 8);
|
||||||
} else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) {
|
} else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) {
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ((__IN(form, 0x60, 32) && n->typ->form == 4)) {
|
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
|
||||||
prec = 9;
|
|
||||||
} else if (form == 4) {
|
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (OPV_ansi) {
|
} else {
|
||||||
if ((((mode == 2 && typ != n->typ)) && prec == -1)) {
|
if ((((mode == 2 && typ != n->typ)) && prec == -1)) {
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
|
|
@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
|
||||||
case 20:
|
case 20:
|
||||||
if (n->subcl != 32) {
|
if (n->subcl != 32) {
|
||||||
OPV_IfStat(n, 0, outerProc);
|
OPV_IfStat(n, 0, outerProc);
|
||||||
} else if (OPV_assert) {
|
} else if (__IN(7, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__ASSERT(", 10);
|
OPM_WriteString((CHAR*)"__ASSERT(", 10);
|
||||||
OPV_expr(n->left->left->left, -1);
|
OPV_expr(n->left->left->left, -1);
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
|
|
@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
|
||||||
break;
|
break;
|
||||||
case 26:
|
case 26:
|
||||||
if (OPM_level == 0) {
|
if (OPM_level == 0) {
|
||||||
if (OPV_mainprog) {
|
if (__IN(10, OPM_opt, 32)) {
|
||||||
OPM_WriteString((CHAR*)"__FINI", 7);
|
OPM_WriteString((CHAR*)"__FINI", 7);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__ENDMOD", 9);
|
OPM_WriteString((CHAR*)"__ENDMOD", 9);
|
||||||
|
|
@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc)
|
||||||
|
|
||||||
void OPV_Module (OPT_Node prog)
|
void OPV_Module (OPT_Node prog)
|
||||||
{
|
{
|
||||||
if (!OPV_mainprog) {
|
if (!__IN(10, OPM_opt, 32)) {
|
||||||
OPC_GenHdr(prog->right);
|
OPC_GenHdr(prog->right);
|
||||||
OPC_GenHdrIncludes();
|
OPC_GenHdrIncludes();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPV__h
|
#ifndef OPV__h
|
||||||
#define OPV__h
|
#define OPV__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Platform__h
|
#ifndef Platform__h
|
||||||
#define Platform__h
|
#define Platform__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Reals__h
|
#ifndef Reals__h
|
||||||
#define Reals__h
|
#define Reals__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Strings__h
|
#ifndef Strings__h
|
||||||
#define Strings__h
|
#define Strings__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Texts__h
|
#ifndef Texts__h
|
||||||
#define Texts__h
|
#define Texts__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done)
|
||||||
OPC_Init();
|
OPC_Init();
|
||||||
OPV_Module(p);
|
OPV_Module(p);
|
||||||
if (OPM_noerr) {
|
if (OPM_noerr) {
|
||||||
if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
||||||
OPM_DeleteNewSym();
|
OPM_DeleteNewSym();
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" Main program.", 16);
|
OPM_LogWStr((CHAR*)" Main program.", 16);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (new) {
|
if (new) {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 32)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
OPM_RegisterNewSym();
|
OPM_RegisterNewSym();
|
||||||
|
|
@ -111,17 +111,17 @@ void Vishap_Translate (void)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
Platform_Exit(1);
|
Platform_Exit(1);
|
||||||
}
|
}
|
||||||
if (!OPM_dontAsm) {
|
if (!__IN(13, OPM_opt, 32)) {
|
||||||
if (OPM_dontLink) {
|
if (__IN(14, OPM_opt, 32)) {
|
||||||
extTools_Assemble(OPM_modName, 32);
|
extTools_Assemble(OPM_modName, 32);
|
||||||
} else {
|
} else {
|
||||||
if (!(OPM_mainProg || OPM_mainLinkStat)) {
|
if (!__IN(10, OPM_opt, 32)) {
|
||||||
extTools_Assemble(OPM_modName, 32);
|
extTools_Assemble(OPM_modName, 32);
|
||||||
Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048);
|
Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048);
|
||||||
Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048);
|
Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048);
|
||||||
Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048);
|
Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048);
|
||||||
} else {
|
} else {
|
||||||
extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048);
|
extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef errors__h
|
#ifndef errors__h
|
||||||
#define errors__h
|
#define errors__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
|
||||||
int16 r, status, exitcode;
|
int16 r, status, exitcode;
|
||||||
__DUP(title, title__len, CHAR);
|
__DUP(title, title__len, CHAR);
|
||||||
__DUP(cmd, cmd__len, CHAR);
|
__DUP(cmd, cmd__len, CHAR);
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 32)) {
|
||||||
Console_String(title, title__len);
|
Console_String(title, title__len);
|
||||||
Console_String(cmd, cmd__len);
|
Console_String(cmd, cmd__len);
|
||||||
Console_Ln();
|
Console_Ln();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef extTools__h
|
#ifndef extTools__h
|
||||||
#define extTools__h
|
#define extTools__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int16
|
#define INTEGER int16
|
||||||
#define LONGINT int32
|
#define LONGINT int32
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef vt100__h
|
#ifndef vt100__h
|
||||||
#define vt100__h
|
#define vt100__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Console__h
|
#ifndef Console__h
|
||||||
#define Console__h
|
#define Console__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPT_Struct y = NIL;
|
OPT_Struct y = NIL;
|
||||||
int32 f, g;
|
int32 f, g;
|
||||||
OPT_Struct p = NIL, q = NIL;
|
OPT_Struct p = NIL, q = NIL;
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 64)) {
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
|
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
|
@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
y = ynode->typ;
|
y = ynode->typ;
|
||||||
f = x->form;
|
f = x->form;
|
||||||
g = y->form;
|
g = y->form;
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 64)) {
|
||||||
OPM_LogWStr((CHAR*)"y.form = ", 10);
|
OPM_LogWStr((CHAR*)"y.form = ", 10);
|
||||||
OPM_LogWNum(y->form, 0);
|
OPM_LogWNum(y->form, 0);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
|
|
||||||
static int32 OPC_indentLevel;
|
static int32 OPC_indentLevel;
|
||||||
static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi;
|
|
||||||
static int8 OPC_hashtab[105];
|
static int8 OPC_hashtab[105];
|
||||||
static CHAR OPC_keytab[50][9];
|
static CHAR OPC_keytab[50][9];
|
||||||
static BOOLEAN OPC_GlbPtrs;
|
static BOOLEAN OPC_GlbPtrs;
|
||||||
|
|
@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj);
|
||||||
void OPC_Init (void)
|
void OPC_Init (void)
|
||||||
{
|
{
|
||||||
OPC_indentLevel = 0;
|
OPC_indentLevel = 0;
|
||||||
OPC_ptrinit = __IN(5, OPM_opt, 64);
|
__MOVE("__init(void)", OPC_BodyNameExt, 13);
|
||||||
OPC_mainprog = OPM_mainProg || OPM_mainLinkStat;
|
|
||||||
OPC_ansi = __IN(6, OPM_opt, 64);
|
|
||||||
if (OPC_ansi) {
|
|
||||||
__MOVE("__init(void)", OPC_BodyNameExt, 13);
|
|
||||||
} else {
|
|
||||||
__MOVE("__init()", OPC_BodyNameExt, 9);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPC_Indent (int32 count)
|
void OPC_Indent (int32 count)
|
||||||
|
|
@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef)
|
||||||
openClause = 0;
|
openClause = 0;
|
||||||
}
|
}
|
||||||
if (form == 12) {
|
if (form == 12) {
|
||||||
if (OPC_ansi) {
|
OPM_Write(')');
|
||||||
OPM_Write(')');
|
OPC_AnsiParamList(typ->link, 0);
|
||||||
OPC_AnsiParamList(typ->link, 0);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)")()", 4);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} else if (comp == 2) {
|
} else if (comp == 2) {
|
||||||
OPM_Write('[');
|
OPM_Write('[');
|
||||||
|
|
@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj)
|
||||||
if (obj->typ != OPT_notyp) {
|
if (obj->typ != OPT_notyp) {
|
||||||
OPC_DefineType(obj->typ);
|
OPC_DefineType(obj->typ);
|
||||||
}
|
}
|
||||||
if (OPC_ansi) {
|
par = obj->link;
|
||||||
par = obj->link;
|
while (par != NIL) {
|
||||||
while (par != NIL) {
|
OPC_DefineType(par->typ);
|
||||||
OPC_DefineType(par->typ);
|
par = par->link;
|
||||||
par = par->link;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty)
|
||||||
OPC_Ident(obj->typ->strobj);
|
OPC_Ident(obj->typ->strobj);
|
||||||
}
|
}
|
||||||
OPM_WriteString((CHAR*)"(*)", 4);
|
OPM_WriteString((CHAR*)"(*)", 4);
|
||||||
if (OPC_ansi) {
|
OPC_AnsiParamList(obj->link, 0);
|
||||||
OPC_AnsiParamList(obj->link, 0);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"()", 3);
|
|
||||||
}
|
|
||||||
OPM_WriteString((CHAR*)", ", 3);
|
OPM_WriteString((CHAR*)", ", 3);
|
||||||
OPC_DeclareParams(obj->link, 1);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis)
|
||||||
OPC_Ident(obj);
|
OPC_Ident(obj);
|
||||||
OPM_WriteString((CHAR*)"__typ", 6);
|
OPM_WriteString((CHAR*)"__typ", 6);
|
||||||
base = NIL;
|
base = NIL;
|
||||||
} else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) {
|
} else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) {
|
||||||
OPM_WriteString((CHAR*)" = NIL", 7);
|
OPM_WriteString((CHAR*)" = NIL", 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define)
|
||||||
OPM_Write(' ');
|
OPM_Write(' ');
|
||||||
OPC_Ident(proc);
|
OPC_Ident(proc);
|
||||||
OPM_Write(' ');
|
OPM_Write(' ');
|
||||||
if (OPC_ansi) {
|
OPC_AnsiParamList(proc->link, 1);
|
||||||
OPC_AnsiParamList(proc->link, 1);
|
if (!define) {
|
||||||
if (!define) {
|
OPM_Write(';');
|
||||||
OPM_Write(';');
|
|
||||||
}
|
|
||||||
OPM_WriteLn();
|
|
||||||
} else if (define) {
|
|
||||||
OPC_DeclareParams(proc->link, 0);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPC_Indent(1);
|
|
||||||
OPC_IdentList(proc->link, 2);
|
|
||||||
OPC_Indent(-1);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"();", 4);
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
}
|
||||||
|
OPM_WriteLn();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
|
static void OPC_ProcPredefs (OPT_Object obj, int8 vis)
|
||||||
|
|
@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void)
|
||||||
case 5:
|
case 5:
|
||||||
OPM_Write('p');
|
OPM_Write('p');
|
||||||
break;
|
break;
|
||||||
case 6:
|
|
||||||
OPM_Write('k');
|
|
||||||
break;
|
|
||||||
case 7:
|
case 7:
|
||||||
OPM_Write('a');
|
OPM_Write('a');
|
||||||
break;
|
break;
|
||||||
|
|
@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var)
|
||||||
if (OPC_NofPtrs(typ) > 0) {
|
if (OPC_NofPtrs(typ) > 0) {
|
||||||
if (!OPC_GlbPtrs) {
|
if (!OPC_GlbPtrs) {
|
||||||
OPC_GlbPtrs = 1;
|
OPC_GlbPtrs = 1;
|
||||||
OPM_WriteString((CHAR*)"static ", 8);
|
OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39);
|
||||||
if (OPC_ansi) {
|
|
||||||
OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32);
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPM_Write(0x09);
|
|
||||||
OPM_WriteString((CHAR*)"void (*P)();", 13);
|
|
||||||
}
|
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
OPC_BegBlk();
|
OPC_BegBlk();
|
||||||
}
|
}
|
||||||
|
|
@ -1451,17 +1411,9 @@ void OPC_EnterBody (void)
|
||||||
{
|
{
|
||||||
OPM_WriteLn();
|
OPM_WriteLn();
|
||||||
OPM_WriteString((CHAR*)"export ", 8);
|
OPM_WriteString((CHAR*)"export ", 8);
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 64)) {
|
||||||
if (OPC_ansi) {
|
OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32);
|
||||||
OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32);
|
OPM_WriteLn();
|
||||||
OPM_WriteLn();
|
|
||||||
} else {
|
|
||||||
OPM_WriteString((CHAR*)"main(argc, argv)", 17);
|
|
||||||
OPM_WriteLn();
|
|
||||||
OPM_Write(0x09);
|
|
||||||
OPM_WriteString((CHAR*)"int argc; char **argv;", 23);
|
|
||||||
OPM_WriteLn();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"void *", 7);
|
OPM_WriteString((CHAR*)"void *", 7);
|
||||||
OPM_WriteString(OPM_modName, 32);
|
OPM_WriteString(OPM_modName, 32);
|
||||||
|
|
@ -1470,20 +1422,20 @@ void OPC_EnterBody (void)
|
||||||
}
|
}
|
||||||
OPC_BegBlk();
|
OPC_BegBlk();
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 64)) {
|
||||||
OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19);
|
OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__DEFMOD", 9);
|
OPM_WriteString((CHAR*)"__DEFMOD", 9);
|
||||||
}
|
}
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
if ((OPC_mainprog && 0)) {
|
if ((__IN(10, OPM_opt, 64) && 0)) {
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94);
|
OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94);
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
}
|
}
|
||||||
OPC_InitImports(OPT_topScope->right);
|
OPC_InitImports(OPT_topScope->right);
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 64)) {
|
||||||
OPM_WriteString((CHAR*)"__REGMAIN(\"", 12);
|
OPM_WriteString((CHAR*)"__REGMAIN(\"", 12);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__REGMOD(\"", 11);
|
OPM_WriteString((CHAR*)"__REGMOD(\"", 11);
|
||||||
|
|
@ -1503,7 +1455,7 @@ void OPC_EnterBody (void)
|
||||||
void OPC_ExitBody (void)
|
void OPC_ExitBody (void)
|
||||||
{
|
{
|
||||||
OPC_BegStat();
|
OPC_BegStat();
|
||||||
if (OPC_mainprog) {
|
if (__IN(10, OPM_opt, 64)) {
|
||||||
OPM_WriteString((CHAR*)"__FINI;", 8);
|
OPM_WriteString((CHAR*)"__FINI;", 8);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)"__ENDMOD;", 10);
|
OPM_WriteString((CHAR*)"__ENDMOD;", 10);
|
||||||
|
|
@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc)
|
||||||
}
|
}
|
||||||
var = var->link;
|
var = var->link;
|
||||||
}
|
}
|
||||||
if (!OPC_ansi) {
|
|
||||||
var = proc->link;
|
|
||||||
while (var != NIL) {
|
|
||||||
if ((var->typ->form == 5 && var->mode == 1)) {
|
|
||||||
OPC_BegStat();
|
|
||||||
OPC_Ident(var->typ->strobj);
|
|
||||||
OPM_Write(' ');
|
|
||||||
OPC_Ident(var);
|
|
||||||
OPM_WriteString((CHAR*)" = _", 5);
|
|
||||||
OPC_Ident(var);
|
|
||||||
OPC_EndStat();
|
|
||||||
}
|
|
||||||
var = var->link;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var = proc->link;
|
var = proc->link;
|
||||||
while (var != NIL) {
|
while (var != NIL) {
|
||||||
if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) {
|
if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) {
|
||||||
|
|
@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
||||||
array = array->BaseTyp;
|
array = array->BaseTyp;
|
||||||
dim -= 1;
|
dim -= 1;
|
||||||
}
|
}
|
||||||
if (OPC_ansi) {
|
OPM_WriteInt(array->n);
|
||||||
OPM_WriteInt(array->n);
|
|
||||||
} else {
|
|
||||||
OPC_IntLiteral(array->n, OPM_AddressSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
@ -36,7 +36,6 @@ static Files_Rider OPM_oldSF, OPM_newSF;
|
||||||
static Files_Rider OPM_R[3];
|
static Files_Rider OPM_R[3];
|
||||||
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
||||||
static int32 OPM_S;
|
static int32 OPM_S;
|
||||||
export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
|
|
||||||
static CHAR OPM_OBERON[1024];
|
static CHAR OPM_OBERON[1024];
|
||||||
static CHAR OPM_MODULES[1024];
|
static CHAR OPM_MODULES[1024];
|
||||||
|
|
||||||
|
|
@ -137,42 +136,94 @@ int32 OPM_Integer (int64 n)
|
||||||
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
{
|
{
|
||||||
int32 i;
|
int32 i;
|
||||||
|
__DUP(s, s__len, CHAR);
|
||||||
i = 1;
|
i = 1;
|
||||||
while (s[__X(i, s__len)] != 0x00) {
|
while (s[__X(i, s__len)] != 0x00) {
|
||||||
switch (s[__X(i, s__len)]) {
|
switch (s[__X(i, s__len)]) {
|
||||||
case 'a':
|
|
||||||
*opt = *opt ^ 0x80;
|
|
||||||
break;
|
|
||||||
case 'c':
|
|
||||||
*opt = *opt ^ 0x4000;
|
|
||||||
break;
|
|
||||||
case 'e':
|
|
||||||
*opt = *opt ^ 0x0200;
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
*opt = *opt ^ 0x010000;
|
|
||||||
break;
|
|
||||||
case 'k':
|
|
||||||
*opt = *opt ^ 0x40;
|
|
||||||
break;
|
|
||||||
case 'm':
|
|
||||||
*opt = *opt ^ 0x0400;
|
|
||||||
break;
|
|
||||||
case 'p':
|
case 'p':
|
||||||
*opt = *opt ^ 0x20;
|
*opt = *opt ^ 0x20;
|
||||||
break;
|
break;
|
||||||
|
case 'a':
|
||||||
|
*opt = *opt ^ 0x80;
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
*opt = *opt ^ 0x04;
|
*opt = *opt ^ 0x04;
|
||||||
break;
|
break;
|
||||||
case 's':
|
|
||||||
*opt = *opt ^ 0x10;
|
|
||||||
break;
|
|
||||||
case 't':
|
case 't':
|
||||||
*opt = *opt ^ 0x08;
|
*opt = *opt ^ 0x08;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
*opt = *opt ^ 0x01;
|
*opt = *opt ^ 0x01;
|
||||||
break;
|
break;
|
||||||
|
case 'e':
|
||||||
|
*opt = *opt ^ 0x0200;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
*opt = *opt ^ 0x10;
|
||||||
|
break;
|
||||||
|
case 'F':
|
||||||
|
*opt = *opt ^ 0x020000;
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
*opt = *opt ^ 0x0400;
|
||||||
|
break;
|
||||||
|
case 'M':
|
||||||
|
*opt = *opt ^ 0x8000;
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
*opt = *opt ^ 0x2000;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
*opt = *opt ^ 0x4000;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
*opt = *opt ^ 0x010000;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
*opt = *opt ^ 0x040000;
|
||||||
|
break;
|
||||||
|
case 'O':
|
||||||
|
if (i + 1 >= Strings_Length(s, s__len)) {
|
||||||
|
OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51);
|
||||||
|
OPM_LogWLn();
|
||||||
|
} else {
|
||||||
|
switch (s[__X(i + 1, s__len)]) {
|
||||||
|
case '2':
|
||||||
|
OPM_ShortintSize = 1;
|
||||||
|
OPM_IntegerSize = 2;
|
||||||
|
OPM_LongintSize = 4;
|
||||||
|
OPM_SetSize = 4;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
OPM_ShortintSize = 1;
|
||||||
|
OPM_IntegerSize = 4;
|
||||||
|
OPM_LongintSize = 8;
|
||||||
|
OPM_SetSize = 8;
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
OPM_ShortintSize = 2;
|
||||||
|
OPM_IntegerSize = 4;
|
||||||
|
OPM_LongintSize = 8;
|
||||||
|
OPM_SetSize = 8;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48);
|
||||||
|
OPM_LogWLn();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'A':
|
||||||
|
if (i + 2 >= Strings_Length(s, s__len)) {
|
||||||
|
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
|
||||||
|
OPM_LogWLn();
|
||||||
|
} else {
|
||||||
|
OPM_AddressSize = s[__X(i + 1, s__len)] - 48;
|
||||||
|
OPM_Alignment = s[__X(i + 2, s__len)] - 48;
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
i += 1;
|
||||||
|
|
@ -198,18 +249,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
}
|
}
|
||||||
Files_SetSearchPath((CHAR*)"", 1);
|
Files_SetSearchPath((CHAR*)"", 1);
|
||||||
break;
|
break;
|
||||||
case 'F':
|
|
||||||
*opt = *opt ^ 0x020000;
|
|
||||||
break;
|
|
||||||
case 'M':
|
|
||||||
*opt = *opt ^ 0x8000;
|
|
||||||
break;
|
|
||||||
case 'S':
|
|
||||||
*opt = *opt ^ 0x2000;
|
|
||||||
break;
|
|
||||||
case 'V':
|
|
||||||
*opt = *opt ^ 0x040000;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
OPM_LogWStr((CHAR*)" warning: option ", 19);
|
OPM_LogWStr((CHAR*)" warning: option ", 19);
|
||||||
OPM_LogW('-');
|
OPM_LogW('-');
|
||||||
|
|
@ -220,6 +259,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
}
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
__DEL(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN OPM_OpenPar (void)
|
BOOLEAN OPM_OpenPar (void)
|
||||||
|
|
@ -246,33 +286,62 @@ BOOLEAN OPM_OpenPar (void)
|
||||||
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
|
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" m - generate code for main module", 36);
|
OPM_LogWStr((CHAR*)" Run time safety", 18);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63);
|
OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" s - generate new symbol file", 31);
|
OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43);
|
OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" r - check value ranges", 25);
|
OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" x - turn off array indices check", 35);
|
OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80);
|
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48);
|
OPM_LogWStr((CHAR*)" Symbol file management", 25);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101);
|
OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67);
|
OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" c - don't call linker", 24);
|
OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" f - don't use color output", 29);
|
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57);
|
OPM_LogWStr((CHAR*)" C compiler and linker control", 32);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)" V - verbose output", 21);
|
OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -c Don't link.", 21);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Miscellaneous", 16);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Size model for elementary types", 34);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97);
|
||||||
|
OPM_LogWLn();
|
||||||
|
OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71);
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
|
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
|
||||||
|
|
@ -287,9 +356,9 @@ BOOLEAN OPM_OpenPar (void)
|
||||||
OPM_S = 1;
|
OPM_S = 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
OPM_glbopt = 0xe9;
|
OPM_glbopt = 0xa9;
|
||||||
while (s[0] == '-') {
|
while (s[0] == '-') {
|
||||||
OPM_ScanOptions((void*)s, 256, &OPM_glbopt);
|
OPM_ScanOptions(s, 256, &OPM_glbopt);
|
||||||
OPM_S += 1;
|
OPM_S += 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
|
|
@ -307,20 +376,14 @@ void OPM_InitOptions (void)
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
while (s[0] == '-') {
|
while (s[0] == '-') {
|
||||||
OPM_ScanOptions((void*)s, 256, &OPM_opt);
|
OPM_ScanOptions(s, 256, &OPM_opt);
|
||||||
OPM_S += 1;
|
OPM_S += 1;
|
||||||
s[0] = 0x00;
|
s[0] = 0x00;
|
||||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||||
}
|
}
|
||||||
OPM_dontAsm = __IN(13, OPM_opt, 64);
|
if (__IN(15, OPM_opt, 64)) {
|
||||||
OPM_dontLink = __IN(14, OPM_opt, 64);
|
|
||||||
OPM_mainProg = __IN(10, OPM_opt, 64);
|
|
||||||
OPM_mainLinkStat = __IN(15, OPM_opt, 64);
|
|
||||||
OPM_notColorOutput = __IN(16, OPM_opt, 64);
|
|
||||||
OPM_forceNewSym = __IN(17, OPM_opt, 64);
|
|
||||||
OPM_Verbose = __IN(18, OPM_opt, 64);
|
|
||||||
if (OPM_mainLinkStat) {
|
|
||||||
OPM_glbopt |= __SETOF(10,64);
|
OPM_glbopt |= __SETOF(10,64);
|
||||||
|
OPM_opt |= __SETOF(10,64);
|
||||||
}
|
}
|
||||||
OPM_GetProperties();
|
OPM_GetProperties();
|
||||||
}
|
}
|
||||||
|
|
@ -406,20 +469,20 @@ static void OPM_LogErrMsg (int32 n)
|
||||||
int32 i;
|
int32 i;
|
||||||
CHAR buf[1024];
|
CHAR buf[1024];
|
||||||
if (n >= 0) {
|
if (n >= 0) {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 64)) {
|
||||||
vt100_SetAttr((CHAR*)"31m", 4);
|
vt100_SetAttr((CHAR*)"31m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" err ", 7);
|
OPM_LogWStr((CHAR*)" err ", 7);
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 64)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 64)) {
|
||||||
vt100_SetAttr((CHAR*)"35m", 4);
|
vt100_SetAttr((CHAR*)"35m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||||
n = -n;
|
n = -n;
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 64)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -492,11 +555,11 @@ static void OPM_ShowLine (int64 pos)
|
||||||
OPM_LogW(' ');
|
OPM_LogW(' ');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
}
|
}
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 64)) {
|
||||||
vt100_SetAttr((CHAR*)"32m", 4);
|
vt100_SetAttr((CHAR*)"32m", 4);
|
||||||
}
|
}
|
||||||
OPM_LogW('^');
|
OPM_LogW('^');
|
||||||
if (!OPM_notColorOutput) {
|
if (!__IN(16, OPM_opt, 64)) {
|
||||||
vt100_SetAttr((CHAR*)"0m", 3);
|
vt100_SetAttr((CHAR*)"0m", 3);
|
||||||
}
|
}
|
||||||
Files_Close(f);
|
Files_Close(f);
|
||||||
|
|
@ -679,7 +742,7 @@ static void OPM_GetProperties (void)
|
||||||
OPM_MinLReal = -OPM_MaxLReal;
|
OPM_MinLReal = -OPM_MaxLReal;
|
||||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||||
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
||||||
if (OPM_Verbose) {
|
if (__IN(18, OPM_opt, 64)) {
|
||||||
OPM_VerboseListSizes();
|
OPM_VerboseListSizes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
@ -15,7 +15,6 @@ import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
|
||||||
import CHAR OPM_modName[32];
|
import CHAR OPM_modName[32];
|
||||||
import CHAR OPM_objname[64];
|
import CHAR OPM_objname[64];
|
||||||
import SET OPM_opt, OPM_glbopt;
|
import SET OPM_opt, OPM_glbopt;
|
||||||
import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose;
|
|
||||||
|
|
||||||
|
|
||||||
import void OPM_CloseFiles (void);
|
import void OPM_CloseFiles (void);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#define INTEGER int32
|
#define INTEGER int32
|
||||||
#define LONGINT int64
|
#define LONGINT int64
|
||||||
|
|
@ -1732,10 +1732,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
|
||||||
}
|
}
|
||||||
OPT_OutObj(OPT_topScope->right);
|
OPT_OutObj(OPT_topScope->right);
|
||||||
*ext = (OPT_sfpresent && OPT_symExtended);
|
*ext = (OPT_sfpresent && OPT_symExtended);
|
||||||
*new = !OPT_sfpresent || OPT_symNew;
|
*new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64);
|
||||||
if (OPM_forceNewSym) {
|
|
||||||
*new = 1;
|
|
||||||
}
|
|
||||||
if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) {
|
if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) {
|
||||||
*new = 1;
|
*new = 1;
|
||||||
if (!OPT_extsf) {
|
if (!OPT_extsf) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue