forked from thewhoo/ifj15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
57 lines (41 loc) · 838 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
47
48
49
50
51
52
53
54
55
56
/*
* Course IFJ @ FIT VUT Brno, 2015
* IFJ15 Interpreter Project
*
* Authors:
* Lukas Osadsky - xosads00
* Pavol Plaskon - xplask00
* Pavel Pospisil - xpospi88
* Matej Postolka - xposto02
*
* Unless otherwise stated, all code is licensed under a
* GNU General Public License v2.0
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "error.h"
#include "galloc.h"
#include "interpret.h"
#include "lex.h"
#include "parser.h"
#include "shared.h"
#include "expr.h"
int main(int argc, char **argv)
{
if (argc < 2)
exit_error(E_INTERNAL);
FILE *fp = fopen(argv[1], "r");
if (fp == NULL)
exit_error(E_INTERNAL);
//gcInit();
lex_init(fp);
global_init();
expr_init();
parse();
fclose(fp);
expr_destroy();
interpret();
//gcDestroy();
return 0;
}