-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
53 lines (48 loc) · 850 Bytes
/
main.c
File metadata and controls
53 lines (48 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
** Concurrent C translator
**
** Joe Barerra, RIACS, 1985
** Bob Brown, RIACS, 1985
** Bill Lynch, RIACS, 1986
**
** Input - named .cc file on argument list (just one!)
** Output - translated programs on stdout
**
** System interface done by Bob Brown, RIACS, 1986
*/
#include <stdio.h>
#define EXTERN
#include "common.h"
#include "bool.h"
bool debugFlag;
main(argc, argv)
int argc;
char *argv[];
{
int yyparse();
int status;
Filename = "stdin";
while ( argc > 1 ) {
if ( strcmp(argv[1], "-G") == 0) {
debugFlag = TRUE;
} else {
if (freopen(argv[1],"r", stdin) == NULL ) {
perror(argv[1]);
exit(1);
}
Filename = argv[1];
}
argv++;
argc--;
}
Linenum = 1;
spec_init();
gram_init();
capture_init();
status=yyparse();
gram_end();
flusherrors();
if ( debugFlag )
spec_printGlobals();
return status;
}