-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.h
55 lines (48 loc) · 1.82 KB
/
parser.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
/**
* Projekt: IFJ2021
*
* @brief Implementace top-down syntakticke anylzy shora dolu.
*
* @author Šimon Vacek xvacek10@stud.fit.vutbr.cz
*/
#ifndef _PARSER_H_
#define _PARSER_H_
#include "symtable.h"
#include "builtIn.h"
#include "generate_code.h"
#include "expression.h"
int parser(FILE *);
/* funkce odpovidajici neterminalum v pravidlech */
int start(Token *, FILE *);
int program(Token *, FILE *);
int fnc_dec(Token *, FILE *);
int params_dec(Token *, FILE *, bst_node_t *);
int params_dec2(Token *, FILE *, bst_node_t *);
int return_type(Token *, FILE *, bst_node_t *);
int data_type(Token *, FILE *, bst_node_t *, SLLElementPtr_Param, int);
int fnc_call(Token *, FILE *);
int value(Token *, FILE *, bst_node_t *, SLLElementPtr_Param *);
int value2(Token *, FILE *, bst_node_t *, SLLElementPtr_Param *);
int value_last(Token *, FILE *, bst_node_t *, SLLElementPtr_Param *);
int fnc_def(Token *, FILE *);
int fnc_head(Token *, FILE *, bst_node_t **);
int fnc_def2(Token *, FILE *, bst_node_t **);
int params_def(Token *, FILE *, bst_node_t *, SLLElementPtr_Param *);
int params_def2(Token *, FILE *, bst_node_t *, SLLElementPtr_Param *);
int var_def(Token *, FILE *, bst_node_t **);
int var_defParam(Token *, FILE *, bst_node_t *, SLLElementPtr_Param *);
int return_(Token *, FILE *, Data_type, bool *);
int fnc_body(Token *, FILE *, Data_type, bool *);
int statement(Token *, FILE *, Data_type, bool *);
int var_dec(Token *, FILE *);
int var_dec_init(Token *, FILE *, bst_node_t *, char *);
int var_assign(Token *, FILE *, bst_node_t *, char *);
int if_(Token *, FILE *, Data_type, bool *);
int loop(Token *, FILE *, Data_type, bool *);
int statements(Token *, FILE *, Data_type, bool *);
/* pomocne funkce */
int get_non_white_token(Token *, FILE *);
int checkDeclaredFncs(bst_node_t *);
int writeFncCall(Token *, FILE *);
#endif
/** @endcode */