-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cc
31 lines (27 loc) · 843 Bytes
/
main.cc
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
/* File: main.cc
* -------------
* This file defines the main() routine for the program and not much else.
* You should not need to modify this file.
*/
#include <string.h>
#include <stdio.h>
#include "utility.h"
#include "errors.h"
#include "parser.h"
/* Function: main()
* ----------------
* Entry point to the entire program. We parse the command line and turn
* on any debugging flags requested by the user when invoking the program.
* InitScanner() is used to set up the scanner.
* InitParser() is used to set up the parser. The call to yyparse() will
* attempt to parse a complete program from the input.
*/
int main(int argc, char *argv[])
{
// SetDebugForKey("tac", true);
ParseCommandLine(argc, argv);
InitScanner();
InitParser();
yyparse();
return (ReportError::NumErrors() == 0? 0 : -1);
}