18 Star 54 Fork 14

RonxBulld / ftrpc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
parser.h 962 Bytes
一键复制 编辑 原始数据 按行查看 历史
//
// Created by Rexfield on 2018/4/27.
//
#ifndef FTRPC_PARSER_H
#define FTRPC_PARSER_H
#include <memory>
#include "lex.h"
#include "symman.h"
#include "ast_tree.h"
class parse
{
private:
bool noPrint = false;
void reportError(const char *fmt, ...);
std::unique_ptr<RootNode> parseRoot();
std::unique_ptr<ModuleNode> parseModule();
std::unique_ptr<ApiNode> parseApi();
std::unique_ptr<ParamNode> parseParam();
std::unique_ptr<TypeNode> parseType();
std::unique_ptr<StructNode> parseStruct();
public:
lex *lexer = nullptr;
TokenManage tokenManage {
#define KEYWD(K) {#K, TOKEN_##K},
#define TYPE(T) {#T, TOKEN_##T},
#include "keywords.h"
};
TypeManage typeManage {
#define KEYWD(K)
#define TYPE(T) {TY_##T, TOKEN_##T},
#include "keywords.h"
};
explicit parse(const char *src);
std::unique_ptr<RootNode> document;
bool work();
};
#endif //FTRPC_PARSER_H
C++
1
https://gitee.com/RonxBulld/ftrpc.git
git@gitee.com:RonxBulld/ftrpc.git
RonxBulld
ftrpc
ftrpc
master

搜索帮助