-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
46 lines (35 loc) · 1 KB
/
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
/**
* @file main.c
* @project Compiler of language IFJ18. School project for subjects IFJ and IAL.
* @author(s) Juraj Holub <[email protected]>
* @date September 2018
* @brief Program main, execute syntax directed analyse and free all dynamic
* allocated sources.
*/
#include <stdio.h>
#include "expressions_parser.h"
#include "scanner.h"
#include "symtable.h"
#include <stdlib.h>
#include "semantic_parser.h"
#include "dynamic_string.h"
#include "gen_out.h"
#include "list.h"
#include "global_interface.h"
#include "error_handle.h"
#include "top_down_parser.h"
int main(int argc, char **argv)
{
create_global_frame();
add_prolog_inst(I_IFJCODE18, NULL, NULL, NULL);
add_prolog_inst(I_CREATEFRAME, NULL, NULL, NULL);
add_prolog_inst(I_PUSHFRAME, NULL, NULL, NULL);
int ret = parse();
add_instruction(I_POPFRAME, NULL, NULL, NULL);
if (ret == SUCCESS)
gen_program();
free_global_frame();
remove_all_st();
free_scanner();
return ret;
}