version 1.2, 2000/01/17 13:57:26 |
version 1.7, 2020/10/07 23:53:25 |
|
|
/* $OpenXM$ */ |
/* $OpenXM: OpenXM/src/k097/k2.c,v 1.6 2015/10/10 11:29:46 takayama Exp $ */ |
/* k2.c main program of k. */ |
/* k2.c main program of k. */ |
|
|
#define DATE "1998,12/15" |
#define DATE "1998,12/15" |
#include <stdio.h> |
#include <stdio.h> |
|
#include <string.h> |
|
#include <stdlib.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
#include "extern.h" |
#include "extern.h" |
#include "extern2.h" |
#include "extern2.h" |
|
|
|
#include "ki.h" |
|
|
char *getLOAD_K_PATH(); /* from d.h */ |
char *getLOAD_K_PATH(); /* from d.h */ |
|
|
#ifdef CALLASIR |
#ifdef CALLASIR |
Line 20 extern int DebugMode; |
|
Line 24 extern int DebugMode; |
|
extern int K00_verbose; |
extern int K00_verbose; |
|
|
int Startupk2 = 1; |
int Startupk2 = 1; |
int FactorA = 0; /* sm1(" (aa) run "); does not work. */ |
|
|
|
main(int argc,char *argv[]) { |
|
|
void main(int argc,char *argv[]) { |
extern int Saki; |
extern int Saki; |
extern int Interactive; |
extern int Interactive; |
int i; |
int i; |
Line 34 main(int argc,char *argv[]) { |
|
Line 38 main(int argc,char *argv[]) { |
|
if (strcmp(argv[i],"-d") == 0) { |
if (strcmp(argv[i],"-d") == 0) { |
fprintf(stderr,"DebugCompiler = 1\n"); |
fprintf(stderr,"DebugCompiler = 1\n"); |
DebugCompiler = 1; |
DebugCompiler = 1; |
}else if (strcmp(argv[i],"-f") == 0) { |
|
fprintf(stderr,"Loading factor-a.sm1\n"); |
|
FactorA = 1; |
|
}else if (strcmp(argv[i],"-nostartup") == 0) { |
}else if (strcmp(argv[i],"-nostartup") == 0) { |
fprintf(stderr,"Do not load startup.k\n"); |
fprintf(stderr,"Do not load startup.k\n"); |
Startupk2 = 0; |
Startupk2 = 0; |
Line 47 main(int argc,char *argv[]) { |
|
Line 48 main(int argc,char *argv[]) { |
|
}else{ |
}else{ |
fprintf(stderr,"Usage: 1: k\n"); |
fprintf(stderr,"Usage: 1: k\n"); |
fprintf(stderr," 2: k -d (DebugCompiler=1)\n"); |
fprintf(stderr," 2: k -d (DebugCompiler=1)\n"); |
fprintf(stderr," 3: k -f (load factor-a.sm1)\n"); |
fprintf(stderr," 3: k -nostartup (do not load startup.k)\n"); |
fprintf(stderr," 4: k -nostartup (do not load startup.k)\n"); |
fprintf(stderr," 4: k -v (verbose) or k -vv \n"); |
fprintf(stderr," 5: k -v (verbose) or k -vv \n"); |
|
exit(1); |
exit(1); |
} |
} |
} |
} |
} |
} |
#ifdef CALLASIR |
#ifdef CALLASIR |
GC_init(); |
GC_INIT(); /* GC_init(); */ |
KasirKanAsirInit(); |
KasirKanAsirInit(); |
#endif |
#endif |
KSstart(); /******** initialize ***********/ |
KSstart(); /******** initialize ***********/ |
Line 75 main(int argc,char *argv[]) { |
|
Line 75 main(int argc,char *argv[]) { |
|
execFile("var.sm1"); KSexecuteString(" strictMode "); |
execFile("var.sm1"); KSexecuteString(" strictMode "); |
execFile("incmac.sm1"); |
execFile("incmac.sm1"); |
execFile("slib.sm1"); |
execFile("slib.sm1"); |
if (FactorA) execFile("factor-b.sm1"); |
|
|
|
printf("\n\nIn(1)="); |
printf("\n\nIn(1)= "); |
s = "startup.k"; |
s = "startup.k"; |
if (Startupk2) { |
if (Startupk2) { |
strcpy(tname,s); |
strcpy(tname,s); |