mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
Add IsConsole tests to compiler.mod, update bootstrap.
This commit is contained in:
parent
6da0d5d685
commit
c12aae020d
187 changed files with 348 additions and 342 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done)
|
|||
if (OPM_noerr) {
|
||||
if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
||||
OPM_DeleteNewSym();
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogWStr((CHAR*)" Main program.", 16);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
} else {
|
||||
if (new) {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
OPM_RegisterNewSym();
|
||||
} else if (ext) {
|
||||
OPM_LogWStr((CHAR*)" Extended symbol file.", 24);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
|||
export void OPM_InitOptions (void);
|
||||
export INT16 OPM_Integer (INT64 n);
|
||||
static void OPM_LogErrMsg (INT16 n);
|
||||
export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len);
|
||||
export void OPM_LogW (CHAR ch);
|
||||
export void OPM_LogWLn (void);
|
||||
export void OPM_LogWNum (INT64 i, INT64 len);
|
||||
|
|
@ -121,6 +122,15 @@ void OPM_LogWLn (void)
|
|||
Out_Ln();
|
||||
}
|
||||
|
||||
void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len)
|
||||
{
|
||||
__DUP(vt100code, vt100code__len, CHAR);
|
||||
if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) {
|
||||
VT100_SetAttr(vt100code, vt100code__len);
|
||||
}
|
||||
__DEL(vt100code);
|
||||
}
|
||||
|
||||
INT64 OPM_SignedMaximum (INT32 bytecount)
|
||||
{
|
||||
INT64 result;
|
||||
|
|
@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n)
|
|||
Texts_Scanner S;
|
||||
CHAR c;
|
||||
if (n >= 0) {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"31m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"31m", 4);
|
||||
OPM_LogWStr((CHAR*)" err ", 7);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
} else {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"35m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"35m", 4);
|
||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||
n = -n;
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogWNum(n, 1);
|
||||
OPM_LogWStr((CHAR*)" ", 3);
|
||||
|
|
@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos)
|
|||
OPM_LogW(' ');
|
||||
i -= 1;
|
||||
}
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogW('^');
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
Files_Close(f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch);
|
|||
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
import void OPM_InitOptions (void);
|
||||
import INT16 OPM_Integer (INT64 n);
|
||||
import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len);
|
||||
import void OPM_LogW (CHAR ch);
|
||||
import void OPM_LogWLn (void);
|
||||
import void OPM_LogWNum (INT64 i, INT64 len);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
#include "Platform.h"
|
||||
|
||||
|
||||
export BOOLEAN Out_IsConsole;
|
||||
static CHAR Out_buf[128];
|
||||
static INT16 Out_in;
|
||||
|
||||
|
|
@ -311,6 +312,7 @@ export void *Out__init(void)
|
|||
__REGCMD("Ln", Out_Ln);
|
||||
__REGCMD("Open", Out_Open);
|
||||
/* BEGIN */
|
||||
Out_IsConsole = Platform_IsConsole(1);
|
||||
Out_in = 0;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Out__h
|
||||
#define Out__h
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
import BOOLEAN Out_IsConsole;
|
||||
|
||||
|
||||
import void Out_Char (CHAR ch);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden
|
|||
export BOOLEAN Platform_Inaccessible (INT16 e);
|
||||
export void Platform_Init (INT32 argc, INT32 argvadr);
|
||||
export BOOLEAN Platform_Interrupted (INT16 e);
|
||||
export BOOLEAN Platform_IsConsole (INT32 h);
|
||||
export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
|
||||
export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
export BOOLEAN Platform_NoSuchDirectory (INT16 e);
|
||||
|
|
@ -131,6 +132,7 @@ extern void Heap_InitHeap();
|
|||
#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var)
|
||||
#define Platform_getpid() (INTEGER)getpid()
|
||||
#define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0)
|
||||
#define Platform_isatty(fd) isatty(fd)
|
||||
#define Platform_lseek(fd, o, w) lseek(fd, o, w)
|
||||
#define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)
|
||||
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
|
||||
|
|
@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
BOOLEAN Platform_IsConsole (INT32 h)
|
||||
{
|
||||
return Platform_isatty(h) != 0;
|
||||
}
|
||||
|
||||
INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ)
|
||||
{
|
||||
Platform_structstats();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden
|
|||
import BOOLEAN Platform_Inaccessible (INT16 e);
|
||||
import void Platform_Init (INT32 argc, INT32 argvadr);
|
||||
import BOOLEAN Platform_Interrupted (INT16 e);
|
||||
import BOOLEAN Platform_IsConsole (INT32 h);
|
||||
import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
|
||||
import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
import BOOLEAN Platform_NoSuchDirectory (INT16 e);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef VT100__h
|
||||
#define VT100__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done)
|
|||
if (OPM_noerr) {
|
||||
if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
||||
OPM_DeleteNewSym();
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogWStr((CHAR*)" Main program.", 16);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
} else {
|
||||
if (new) {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
OPM_RegisterNewSym();
|
||||
} else if (ext) {
|
||||
OPM_LogWStr((CHAR*)" Extended symbol file.", 24);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
|||
export void OPM_InitOptions (void);
|
||||
export INT16 OPM_Integer (INT64 n);
|
||||
static void OPM_LogErrMsg (INT16 n);
|
||||
export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len);
|
||||
export void OPM_LogW (CHAR ch);
|
||||
export void OPM_LogWLn (void);
|
||||
export void OPM_LogWNum (INT64 i, INT64 len);
|
||||
|
|
@ -121,6 +122,15 @@ void OPM_LogWLn (void)
|
|||
Out_Ln();
|
||||
}
|
||||
|
||||
void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len)
|
||||
{
|
||||
__DUP(vt100code, vt100code__len, CHAR);
|
||||
if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) {
|
||||
VT100_SetAttr(vt100code, vt100code__len);
|
||||
}
|
||||
__DEL(vt100code);
|
||||
}
|
||||
|
||||
INT64 OPM_SignedMaximum (INT32 bytecount)
|
||||
{
|
||||
INT64 result;
|
||||
|
|
@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n)
|
|||
Texts_Scanner S;
|
||||
CHAR c;
|
||||
if (n >= 0) {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"31m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"31m", 4);
|
||||
OPM_LogWStr((CHAR*)" err ", 7);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
} else {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"35m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"35m", 4);
|
||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||
n = -n;
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogWNum(n, 1);
|
||||
OPM_LogWStr((CHAR*)" ", 3);
|
||||
|
|
@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos)
|
|||
OPM_LogW(' ');
|
||||
i -= 1;
|
||||
}
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogW('^');
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
Files_Close(f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch);
|
|||
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
import void OPM_InitOptions (void);
|
||||
import INT16 OPM_Integer (INT64 n);
|
||||
import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len);
|
||||
import void OPM_LogW (CHAR ch);
|
||||
import void OPM_LogWLn (void);
|
||||
import void OPM_LogWNum (INT64 i, INT64 len);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
#include "Platform.h"
|
||||
|
||||
|
||||
export BOOLEAN Out_IsConsole;
|
||||
static CHAR Out_buf[128];
|
||||
static INT16 Out_in;
|
||||
|
||||
|
|
@ -311,6 +312,7 @@ export void *Out__init(void)
|
|||
__REGCMD("Ln", Out_Ln);
|
||||
__REGCMD("Open", Out_Open);
|
||||
/* BEGIN */
|
||||
Out_IsConsole = Platform_IsConsole(1);
|
||||
Out_in = 0;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Out__h
|
||||
#define Out__h
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
import BOOLEAN Out_IsConsole;
|
||||
|
||||
|
||||
import void Out_Char (CHAR ch);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden
|
|||
export BOOLEAN Platform_Inaccessible (INT16 e);
|
||||
export void Platform_Init (INT32 argc, INT32 argvadr);
|
||||
export BOOLEAN Platform_Interrupted (INT16 e);
|
||||
export BOOLEAN Platform_IsConsole (INT32 h);
|
||||
export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
|
||||
export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
export BOOLEAN Platform_NoSuchDirectory (INT16 e);
|
||||
|
|
@ -131,6 +132,7 @@ extern void Heap_InitHeap();
|
|||
#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var)
|
||||
#define Platform_getpid() (INTEGER)getpid()
|
||||
#define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0)
|
||||
#define Platform_isatty(fd) isatty(fd)
|
||||
#define Platform_lseek(fd, o, w) lseek(fd, o, w)
|
||||
#define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)
|
||||
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
|
||||
|
|
@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
BOOLEAN Platform_IsConsole (INT32 h)
|
||||
{
|
||||
return Platform_isatty(h) != 0;
|
||||
}
|
||||
|
||||
INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ)
|
||||
{
|
||||
Platform_structstats();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden
|
|||
import BOOLEAN Platform_Inaccessible (INT16 e);
|
||||
import void Platform_Init (INT32 argc, INT32 argvadr);
|
||||
import BOOLEAN Platform_Interrupted (INT16 e);
|
||||
import BOOLEAN Platform_IsConsole (INT32 h);
|
||||
import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
|
||||
import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
import BOOLEAN Platform_NoSuchDirectory (INT16 e);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef VT100__h
|
||||
#define VT100__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done)
|
|||
if (OPM_noerr) {
|
||||
if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
|
||||
OPM_DeleteNewSym();
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogWStr((CHAR*)" Main program.", 16);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
} else {
|
||||
if (new) {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogWStr((CHAR*)" New symbol file.", 19);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
OPM_RegisterNewSym();
|
||||
} else if (ext) {
|
||||
OPM_LogWStr((CHAR*)" Extended symbol file.", 24);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
|||
export void OPM_InitOptions (void);
|
||||
export INT16 OPM_Integer (INT64 n);
|
||||
static void OPM_LogErrMsg (INT16 n);
|
||||
export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len);
|
||||
export void OPM_LogW (CHAR ch);
|
||||
export void OPM_LogWLn (void);
|
||||
export void OPM_LogWNum (INT64 i, INT64 len);
|
||||
|
|
@ -121,6 +122,15 @@ void OPM_LogWLn (void)
|
|||
Out_Ln();
|
||||
}
|
||||
|
||||
void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len)
|
||||
{
|
||||
__DUP(vt100code, vt100code__len, CHAR);
|
||||
if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) {
|
||||
VT100_SetAttr(vt100code, vt100code__len);
|
||||
}
|
||||
__DEL(vt100code);
|
||||
}
|
||||
|
||||
INT64 OPM_SignedMaximum (INT32 bytecount)
|
||||
{
|
||||
INT64 result;
|
||||
|
|
@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n)
|
|||
Texts_Scanner S;
|
||||
CHAR c;
|
||||
if (n >= 0) {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"31m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"31m", 4);
|
||||
OPM_LogWStr((CHAR*)" err ", 7);
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
} else {
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"35m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"35m", 4);
|
||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||
n = -n;
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogWNum(n, 1);
|
||||
OPM_LogWStr((CHAR*)" ", 3);
|
||||
|
|
@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos)
|
|||
OPM_LogW(' ');
|
||||
i -= 1;
|
||||
}
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"32m", 4);
|
||||
OPM_LogW('^');
|
||||
if (!__IN(16, OPM_Options, 32)) {
|
||||
VT100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
OPM_LogVT100((CHAR*)"0m", 3);
|
||||
Files_Close(f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch);
|
|||
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
import void OPM_InitOptions (void);
|
||||
import INT16 OPM_Integer (INT64 n);
|
||||
import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len);
|
||||
import void OPM_LogW (CHAR ch);
|
||||
import void OPM_LogWLn (void);
|
||||
import void OPM_LogWNum (INT64 i, INT64 len);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
#include "Platform.h"
|
||||
|
||||
|
||||
export BOOLEAN Out_IsConsole;
|
||||
static CHAR Out_buf[128];
|
||||
static INT16 Out_in;
|
||||
|
||||
|
|
@ -311,6 +312,7 @@ export void *Out__init(void)
|
|||
__REGCMD("Ln", Out_Ln);
|
||||
__REGCMD("Open", Out_Open);
|
||||
/* BEGIN */
|
||||
Out_IsConsole = Platform_IsConsole(1);
|
||||
Out_in = 0;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#ifndef Out__h
|
||||
#define Out__h
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
import BOOLEAN Out_IsConsole;
|
||||
|
||||
|
||||
import void Out_Char (CHAR ch);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
|
||||
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */
|
||||
|
||||
#define SHORTINT INT8
|
||||
#define INTEGER INT16
|
||||
|
|
@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden
|
|||
export BOOLEAN Platform_Inaccessible (INT16 e);
|
||||
export void Platform_Init (INT32 argc, INT64 argvadr);
|
||||
export BOOLEAN Platform_Interrupted (INT16 e);
|
||||
export BOOLEAN Platform_IsConsole (INT32 h);
|
||||
export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d);
|
||||
export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h);
|
||||
export BOOLEAN Platform_NoSuchDirectory (INT16 e);
|
||||
|
|
@ -131,6 +132,7 @@ extern void Heap_InitHeap();
|
|||
#define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var)
|
||||
#define Platform_getpid() (INTEGER)getpid()
|
||||
#define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0)
|
||||
#define Platform_isatty(fd) isatty(fd)
|
||||
#define Platform_lseek(fd, o, w) lseek(fd, o, w)
|
||||
#define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)
|
||||
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
|
||||
|
|
@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h)
|
|||
__RETCHK;
|
||||
}
|
||||
|
||||
BOOLEAN Platform_IsConsole (INT32 h)
|
||||
{
|
||||
return Platform_isatty(h) != 0;
|
||||
}
|
||||
|
||||
INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ)
|
||||
{
|
||||
Platform_structstats();
|
||||
|
|
|
|||
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