Skip to content

Commit 42f6cd0

Browse files
author
qi
committed
-_-
1 parent 1ce0c5c commit 42f6cd0

24 files changed

+163
-419
lines changed

loucomp/analyze.o

-4.02 KB
Binary file not shown.

loucomp/cgen.o

-9.1 KB
Binary file not shown.

loucomp/code.o

-4.45 KB
Binary file not shown.

loucomp/lex/TINY.L

-75
This file was deleted.

loucomp/main.c

+5-23
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,13 @@
77

88
#include "globals.h"
99

10-
/* set NO_PARSE to TRUE to get a scanner-only compiler */
11-
#define NO_PARSE FALSE
12-
/* set NO_ANALYZE to TRUE to get a parser-only compiler */
13-
#define NO_ANALYZE FALSE
14-
15-
/* set NO_CODE to TRUE to get a compiler that does not
16-
* generate code
17-
*/
18-
#define NO_CODE FALSE
1910

2011
#include "util.h"
21-
#if NO_PARSE
2212
#include "scan.h"
23-
#else
2413
#include "parse.h"
25-
#if !NO_ANALYZE
2614
#include "analyze.h"
27-
#if !NO_CODE
2815
#include "cgen.h"
29-
#endif
30-
#endif
31-
#endif
16+
3217

3318
/* allocate global variables */
3419
int lineno = 0;
@@ -62,23 +47,23 @@ int main( int argc, char * argv[] )
6247
}
6348
listing = stdout; /* send listing to screen */
6449
fprintf(listing,"\nTINY COMPILATION: %s\n",pgm);
65-
#if NO_PARSE
50+
6651
while (getToken()!=ENDFILE);
67-
#else
52+
6853
syntaxTree = parse();
6954
if (TraceParse) {
7055
fprintf(listing,"\nSyntax tree:\n");
7156
printTree(syntaxTree);
7257
}
73-
#if !NO_ANALYZE
58+
7459
if (! Error)
7560
{ if (TraceAnalyze) fprintf(listing,"\nBuilding Symbol Table...\n");
7661
buildSymtab(syntaxTree);
7762
if (TraceAnalyze) fprintf(listing,"\nChecking Types...\n");
7863
typeCheck(syntaxTree);
7964
if (TraceAnalyze) fprintf(listing,"\nType Checking Finished\n");
8065
}
81-
#if !NO_CODE
66+
8267
if (! Error)
8368
{ char * codefile;
8469
int fnlen = strcspn(pgm,".");
@@ -93,9 +78,6 @@ int main( int argc, char * argv[] )
9378
codeGen(syntaxTree,codefile);
9479
fclose(code);
9580
}
96-
#endif
97-
#endif
98-
#endif
9981
fclose(source);
10082
return 0;
10183
}

loucomp/main.o

-4.72 KB
Binary file not shown.

loucomp/parse.o

-6.91 KB
Binary file not shown.

loucomp/scan.o

-7.12 KB
Binary file not shown.

loucomp/symtab.o

-3.4 KB
Binary file not shown.

loucomp/tiny.exe

-31.1 KB
Binary file not shown.

loucomp/tm.exe

-21.3 KB
Binary file not shown.

loucomp/util.o

-7.71 KB
Binary file not shown.

loucomp/yacc/GLOBALS.H

-120
This file was deleted.

0 commit comments

Comments
 (0)