mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 02:52:24 +00:00
SET32 and SET64 compatibility and bootstrap update.
This commit is contained in:
parent
08bf8d2fc3
commit
6dedf34785
202 changed files with 1650 additions and 1272 deletions
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void)
|
|||
OPT_Struct adrinttyp = NIL;
|
||||
OPT_sysptrtyp->size = OPM_AddressSize;
|
||||
OPT_adrtyp->size = OPM_AddressSize;
|
||||
OPT_settyp->size = OPM_SetSize;
|
||||
adrinttyp = OPT_IntType(OPM_AddressSize);
|
||||
OPT_adrtyp->strobj = adrinttyp->strobj;
|
||||
OPT_sinttyp = OPT_IntType(OPM_ShortintSize);
|
||||
|
|
@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void)
|
|||
OPT_sintobj->typ = OPT_sinttyp;
|
||||
OPT_intobj->typ = OPT_inttyp;
|
||||
OPT_lintobj->typ = OPT_linttyp;
|
||||
switch (OPM_LongintSize) {
|
||||
case 4:
|
||||
OPT_settyp = OPT_set32typ;
|
||||
break;
|
||||
default:
|
||||
OPT_settyp = OPT_set64typ;
|
||||
break;
|
||||
}
|
||||
OPT_setobj->typ = OPT_settyp;
|
||||
if (__STRCMP(OPM_Model, "C") == 0) {
|
||||
OPT_cpbytetyp->strobj->name[4] = 0x00;
|
||||
} else {
|
||||
OPT_cpbytetyp->strobj->name[4] = '@';
|
||||
}
|
||||
}
|
||||
|
||||
void Compiler_Translate (void)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -18,6 +19,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
#include "Console.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
|
|||
export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
|
||||
export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x);
|
||||
export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x);
|
||||
export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
|
||||
export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x);
|
||||
export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
|
||||
export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
export void Files_Register (Files_File f);
|
||||
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
|
||||
|
|
@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L
|
|||
export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
|
||||
export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
|
||||
export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
|
||||
export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x);
|
||||
export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x);
|
||||
export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
|
||||
export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
|
||||
export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x);
|
||||
export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
|
||||
export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
|
||||
#define Files_IdxTrap() __HALT(-1)
|
||||
#define Files_ToAdr(x) (address)x
|
||||
|
||||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
|
||||
{
|
||||
|
|
@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
|
|||
} else {
|
||||
min = n;
|
||||
}
|
||||
__MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
|
||||
__MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min);
|
||||
offset += min;
|
||||
(*r).offset = offset;
|
||||
xpos += min;
|
||||
|
|
@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT
|
|||
} else {
|
||||
min = n;
|
||||
}
|
||||
__MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
|
||||
__MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min);
|
||||
offset += min;
|
||||
(*r).offset = offset;
|
||||
if (offset > buf->size) {
|
||||
|
|
@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x)
|
|||
*x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
||||
}
|
||||
|
||||
void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x)
|
||||
void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x)
|
||||
{
|
||||
CHAR b[4];
|
||||
int32 l;
|
||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||
l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
||||
*x = (SET)l;
|
||||
*x = (uint32)l;
|
||||
}
|
||||
|
||||
void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x)
|
||||
|
|
@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x)
|
|||
*x = n;
|
||||
}
|
||||
|
||||
void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x)
|
||||
{
|
||||
int32 n;
|
||||
Files_ReadNum(&*R, R__typ, &n);
|
||||
*x = n;
|
||||
}
|
||||
|
||||
void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x)
|
||||
{
|
||||
Files_Write(&*R, R__typ, __VAL(CHAR, x));
|
||||
|
|
@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
|
|||
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||
}
|
||||
|
||||
void Files_WriteSet (Files_Rider *R, address *R__typ, SET x)
|
||||
void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
|
||||
{
|
||||
CHAR b[4];
|
||||
int32 i;
|
||||
|
|
@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len
|
|||
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
|
||||
}
|
||||
|
||||
void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x)
|
||||
{
|
||||
while (x < -64 || x > 63) {
|
||||
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
|
||||
x = __ASHR(x, 7);
|
||||
}
|
||||
Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128));
|
||||
}
|
||||
|
||||
void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x)
|
||||
void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x)
|
||||
{
|
||||
while (x < -64 || x > 63) {
|
||||
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
|
||||
|
|
@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}};
|
|||
export void *Files__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Heap);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
|
|||
import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
|
||||
import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x);
|
||||
import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x);
|
||||
import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
|
||||
import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x);
|
||||
import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
|
||||
import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void Files_Register (Files_File f);
|
||||
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
|
||||
|
|
@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L
|
|||
import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
|
||||
import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
|
||||
import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
|
||||
import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x);
|
||||
import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x);
|
||||
import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
|
||||
import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
|
||||
import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x);
|
||||
import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
|
||||
import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void *Files__init(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc);
|
|||
export void OPB_SetElem (OPT_Node *x);
|
||||
static void OPB_SetIntType (OPT_Node node);
|
||||
export void OPB_SetRange (OPT_Node *x, OPT_Node y);
|
||||
static void OPB_SetSetType (OPT_Node node);
|
||||
export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
|
||||
export void OPB_StPar0 (OPT_Node *par0, int16 fctno);
|
||||
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
|
||||
|
|
@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node)
|
|||
node->typ = OPT_IntType(OPT_IntSize(node->conval->intval));
|
||||
}
|
||||
|
||||
static void OPB_SetSetType (OPT_Node node)
|
||||
{
|
||||
int32 i32;
|
||||
__GET((address)&node->conval->setval + 4, i32, int32);
|
||||
if (i32 == 0) {
|
||||
node->typ = OPT_set32typ;
|
||||
} else {
|
||||
node->typ = OPT_set64typ;
|
||||
}
|
||||
}
|
||||
|
||||
OPT_Node OPB_NewIntConst (int64 intval)
|
||||
{
|
||||
OPT_Node _o_result;
|
||||
|
|
@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y)
|
|||
}
|
||||
}
|
||||
|
||||
static struct TypTest__57 {
|
||||
static struct TypTest__58 {
|
||||
OPT_Node *x;
|
||||
OPT_Object *obj;
|
||||
BOOLEAN *guard;
|
||||
struct TypTest__57 *lnk;
|
||||
} *TypTest__57_s;
|
||||
struct TypTest__58 *lnk;
|
||||
} *TypTest__58_s;
|
||||
|
||||
static void GTT__58 (OPT_Struct t0, OPT_Struct t1);
|
||||
static void GTT__59 (OPT_Struct t0, OPT_Struct t1);
|
||||
|
||||
static void GTT__58 (OPT_Struct t0, OPT_Struct t1)
|
||||
static void GTT__59 (OPT_Struct t0, OPT_Struct t1)
|
||||
{
|
||||
OPT_Node node = NIL;
|
||||
OPT_Struct t = NIL;
|
||||
|
|
@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1)
|
|||
t1 = t1->BaseTyp;
|
||||
}
|
||||
if (t1 == t0 || t0->form == 0) {
|
||||
if (*TypTest__57_s->guard) {
|
||||
OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL);
|
||||
(*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly;
|
||||
if (*TypTest__58_s->guard) {
|
||||
OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL);
|
||||
(*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly;
|
||||
} else {
|
||||
node = OPT_NewNode(11);
|
||||
node->subcl = 16;
|
||||
node->left = *TypTest__57_s->x;
|
||||
node->obj = *TypTest__57_s->obj;
|
||||
*TypTest__57_s->x = node;
|
||||
node->left = *TypTest__58_s->x;
|
||||
node->obj = *TypTest__58_s->obj;
|
||||
*TypTest__58_s->x = node;
|
||||
}
|
||||
} else {
|
||||
OPB_err(85);
|
||||
}
|
||||
} else if (t0 != t1) {
|
||||
OPB_err(85);
|
||||
} else if (!*TypTest__57_s->guard) {
|
||||
if ((*TypTest__57_s->x)->class == 5) {
|
||||
} else if (!*TypTest__58_s->guard) {
|
||||
if ((*TypTest__58_s->x)->class == 5) {
|
||||
node = OPT_NewNode(11);
|
||||
node->subcl = 16;
|
||||
node->left = *TypTest__57_s->x;
|
||||
node->obj = *TypTest__57_s->obj;
|
||||
*TypTest__57_s->x = node;
|
||||
node->left = *TypTest__58_s->x;
|
||||
node->obj = *TypTest__58_s->obj;
|
||||
*TypTest__58_s->x = node;
|
||||
} else {
|
||||
*TypTest__57_s->x = OPB_NewBoolConst(1);
|
||||
*TypTest__58_s->x = OPB_NewBoolConst(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
|
||||
{
|
||||
struct TypTest__57 _s;
|
||||
struct TypTest__58 _s;
|
||||
_s.x = x;
|
||||
_s.obj = &obj;
|
||||
_s.guard = &guard;
|
||||
_s.lnk = TypTest__57_s;
|
||||
TypTest__57_s = &_s;
|
||||
_s.lnk = TypTest__58_s;
|
||||
TypTest__58_s = &_s;
|
||||
if (OPB_NotVar(*x)) {
|
||||
OPB_err(112);
|
||||
} else if ((*x)->typ->form == 11) {
|
||||
if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) {
|
||||
OPB_err(85);
|
||||
} else if (obj->typ->form == 11) {
|
||||
GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp);
|
||||
GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp);
|
||||
} else {
|
||||
OPB_err(86);
|
||||
}
|
||||
} else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) {
|
||||
GTT__58((*x)->typ, obj->typ);
|
||||
GTT__59((*x)->typ, obj->typ);
|
||||
} else {
|
||||
OPB_err(87);
|
||||
}
|
||||
|
|
@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
|
|||
} else {
|
||||
(*x)->typ = OPT_booltyp;
|
||||
}
|
||||
TypTest__57_s = _s.lnk;
|
||||
TypTest__58_s = _s.lnk;
|
||||
}
|
||||
|
||||
void OPB_In (OPT_Node *x, OPT_Node y)
|
||||
|
|
@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
|||
f = (*x)->typ->form;
|
||||
g = typ->form;
|
||||
if ((*x)->class == 7) {
|
||||
if (f == 4) {
|
||||
if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) {
|
||||
OPB_SetSetType(*x);
|
||||
if ((*x)->typ->size > typ->size) {
|
||||
OPB_err(203);
|
||||
(*x)->conval->setval = 0x0;
|
||||
}
|
||||
} else if (f == 4) {
|
||||
if (g == 4) {
|
||||
if ((*x)->typ->size > typ->size) {
|
||||
OPB_SetIntType(*x);
|
||||
|
|
@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
|
|||
OPB_err(100);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if ((g == 7 && y->typ->size < z->typ->size)) {
|
||||
OPB_Convert(&y, z->typ);
|
||||
} else {
|
||||
OPB_err(100);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (g == 4) {
|
||||
OPB_Convert(&y, z->typ);
|
||||
|
|
@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
*par0 = x;
|
||||
}
|
||||
|
||||
static struct StPar1__52 {
|
||||
struct StPar1__52 *lnk;
|
||||
} *StPar1__52_s;
|
||||
static struct StPar1__53 {
|
||||
struct StPar1__53 *lnk;
|
||||
} *StPar1__53_s;
|
||||
|
||||
static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
|
||||
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
|
||||
|
||||
static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
|
||||
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
|
||||
{
|
||||
OPT_Node _o_result;
|
||||
OPT_Node node = NIL;
|
||||
|
|
@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
int16 f, L;
|
||||
OPT_Struct typ = NIL;
|
||||
OPT_Node p = NIL, t = NIL;
|
||||
struct StPar1__52 _s;
|
||||
_s.lnk = StPar1__52_s;
|
||||
StPar1__52_s = &_s;
|
||||
struct StPar1__53 _s;
|
||||
_s.lnk = StPar1__53_s;
|
||||
StPar1__53_s = &_s;
|
||||
p = *par0;
|
||||
f = x->typ->form;
|
||||
switch (fctno) {
|
||||
|
|
@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(111);
|
||||
}
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
p->typ = OPT_notyp;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) {
|
||||
OPB_err(202);
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
p = p->left;
|
||||
x->conval->intval += 1;
|
||||
}
|
||||
p = NewOp__53(12, 19, p, x);
|
||||
p = NewOp__54(12, 19, p, x);
|
||||
p->typ = OPT_linttyp;
|
||||
} else {
|
||||
p = x;
|
||||
|
|
@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
t = x;
|
||||
x = p;
|
||||
p = t;
|
||||
p = NewOp__53(19, 18, p, x);
|
||||
p = NewOp__54(19, 18, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
}
|
||||
p->obj = NIL;
|
||||
} else {
|
||||
p = NewOp__53(12, 17, p, x);
|
||||
p = NewOp__54(12, 17, p, x);
|
||||
p->typ = p->left->typ;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(111);
|
||||
} else {
|
||||
if (fctno == 22) {
|
||||
p = NewOp__53(12, 27, p, x);
|
||||
p = NewOp__54(12, 27, p, x);
|
||||
} else {
|
||||
p = NewOp__53(12, 28, p, x);
|
||||
p = NewOp__54(12, 28, p, x);
|
||||
}
|
||||
p->typ = p->left->typ;
|
||||
}
|
||||
|
|
@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
x = p;
|
||||
p = t;
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if (x->class == 8 || x->class == 9) {
|
||||
OPB_err(126);
|
||||
} else if (f == 4) {
|
||||
p = NewOp__53(12, 26, p, x);
|
||||
p = NewOp__54(12, 26, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if (x->class == 8 || x->class == 9) {
|
||||
OPB_err(126);
|
||||
} else if (f == 4) {
|
||||
p = NewOp__53(19, 30, p, x);
|
||||
p = NewOp__54(19, 30, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
break;
|
||||
}
|
||||
*par0 = p;
|
||||
StPar1__52_s = _s.lnk;
|
||||
StPar1__53_s = _s.lnk;
|
||||
}
|
||||
|
||||
void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj)
|
|||
OPM_Write('_');
|
||||
}
|
||||
}
|
||||
} else if ((mode == 5 && obj->typ->form == 4)) {
|
||||
} else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) {
|
||||
if (obj->typ == OPT_adrtyp) {
|
||||
OPM_WriteString((CHAR*)"address", 8);
|
||||
} else {
|
||||
if (obj->typ->form == 4) {
|
||||
OPM_WriteString((CHAR*)"int", 4);
|
||||
} else {
|
||||
OPM_WriteString((CHAR*)"uint", 5);
|
||||
}
|
||||
OPM_WriteInt(__ASHL(obj->typ->size, 3));
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n)
|
|||
OPM_currFile = 1;
|
||||
OPC_GenHeaderMsg();
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define INTEGER int", 20);
|
||||
OPM_WriteString((CHAR*)"#define SHORTINT int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define INTEGER int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_inttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define LONGINT int", 20);
|
||||
OPM_WriteString((CHAR*)"#define LONGINT int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_linttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define SET uint", 21);
|
||||
OPM_WriteString((CHAR*)"#define SET uint", 22);
|
||||
OPM_WriteInt(__ASHL(OPT_settyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteLn();
|
||||
|
|
@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
|||
void OPC_Constant (OPT_Const con, int16 form)
|
||||
{
|
||||
int16 i;
|
||||
SET s;
|
||||
uint32 s;
|
||||
int32 hex;
|
||||
BOOLEAN skipLeading;
|
||||
switch (form) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize;
|
|||
export int16 OPM_AddressSize;
|
||||
static int16 OPM_GlobalAlignment;
|
||||
export int16 OPM_Alignment;
|
||||
export SET OPM_GlobalOptions, OPM_Options;
|
||||
export uint32 OPM_GlobalOptions, OPM_Options;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
|
|
@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void);
|
|||
export void OPM_FPrint (int32 *fp, int64 val);
|
||||
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
export void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
export void OPM_FPrintSet (int32 *fp, SET set);
|
||||
export void OPM_FPrintSet (int32 *fp, uint32 set);
|
||||
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
|
||||
export void OPM_Get (CHAR *ch);
|
||||
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
|
|
@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void);
|
|||
export int64 OPM_SymRInt64 (void);
|
||||
export void OPM_SymRLReal (LONGREAL *lr);
|
||||
export void OPM_SymRReal (REAL *r);
|
||||
export void OPM_SymRSet (SET *s);
|
||||
export void OPM_SymRSet (uint32 *s);
|
||||
export void OPM_SymWCh (CHAR ch);
|
||||
export void OPM_SymWInt (int64 i);
|
||||
export void OPM_SymWLReal (LONGREAL lr);
|
||||
export void OPM_SymWReal (REAL r);
|
||||
export void OPM_SymWSet (SET s);
|
||||
export void OPM_SymWSet (uint32 s);
|
||||
static void OPM_VerboseListSizes (void);
|
||||
export void OPM_Write (CHAR ch);
|
||||
export void OPM_WriteHex (int64 i);
|
||||
|
|
@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void)
|
|||
OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79);
|
||||
OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95);
|
||||
OPM_LogWLn();
|
||||
|
|
@ -709,10 +710,10 @@ void OPM_err (int16 n)
|
|||
|
||||
void OPM_FPrint (int32 *fp, int64 val)
|
||||
{
|
||||
*fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32);
|
||||
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
|
||||
}
|
||||
|
||||
void OPM_FPrintSet (int32 *fp, SET set)
|
||||
void OPM_FPrintSet (int32 *fp, uint32 set)
|
||||
{
|
||||
OPM_FPrint(&*fp, (int32)set);
|
||||
}
|
||||
|
|
@ -751,13 +752,11 @@ int32 OPM_SymRInt (void)
|
|||
int64 OPM_SymRInt64 (void)
|
||||
{
|
||||
int64 _o_result;
|
||||
int64 k;
|
||||
Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k);
|
||||
_o_result = k;
|
||||
_o_result = OPM_SymRInt();
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
void OPM_SymRSet (SET *s)
|
||||
void OPM_SymRSet (uint32 *s)
|
||||
{
|
||||
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s);
|
||||
}
|
||||
|
|
@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch)
|
|||
|
||||
void OPM_SymWInt (int64 i)
|
||||
{
|
||||
Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i);
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
|
||||
}
|
||||
|
||||
void OPM_SymWSet (SET s)
|
||||
void OPM_SymWSet (uint32 s)
|
||||
{
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import CHAR OPM_Model[10];
|
||||
import int16 OPM_AddressSize, OPM_Alignment;
|
||||
import SET OPM_GlobalOptions, OPM_Options;
|
||||
import uint32 OPM_GlobalOptions, OPM_Options;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
|
|
@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void);
|
|||
import void OPM_FPrint (int32 *fp, int64 val);
|
||||
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
import void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
import void OPM_FPrintSet (int32 *fp, SET set);
|
||||
import void OPM_FPrintSet (int32 *fp, uint32 set);
|
||||
import void OPM_Get (CHAR *ch);
|
||||
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
import void OPM_InitOptions (void);
|
||||
|
|
@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void);
|
|||
import int64 OPM_SymRInt64 (void);
|
||||
import void OPM_SymRLReal (LONGREAL *lr);
|
||||
import void OPM_SymRReal (REAL *r);
|
||||
import void OPM_SymRSet (SET *s);
|
||||
import void OPM_SymRSet (uint32 *s);
|
||||
import void OPM_SymWCh (CHAR ch);
|
||||
import void OPM_SymWInt (int64 i);
|
||||
import void OPM_SymWLReal (LONGREAL lr);
|
||||
import void OPM_SymWReal (REAL r);
|
||||
import void OPM_SymWSet (SET s);
|
||||
import void OPM_SymWSet (uint32 s);
|
||||
import void OPM_Write (CHAR ch);
|
||||
import void OPM_WriteHex (int64 i);
|
||||
import void OPM_WriteInt (int64 i);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x);
|
|||
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b);
|
||||
static void OPP_Factor (OPT_Node *x);
|
||||
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp);
|
||||
export void OPP_Module (OPT_Node *prog, SET opt);
|
||||
export void OPP_Module (OPT_Node *prog, uint32 opt);
|
||||
static void OPP_PointerType (OPT_Struct *typ);
|
||||
static void OPP_ProcedureDeclaration (OPT_Node *x);
|
||||
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
|
||||
|
|
@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
|
|||
OPP_CheckSym(41);
|
||||
}
|
||||
|
||||
void OPP_Module (OPT_Node *prog, SET opt)
|
||||
void OPP_Module (OPT_Node *prog, uint32 opt)
|
||||
{
|
||||
OPS_Name impName, aliasName;
|
||||
OPT_Node procdec = NIL, statseq = NIL;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
|
||||
|
||||
import void OPP_Module (OPT_Node *prog, SET opt);
|
||||
import void OPP_Module (OPT_Node *prog, uint32 opt);
|
||||
import void *OPP__init(void);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -19,7 +20,7 @@ typedef
|
|||
OPT_ConstExt ext;
|
||||
int64 intval;
|
||||
int32 intval2;
|
||||
SET setval;
|
||||
uint32 setval;
|
||||
LONGREAL realval;
|
||||
} OPT_ConstDesc;
|
||||
|
||||
|
|
@ -88,8 +89,8 @@ typedef
|
|||
|
||||
|
||||
export OPT_Object OPT_topScope;
|
||||
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
|
||||
export int8 OPT_nofGmod;
|
||||
export OPT_Object OPT_GlbMod[64];
|
||||
export OPS_Name OPT_SelfName;
|
||||
|
|
@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par);
|
|||
static void OPT_InStruct (OPT_Struct *typ);
|
||||
static OPT_Object OPT_InTProc (int8 mno);
|
||||
static OPT_Struct OPT_InTyp (int32 tag);
|
||||
export void OPT_Init (OPS_Name name, SET opt);
|
||||
export void OPT_Init (OPS_Name name, uint32 opt);
|
||||
export void OPT_InitRecno (void);
|
||||
static void OPT_InitStruct (OPT_Struct *typ, int8 form);
|
||||
export void OPT_Insert (OPS_Name name, OPT_Object *obj);
|
||||
|
|
@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj);
|
|||
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
||||
static void OPT_OutStr (OPT_Struct typ);
|
||||
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
||||
export OPT_Struct OPT_SetType (int32 size);
|
||||
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
|
||||
export int32 OPT_SizeAlignment (int32 size);
|
||||
export void OPT_TypSize (OPT_Struct typ);
|
||||
|
|
@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size)
|
|||
return _o_result;
|
||||
}
|
||||
|
||||
OPT_Struct OPT_SetType (int32 size)
|
||||
{
|
||||
OPT_Struct _o_result;
|
||||
if (size == OPT_set32typ->size) {
|
||||
_o_result = OPT_set32typ;
|
||||
return _o_result;
|
||||
}
|
||||
_o_result = OPT_set64typ;
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
|
||||
{
|
||||
OPT_Struct _o_result;
|
||||
|
|
@ -449,7 +462,7 @@ void OPT_CloseScope (void)
|
|||
OPT_topScope = OPT_topScope->left;
|
||||
}
|
||||
|
||||
void OPT_Init (OPS_Name name, SET opt)
|
||||
void OPT_Init (OPS_Name name, uint32 opt)
|
||||
{
|
||||
OPT_topScope = OPT_universe;
|
||||
OPT_OpenScope(0, NIL);
|
||||
|
|
@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag)
|
|||
if (tag == 4) {
|
||||
_o_result = OPT_IntType(OPM_SymRInt());
|
||||
return _o_result;
|
||||
} else if (tag == 7) {
|
||||
_o_result = OPT_SetType(OPM_SymRInt());
|
||||
return _o_result;
|
||||
} else {
|
||||
_o_result = OPT_impCtxt.ref[__X(tag, 255)];
|
||||
return _o_result;
|
||||
|
|
@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
|||
OPT_Object strobj = NIL;
|
||||
if (typ->ref < OPT_expCtxt.ref) {
|
||||
OPM_SymWInt(-typ->ref);
|
||||
if (typ->ref == 4) {
|
||||
if (__IN(typ->ref, 0x90, 32)) {
|
||||
OPM_SymWInt(typ->size);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
|||
break;
|
||||
case 7:
|
||||
OPM_SymWSet(obj->conval->setval);
|
||||
OPM_SymWInt(obj->typ->size);
|
||||
break;
|
||||
case 5:
|
||||
rval = obj->conval->realval;
|
||||
|
|
@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*))
|
|||
{
|
||||
P(OPT_topScope);
|
||||
P(OPT_undftyp);
|
||||
P(OPT_niltyp);
|
||||
P(OPT_notyp);
|
||||
P(OPT_bytetyp);
|
||||
P(OPT_cpbytetyp);
|
||||
P(OPT_booltyp);
|
||||
P(OPT_chartyp);
|
||||
P(OPT_sinttyp);
|
||||
P(OPT_inttyp);
|
||||
P(OPT_linttyp);
|
||||
P(OPT_hinttyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_int8typ);
|
||||
P(OPT_int16typ);
|
||||
P(OPT_int32typ);
|
||||
P(OPT_int64typ);
|
||||
P(OPT_settyp);
|
||||
P(OPT_set32typ);
|
||||
P(OPT_set64typ);
|
||||
P(OPT_realtyp);
|
||||
P(OPT_lrltyp);
|
||||
P(OPT_settyp);
|
||||
P(OPT_stringtyp);
|
||||
P(OPT_niltyp);
|
||||
P(OPT_notyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_sysptrtyp);
|
||||
P(OPT_sintobj);
|
||||
P(OPT_intobj);
|
||||
P(OPT_lintobj);
|
||||
P(OPT_setobj);
|
||||
__ENUMP(OPT_GlbMod, 64, P);
|
||||
P(OPT_universe);
|
||||
P(OPT_syslink);
|
||||
|
|
@ -2056,6 +2077,8 @@ export void *OPT__init(void)
|
|||
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
|
||||
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
|
||||
OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ);
|
||||
OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ);
|
||||
OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ);
|
||||
OPT_EnterProc((CHAR*)"ADR", 20);
|
||||
OPT_EnterProc((CHAR*)"CC", 21);
|
||||
OPT_EnterProc((CHAR*)"LSH", 22);
|
||||
|
|
@ -2073,13 +2096,14 @@ export void *OPT__init(void)
|
|||
OPT_topScope->right = NIL;
|
||||
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
|
||||
OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
|
||||
OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
|
||||
OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
|
||||
OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
|
||||
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
|
||||
OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp);
|
||||
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj);
|
||||
OPT_EnterBoolConst((CHAR*)"FALSE", 0);
|
||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
@ -17,7 +17,7 @@ typedef
|
|||
OPT_ConstExt ext;
|
||||
int64 intval;
|
||||
int32 intval2;
|
||||
SET setval;
|
||||
uint32 setval;
|
||||
LONGREAL realval;
|
||||
} OPT_ConstDesc;
|
||||
|
||||
|
|
@ -67,8 +67,8 @@ typedef
|
|||
|
||||
|
||||
import OPT_Object OPT_topScope;
|
||||
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
|
||||
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
|
||||
import int8 OPT_nofGmod;
|
||||
import OPT_Object OPT_GlbMod[64];
|
||||
import OPS_Name OPT_SelfName;
|
||||
|
|
@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
|
|||
import void OPT_FindImport (OPT_Object mod, OPT_Object *res);
|
||||
import void OPT_IdFPrint (OPT_Struct typ);
|
||||
import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
|
||||
import void OPT_Init (OPS_Name name, SET opt);
|
||||
import void OPT_Init (OPS_Name name, uint32 opt);
|
||||
import void OPT_InitRecno (void);
|
||||
import void OPT_Insert (OPS_Name name, OPT_Object *obj);
|
||||
import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
|
||||
|
|
@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class);
|
|||
import OPT_Object OPT_NewObj (void);
|
||||
import OPT_Struct OPT_NewStr (int8 form, int8 comp);
|
||||
import void OPT_OpenScope (int8 level, OPT_Object owner);
|
||||
import OPT_Struct OPT_SetType (int32 size);
|
||||
import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
|
||||
import int32 OPT_SizeAlignment (int32 size);
|
||||
import void OPT_TypSize (OPT_Struct typ);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
|
|||
OPV_Traverse(topScope->right, topScope, 1);
|
||||
OPV_Traverse(topScope->right, topScope, 0);
|
||||
OPT_chartyp->strobj->linkadr = 2;
|
||||
OPT_cpbytetyp->strobj->linkadr = 2;
|
||||
OPT_settyp->strobj->linkadr = 2;
|
||||
OPT_realtyp->strobj->linkadr = 2;
|
||||
OPT_adrtyp->strobj->linkadr = 2;
|
||||
|
|
@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope)
|
|||
OPT_int16typ->strobj->linkadr = 2;
|
||||
OPT_int32typ->strobj->linkadr = 2;
|
||||
OPT_int64typ->strobj->linkadr = 2;
|
||||
OPT_set32typ->strobj->linkadr = 2;
|
||||
OPT_set64typ->strobj->linkadr = 2;
|
||||
OPT_hinttyp->strobj->linkadr = 2;
|
||||
OPT_lrltyp->strobj->linkadr = 2;
|
||||
OPT_booltyp->strobj->linkadr = 2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -40,7 +41,7 @@ export int32 Platform_ArgVector;
|
|||
static Platform_HaltProcedure Platform_HaltHandler;
|
||||
static int32 Platform_TimeStart;
|
||||
export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
|
||||
export CHAR Platform_nl[3];
|
||||
export CHAR Platform_NL[3];
|
||||
|
||||
export address *Platform_FileIdentity__typ;
|
||||
|
||||
|
|
@ -798,7 +799,7 @@ export void *Platform__init(void)
|
|||
Platform_SeekSet = Platform_seekset();
|
||||
Platform_SeekCur = Platform_seekcur();
|
||||
Platform_SeekEnd = Platform_seekend();
|
||||
Platform_nl[0] = 0x0a;
|
||||
Platform_nl[1] = 0x00;
|
||||
Platform_NL[0] = 0x0a;
|
||||
Platform_NL[1] = 0x00;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
@ -26,7 +26,7 @@ import CHAR Platform_CWD[256];
|
|||
import int16 Platform_ArgCount;
|
||||
import int32 Platform_ArgVector;
|
||||
import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
|
||||
import CHAR Platform_nl[3];
|
||||
import CHAR Platform_NL[3];
|
||||
|
||||
import address *Platform_FileIdentity__typ;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -183,7 +184,7 @@ export address *Texts_Writer__typ;
|
|||
export address *Texts__1__typ;
|
||||
|
||||
export void Texts_Append (Texts_Text T, Texts_Buffer B);
|
||||
export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
static Texts_Elem Texts_CloneElem (Texts_Elem e);
|
||||
static Texts_Piece Texts_ClonePiece (Texts_Piece p);
|
||||
export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
|
||||
|
|
@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end)
|
|||
}
|
||||
}
|
||||
|
||||
void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff)
|
||||
void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff)
|
||||
{
|
||||
Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL;
|
||||
int32 co, uo, ud, vo, vd;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
@ -129,7 +129,7 @@ import address *Texts_Scanner__typ;
|
|||
import address *Texts_Writer__typ;
|
||||
|
||||
import void Texts_Append (Texts_Text T, Texts_Buffer B);
|
||||
import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
|
||||
import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
|
||||
import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void)
|
|||
OPT_Struct adrinttyp = NIL;
|
||||
OPT_sysptrtyp->size = OPM_AddressSize;
|
||||
OPT_adrtyp->size = OPM_AddressSize;
|
||||
OPT_settyp->size = OPM_SetSize;
|
||||
adrinttyp = OPT_IntType(OPM_AddressSize);
|
||||
OPT_adrtyp->strobj = adrinttyp->strobj;
|
||||
OPT_sinttyp = OPT_IntType(OPM_ShortintSize);
|
||||
|
|
@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void)
|
|||
OPT_sintobj->typ = OPT_sinttyp;
|
||||
OPT_intobj->typ = OPT_inttyp;
|
||||
OPT_lintobj->typ = OPT_linttyp;
|
||||
switch (OPM_LongintSize) {
|
||||
case 4:
|
||||
OPT_settyp = OPT_set32typ;
|
||||
break;
|
||||
default:
|
||||
OPT_settyp = OPT_set64typ;
|
||||
break;
|
||||
}
|
||||
OPT_setobj->typ = OPT_settyp;
|
||||
if (__STRCMP(OPM_Model, "C") == 0) {
|
||||
OPT_cpbytetyp->strobj->name[4] = 0x00;
|
||||
} else {
|
||||
OPT_cpbytetyp->strobj->name[4] = '@';
|
||||
}
|
||||
}
|
||||
|
||||
void Compiler_Translate (void)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -18,6 +19,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
#include "Console.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
|
|||
export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
|
||||
export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x);
|
||||
export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x);
|
||||
export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
|
||||
export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x);
|
||||
export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
|
||||
export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
export void Files_Register (Files_File f);
|
||||
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
|
||||
|
|
@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L
|
|||
export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
|
||||
export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
|
||||
export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
|
||||
export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x);
|
||||
export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x);
|
||||
export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
|
||||
export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
|
||||
export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x);
|
||||
export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
|
||||
export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
|
||||
#define Files_IdxTrap() __HALT(-1)
|
||||
#define Files_ToAdr(x) (address)x
|
||||
|
||||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
|
||||
{
|
||||
|
|
@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
|
|||
} else {
|
||||
min = n;
|
||||
}
|
||||
__MOVE(((address)buf->data) + offset, ((address)x) + xpos, min);
|
||||
__MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min);
|
||||
offset += min;
|
||||
(*r).offset = offset;
|
||||
xpos += min;
|
||||
|
|
@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT
|
|||
} else {
|
||||
min = n;
|
||||
}
|
||||
__MOVE(((address)x) + xpos, ((address)buf->data) + offset, min);
|
||||
__MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min);
|
||||
offset += min;
|
||||
(*r).offset = offset;
|
||||
if (offset > buf->size) {
|
||||
|
|
@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x)
|
|||
*x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
||||
}
|
||||
|
||||
void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x)
|
||||
void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x)
|
||||
{
|
||||
CHAR b[4];
|
||||
int32 l;
|
||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||
l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
||||
*x = (SET)l;
|
||||
*x = (uint32)l;
|
||||
}
|
||||
|
||||
void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x)
|
||||
|
|
@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x)
|
|||
*x = n;
|
||||
}
|
||||
|
||||
void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x)
|
||||
{
|
||||
int32 n;
|
||||
Files_ReadNum(&*R, R__typ, &n);
|
||||
*x = n;
|
||||
}
|
||||
|
||||
void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x)
|
||||
{
|
||||
Files_Write(&*R, R__typ, __VAL(CHAR, x));
|
||||
|
|
@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
|
|||
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||
}
|
||||
|
||||
void Files_WriteSet (Files_Rider *R, address *R__typ, SET x)
|
||||
void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
|
||||
{
|
||||
CHAR b[4];
|
||||
int32 i;
|
||||
|
|
@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len
|
|||
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
|
||||
}
|
||||
|
||||
void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x)
|
||||
{
|
||||
while (x < -64 || x > 63) {
|
||||
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
|
||||
x = __ASHR(x, 7);
|
||||
}
|
||||
Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128));
|
||||
}
|
||||
|
||||
void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x)
|
||||
void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x)
|
||||
{
|
||||
while (x < -64 || x > 63) {
|
||||
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
|
||||
|
|
@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}};
|
|||
export void *Files__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Heap);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
|
|||
import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
|
||||
import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x);
|
||||
import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x);
|
||||
import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
|
||||
import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x);
|
||||
import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
|
||||
import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void Files_Register (Files_File f);
|
||||
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
|
||||
|
|
@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L
|
|||
import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
|
||||
import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
|
||||
import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
|
||||
import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x);
|
||||
import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x);
|
||||
import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
|
||||
import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
|
||||
import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x);
|
||||
import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
|
||||
import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void *Files__init(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc);
|
|||
export void OPB_SetElem (OPT_Node *x);
|
||||
static void OPB_SetIntType (OPT_Node node);
|
||||
export void OPB_SetRange (OPT_Node *x, OPT_Node y);
|
||||
static void OPB_SetSetType (OPT_Node node);
|
||||
export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
|
||||
export void OPB_StPar0 (OPT_Node *par0, int16 fctno);
|
||||
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
|
||||
|
|
@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node)
|
|||
node->typ = OPT_IntType(OPT_IntSize(node->conval->intval));
|
||||
}
|
||||
|
||||
static void OPB_SetSetType (OPT_Node node)
|
||||
{
|
||||
int32 i32;
|
||||
__GET((address)&node->conval->setval + 4, i32, int32);
|
||||
if (i32 == 0) {
|
||||
node->typ = OPT_set32typ;
|
||||
} else {
|
||||
node->typ = OPT_set64typ;
|
||||
}
|
||||
}
|
||||
|
||||
OPT_Node OPB_NewIntConst (int64 intval)
|
||||
{
|
||||
OPT_Node _o_result;
|
||||
|
|
@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y)
|
|||
}
|
||||
}
|
||||
|
||||
static struct TypTest__57 {
|
||||
static struct TypTest__58 {
|
||||
OPT_Node *x;
|
||||
OPT_Object *obj;
|
||||
BOOLEAN *guard;
|
||||
struct TypTest__57 *lnk;
|
||||
} *TypTest__57_s;
|
||||
struct TypTest__58 *lnk;
|
||||
} *TypTest__58_s;
|
||||
|
||||
static void GTT__58 (OPT_Struct t0, OPT_Struct t1);
|
||||
static void GTT__59 (OPT_Struct t0, OPT_Struct t1);
|
||||
|
||||
static void GTT__58 (OPT_Struct t0, OPT_Struct t1)
|
||||
static void GTT__59 (OPT_Struct t0, OPT_Struct t1)
|
||||
{
|
||||
OPT_Node node = NIL;
|
||||
OPT_Struct t = NIL;
|
||||
|
|
@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1)
|
|||
t1 = t1->BaseTyp;
|
||||
}
|
||||
if (t1 == t0 || t0->form == 0) {
|
||||
if (*TypTest__57_s->guard) {
|
||||
OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL);
|
||||
(*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly;
|
||||
if (*TypTest__58_s->guard) {
|
||||
OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL);
|
||||
(*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly;
|
||||
} else {
|
||||
node = OPT_NewNode(11);
|
||||
node->subcl = 16;
|
||||
node->left = *TypTest__57_s->x;
|
||||
node->obj = *TypTest__57_s->obj;
|
||||
*TypTest__57_s->x = node;
|
||||
node->left = *TypTest__58_s->x;
|
||||
node->obj = *TypTest__58_s->obj;
|
||||
*TypTest__58_s->x = node;
|
||||
}
|
||||
} else {
|
||||
OPB_err(85);
|
||||
}
|
||||
} else if (t0 != t1) {
|
||||
OPB_err(85);
|
||||
} else if (!*TypTest__57_s->guard) {
|
||||
if ((*TypTest__57_s->x)->class == 5) {
|
||||
} else if (!*TypTest__58_s->guard) {
|
||||
if ((*TypTest__58_s->x)->class == 5) {
|
||||
node = OPT_NewNode(11);
|
||||
node->subcl = 16;
|
||||
node->left = *TypTest__57_s->x;
|
||||
node->obj = *TypTest__57_s->obj;
|
||||
*TypTest__57_s->x = node;
|
||||
node->left = *TypTest__58_s->x;
|
||||
node->obj = *TypTest__58_s->obj;
|
||||
*TypTest__58_s->x = node;
|
||||
} else {
|
||||
*TypTest__57_s->x = OPB_NewBoolConst(1);
|
||||
*TypTest__58_s->x = OPB_NewBoolConst(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
|
||||
{
|
||||
struct TypTest__57 _s;
|
||||
struct TypTest__58 _s;
|
||||
_s.x = x;
|
||||
_s.obj = &obj;
|
||||
_s.guard = &guard;
|
||||
_s.lnk = TypTest__57_s;
|
||||
TypTest__57_s = &_s;
|
||||
_s.lnk = TypTest__58_s;
|
||||
TypTest__58_s = &_s;
|
||||
if (OPB_NotVar(*x)) {
|
||||
OPB_err(112);
|
||||
} else if ((*x)->typ->form == 11) {
|
||||
if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) {
|
||||
OPB_err(85);
|
||||
} else if (obj->typ->form == 11) {
|
||||
GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp);
|
||||
GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp);
|
||||
} else {
|
||||
OPB_err(86);
|
||||
}
|
||||
} else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) {
|
||||
GTT__58((*x)->typ, obj->typ);
|
||||
GTT__59((*x)->typ, obj->typ);
|
||||
} else {
|
||||
OPB_err(87);
|
||||
}
|
||||
|
|
@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
|
|||
} else {
|
||||
(*x)->typ = OPT_booltyp;
|
||||
}
|
||||
TypTest__57_s = _s.lnk;
|
||||
TypTest__58_s = _s.lnk;
|
||||
}
|
||||
|
||||
void OPB_In (OPT_Node *x, OPT_Node y)
|
||||
|
|
@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
|||
f = (*x)->typ->form;
|
||||
g = typ->form;
|
||||
if ((*x)->class == 7) {
|
||||
if (f == 4) {
|
||||
if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) {
|
||||
OPB_SetSetType(*x);
|
||||
if ((*x)->typ->size > typ->size) {
|
||||
OPB_err(203);
|
||||
(*x)->conval->setval = 0x0;
|
||||
}
|
||||
} else if (f == 4) {
|
||||
if (g == 4) {
|
||||
if ((*x)->typ->size > typ->size) {
|
||||
OPB_SetIntType(*x);
|
||||
|
|
@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
|
|||
OPB_err(100);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if ((g == 7 && y->typ->size < z->typ->size)) {
|
||||
OPB_Convert(&y, z->typ);
|
||||
} else {
|
||||
OPB_err(100);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (g == 4) {
|
||||
OPB_Convert(&y, z->typ);
|
||||
|
|
@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
*par0 = x;
|
||||
}
|
||||
|
||||
static struct StPar1__52 {
|
||||
struct StPar1__52 *lnk;
|
||||
} *StPar1__52_s;
|
||||
static struct StPar1__53 {
|
||||
struct StPar1__53 *lnk;
|
||||
} *StPar1__53_s;
|
||||
|
||||
static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
|
||||
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
|
||||
|
||||
static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
|
||||
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
|
||||
{
|
||||
OPT_Node _o_result;
|
||||
OPT_Node node = NIL;
|
||||
|
|
@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
int16 f, L;
|
||||
OPT_Struct typ = NIL;
|
||||
OPT_Node p = NIL, t = NIL;
|
||||
struct StPar1__52 _s;
|
||||
_s.lnk = StPar1__52_s;
|
||||
StPar1__52_s = &_s;
|
||||
struct StPar1__53 _s;
|
||||
_s.lnk = StPar1__53_s;
|
||||
StPar1__53_s = &_s;
|
||||
p = *par0;
|
||||
f = x->typ->form;
|
||||
switch (fctno) {
|
||||
|
|
@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(111);
|
||||
}
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
p->typ = OPT_notyp;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) {
|
||||
OPB_err(202);
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
p = p->left;
|
||||
x->conval->intval += 1;
|
||||
}
|
||||
p = NewOp__53(12, 19, p, x);
|
||||
p = NewOp__54(12, 19, p, x);
|
||||
p->typ = OPT_linttyp;
|
||||
} else {
|
||||
p = x;
|
||||
|
|
@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
t = x;
|
||||
x = p;
|
||||
p = t;
|
||||
p = NewOp__53(19, 18, p, x);
|
||||
p = NewOp__54(19, 18, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
}
|
||||
p->obj = NIL;
|
||||
} else {
|
||||
p = NewOp__53(12, 17, p, x);
|
||||
p = NewOp__54(12, 17, p, x);
|
||||
p->typ = p->left->typ;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(111);
|
||||
} else {
|
||||
if (fctno == 22) {
|
||||
p = NewOp__53(12, 27, p, x);
|
||||
p = NewOp__54(12, 27, p, x);
|
||||
} else {
|
||||
p = NewOp__53(12, 28, p, x);
|
||||
p = NewOp__54(12, 28, p, x);
|
||||
}
|
||||
p->typ = p->left->typ;
|
||||
}
|
||||
|
|
@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
x = p;
|
||||
p = t;
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if (x->class == 8 || x->class == 9) {
|
||||
OPB_err(126);
|
||||
} else if (f == 4) {
|
||||
p = NewOp__53(12, 26, p, x);
|
||||
p = NewOp__54(12, 26, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if (x->class == 8 || x->class == 9) {
|
||||
OPB_err(126);
|
||||
} else if (f == 4) {
|
||||
p = NewOp__53(19, 30, p, x);
|
||||
p = NewOp__54(19, 30, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
break;
|
||||
}
|
||||
*par0 = p;
|
||||
StPar1__52_s = _s.lnk;
|
||||
StPar1__53_s = _s.lnk;
|
||||
}
|
||||
|
||||
void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj)
|
|||
OPM_Write('_');
|
||||
}
|
||||
}
|
||||
} else if ((mode == 5 && obj->typ->form == 4)) {
|
||||
} else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) {
|
||||
if (obj->typ == OPT_adrtyp) {
|
||||
OPM_WriteString((CHAR*)"address", 8);
|
||||
} else {
|
||||
if (obj->typ->form == 4) {
|
||||
OPM_WriteString((CHAR*)"int", 4);
|
||||
} else {
|
||||
OPM_WriteString((CHAR*)"uint", 5);
|
||||
}
|
||||
OPM_WriteInt(__ASHL(obj->typ->size, 3));
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n)
|
|||
OPM_currFile = 1;
|
||||
OPC_GenHeaderMsg();
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define INTEGER int", 20);
|
||||
OPM_WriteString((CHAR*)"#define SHORTINT int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define INTEGER int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_inttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define LONGINT int", 20);
|
||||
OPM_WriteString((CHAR*)"#define LONGINT int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_linttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define SET uint", 21);
|
||||
OPM_WriteString((CHAR*)"#define SET uint", 22);
|
||||
OPM_WriteInt(__ASHL(OPT_settyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteLn();
|
||||
|
|
@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
|||
void OPC_Constant (OPT_Const con, int16 form)
|
||||
{
|
||||
int16 i;
|
||||
SET s;
|
||||
uint32 s;
|
||||
int32 hex;
|
||||
BOOLEAN skipLeading;
|
||||
switch (form) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize;
|
|||
export int16 OPM_AddressSize;
|
||||
static int16 OPM_GlobalAlignment;
|
||||
export int16 OPM_Alignment;
|
||||
export SET OPM_GlobalOptions, OPM_Options;
|
||||
export uint32 OPM_GlobalOptions, OPM_Options;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
|
|
@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void);
|
|||
export void OPM_FPrint (int32 *fp, int64 val);
|
||||
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
export void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
export void OPM_FPrintSet (int32 *fp, SET set);
|
||||
export void OPM_FPrintSet (int32 *fp, uint32 set);
|
||||
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
|
||||
export void OPM_Get (CHAR *ch);
|
||||
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
|
|
@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void);
|
|||
export int64 OPM_SymRInt64 (void);
|
||||
export void OPM_SymRLReal (LONGREAL *lr);
|
||||
export void OPM_SymRReal (REAL *r);
|
||||
export void OPM_SymRSet (SET *s);
|
||||
export void OPM_SymRSet (uint32 *s);
|
||||
export void OPM_SymWCh (CHAR ch);
|
||||
export void OPM_SymWInt (int64 i);
|
||||
export void OPM_SymWLReal (LONGREAL lr);
|
||||
export void OPM_SymWReal (REAL r);
|
||||
export void OPM_SymWSet (SET s);
|
||||
export void OPM_SymWSet (uint32 s);
|
||||
static void OPM_VerboseListSizes (void);
|
||||
export void OPM_Write (CHAR ch);
|
||||
export void OPM_WriteHex (int64 i);
|
||||
|
|
@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void)
|
|||
OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79);
|
||||
OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95);
|
||||
OPM_LogWLn();
|
||||
|
|
@ -709,10 +710,10 @@ void OPM_err (int16 n)
|
|||
|
||||
void OPM_FPrint (int32 *fp, int64 val)
|
||||
{
|
||||
*fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32);
|
||||
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
|
||||
}
|
||||
|
||||
void OPM_FPrintSet (int32 *fp, SET set)
|
||||
void OPM_FPrintSet (int32 *fp, uint32 set)
|
||||
{
|
||||
OPM_FPrint(&*fp, (int32)set);
|
||||
}
|
||||
|
|
@ -751,13 +752,11 @@ int32 OPM_SymRInt (void)
|
|||
int64 OPM_SymRInt64 (void)
|
||||
{
|
||||
int64 _o_result;
|
||||
int64 k;
|
||||
Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k);
|
||||
_o_result = k;
|
||||
_o_result = OPM_SymRInt();
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
void OPM_SymRSet (SET *s)
|
||||
void OPM_SymRSet (uint32 *s)
|
||||
{
|
||||
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s);
|
||||
}
|
||||
|
|
@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch)
|
|||
|
||||
void OPM_SymWInt (int64 i)
|
||||
{
|
||||
Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i);
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
|
||||
}
|
||||
|
||||
void OPM_SymWSet (SET s)
|
||||
void OPM_SymWSet (uint32 s)
|
||||
{
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import CHAR OPM_Model[10];
|
||||
import int16 OPM_AddressSize, OPM_Alignment;
|
||||
import SET OPM_GlobalOptions, OPM_Options;
|
||||
import uint32 OPM_GlobalOptions, OPM_Options;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
|
|
@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void);
|
|||
import void OPM_FPrint (int32 *fp, int64 val);
|
||||
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
import void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
import void OPM_FPrintSet (int32 *fp, SET set);
|
||||
import void OPM_FPrintSet (int32 *fp, uint32 set);
|
||||
import void OPM_Get (CHAR *ch);
|
||||
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
import void OPM_InitOptions (void);
|
||||
|
|
@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void);
|
|||
import int64 OPM_SymRInt64 (void);
|
||||
import void OPM_SymRLReal (LONGREAL *lr);
|
||||
import void OPM_SymRReal (REAL *r);
|
||||
import void OPM_SymRSet (SET *s);
|
||||
import void OPM_SymRSet (uint32 *s);
|
||||
import void OPM_SymWCh (CHAR ch);
|
||||
import void OPM_SymWInt (int64 i);
|
||||
import void OPM_SymWLReal (LONGREAL lr);
|
||||
import void OPM_SymWReal (REAL r);
|
||||
import void OPM_SymWSet (SET s);
|
||||
import void OPM_SymWSet (uint32 s);
|
||||
import void OPM_Write (CHAR ch);
|
||||
import void OPM_WriteHex (int64 i);
|
||||
import void OPM_WriteInt (int64 i);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x);
|
|||
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b);
|
||||
static void OPP_Factor (OPT_Node *x);
|
||||
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp);
|
||||
export void OPP_Module (OPT_Node *prog, SET opt);
|
||||
export void OPP_Module (OPT_Node *prog, uint32 opt);
|
||||
static void OPP_PointerType (OPT_Struct *typ);
|
||||
static void OPP_ProcedureDeclaration (OPT_Node *x);
|
||||
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
|
||||
|
|
@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
|
|||
OPP_CheckSym(41);
|
||||
}
|
||||
|
||||
void OPP_Module (OPT_Node *prog, SET opt)
|
||||
void OPP_Module (OPT_Node *prog, uint32 opt)
|
||||
{
|
||||
OPS_Name impName, aliasName;
|
||||
OPT_Node procdec = NIL, statseq = NIL;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
|
||||
|
||||
import void OPP_Module (OPT_Node *prog, SET opt);
|
||||
import void OPP_Module (OPT_Node *prog, uint32 opt);
|
||||
import void *OPP__init(void);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -19,7 +20,7 @@ typedef
|
|||
OPT_ConstExt ext;
|
||||
int64 intval;
|
||||
int32 intval2;
|
||||
SET setval;
|
||||
uint32 setval;
|
||||
LONGREAL realval;
|
||||
} OPT_ConstDesc;
|
||||
|
||||
|
|
@ -88,8 +89,8 @@ typedef
|
|||
|
||||
|
||||
export OPT_Object OPT_topScope;
|
||||
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
|
||||
export int8 OPT_nofGmod;
|
||||
export OPT_Object OPT_GlbMod[64];
|
||||
export OPS_Name OPT_SelfName;
|
||||
|
|
@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par);
|
|||
static void OPT_InStruct (OPT_Struct *typ);
|
||||
static OPT_Object OPT_InTProc (int8 mno);
|
||||
static OPT_Struct OPT_InTyp (int32 tag);
|
||||
export void OPT_Init (OPS_Name name, SET opt);
|
||||
export void OPT_Init (OPS_Name name, uint32 opt);
|
||||
export void OPT_InitRecno (void);
|
||||
static void OPT_InitStruct (OPT_Struct *typ, int8 form);
|
||||
export void OPT_Insert (OPS_Name name, OPT_Object *obj);
|
||||
|
|
@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj);
|
|||
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
||||
static void OPT_OutStr (OPT_Struct typ);
|
||||
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
||||
export OPT_Struct OPT_SetType (int32 size);
|
||||
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
|
||||
export int32 OPT_SizeAlignment (int32 size);
|
||||
export void OPT_TypSize (OPT_Struct typ);
|
||||
|
|
@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size)
|
|||
return _o_result;
|
||||
}
|
||||
|
||||
OPT_Struct OPT_SetType (int32 size)
|
||||
{
|
||||
OPT_Struct _o_result;
|
||||
if (size == OPT_set32typ->size) {
|
||||
_o_result = OPT_set32typ;
|
||||
return _o_result;
|
||||
}
|
||||
_o_result = OPT_set64typ;
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
|
||||
{
|
||||
OPT_Struct _o_result;
|
||||
|
|
@ -449,7 +462,7 @@ void OPT_CloseScope (void)
|
|||
OPT_topScope = OPT_topScope->left;
|
||||
}
|
||||
|
||||
void OPT_Init (OPS_Name name, SET opt)
|
||||
void OPT_Init (OPS_Name name, uint32 opt)
|
||||
{
|
||||
OPT_topScope = OPT_universe;
|
||||
OPT_OpenScope(0, NIL);
|
||||
|
|
@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag)
|
|||
if (tag == 4) {
|
||||
_o_result = OPT_IntType(OPM_SymRInt());
|
||||
return _o_result;
|
||||
} else if (tag == 7) {
|
||||
_o_result = OPT_SetType(OPM_SymRInt());
|
||||
return _o_result;
|
||||
} else {
|
||||
_o_result = OPT_impCtxt.ref[__X(tag, 255)];
|
||||
return _o_result;
|
||||
|
|
@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
|||
OPT_Object strobj = NIL;
|
||||
if (typ->ref < OPT_expCtxt.ref) {
|
||||
OPM_SymWInt(-typ->ref);
|
||||
if (typ->ref == 4) {
|
||||
if (__IN(typ->ref, 0x90, 32)) {
|
||||
OPM_SymWInt(typ->size);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
|||
break;
|
||||
case 7:
|
||||
OPM_SymWSet(obj->conval->setval);
|
||||
OPM_SymWInt(obj->typ->size);
|
||||
break;
|
||||
case 5:
|
||||
rval = obj->conval->realval;
|
||||
|
|
@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*))
|
|||
{
|
||||
P(OPT_topScope);
|
||||
P(OPT_undftyp);
|
||||
P(OPT_niltyp);
|
||||
P(OPT_notyp);
|
||||
P(OPT_bytetyp);
|
||||
P(OPT_cpbytetyp);
|
||||
P(OPT_booltyp);
|
||||
P(OPT_chartyp);
|
||||
P(OPT_sinttyp);
|
||||
P(OPT_inttyp);
|
||||
P(OPT_linttyp);
|
||||
P(OPT_hinttyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_int8typ);
|
||||
P(OPT_int16typ);
|
||||
P(OPT_int32typ);
|
||||
P(OPT_int64typ);
|
||||
P(OPT_settyp);
|
||||
P(OPT_set32typ);
|
||||
P(OPT_set64typ);
|
||||
P(OPT_realtyp);
|
||||
P(OPT_lrltyp);
|
||||
P(OPT_settyp);
|
||||
P(OPT_stringtyp);
|
||||
P(OPT_niltyp);
|
||||
P(OPT_notyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_sysptrtyp);
|
||||
P(OPT_sintobj);
|
||||
P(OPT_intobj);
|
||||
P(OPT_lintobj);
|
||||
P(OPT_setobj);
|
||||
__ENUMP(OPT_GlbMod, 64, P);
|
||||
P(OPT_universe);
|
||||
P(OPT_syslink);
|
||||
|
|
@ -2056,6 +2077,8 @@ export void *OPT__init(void)
|
|||
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
|
||||
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
|
||||
OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ);
|
||||
OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ);
|
||||
OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ);
|
||||
OPT_EnterProc((CHAR*)"ADR", 20);
|
||||
OPT_EnterProc((CHAR*)"CC", 21);
|
||||
OPT_EnterProc((CHAR*)"LSH", 22);
|
||||
|
|
@ -2073,13 +2096,14 @@ export void *OPT__init(void)
|
|||
OPT_topScope->right = NIL;
|
||||
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
|
||||
OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
|
||||
OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
|
||||
OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
|
||||
OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
|
||||
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
|
||||
OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp);
|
||||
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj);
|
||||
OPT_EnterBoolConst((CHAR*)"FALSE", 0);
|
||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
@ -17,7 +17,7 @@ typedef
|
|||
OPT_ConstExt ext;
|
||||
int64 intval;
|
||||
int32 intval2;
|
||||
SET setval;
|
||||
uint32 setval;
|
||||
LONGREAL realval;
|
||||
} OPT_ConstDesc;
|
||||
|
||||
|
|
@ -67,8 +67,8 @@ typedef
|
|||
|
||||
|
||||
import OPT_Object OPT_topScope;
|
||||
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
|
||||
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
|
||||
import int8 OPT_nofGmod;
|
||||
import OPT_Object OPT_GlbMod[64];
|
||||
import OPS_Name OPT_SelfName;
|
||||
|
|
@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
|
|||
import void OPT_FindImport (OPT_Object mod, OPT_Object *res);
|
||||
import void OPT_IdFPrint (OPT_Struct typ);
|
||||
import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
|
||||
import void OPT_Init (OPS_Name name, SET opt);
|
||||
import void OPT_Init (OPS_Name name, uint32 opt);
|
||||
import void OPT_InitRecno (void);
|
||||
import void OPT_Insert (OPS_Name name, OPT_Object *obj);
|
||||
import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
|
||||
|
|
@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class);
|
|||
import OPT_Object OPT_NewObj (void);
|
||||
import OPT_Struct OPT_NewStr (int8 form, int8 comp);
|
||||
import void OPT_OpenScope (int8 level, OPT_Object owner);
|
||||
import OPT_Struct OPT_SetType (int32 size);
|
||||
import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
|
||||
import int32 OPT_SizeAlignment (int32 size);
|
||||
import void OPT_TypSize (OPT_Struct typ);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
|
|||
OPV_Traverse(topScope->right, topScope, 1);
|
||||
OPV_Traverse(topScope->right, topScope, 0);
|
||||
OPT_chartyp->strobj->linkadr = 2;
|
||||
OPT_cpbytetyp->strobj->linkadr = 2;
|
||||
OPT_settyp->strobj->linkadr = 2;
|
||||
OPT_realtyp->strobj->linkadr = 2;
|
||||
OPT_adrtyp->strobj->linkadr = 2;
|
||||
|
|
@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope)
|
|||
OPT_int16typ->strobj->linkadr = 2;
|
||||
OPT_int32typ->strobj->linkadr = 2;
|
||||
OPT_int64typ->strobj->linkadr = 2;
|
||||
OPT_set32typ->strobj->linkadr = 2;
|
||||
OPT_set64typ->strobj->linkadr = 2;
|
||||
OPT_hinttyp->strobj->linkadr = 2;
|
||||
OPT_lrltyp->strobj->linkadr = 2;
|
||||
OPT_booltyp->strobj->linkadr = 2;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -40,7 +41,7 @@ export int32 Platform_ArgVector;
|
|||
static Platform_HaltProcedure Platform_HaltHandler;
|
||||
static int32 Platform_TimeStart;
|
||||
export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
|
||||
export CHAR Platform_nl[3];
|
||||
export CHAR Platform_NL[3];
|
||||
|
||||
export address *Platform_FileIdentity__typ;
|
||||
|
||||
|
|
@ -798,7 +799,7 @@ export void *Platform__init(void)
|
|||
Platform_SeekSet = Platform_seekset();
|
||||
Platform_SeekCur = Platform_seekcur();
|
||||
Platform_SeekEnd = Platform_seekend();
|
||||
Platform_nl[0] = 0x0a;
|
||||
Platform_nl[1] = 0x00;
|
||||
Platform_NL[0] = 0x0a;
|
||||
Platform_NL[1] = 0x00;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
@ -26,7 +26,7 @@ import CHAR Platform_CWD[256];
|
|||
import int16 Platform_ArgCount;
|
||||
import int32 Platform_ArgVector;
|
||||
import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd;
|
||||
import CHAR Platform_nl[3];
|
||||
import CHAR Platform_NL[3];
|
||||
|
||||
import address *Platform_FileIdentity__typ;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -183,7 +184,7 @@ export address *Texts_Writer__typ;
|
|||
export address *Texts__1__typ;
|
||||
|
||||
export void Texts_Append (Texts_Text T, Texts_Buffer B);
|
||||
export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
static Texts_Elem Texts_CloneElem (Texts_Elem e);
|
||||
static Texts_Piece Texts_ClonePiece (Texts_Piece p);
|
||||
export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
|
||||
|
|
@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end)
|
|||
}
|
||||
}
|
||||
|
||||
void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff)
|
||||
void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff)
|
||||
{
|
||||
Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL;
|
||||
int32 co, uo, ud, vo, vd;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
@ -130,7 +130,7 @@ import address *Texts_Scanner__typ;
|
|||
import address *Texts_Writer__typ;
|
||||
|
||||
import void Texts_Append (Texts_Text T, Texts_Buffer B);
|
||||
import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff);
|
||||
import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len);
|
||||
import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB);
|
||||
import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void)
|
|||
OPT_Struct adrinttyp = NIL;
|
||||
OPT_sysptrtyp->size = OPM_AddressSize;
|
||||
OPT_adrtyp->size = OPM_AddressSize;
|
||||
OPT_settyp->size = OPM_SetSize;
|
||||
adrinttyp = OPT_IntType(OPM_AddressSize);
|
||||
OPT_adrtyp->strobj = adrinttyp->strobj;
|
||||
OPT_sinttyp = OPT_IntType(OPM_ShortintSize);
|
||||
|
|
@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void)
|
|||
OPT_sintobj->typ = OPT_sinttyp;
|
||||
OPT_intobj->typ = OPT_inttyp;
|
||||
OPT_lintobj->typ = OPT_linttyp;
|
||||
switch (OPM_LongintSize) {
|
||||
case 4:
|
||||
OPT_settyp = OPT_set32typ;
|
||||
break;
|
||||
default:
|
||||
OPT_settyp = OPT_set64typ;
|
||||
break;
|
||||
}
|
||||
OPT_setobj->typ = OPT_settyp;
|
||||
if (__STRCMP(OPM_Model, "C") == 0) {
|
||||
OPT_cpbytetyp->strobj->name[4] = 0x00;
|
||||
} else {
|
||||
OPT_cpbytetyp->strobj->name[4] = '@';
|
||||
}
|
||||
}
|
||||
|
||||
void Compiler_Translate (void)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -18,6 +19,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
#include "Console.h"
|
||||
#include "Heap.h"
|
||||
#include "Console.h"
|
||||
#include "Platform.h"
|
||||
#include "Strings.h"
|
||||
|
||||
|
|
@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
|
|||
export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
|
||||
export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x);
|
||||
export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x);
|
||||
export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
|
||||
export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x);
|
||||
export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
|
||||
export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
export void Files_Register (Files_File f);
|
||||
export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
|
||||
|
|
@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L
|
|||
export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
|
||||
export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
|
||||
export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
|
||||
export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x);
|
||||
export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x);
|
||||
export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
|
||||
export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
|
||||
export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x);
|
||||
export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
|
||||
export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
|
||||
#define Files_IdxTrap() __HALT(-1)
|
||||
#define Files_ToAdr(x) (address)x
|
||||
|
||||
static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode)
|
||||
{
|
||||
|
|
@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x
|
|||
} else {
|
||||
min = n;
|
||||
}
|
||||
__MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min);
|
||||
__MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min);
|
||||
offset += min;
|
||||
(*r).offset = offset;
|
||||
xpos += min;
|
||||
|
|
@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT
|
|||
} else {
|
||||
min = n;
|
||||
}
|
||||
__MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min);
|
||||
__MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min);
|
||||
offset += min;
|
||||
(*r).offset = offset;
|
||||
if (offset > buf->size) {
|
||||
|
|
@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x)
|
|||
*x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
||||
}
|
||||
|
||||
void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x)
|
||||
void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x)
|
||||
{
|
||||
CHAR b[4];
|
||||
int32 l;
|
||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||
l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
||||
*x = (SET)l;
|
||||
*x = (uint32)l;
|
||||
}
|
||||
|
||||
void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x)
|
||||
|
|
@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x)
|
|||
*x = n;
|
||||
}
|
||||
|
||||
void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x)
|
||||
{
|
||||
int32 n;
|
||||
Files_ReadNum(&*R, R__typ, &n);
|
||||
*x = n;
|
||||
}
|
||||
|
||||
void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x)
|
||||
{
|
||||
Files_Write(&*R, R__typ, __VAL(CHAR, x));
|
||||
|
|
@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x)
|
|||
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||
}
|
||||
|
||||
void Files_WriteSet (Files_Rider *R, address *R__typ, SET x)
|
||||
void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x)
|
||||
{
|
||||
CHAR b[4];
|
||||
int32 i;
|
||||
|
|
@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len
|
|||
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
|
||||
}
|
||||
|
||||
void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x)
|
||||
{
|
||||
while (x < -64 || x > 63) {
|
||||
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
|
||||
x = __ASHR(x, 7);
|
||||
}
|
||||
Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128));
|
||||
}
|
||||
|
||||
void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x)
|
||||
void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x)
|
||||
{
|
||||
while (x < -64 || x > 63) {
|
||||
Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128));
|
||||
|
|
@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}};
|
|||
export void *Files__init(void)
|
||||
{
|
||||
__DEFMOD;
|
||||
__MODULE_IMPORT(Configuration);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Heap);
|
||||
__MODULE_IMPORT(Console);
|
||||
__MODULE_IMPORT(Platform);
|
||||
__MODULE_IMPORT(Strings);
|
||||
__REGMOD("Files", EnumPtrs);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
@ -48,9 +48,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x);
|
|||
import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x);
|
||||
import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x);
|
||||
import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x);
|
||||
import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x);
|
||||
import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x);
|
||||
import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x);
|
||||
import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void Files_Register (Files_File f);
|
||||
import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res);
|
||||
|
|
@ -62,10 +61,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L
|
|||
import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x);
|
||||
import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x);
|
||||
import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x);
|
||||
import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x);
|
||||
import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x);
|
||||
import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x);
|
||||
import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x);
|
||||
import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x);
|
||||
import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x);
|
||||
import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len);
|
||||
import void *Files__init(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc);
|
|||
export void OPB_SetElem (OPT_Node *x);
|
||||
static void OPB_SetIntType (OPT_Node node);
|
||||
export void OPB_SetRange (OPT_Node *x, OPT_Node y);
|
||||
static void OPB_SetSetType (OPT_Node node);
|
||||
export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno);
|
||||
export void OPB_StPar0 (OPT_Node *par0, int16 fctno);
|
||||
export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno);
|
||||
|
|
@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node)
|
|||
node->typ = OPT_IntType(OPT_IntSize(node->conval->intval));
|
||||
}
|
||||
|
||||
static void OPB_SetSetType (OPT_Node node)
|
||||
{
|
||||
int32 i32;
|
||||
__GET((address)&node->conval->setval + 4, i32, int32);
|
||||
if (i32 == 0) {
|
||||
node->typ = OPT_set32typ;
|
||||
} else {
|
||||
node->typ = OPT_set64typ;
|
||||
}
|
||||
}
|
||||
|
||||
OPT_Node OPB_NewIntConst (int64 intval)
|
||||
{
|
||||
OPT_Node _o_result;
|
||||
|
|
@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y)
|
|||
}
|
||||
}
|
||||
|
||||
static struct TypTest__57 {
|
||||
static struct TypTest__58 {
|
||||
OPT_Node *x;
|
||||
OPT_Object *obj;
|
||||
BOOLEAN *guard;
|
||||
struct TypTest__57 *lnk;
|
||||
} *TypTest__57_s;
|
||||
struct TypTest__58 *lnk;
|
||||
} *TypTest__58_s;
|
||||
|
||||
static void GTT__58 (OPT_Struct t0, OPT_Struct t1);
|
||||
static void GTT__59 (OPT_Struct t0, OPT_Struct t1);
|
||||
|
||||
static void GTT__58 (OPT_Struct t0, OPT_Struct t1)
|
||||
static void GTT__59 (OPT_Struct t0, OPT_Struct t1)
|
||||
{
|
||||
OPT_Node node = NIL;
|
||||
OPT_Struct t = NIL;
|
||||
|
|
@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1)
|
|||
t1 = t1->BaseTyp;
|
||||
}
|
||||
if (t1 == t0 || t0->form == 0) {
|
||||
if (*TypTest__57_s->guard) {
|
||||
OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL);
|
||||
(*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly;
|
||||
if (*TypTest__58_s->guard) {
|
||||
OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL);
|
||||
(*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly;
|
||||
} else {
|
||||
node = OPT_NewNode(11);
|
||||
node->subcl = 16;
|
||||
node->left = *TypTest__57_s->x;
|
||||
node->obj = *TypTest__57_s->obj;
|
||||
*TypTest__57_s->x = node;
|
||||
node->left = *TypTest__58_s->x;
|
||||
node->obj = *TypTest__58_s->obj;
|
||||
*TypTest__58_s->x = node;
|
||||
}
|
||||
} else {
|
||||
OPB_err(85);
|
||||
}
|
||||
} else if (t0 != t1) {
|
||||
OPB_err(85);
|
||||
} else if (!*TypTest__57_s->guard) {
|
||||
if ((*TypTest__57_s->x)->class == 5) {
|
||||
} else if (!*TypTest__58_s->guard) {
|
||||
if ((*TypTest__58_s->x)->class == 5) {
|
||||
node = OPT_NewNode(11);
|
||||
node->subcl = 16;
|
||||
node->left = *TypTest__57_s->x;
|
||||
node->obj = *TypTest__57_s->obj;
|
||||
*TypTest__57_s->x = node;
|
||||
node->left = *TypTest__58_s->x;
|
||||
node->obj = *TypTest__58_s->obj;
|
||||
*TypTest__58_s->x = node;
|
||||
} else {
|
||||
*TypTest__57_s->x = OPB_NewBoolConst(1);
|
||||
*TypTest__58_s->x = OPB_NewBoolConst(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
|
||||
{
|
||||
struct TypTest__57 _s;
|
||||
struct TypTest__58 _s;
|
||||
_s.x = x;
|
||||
_s.obj = &obj;
|
||||
_s.guard = &guard;
|
||||
_s.lnk = TypTest__57_s;
|
||||
TypTest__57_s = &_s;
|
||||
_s.lnk = TypTest__58_s;
|
||||
TypTest__58_s = &_s;
|
||||
if (OPB_NotVar(*x)) {
|
||||
OPB_err(112);
|
||||
} else if ((*x)->typ->form == 11) {
|
||||
if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) {
|
||||
OPB_err(85);
|
||||
} else if (obj->typ->form == 11) {
|
||||
GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp);
|
||||
GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp);
|
||||
} else {
|
||||
OPB_err(86);
|
||||
}
|
||||
} else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) {
|
||||
GTT__58((*x)->typ, obj->typ);
|
||||
GTT__59((*x)->typ, obj->typ);
|
||||
} else {
|
||||
OPB_err(87);
|
||||
}
|
||||
|
|
@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard)
|
|||
} else {
|
||||
(*x)->typ = OPT_booltyp;
|
||||
}
|
||||
TypTest__57_s = _s.lnk;
|
||||
TypTest__58_s = _s.lnk;
|
||||
}
|
||||
|
||||
void OPB_In (OPT_Node *x, OPT_Node y)
|
||||
|
|
@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
|||
f = (*x)->typ->form;
|
||||
g = typ->form;
|
||||
if ((*x)->class == 7) {
|
||||
if (f == 4) {
|
||||
if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) {
|
||||
OPB_SetSetType(*x);
|
||||
if ((*x)->typ->size > typ->size) {
|
||||
OPB_err(203);
|
||||
(*x)->conval->setval = 0x0;
|
||||
}
|
||||
} else if (f == 4) {
|
||||
if (g == 4) {
|
||||
if ((*x)->typ->size > typ->size) {
|
||||
OPB_SetIntType(*x);
|
||||
|
|
@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y)
|
|||
OPB_err(100);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if ((g == 7 && y->typ->size < z->typ->size)) {
|
||||
OPB_Convert(&y, z->typ);
|
||||
} else {
|
||||
OPB_err(100);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (g == 4) {
|
||||
OPB_Convert(&y, z->typ);
|
||||
|
|
@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
*par0 = x;
|
||||
}
|
||||
|
||||
static struct StPar1__52 {
|
||||
struct StPar1__52 *lnk;
|
||||
} *StPar1__52_s;
|
||||
static struct StPar1__53 {
|
||||
struct StPar1__53 *lnk;
|
||||
} *StPar1__53_s;
|
||||
|
||||
static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
|
||||
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right);
|
||||
|
||||
static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
|
||||
static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right)
|
||||
{
|
||||
OPT_Node _o_result;
|
||||
OPT_Node node = NIL;
|
||||
|
|
@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
int16 f, L;
|
||||
OPT_Struct typ = NIL;
|
||||
OPT_Node p = NIL, t = NIL;
|
||||
struct StPar1__52 _s;
|
||||
_s.lnk = StPar1__52_s;
|
||||
StPar1__52_s = &_s;
|
||||
struct StPar1__53 _s;
|
||||
_s.lnk = StPar1__53_s;
|
||||
StPar1__53_s = &_s;
|
||||
p = *par0;
|
||||
f = x->typ->form;
|
||||
switch (fctno) {
|
||||
|
|
@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(111);
|
||||
}
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
p->typ = OPT_notyp;
|
||||
}
|
||||
break;
|
||||
|
|
@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) {
|
||||
OPB_err(202);
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
p = p->left;
|
||||
x->conval->intval += 1;
|
||||
}
|
||||
p = NewOp__53(12, 19, p, x);
|
||||
p = NewOp__54(12, 19, p, x);
|
||||
p->typ = OPT_linttyp;
|
||||
} else {
|
||||
p = x;
|
||||
|
|
@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
t = x;
|
||||
x = p;
|
||||
p = t;
|
||||
p = NewOp__53(19, 18, p, x);
|
||||
p = NewOp__54(19, 18, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
}
|
||||
p->obj = NIL;
|
||||
} else {
|
||||
p = NewOp__53(12, 17, p, x);
|
||||
p = NewOp__54(12, 17, p, x);
|
||||
p->typ = p->left->typ;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(111);
|
||||
} else {
|
||||
if (fctno == 22) {
|
||||
p = NewOp__53(12, 27, p, x);
|
||||
p = NewOp__54(12, 27, p, x);
|
||||
} else {
|
||||
p = NewOp__53(12, 28, p, x);
|
||||
p = NewOp__54(12, 28, p, x);
|
||||
}
|
||||
p->typ = p->left->typ;
|
||||
}
|
||||
|
|
@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
x = p;
|
||||
p = t;
|
||||
}
|
||||
p = NewOp__53(19, fctno, p, x);
|
||||
p = NewOp__54(19, fctno, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if (x->class == 8 || x->class == 9) {
|
||||
OPB_err(126);
|
||||
} else if (f == 4) {
|
||||
p = NewOp__53(12, 26, p, x);
|
||||
p = NewOp__54(12, 26, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
if (x->class == 8 || x->class == 9) {
|
||||
OPB_err(126);
|
||||
} else if (f == 4) {
|
||||
p = NewOp__53(19, 30, p, x);
|
||||
p = NewOp__54(19, 30, p, x);
|
||||
} else {
|
||||
OPB_err(111);
|
||||
}
|
||||
|
|
@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
break;
|
||||
}
|
||||
*par0 = p;
|
||||
StPar1__52_s = _s.lnk;
|
||||
StPar1__53_s = _s.lnk;
|
||||
}
|
||||
|
||||
void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj)
|
|||
OPM_Write('_');
|
||||
}
|
||||
}
|
||||
} else if ((mode == 5 && obj->typ->form == 4)) {
|
||||
} else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) {
|
||||
if (obj->typ == OPT_adrtyp) {
|
||||
OPM_WriteString((CHAR*)"address", 8);
|
||||
} else {
|
||||
if (obj->typ->form == 4) {
|
||||
OPM_WriteString((CHAR*)"int", 4);
|
||||
} else {
|
||||
OPM_WriteString((CHAR*)"uint", 5);
|
||||
}
|
||||
OPM_WriteInt(__ASHL(obj->typ->size, 3));
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n)
|
|||
OPM_currFile = 1;
|
||||
OPC_GenHeaderMsg();
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define INTEGER int", 20);
|
||||
OPM_WriteString((CHAR*)"#define SHORTINT int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define INTEGER int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_inttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define LONGINT int", 20);
|
||||
OPM_WriteString((CHAR*)"#define LONGINT int", 21);
|
||||
OPM_WriteInt(__ASHL(OPT_linttyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteString((CHAR*)"#define SET uint", 21);
|
||||
OPM_WriteString((CHAR*)"#define SET uint", 22);
|
||||
OPM_WriteInt(__ASHL(OPT_settyp->size, 3));
|
||||
OPM_WriteLn();
|
||||
OPM_WriteLn();
|
||||
|
|
@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
|||
void OPC_Constant (OPT_Const con, int16 form)
|
||||
{
|
||||
int16 i;
|
||||
SET s;
|
||||
uint32 s;
|
||||
int32 hex;
|
||||
BOOLEAN skipLeading;
|
||||
switch (form) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize;
|
|||
export int16 OPM_AddressSize;
|
||||
static int16 OPM_GlobalAlignment;
|
||||
export int16 OPM_Alignment;
|
||||
export SET OPM_GlobalOptions, OPM_Options;
|
||||
export uint32 OPM_GlobalOptions, OPM_Options;
|
||||
export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
|
|
@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void);
|
|||
export void OPM_FPrint (int32 *fp, int64 val);
|
||||
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
export void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
export void OPM_FPrintSet (int32 *fp, SET set);
|
||||
export void OPM_FPrintSet (int32 *fp, uint32 set);
|
||||
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
|
||||
export void OPM_Get (CHAR *ch);
|
||||
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
|
|
@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void);
|
|||
export int64 OPM_SymRInt64 (void);
|
||||
export void OPM_SymRLReal (LONGREAL *lr);
|
||||
export void OPM_SymRReal (REAL *r);
|
||||
export void OPM_SymRSet (SET *s);
|
||||
export void OPM_SymRSet (uint32 *s);
|
||||
export void OPM_SymWCh (CHAR ch);
|
||||
export void OPM_SymWInt (int64 i);
|
||||
export void OPM_SymWLReal (LONGREAL lr);
|
||||
export void OPM_SymWReal (REAL r);
|
||||
export void OPM_SymWSet (SET s);
|
||||
export void OPM_SymWSet (uint32 s);
|
||||
static void OPM_VerboseListSizes (void);
|
||||
export void OPM_Write (CHAR ch);
|
||||
export void OPM_WriteHex (int64 i);
|
||||
|
|
@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void)
|
|||
OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79);
|
||||
OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95);
|
||||
OPM_LogWLn();
|
||||
|
|
@ -709,10 +710,10 @@ void OPM_err (int16 n)
|
|||
|
||||
void OPM_FPrint (int32 *fp, int64 val)
|
||||
{
|
||||
*fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32);
|
||||
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
|
||||
}
|
||||
|
||||
void OPM_FPrintSet (int32 *fp, SET set)
|
||||
void OPM_FPrintSet (int32 *fp, uint32 set)
|
||||
{
|
||||
OPM_FPrint(&*fp, (int32)set);
|
||||
}
|
||||
|
|
@ -751,13 +752,11 @@ int32 OPM_SymRInt (void)
|
|||
int64 OPM_SymRInt64 (void)
|
||||
{
|
||||
int64 _o_result;
|
||||
int64 k;
|
||||
Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k);
|
||||
_o_result = k;
|
||||
_o_result = OPM_SymRInt();
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
void OPM_SymRSet (SET *s)
|
||||
void OPM_SymRSet (uint32 *s)
|
||||
{
|
||||
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s);
|
||||
}
|
||||
|
|
@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch)
|
|||
|
||||
void OPM_SymWInt (int64 i)
|
||||
{
|
||||
Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i);
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
|
||||
}
|
||||
|
||||
void OPM_SymWSet (SET s)
|
||||
void OPM_SymWSet (uint32 s)
|
||||
{
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import CHAR OPM_Model[10];
|
||||
import int16 OPM_AddressSize, OPM_Alignment;
|
||||
import SET OPM_GlobalOptions, OPM_Options;
|
||||
import uint32 OPM_GlobalOptions, OPM_Options;
|
||||
import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
|
|
@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void);
|
|||
import void OPM_FPrint (int32 *fp, int64 val);
|
||||
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
import void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
import void OPM_FPrintSet (int32 *fp, SET set);
|
||||
import void OPM_FPrintSet (int32 *fp, uint32 set);
|
||||
import void OPM_Get (CHAR *ch);
|
||||
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
import void OPM_InitOptions (void);
|
||||
|
|
@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void);
|
|||
import int64 OPM_SymRInt64 (void);
|
||||
import void OPM_SymRLReal (LONGREAL *lr);
|
||||
import void OPM_SymRReal (REAL *r);
|
||||
import void OPM_SymRSet (SET *s);
|
||||
import void OPM_SymRSet (uint32 *s);
|
||||
import void OPM_SymWCh (CHAR ch);
|
||||
import void OPM_SymWInt (int64 i);
|
||||
import void OPM_SymWLReal (LONGREAL lr);
|
||||
import void OPM_SymWReal (REAL r);
|
||||
import void OPM_SymWSet (SET s);
|
||||
import void OPM_SymWSet (uint32 s);
|
||||
import void OPM_Write (CHAR ch);
|
||||
import void OPM_WriteHex (int64 i);
|
||||
import void OPM_WriteInt (int64 i);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x);
|
|||
static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b);
|
||||
static void OPP_Factor (OPT_Node *x);
|
||||
static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp);
|
||||
export void OPP_Module (OPT_Node *prog, SET opt);
|
||||
export void OPP_Module (OPT_Node *prog, uint32 opt);
|
||||
static void OPP_PointerType (OPT_Struct *typ);
|
||||
static void OPP_ProcedureDeclaration (OPT_Node *x);
|
||||
static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec);
|
||||
|
|
@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
|
|||
OPP_CheckSym(41);
|
||||
}
|
||||
|
||||
void OPP_Module (OPT_Node *prog, SET opt)
|
||||
void OPP_Module (OPT_Node *prog, uint32 opt)
|
||||
{
|
||||
OPS_Name impName, aliasName;
|
||||
OPT_Node procdec = NIL, statseq = NIL;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
|
||||
|
||||
import void OPP_Module (OPT_Node *prog, SET opt);
|
||||
import void OPP_Module (OPT_Node *prog, uint32 opt);
|
||||
import void *OPP__init(void);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
|
||||
#define SHORTINT int8
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
|
@ -19,7 +20,7 @@ typedef
|
|||
OPT_ConstExt ext;
|
||||
int64 intval;
|
||||
int32 intval2;
|
||||
SET setval;
|
||||
uint32 setval;
|
||||
LONGREAL realval;
|
||||
} OPT_ConstDesc;
|
||||
|
||||
|
|
@ -88,8 +89,8 @@ typedef
|
|||
|
||||
|
||||
export OPT_Object OPT_topScope;
|
||||
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj;
|
||||
export int8 OPT_nofGmod;
|
||||
export OPT_Object OPT_GlbMod[64];
|
||||
export OPS_Name OPT_SelfName;
|
||||
|
|
@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par);
|
|||
static void OPT_InStruct (OPT_Struct *typ);
|
||||
static OPT_Object OPT_InTProc (int8 mno);
|
||||
static OPT_Struct OPT_InTyp (int32 tag);
|
||||
export void OPT_Init (OPS_Name name, SET opt);
|
||||
export void OPT_Init (OPS_Name name, uint32 opt);
|
||||
export void OPT_InitRecno (void);
|
||||
static void OPT_InitStruct (OPT_Struct *typ, int8 form);
|
||||
export void OPT_Insert (OPS_Name name, OPT_Object *obj);
|
||||
|
|
@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj);
|
|||
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
|
||||
static void OPT_OutStr (OPT_Struct typ);
|
||||
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
|
||||
export OPT_Struct OPT_SetType (int32 size);
|
||||
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir);
|
||||
export int32 OPT_SizeAlignment (int32 size);
|
||||
export void OPT_TypSize (OPT_Struct typ);
|
||||
|
|
@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size)
|
|||
return _o_result;
|
||||
}
|
||||
|
||||
OPT_Struct OPT_SetType (int32 size)
|
||||
{
|
||||
OPT_Struct _o_result;
|
||||
if (size == OPT_set32typ->size) {
|
||||
_o_result = OPT_set32typ;
|
||||
return _o_result;
|
||||
}
|
||||
_o_result = OPT_set64typ;
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)
|
||||
{
|
||||
OPT_Struct _o_result;
|
||||
|
|
@ -449,7 +462,7 @@ void OPT_CloseScope (void)
|
|||
OPT_topScope = OPT_topScope->left;
|
||||
}
|
||||
|
||||
void OPT_Init (OPS_Name name, SET opt)
|
||||
void OPT_Init (OPS_Name name, uint32 opt)
|
||||
{
|
||||
OPT_topScope = OPT_universe;
|
||||
OPT_OpenScope(0, NIL);
|
||||
|
|
@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag)
|
|||
if (tag == 4) {
|
||||
_o_result = OPT_IntType(OPM_SymRInt());
|
||||
return _o_result;
|
||||
} else if (tag == 7) {
|
||||
_o_result = OPT_SetType(OPM_SymRInt());
|
||||
return _o_result;
|
||||
} else {
|
||||
_o_result = OPT_impCtxt.ref[__X(tag, 255)];
|
||||
return _o_result;
|
||||
|
|
@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
|||
OPT_Object strobj = NIL;
|
||||
if (typ->ref < OPT_expCtxt.ref) {
|
||||
OPM_SymWInt(-typ->ref);
|
||||
if (typ->ref == 4) {
|
||||
if (__IN(typ->ref, 0x90, 32)) {
|
||||
OPM_SymWInt(typ->size);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
|||
break;
|
||||
case 7:
|
||||
OPM_SymWSet(obj->conval->setval);
|
||||
OPM_SymWInt(obj->typ->size);
|
||||
break;
|
||||
case 5:
|
||||
rval = obj->conval->realval;
|
||||
|
|
@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*))
|
|||
{
|
||||
P(OPT_topScope);
|
||||
P(OPT_undftyp);
|
||||
P(OPT_niltyp);
|
||||
P(OPT_notyp);
|
||||
P(OPT_bytetyp);
|
||||
P(OPT_cpbytetyp);
|
||||
P(OPT_booltyp);
|
||||
P(OPT_chartyp);
|
||||
P(OPT_sinttyp);
|
||||
P(OPT_inttyp);
|
||||
P(OPT_linttyp);
|
||||
P(OPT_hinttyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_int8typ);
|
||||
P(OPT_int16typ);
|
||||
P(OPT_int32typ);
|
||||
P(OPT_int64typ);
|
||||
P(OPT_settyp);
|
||||
P(OPT_set32typ);
|
||||
P(OPT_set64typ);
|
||||
P(OPT_realtyp);
|
||||
P(OPT_lrltyp);
|
||||
P(OPT_settyp);
|
||||
P(OPT_stringtyp);
|
||||
P(OPT_niltyp);
|
||||
P(OPT_notyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_sysptrtyp);
|
||||
P(OPT_sintobj);
|
||||
P(OPT_intobj);
|
||||
P(OPT_lintobj);
|
||||
P(OPT_setobj);
|
||||
__ENUMP(OPT_GlbMod, 64, P);
|
||||
P(OPT_universe);
|
||||
P(OPT_syslink);
|
||||
|
|
@ -2056,6 +2077,8 @@ export void *OPT__init(void)
|
|||
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
|
||||
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
|
||||
OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ);
|
||||
OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ);
|
||||
OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ);
|
||||
OPT_EnterProc((CHAR*)"ADR", 20);
|
||||
OPT_EnterProc((CHAR*)"CC", 21);
|
||||
OPT_EnterProc((CHAR*)"LSH", 22);
|
||||
|
|
@ -2073,13 +2096,14 @@ export void *OPT__init(void)
|
|||
OPT_topScope->right = NIL;
|
||||
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
|
||||
OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
|
||||
OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
|
||||
OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
|
||||
OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
|
||||
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
|
||||
OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp);
|
||||
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj);
|
||||
OPT_EnterBoolConst((CHAR*)"FALSE", 0);
|
||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||
|
|
|
|||
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