version 1.33, 2020/06/10 21:03:36 |
version 1.34, 2020/06/10 21:03:56 |
|
|
THIS SOFTWARE. |
THIS SOFTWARE. |
****************************************************************/ |
****************************************************************/ |
|
|
const char *version = "version 20191025"; |
const char *version = "version 20191110"; |
|
|
#define DEBUG |
#define DEBUG |
#include <stdio.h> |
#include <stdio.h> |
|
|
extern FILE *yyin; /* lex input file */ |
extern FILE *yyin; /* lex input file */ |
char *lexprog; /* points to program argument if it exists */ |
char *lexprog; /* points to program argument if it exists */ |
extern int errorflag; /* non-zero if any syntax errors; set by yyerror */ |
extern int errorflag; /* non-zero if any syntax errors; set by yyerror */ |
int compile_time = 2; /* for error printing: */ |
enum compile_states compile_time = ERROR_PRINTING; |
/* 2 = cmdline, 1 = compile, 0 = running */ |
|
|
|
#define MAX_PFILE 20 /* max number of -f's */ |
#define MAX_PFILE 20 /* max number of -f's */ |
|
|
|
|
int npfile = 0; /* number of filenames */ |
int npfile = 0; /* number of filenames */ |
int curpfile = 0; /* current filename */ |
int curpfile = 0; /* current filename */ |
|
|
int safe = 0; /* 1 => "safe" mode */ |
bool safe = false; /* true => "safe" mode */ |
|
|
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |
{ |
{ |
|
|
switch (argv[1][1]) { |
switch (argv[1][1]) { |
case 's': |
case 's': |
if (strcmp(argv[1], "-safe") == 0) |
if (strcmp(argv[1], "-safe") == 0) |
safe = 1; |
safe = true; |
break; |
break; |
case 'f': /* next argument is program filename */ |
case 'f': /* next argument is program filename */ |
if (argv[1][2] != 0) { /* arg is -fsomething */ |
if (argv[1][2] != 0) { /* arg is -fsomething */ |
|
|
} |
} |
recinit(recsize); |
recinit(recsize); |
syminit(); |
syminit(); |
compile_time = 1; |
compile_time = COMPILING; |
argv[0] = cmdname; /* put prog name at front of arglist */ |
argv[0] = cmdname; /* put prog name at front of arglist */ |
DPRINTF( ("argc=%d, argv[0]=%s\n", argc, argv[0]) ); |
DPRINTF( ("argc=%d, argv[0]=%s\n", argc, argv[0]) ); |
arginit(argc, argv); |
arginit(argc, argv); |
|
|
*FS = qstring(fs, '\0'); |
*FS = qstring(fs, '\0'); |
DPRINTF( ("errorflag=%d\n", errorflag) ); |
DPRINTF( ("errorflag=%d\n", errorflag) ); |
if (errorflag == 0) { |
if (errorflag == 0) { |
compile_time = 0; |
compile_time = RUNNING; |
run(winner); |
run(winner); |
} else |
} else |
bracecheck(); |
bracecheck(); |