-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser.h
48 lines (41 loc) · 1.76 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
/***************************
* PROJECT:
* IFJ20 - Compiler for imperative programming language IFJ20
*
* UNIVERSITY:
* Faculty of Information Technology, Brno University of Technology
*
* FILE:
* parser.h
*
* DESCRIPTION:
* Parser header file
*
* AUTHORS:
* Tomáš Hrúz <[email protected]>
* Kolaříková Mirka <[email protected]>
* Aleš Řezáč <[email protected]>
* Žovinec Martin <[email protected]>
*/
#ifndef PARSER_H
#define PARSER_H
#include <ctype.h>
#include "main.h"
#include "prec_parser.h"
#include "symtable.h"
#include "generator.h"
int parse(tListOfInstr *instrList); //Function called in main that starts parsing
int program(); //First rule of LL grammar it will continuously dive deeper in LL grammar and than bubble back to main
int prolog(); //First line of program according to LL-grammar
int fun_def_list(); //Rule for list of function definitions
int fun_def(); //Rule for function definition
int stat_list(varNode * treePtr); //Rule for list of statements in function
int fun_params(varNode * treePtr); //Handling of parameters in definition of function
int fun_returns(); //handling of returns in definition of function
int stat(varNode * treePtr); //Rule for single statement
int ass_exps(varNode * treePtr, funList *assignVariablesList,int assignVarCounter, funList *assignAssignList,int assignAssignmentCounter);
int ass_stat(varNode * treePtr, funList *assignVariablesList, int assignVarCounter); //Left sides of assign statement
int fun_call_param(varNode * treePtr); //Handling of paramters in calling of function
int print_params(varNode * treePtr); //Handling of print parameters
int return_values(varNode * treePtr); //Handling of return values
#endif /* PARSER_H*/