forked from thewhoo/ifj15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
expr.h
82 lines (71 loc) · 1.39 KB
/
expr.h
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* 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
*
*/
/**
* @file expr.h
* @brief Expression library
*/
#ifndef EXPR_H
#define EXPR_H
#include "adt.h"
#include "ilist.h"
#include <stdbool.h>
enum {
oper_add,
oper_sub,
oper_mul,
oper_div,
oper_lr_bracket,
oper_rr_bracket,
oper_id,
oper_less,
oper_greater,
oper_less_e,
oper_greater_e,
oper_equal,
oper_not_equal
};
enum {
EQ,
LO,
HI,
ER
};
enum {
not_function,
internal_function,
external_function
};
/**
* @brief Inicializace modulu
*
* Inicializace zasobniku potrebnych pri praci modulu
*/
void expr_init();
/**
* @brief Deinicializace modulu
*
* Uvolneni zasobniku potrebnych pri praci modulu
*/
void expr_destroy();
/**
* @brief Zpracovani vyrazu
*
* Funkce pro zpracovani vyrazu, generuje instrukce a vraci rizeni
*
* @param variable_toilet Ukazatel na promennou pro prirazeni vysledku vyrazu
* @param list_toilet Ukazatel na aktulani instrukcni list pro vlozeni vygenerovanych instrukci
*/
void expression(TVariable *ret_var, Tins_list *act_ins_list);
#endif //EXPR_H