-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProgramLanguageAnalyser.hpp
50 lines (42 loc) · 1.83 KB
/
ProgramLanguageAnalyser.hpp
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
#ifndef PROGRAMLANGUAGEANALYSER_HPP
#define PROGRAMLANGUAGEANALYSER_HPP
#include "AbstractSyntaxTree.hpp"
#include "Stack.hpp"
#include "ProgramLanguage.hpp"
#include "ProgramLanguageLexer.hpp"
class ProgramLanguageAnalyser {
public:
AbstractSyntaxTree abstractSyntaxTree;
ProgramLanguageAnalyser();
void ProgramLanguageAnalyserDtor();
void analyseText(const char *textBuffer);
private:
Stack<ProgramLanguage::Lexem> lexemList;
ProgramLanguage::Lexem *lexemListTraverser;
ProgramLanguageLexer lexer;
AbstractSyntaxTree::Node *analyseProgram();
AbstractSyntaxTree::Node *analyseFunctionDeclarationList();
AbstractSyntaxTree::Node *analyseFunctionDeclaration();
AbstractSyntaxTree::Node *analyseFunctionImplementation();
AbstractSyntaxTree::Node *analyseFunctionImplementationParameterList();
AbstractSyntaxTree::Node *analyseBlock();
AbstractSyntaxTree::Node *analyseStatement();
AbstractSyntaxTree::Node *analyseIf();
AbstractSyntaxTree::Node *analyseWhile();
AbstractSyntaxTree::Node *analyseCondition();
AbstractSyntaxTree::Node *analyseExpression();
AbstractSyntaxTree::Node *analyseTertiaryExpression();
AbstractSyntaxTree::Node *analyseSecondaryExpression();
AbstractSyntaxTree::Node *analysePrimaryExpression();
AbstractSyntaxTree::Node *analyseReturnOperator();
AbstractSyntaxTree::Node *analyseOperator();
AbstractSyntaxTree::Node *analyseAssignmentOperator();
AbstractSyntaxTree::Node *analyseFunctionCallOperator();
AbstractSyntaxTree::Node *analyseFunctionCallParameterList();
AbstractSyntaxTree::Node *analyseBlockBody();
AbstractSyntaxTree::Node *analyseVariable();
AbstractSyntaxTree::Node *analyseNumber();
void requireSymbol(char symbol);
bool lookForSymbol(char symbol) const;
};
#endif /* PROGRAMLANGUAGEANALYSER_HPP */