2024-03-17 07:58:28 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ast_basic.h"
|
2024-06-18 03:54:36 +00:00
|
|
|
|
#include "ast_gen.h"
|
2024-03-17 07:58:28 +00:00
|
|
|
|
#include "libsyntax.h"
|
|
|
|
|
#include <libtoken.h>
|
|
|
|
|
#include <tokens_novel.h>
|
|
|
|
|
|
|
|
|
|
namespace example_novel {
|
|
|
|
|
/**
|
|
|
|
|
* @brief <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* ExprNode::typeMark() <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
*/
|
|
|
|
|
enum NovelExprs {
|
|
|
|
|
DESPITE = -1,
|
|
|
|
|
DESC_SECTION = 0,
|
|
|
|
|
FRAG_REFERS = 1,
|
|
|
|
|
FRAG_DEFINES = 2,
|
|
|
|
|
STORY_DEFINES = 3,
|
|
|
|
|
DOC_DEFINES = 4,
|
|
|
|
|
VOLUME_DEFINE = 5,
|
|
|
|
|
ARTICLE_DEFINE = 6,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class LIBSYNTAX_EXPORT NovalSyntax {
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @brief <EFBFBD><EFBFBD>ȡnovel<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2024-07-12 04:53:43 +00:00
|
|
|
|
static std::shared_ptr<const lib_syntax::ExprRule> getParseTree();
|
2024-06-18 03:54:36 +00:00
|
|
|
|
|
2024-06-18 04:44:18 +00:00
|
|
|
|
static std::shared_ptr<const ast_gen::SyntaxElement> tidy(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
|
|
|
|
|
|
|
|
|
private:
|
2024-07-28 08:37:31 +00:00
|
|
|
|
static void build_objecttree(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
2024-06-18 04:44:18 +00:00
|
|
|
|
static void node_register(std::shared_ptr<const ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
2024-03-17 07:58:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace example_novel
|