AALanguage
The best language for those who have nothing to do
Loading...
Searching...
No Matches
Analyzer.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <regex>
4
#include <iostream>
5
#include "
LexicalAnalyzer.h
"
6
#include <exception>
7
#include <stack>
8
#include <unordered_set>
9
#include <string>
10
#include <cstdlib>
11
#include <ctime>
12
#include <random>
13
#include <chrono>
14
#include "
Large.h
"
15
#include "
Poliz.h
"
16
#include "
Semantic.h
"
17
19
class
Analyzer
{
20
public
:
22
Analyzer
();
29
void
execute
(std::string path, std::string lib_path);
30
private
:
31
Token
current_token
;
32
Poliz
prog
;
33
Semantic
semantic
;
35
std::vector<std::string>
service_types
= {
"bool"
,
"char"
,
"byte"
,
"double"
,
"udouble"
,
"float"
,
"ufloat"
,
"int"
,
"uint"
,
"long"
,
36
"ulong"
,
"short"
,
"ushort"
,
"string"
,
"large"
};
37
41
void
program
(
LexicalAnalyzer
& lex);
45
void
preprocessor
(
LexicalAnalyzer
& lex);
49
void
namespace_definition
(
LexicalAnalyzer
& lex);
53
void
program_body
(
LexicalAnalyzer
& lex);
57
void
var_definition
(
LexicalAnalyzer
& lex);
61
void
var_definitions
(
LexicalAnalyzer
& lex,
bool
need_semicolon =
true
,
bool
is_program =
false
);
67
void
type
(
LexicalAnalyzer
& lex);
71
void
default_type
(
LexicalAnalyzer
& lex);
72
void
function_or_var_definitions
(
LexicalAnalyzer
& lex,
bool
is_program =
false
);
76
void
function
(
LexicalAnalyzer
& lex,
bool
is_struct =
false
);
80
void
expression
(
LexicalAnalyzer
& lex,
bool
is_vars =
false
,
bool
is_print =
false
);
84
void
parameter_list
(
LexicalAnalyzer
& lex);
88
void
statement
(
LexicalAnalyzer
& lex,
bool
prev_table =
false
);
89
void
semicolon
(
LexicalAnalyzer
& lex,
bool
is_important =
false
);
90
void
may_be_semicolon
(
LexicalAnalyzer
& lex);
91
95
void
assignment_expression
(
LexicalAnalyzer
& lex);
99
void
logical_or_expression
(
LexicalAnalyzer
& lex);
103
void
logical_and_expression
(
LexicalAnalyzer
& lex);
107
void
bitwise_or_expression
(
LexicalAnalyzer
& lex);
111
void
bitwise_xor_expression
(
LexicalAnalyzer
& lex);
115
void
bitwise_consequence_expression
(
LexicalAnalyzer
& lex);
119
void
bitwise_and_expression
(
LexicalAnalyzer
& lex);
123
void
equality_expression
(
LexicalAnalyzer
& lex);
127
void
comparison_expression
(
LexicalAnalyzer
& lex);
131
void
bitwise_shift_expression
(
LexicalAnalyzer
& lex);
135
void
plus_expression
(
LexicalAnalyzer
& lex);
139
void
multiply_expression
(
LexicalAnalyzer
& lex);
143
void
unary_expression
(
LexicalAnalyzer
& lex);
147
void
construct_expression
(
LexicalAnalyzer
& lex);
151
void
field
(
LexicalAnalyzer
& lex,
bool
only_array =
false
);
152
156
void
if_statement
(
LexicalAnalyzer
& lex);
160
void
goto_statement
(
LexicalAnalyzer
& lex);
164
void
return_statement
(
LexicalAnalyzer
& lex);
168
void
while_statement
(
LexicalAnalyzer
& lex);
172
void
for_statement
(
LexicalAnalyzer
& lex);
178
void
switch_statement
(
LexicalAnalyzer
& lex);
179
180
void
read_statement
(
LexicalAnalyzer
& lex);
181
void
readln_statement
(
LexicalAnalyzer
& lex);
182
void
print_statement
(
LexicalAnalyzer
& lex);
183
void
exit_statement
(
LexicalAnalyzer
& lex);
184
void
convert_statement
(
LexicalAnalyzer
& lex);
185
void
rand_statement
(
LexicalAnalyzer
& lex);
186
void
strlen_statement
(
LexicalAnalyzer
& lex);
187
void
time_statement
(
LexicalAnalyzer
& lex);
188
};
D:
GitHub
AALanguage2
AALanguage
Analyzer.h
Generated by
1.10.0