-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenums.c
146 lines (140 loc) · 2.97 KB
/
enums.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/**
* Fakutla informacnich technologii, Vysoke uceni technicke v Brne
* Projekt IFJ
* Implementace prekladace imperativniho jazyka IFJ17
*
* Tym: Jakub Trubka (xtrubk00)
* Roman Zajic (xzajic16)
* Miroslav Karpisek (xkarpi05)
* Jakub Samek (xsamek07)
*
* Soubor: enums.c
* Autori: Miroslav Karpisek
* Jakub Trubka
*
* Datum: 22-10-2017
* Uprava: 05-12-2017
*/
#include "enums.h"
// pro tisk enumID cTokenu
char *keywords[67] = {
"left_bracket", //leva zavorka
"right_bracket", //prava zavorka
"func", //token pro precedencni analyzu (nelze ziskat z lexikalniho analyzatoru)
",", //carka
"$", //token pro precedencni analyzu (nelze ziskat z lexikalniho analyzatoru)
"*", // *
"/", //lomitko
"\\", //zpetne lomitko
"+", //plus
"-", //minus
"=", //rovna se
"<>", // <>
"<", // <
"<=", // <=
">", // >
">=", // >=
"id", //16, identifikator
"celoc_lit", //17, celociselny literal
"celoc_lit_exp", //18, celociselny literal s exponentem
"des_lit", //19, desetinny literal
"des_lit_exp", //20, desetinny literal s exponentem
"ret_lit", //21, retezcovy literal
"as",
"asc",
"declare",
"dim",
"do",
"double",
"else",
"end",
"chr",
"function",
"if",
"input",
"integer",
"length",
"loop",
"print",
"return",
"scope",
"string",
"substr",
"then",
"while",
"and",
"boolean",
"continue",
"elseif",
"exit",
"false",
"for",
"next",
"not",
"or",
"shared",
"static",
"true",
";", //semicolon
"EOL", //new line
"EOF", //EOF
"handle_start",
"EXPR",
"plus_equal",
"minus_equal",
"mul_equal",
"div_equal",
"mod_equal",
};
// pro tisk precedenc
char* helperTable[25] = {
"(",
")",
"<func>",
",",
"$",
"*",
"/",
"\\",
"+",
"-",
"=",
"<>",
"<",
"<=",
">",
">=",
"<id>",
"<int>",
"<double>",
"<string>",
"<expr_string>",
"<expr_double",
"<expr_int>",
"<HANDLE>",
"__undef__"
};
// tisk pro symbolType
char* varType[5] = {
"Undef",
"String",
"Double",
"Integer",
"Boolean",
};
//pro tisk operatoru
char* operationType[13] = {
"scitani/konkatenace",
"nasobeni",
"deleni",
"odcitani",
"celociselne deleni",
"porovnani",
"porovnani",
"porovnani",
"porovnani",
"porovnani",
"porovnani",
"porovnani",
"porovnani",
};