-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
46 lines (40 loc) · 789 Bytes
/
main.c
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
#include <stdio.h>
#include <getopt.h>
#include "lambda.h"
#ifdef YYDEBUG
extern int yydebug;
#endif
extern int yyparse();
extern int yylex_destroy(void);
void do_getopt(int, char**);
int main(int argc, char** argv)
{
do_getopt(argc, argv);
lambda_prompt();
int result = yyparse();
if (result != 0)
{
fprintf(stderr, "Aborted\n");
goto CLEAN_UP;
}
CLEAN_UP:
//ncl_cleanup();
yylex_destroy();
return result;
}
void do_getopt(int argc, char** argv)
{
int c = 0;
while ((c = getopt(argc, argv, "t")) != -1)
{
switch (c)
{
// -t flags turns on parser tracing
case 't':
yydebug = 1;
break;
default:
break;
}
}
}