/
thomas-king
/
Interpretator
Обзор
Документация
Войти
/
thomas-king
/
Interpretator
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
include/Expression/Parser.h
38 строк
851 B
AceRodstin
Initial commit
28 ноя 2022, 12:18
28 ноя 2022, 12:18
796ddaf
Код
Авторство
О чём код?
// // Created by Ace Rodstin on 22 Nov 2022. // #ifndef GRAMMARPARSER_PARSER_H #define GRAMMARPARSER_PARSER_H #include <string> #include <vector> #include <map> #include "Node.h" #include "../Lexer/Parser.h" #include <list> #include "../lib/Array/Array.h" using namespace std; namespace Expression { class Parser { public: Node* parse(vector<Lexer::Token> &tokens); private: typedef Array<Lexer::Token> Buffer; Node* create_expression(Buffer buffer); Node* create_a_term(Buffer buffer); Node* create_b_term(Buffer buffer); Node* create_c_term(Buffer buffer); Buffer::iterator first_operator(Node::Kind non_terminal_kind, Buffer &buffer); Buffer::iterator first_punctuator(Ace::Punctuator kind, Buffer &buffer); Buffer::iterator last_punctuator(Ace::Punctuator kind, Buffer &buffer); }; } #endif //GRAMMARPARSER_PARSER_H