修改解析流程,移除异常机制,开发中
This commit is contained in:
parent
449f898257
commit
0c4f0d0a15
|
@ -30,7 +30,7 @@ QString NovelParser::version() const
|
|||
}
|
||||
|
||||
std::shared_ptr<const ast_gen::ElementAccess> NovelParser::parse(const QFileInfoList source_list) const {
|
||||
QList<std::shared_ptr<const ast_basic::Expression>> forst_root;
|
||||
QList<std::shared_ptr<const ast_basic::ExprInst>> forst_root;
|
||||
auto word_reader = std::make_shared<lib_token::WordReader>();
|
||||
auto context = std::make_shared<ast_gen::GlobalElement>(u8"小说");
|
||||
|
||||
|
@ -38,9 +38,10 @@ std::shared_ptr<const ast_gen::ElementAccess> NovelParser::parse(const QFileInfo
|
|||
for (auto& file : source_list) {
|
||||
context->setCurrentFile(file.canonicalFilePath());
|
||||
auto words = word_reader->wordsFrom(file.canonicalFilePath());
|
||||
auto exprs_result = this->syntax_defines->parse(context, words);
|
||||
forst_root.append(std::get<0>(exprs_result));
|
||||
this->syntax_defines->parse(context, words);
|
||||
}
|
||||
|
||||
forst_root = context->getDocs();
|
||||
auto current_stamp = QTime::currentTime();
|
||||
qDebug().noquote() << QString(u8"%词法解析+语法解析消耗时间:%1 ms。").arg(time_stamp.msecsTo(current_stamp));
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace example_novel {
|
|||
class NovelParser
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<const lib_syntax::ExpressionRule> syntax_defines;
|
||||
std::shared_ptr<const lib_syntax::ExprRule> syntax_defines;
|
||||
QList<std::shared_ptr<const lib_parse::CheckProvider>> checker_list;
|
||||
std::shared_ptr<const lib_parse::Analyzer> analyzer_ref;
|
||||
|
||||
|
|
|
@ -48,4 +48,5 @@ bool VisitorControl::visitWith(std::shared_ptr<const ElementAccess> syntax_elm,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ using namespace ast_basic;
|
|||
using namespace lib_token;
|
||||
using namespace lib_syntax;
|
||||
|
||||
ExpressionElement::ExpressionElement(std::shared_ptr<const ExpressionRule> bind) : _expr_rule(bind) {}
|
||||
ExpressionElement::ExpressionElement(std::shared_ptr<const ExprRule> bind) : _expr_rule(bind) {}
|
||||
|
||||
std::shared_ptr<const ExpressionRule> ExpressionElement::definedRule() const {
|
||||
std::shared_ptr<const ExprRule> ExpressionElement::definedRule() const {
|
||||
return _expr_rule;
|
||||
}
|
||||
|
||||
|
@ -26,11 +26,11 @@ void ExpressionElement::addToken(std::shared_ptr<const IToken> token_inst) {
|
|||
this->tokens_bind.append(token_inst);
|
||||
}
|
||||
|
||||
QList<std::shared_ptr<const Expression>> ExpressionElement::children() const {
|
||||
QList<std::shared_ptr<const ExprInst>> ExpressionElement::children() const {
|
||||
return this->children_store;
|
||||
}
|
||||
|
||||
void ExpressionElement::addChild(std::shared_ptr<const Expression> inst) {
|
||||
void ExpressionElement::addChild(std::shared_ptr<const ExprInst> inst) {
|
||||
this->children_store.append(inst);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ void ExpressionContext::setCurrentFile(const QString& path) { this->current_file
|
|||
|
||||
QString ExpressionContext::currentFile() const { return this->current_file_path; }
|
||||
|
||||
std::shared_ptr<Expression> ExpressionContext::currentInst() const
|
||||
std::shared_ptr<ExprInst> ExpressionContext::currentInst() const
|
||||
{
|
||||
if (expression_stack.size())
|
||||
return expression_stack.last();
|
||||
|
@ -52,13 +52,13 @@ std::shared_ptr<Expression> ExpressionContext::currentInst() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void ExpressionContext::pushInst(std::shared_ptr<Expression> current_inst)
|
||||
void ExpressionContext::pushInst(std::shared_ptr<ExprInst> current_inst)
|
||||
{
|
||||
if (!expression_stack.size() || expression_stack.last() != current_inst)
|
||||
expression_stack.append(current_inst);
|
||||
}
|
||||
|
||||
std::shared_ptr<Expression> ExpressionContext::popInst()
|
||||
std::shared_ptr<ExprInst> ExpressionContext::popInst()
|
||||
{
|
||||
auto lastx = expression_stack.takeLast();
|
||||
return lastx;
|
||||
|
@ -103,3 +103,12 @@ void ExpressionContext::clearErrors(int start) {
|
|||
QList<std::shared_ptr<const BaseRule>> ExpressionContext::currentExpressionRuleStack() const {
|
||||
return rule_stack;
|
||||
}
|
||||
|
||||
|
||||
void ExpressionContext::appendDoc(std::shared_ptr<ast_basic::ExprInst> inst) {
|
||||
this->document_store.append(inst);
|
||||
}
|
||||
|
||||
QList<std::shared_ptr<const ast_basic::ExprInst>> ExpressionContext::getDocs() const {
|
||||
return this->document_store;
|
||||
}
|
|
@ -10,15 +10,15 @@ namespace ast_basic {
|
|||
/**
|
||||
* @brief 抽象语法树集合节点/表达式节点
|
||||
*/
|
||||
class Expression {
|
||||
class ExprInst {
|
||||
public:
|
||||
virtual ~Expression() = default;
|
||||
virtual ~ExprInst() = default;
|
||||
|
||||
/**
|
||||
* @brief 获取表达式的解析规则
|
||||
* @return
|
||||
*/
|
||||
virtual std::shared_ptr<const lib_syntax::ExpressionRule> definedRule() const = 0;
|
||||
virtual std::shared_ptr<const lib_syntax::ExprRule> definedRule() const = 0;
|
||||
//=====================================================
|
||||
/**
|
||||
* 获取语法节点的源码文件路径.
|
||||
|
@ -49,13 +49,13 @@ namespace ast_basic {
|
|||
* @brief 子表达式集合
|
||||
* @return
|
||||
*/
|
||||
virtual QList<std::shared_ptr<const Expression>> children() const = 0;
|
||||
virtual QList<std::shared_ptr<const ExprInst>> children() const = 0;
|
||||
/**
|
||||
* @brief 添加子表达式.
|
||||
*
|
||||
* \param inst 子表达式实例
|
||||
*/
|
||||
virtual void addChild(std::shared_ptr<const Expression> inst) = 0;
|
||||
virtual void addChild(std::shared_ptr<const ExprInst> inst) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -63,31 +63,32 @@ namespace ast_basic {
|
|||
/**
|
||||
* @brief 表达式节点
|
||||
*/
|
||||
class LIBSYNTAX_EXPORT ExpressionElement : public ast_basic::Expression, public std::enable_shared_from_this<ExpressionElement> {
|
||||
class LIBSYNTAX_EXPORT ExpressionElement : public ast_basic::ExprInst, public std::enable_shared_from_this<ExpressionElement> {
|
||||
private:
|
||||
std::shared_ptr<const lib_syntax::ExpressionRule> _expr_rule;
|
||||
QList<std::shared_ptr<const Expression>> children_store;
|
||||
std::shared_ptr<const lib_syntax::ExprRule> _expr_rule;
|
||||
QList<std::shared_ptr<const ExprInst>> children_store;
|
||||
QList<std::shared_ptr<const lib_token::IToken>> tokens_bind;
|
||||
|
||||
public:
|
||||
ExpressionElement(std::shared_ptr<const lib_syntax::ExpressionRule> bind);
|
||||
ExpressionElement(std::shared_ptr<const lib_syntax::ExprRule> bind);
|
||||
|
||||
// 通过 Expression 继承
|
||||
std::shared_ptr<const lib_syntax::ExpressionRule> definedRule() const override;
|
||||
std::shared_ptr<const lib_syntax::ExprRule> definedRule() const override;
|
||||
QString filePath() const override;
|
||||
|
||||
QList<std::shared_ptr<const lib_token::IToken>> tokens() const override;
|
||||
void tokensReset(const QList<std::shared_ptr<const lib_token::IToken>>& list) override;
|
||||
void addToken(std::shared_ptr<const lib_token::IToken> token_inst) override;
|
||||
|
||||
QList<std::shared_ptr<const Expression>> children() const override;
|
||||
void addChild(std::shared_ptr<const Expression> inst) override;
|
||||
QList<std::shared_ptr<const ExprInst>> children() const override;
|
||||
void addChild(std::shared_ptr<const ExprInst> inst) override;
|
||||
};
|
||||
|
||||
class LIBSYNTAX_EXPORT ExpressionContext : public lib_syntax::ParseContext, public std::enable_shared_from_this<ExpressionContext> {
|
||||
private:
|
||||
QList<std::shared_ptr<const lib_syntax::BaseRule>> rule_stack;
|
||||
QList<std::shared_ptr<Expression>> expression_stack;
|
||||
QList<std::shared_ptr<ExprInst>> expression_stack;
|
||||
QList<std::shared_ptr<const ast_basic::ExprInst>> document_store;
|
||||
QString current_file_path;
|
||||
QList<std::tuple<int, QString>> errors_storage;
|
||||
|
||||
|
@ -98,15 +99,18 @@ namespace ast_basic {
|
|||
virtual QString currentFile() const;
|
||||
|
||||
// 通过 ParseContext 继承
|
||||
std::shared_ptr<ast_basic::Expression> currentInst() const override;
|
||||
void pushInst(std::shared_ptr<ast_basic::Expression> current_inst) override;
|
||||
std::shared_ptr<ast_basic::Expression> popInst() override;
|
||||
std::shared_ptr<ast_basic::ExprInst> currentInst() const override;
|
||||
void pushInst(std::shared_ptr<ast_basic::ExprInst> current_inst) override;
|
||||
std::shared_ptr<ast_basic::ExprInst> popInst() override;
|
||||
|
||||
std::shared_ptr<const lib_syntax::BaseRule> currentExpressionRule() const override;
|
||||
void pushExpressionRule(std::shared_ptr<const lib_syntax::BaseRule> inst) override;
|
||||
std::shared_ptr<const lib_syntax::BaseRule> popExpressionRule() override;
|
||||
virtual QList<std::shared_ptr<const lib_syntax::BaseRule>> currentExpressionRuleStack() const;
|
||||
|
||||
virtual void appendDoc(std::shared_ptr<ast_basic::ExprInst> inst) override;
|
||||
virtual QList<std::shared_ptr<const ast_basic::ExprInst>> getDocs() const override;
|
||||
|
||||
void appendParseErrors(int start, const QString& error_msg) override;
|
||||
QStringList errors() const override;
|
||||
void clearErrors(int start) override;
|
||||
|
|
|
@ -39,7 +39,7 @@ void ast_gen::GlobalElement::setParent(std::shared_ptr<const SyntaxElement> inst
|
|||
|
||||
QList<std::shared_ptr<const TokenAccess>> GlobalElement::selfTokens() const { return QList<std::shared_ptr<const TokenAccess>>(); }
|
||||
|
||||
std::shared_ptr<const ast_basic::Expression> ast_gen::GlobalElement::bindExpression() const
|
||||
std::shared_ptr<const ast_basic::ExprInst> ast_gen::GlobalElement::bindExpression() const
|
||||
{
|
||||
return bind_exprs;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void ast_gen::GlobalElement::cacheLoad()
|
|||
}
|
||||
|
||||
void GlobalElement::addChild(std::shared_ptr<ast_gen::SyntaxElement> citem) {
|
||||
auto convx = std::dynamic_pointer_cast<ast_basic::Expression>(citem);
|
||||
auto convx = std::dynamic_pointer_cast<ast_basic::ExprInst>(citem);
|
||||
bind_exprs->addChild(convx);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace ast_gen
|
|||
*
|
||||
* \return 表达式实例
|
||||
*/
|
||||
virtual std::shared_ptr<const ast_basic::Expression> bindExpression() const = 0;
|
||||
virtual std::shared_ptr<const ast_basic::ExprInst> bindExpression() const = 0;
|
||||
|
||||
/**
|
||||
* @brief 类型标记
|
||||
|
@ -107,7 +107,7 @@ namespace ast_gen
|
|||
QString names_store;
|
||||
QHash<QString, std::shared_ptr<const SyntaxElement>> node_cache;
|
||||
|
||||
std::shared_ptr<ast_basic::Expression> bind_exprs = std::make_shared<ast_basic::ExpressionElement>(nullptr);
|
||||
std::shared_ptr<ast_basic::ExprInst> bind_exprs = std::make_shared<ast_basic::ExpressionElement>(nullptr);
|
||||
|
||||
public:
|
||||
static GlobalElement* UniquePtr;
|
||||
|
@ -135,7 +135,7 @@ namespace ast_gen
|
|||
virtual QList<std::shared_ptr<const TokenAccess>> selfTokens() const override;
|
||||
|
||||
// 通过 SyntaxElement 继承
|
||||
virtual std::shared_ptr<const ast_basic::Expression> bindExpression() const override;
|
||||
virtual std::shared_ptr<const ast_basic::ExprInst> bindExpression() const override;
|
||||
virtual void cacheLoad() override;
|
||||
};
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
using namespace example_novel;
|
||||
using namespace lib_syntax;
|
||||
|
||||
TextSection::TextSection(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
TextSection::TextSection(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind) {}
|
||||
|
||||
QString TextSection::content() const
|
||||
|
@ -30,7 +30,7 @@ void TextSection::cacheLoad()
|
|||
context_store = text;
|
||||
}
|
||||
|
||||
FragmentRefers::FragmentRefers(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
FragmentRefers::FragmentRefers(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind) {}
|
||||
|
||||
QString FragmentRefers::storyRefer() const { return story_refs; }
|
||||
|
@ -59,7 +59,7 @@ QString FragmentRefers::signature() const {
|
|||
}
|
||||
|
||||
|
||||
FragmentDefine::FragmentDefine(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
FragmentDefine::FragmentDefine(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind) {}
|
||||
|
||||
QString FragmentDefine::name() const { return name_store; }
|
||||
|
@ -78,7 +78,7 @@ bool FragmentDefine::isAnonymous() const
|
|||
QString FragmentDefine::signature() const { return parent()->signature() + u8"&" + name(); }
|
||||
|
||||
|
||||
StoryDefine::StoryDefine(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
StoryDefine::StoryDefine(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind), sort_index(0) {}
|
||||
|
||||
QString StoryDefine::name() const { return name_store; }
|
||||
|
@ -104,7 +104,7 @@ bool StoryDefine::isAnonymous() const
|
|||
QString StoryDefine::signature() const { return name(); }
|
||||
|
||||
#include "syntax_novel.h"
|
||||
Document::Document(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
Document::Document(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind) {}
|
||||
|
||||
int Document::typeMark() const { return (int)NovelNode::Document; }
|
||||
|
@ -120,7 +120,7 @@ void Document::cacheLoad()
|
|||
{
|
||||
}
|
||||
|
||||
AbstractImpl::AbstractImpl(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
AbstractImpl::AbstractImpl(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: ExpressionElement(rule_bind) { parent_store.reset(); }
|
||||
|
||||
QList<std::shared_ptr<const ast_gen::TokenAccess> > AbstractImpl::selfTokens() const {
|
||||
|
@ -145,7 +145,7 @@ void AbstractImpl::setParent(std::shared_ptr<const ast_gen::SyntaxElement> inst)
|
|||
|
||||
|
||||
// ͨ¹ý SyntaxElement ¼Ì³Ð
|
||||
std::shared_ptr<const ast_basic::Expression> AbstractImpl::bindExpression() const {
|
||||
std::shared_ptr<const ast_basic::ExprInst> AbstractImpl::bindExpression() const {
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ QString AbstractImpl::path() const
|
|||
return ast_basic::ExpressionElement::filePath();
|
||||
}
|
||||
|
||||
VolumeDefine::VolumeDefine(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
VolumeDefine::VolumeDefine(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind) {}
|
||||
|
||||
QString VolumeDefine::name() const { return name_store; }
|
||||
|
@ -173,7 +173,7 @@ bool VolumeDefine::isAnonymous() const
|
|||
|
||||
QString VolumeDefine::signature() const { return name(); }
|
||||
|
||||
ArticleDefine::ArticleDefine(std::shared_ptr<const ExpressionRule> rule_bind)
|
||||
ArticleDefine::ArticleDefine(std::shared_ptr<const ExprRule> rule_bind)
|
||||
: AbstractImpl(rule_bind) {}
|
||||
|
||||
QString ArticleDefine::name() const { return name_store; }
|
||||
|
@ -192,7 +192,7 @@ bool ArticleDefine::isAnonymous() const
|
|||
|
||||
QString ArticleDefine::signature() const { return parent()->signature() + u8"&" + name(); }
|
||||
|
||||
RankDeclare::RankDeclare(std::shared_ptr<const ExpressionRule> rule)
|
||||
RankDeclare::RankDeclare(std::shared_ptr<const ExprRule> rule)
|
||||
: AbstractImpl(rule)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -21,10 +21,10 @@ namespace example_novel
|
|||
std::weak_ptr<const SyntaxElement> parent_store;
|
||||
|
||||
public:
|
||||
explicit AbstractImpl(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
explicit AbstractImpl(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
// ͨ¹ý SyntaxElement ¼Ì³Ð
|
||||
virtual std::shared_ptr<const ast_basic::Expression> bindExpression() const override;
|
||||
virtual std::shared_ptr<const ast_basic::ExprInst> bindExpression() const override;
|
||||
QString path() const override;
|
||||
virtual std::shared_ptr<const ast_gen::SyntaxElement> parent() const override;
|
||||
virtual void setParent(std::shared_ptr<const ast_gen::SyntaxElement> inst) override;
|
||||
|
@ -34,7 +34,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT TextSection : public AbstractImpl {
|
||||
public:
|
||||
TextSection(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
TextSection(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
QString content() const;
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT FragmentRefers : public AbstractImpl {
|
||||
public:
|
||||
FragmentRefers(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
FragmentRefers(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
QString storyRefer() const;
|
||||
QString fragmentRefer() const;
|
||||
|
@ -70,7 +70,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT FragmentDefine : public AbstractImpl {
|
||||
public:
|
||||
FragmentDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
FragmentDefine(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
QString name() const;
|
||||
|
||||
|
@ -87,7 +87,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT ArticleDefine : public AbstractImpl {
|
||||
public:
|
||||
ArticleDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
ArticleDefine(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
QString name() const;
|
||||
|
||||
|
@ -104,7 +104,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT VolumeDefine : public AbstractImpl {
|
||||
public:
|
||||
VolumeDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
VolumeDefine(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
QString name() const;
|
||||
|
||||
|
@ -121,7 +121,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT StoryDefine : public AbstractImpl {
|
||||
public:
|
||||
StoryDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
StoryDefine(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
QString name() const;
|
||||
void setSort(int value);
|
||||
|
@ -141,7 +141,7 @@ namespace example_novel
|
|||
|
||||
class LIBSYNTAX_EXPORT Document : public AbstractImpl {
|
||||
public:
|
||||
Document(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
Document(std::shared_ptr<const lib_syntax::ExprRule> rule_bind);
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
|
@ -155,7 +155,7 @@ namespace example_novel
|
|||
private:
|
||||
int page_rank = 0;
|
||||
public:
|
||||
RankDeclare(std::shared_ptr<const lib_syntax::ExpressionRule> rule);
|
||||
RankDeclare(std::shared_ptr<const lib_syntax::ExprRule> rule);
|
||||
|
||||
int rankNumber() const;
|
||||
|
||||
|
|
|
@ -11,12 +11,10 @@ TokenMatch::TokenMatch(shared_ptr<const ITokenDefine> define) : define_peer(defi
|
|||
|
||||
QList<std::shared_ptr<const BaseRule>> TokenMatch::children() const { return QList<std::shared_ptr<const BaseRule>>(); }
|
||||
|
||||
std::tuple<std::shared_ptr<const Expression>, std::shared_ptr<const IWordBase>> TokenMatch::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
if (!head)
|
||||
throw new InputTerminal(rt_inst->currentFile());
|
||||
|
||||
if (head->content() == u8"初遇江枫的") {
|
||||
qDebug() << u8"初遇江枫的";
|
||||
std::tuple<BaseRule::MatchResult, std::shared_ptr<const IWordBase>> TokenMatch::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
if (!head) {
|
||||
rt_inst->appendParseErrors(-1, QString(u8"Syntax[0x0000]token流(%1)提前终止").arg(rt_inst->currentFile()));
|
||||
return std::make_tuple(BaseRule::MatchResult::Fail, head);
|
||||
}
|
||||
|
||||
auto match_result = define_peer->analysis(head);
|
||||
|
@ -24,14 +22,17 @@ std::tuple<std::shared_ptr<const Expression>, std::shared_ptr<const IWordBase>>
|
|||
rt_inst->currentInst()->addToken(std::get<0>(match_result));
|
||||
}
|
||||
else {
|
||||
throw new MismatchException(head);
|
||||
rt_inst->appendParseErrors(head->position(),
|
||||
QString(u8"Syntax[0x00001]语法匹配错误,不能识别token:%1<%2,%3>(%4)")
|
||||
.arg(head->content()).arg(head->row()).arg(head->column()).arg(head->file()));
|
||||
return std::make_tuple(BaseRule::MatchResult::Part, head);
|
||||
}
|
||||
|
||||
if (std::get<1>(match_result)) {
|
||||
return std::make_tuple(nullptr, std::make_shared<WordImpl>(std::get<1>(match_result), head->nextWord()));
|
||||
return std::make_tuple(BaseRule::MatchResult::Success, std::make_shared<WordImpl>(std::get<1>(match_result), head->nextWord()));
|
||||
}
|
||||
else {
|
||||
return std::make_tuple(nullptr, head->nextWord());
|
||||
return std::make_tuple(BaseRule::MatchResult::Success, head->nextWord());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,34 +44,40 @@ Rept::Rept(std::shared_ptr<const BaseRule> rule, int min, int max) : rule_peer(r
|
|||
|
||||
QList<std::shared_ptr<const BaseRule>> Rept::children() const { return QList<std::shared_ptr<const BaseRule>>() << rule_peer; }
|
||||
|
||||
std::tuple<std::shared_ptr<const Expression>, std::shared_ptr<const IWordBase>> Rept::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
std::tuple<BaseRule::MatchResult, std::shared_ptr<const IWordBase>> Rept::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
auto temp_head = head;
|
||||
|
||||
// min-match
|
||||
for (auto idx = 0; idx < min_match; ++idx) {
|
||||
auto result_gen = rule_peer->parse(rt_inst, temp_head);
|
||||
if (std::get<0>(result_gen))
|
||||
rt_inst->currentInst()->addChild(std::get<0>(result_gen));
|
||||
|
||||
switch (std::get<0>(result_gen)) {
|
||||
case BaseRule::MatchResult::Fail:
|
||||
return std::make_tuple(BaseRule::MatchResult::Part, temp_head);
|
||||
case BaseRule::MatchResult::Part:
|
||||
return std::make_tuple(BaseRule::MatchResult::Part, std::get<1>(result_gen));
|
||||
default:
|
||||
temp_head = std::get<1>(result_gen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// max-match
|
||||
for (auto idx = min_match; idx < max_match; ++idx) {
|
||||
try {
|
||||
if (!temp_head)
|
||||
break;
|
||||
|
||||
auto result_gen = rule_peer->parse(rt_inst, temp_head);
|
||||
if (std::get<0>(result_gen))
|
||||
rt_inst->currentInst()->addChild(std::get<0>(result_gen));
|
||||
|
||||
switch (std::get<0>(result_gen)) {
|
||||
case BaseRule::MatchResult::Fail:
|
||||
case BaseRule::MatchResult::Part:
|
||||
return std::make_tuple(BaseRule::MatchResult::Success, temp_head);
|
||||
default:
|
||||
temp_head = std::get<1>(result_gen);
|
||||
}
|
||||
catch (SyntaxException* ex) {
|
||||
delete ex;
|
||||
return std::make_tuple(nullptr, temp_head);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_tuple(nullptr, temp_head);
|
||||
return std::make_tuple(BaseRule::MatchResult::Success, temp_head);
|
||||
}
|
||||
|
||||
QString Rept::token_present() const
|
||||
|
@ -82,18 +89,25 @@ Seqs::Seqs(const QList<std::shared_ptr<const BaseRule>> mbrs) : mbrs_store(mbrs)
|
|||
|
||||
QList<std::shared_ptr<const BaseRule>> Seqs::children() const { return mbrs_store; }
|
||||
|
||||
std::tuple<std::shared_ptr<const Expression>, std::shared_ptr<const IWordBase>> Seqs::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
std::tuple<BaseRule::MatchResult, std::shared_ptr<const IWordBase>> Seqs::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
auto temp_head = head;
|
||||
|
||||
for (auto& r : mbrs_store) {
|
||||
auto rst_gene = r->parse(rt_inst, temp_head);
|
||||
switch (std::get<0>(rst_gene)) {
|
||||
case BaseRule::MatchResult::Fail:
|
||||
return std::make_tuple(BaseRule::MatchResult::Part, temp_head);
|
||||
case BaseRule::MatchResult::Part:
|
||||
return rst_gene;
|
||||
case BaseRule::MatchResult::Success:
|
||||
temp_head = std::get<1>(rst_gene);
|
||||
|
||||
if (std::get<0>(rst_gene))
|
||||
rt_inst->currentInst()->addChild(std::get<0>(rst_gene));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_tuple(nullptr, temp_head);
|
||||
return std::make_tuple(BaseRule::MatchResult::Success, temp_head);
|
||||
}
|
||||
|
||||
QString Seqs::token_present() const
|
||||
|
@ -121,35 +135,34 @@ public:
|
|||
return false;
|
||||
}
|
||||
};
|
||||
std::tuple<std::shared_ptr<const Expression>, std::shared_ptr<const IWordBase>> Any::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
std::function<words_span(std::shared_ptr<const IWordBase>, std::shared_ptr<const IWordBase>)> measure_span =
|
||||
[&](std::shared_ptr<const IWordBase> anchor, std::shared_ptr<const IWordBase> head)->words_span {
|
||||
return words_span(anchor->row() - head->row(), anchor->column() - head->column());
|
||||
};
|
||||
std::tuple<BaseRule::MatchResult, std::shared_ptr<const IWordBase>> Any::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
std::tuple<std::shared_ptr<const BaseRule>, int> temp_result = std::make_tuple(nullptr, -1);
|
||||
auto rule_present = this->token_present();
|
||||
|
||||
std::tuple<std::shared_ptr<const BaseRule>, words_span> temp_result = std::make_tuple(mbrs_store.first(), words_span(0,0));
|
||||
for (auto& fork : mbrs_store) {
|
||||
try {
|
||||
auto gen = fork->parse(rt_inst, head);
|
||||
|
||||
switch (std::get<0>(gen)) {
|
||||
// 遇到成功的直接返回解析结果
|
||||
if (std::get<0>(gen))
|
||||
rt_inst->currentInst()->addChild(std::get<0>(gen));
|
||||
return std::make_tuple(nullptr, std::get<1>(gen));
|
||||
case BaseRule::MatchResult::Success:
|
||||
return gen;
|
||||
case BaseRule::MatchResult::Fail: {
|
||||
if (!std::get<0>(temp_result))
|
||||
temp_result = std::make_tuple(fork, 0);
|
||||
}break;
|
||||
case BaseRule::MatchResult::Part: {
|
||||
auto span = std::get<1>(gen)->position() - head->position();
|
||||
if (span > std::get<1>(temp_result))
|
||||
temp_result = std::make_tuple(fork, span);
|
||||
}
|
||||
// 语法错误的会进行比较
|
||||
catch (MismatchException* ex) {
|
||||
auto current_span = measure_span(ex->targetWord(), head);
|
||||
|
||||
if (current_span > std::get<1>(temp_result))
|
||||
temp_result = std::make_tuple(fork, current_span);
|
||||
|
||||
delete ex;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 分析最匹配的分支
|
||||
return std::get<0>(temp_result)->parse(rt_inst, head);
|
||||
rt_inst->clearErrors(head->position());
|
||||
auto temp = std::get<0>(temp_result)->parse(rt_inst, head);
|
||||
return std::make_tuple(BaseRule::MatchResult::Part, std::get<1>(temp));
|
||||
}
|
||||
|
||||
QString Any::token_present() const
|
||||
|
@ -166,60 +179,63 @@ SyntaxException::SyntaxException(const QString& message) { this->msg_store = mes
|
|||
|
||||
QString SyntaxException::message() const { return msg_store; }
|
||||
|
||||
ExpressionRule::ExpressionRule(const QString& rule_name, int expr_mark) : name_store(rule_name) {
|
||||
ExprRule::ExprRule(const QString& rule_name, int expr_mark) : name_store(rule_name) {
|
||||
this->filter_proc = [](const TokenSeqs& seqs) { return seqs; };
|
||||
this->mark_store = expr_mark;
|
||||
}
|
||||
|
||||
std::shared_ptr<const ExpressionRule> ExpressionRule::reloadRule(std::function<TokenSeqs(const TokenSeqs&)> filter, std::shared_ptr<const BaseRule> rule) {
|
||||
std::shared_ptr<const ExprRule> ExprRule::reloadRule(std::function<TokenSeqs(const TokenSeqs&)> filter, std::shared_ptr<const BaseRule> rule) {
|
||||
auto ninst = makeCopy();
|
||||
ninst->child_store = rule;
|
||||
ninst->filter_proc = filter;
|
||||
return ninst;
|
||||
}
|
||||
|
||||
QString ExpressionRule::name() const { return name_store; }
|
||||
QString ExprRule::name() const { return name_store; }
|
||||
|
||||
int ExpressionRule::typeMark() const { return this->mark_store; }
|
||||
int ExprRule::typeMark() const { return this->mark_store; }
|
||||
|
||||
QList<std::shared_ptr<const BaseRule>> ExpressionRule::children() const {
|
||||
QList<std::shared_ptr<const BaseRule>> ExprRule::children() const {
|
||||
return QList<std::shared_ptr<const BaseRule>>() << this->child_store;
|
||||
}
|
||||
|
||||
std::tuple<std::shared_ptr<const Expression>, std::shared_ptr<const IWordBase>> ExpressionRule::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
std::shared_ptr<Expression> elm_ast = this->newEmptyInstance();
|
||||
std::tuple<BaseRule::MatchResult, std::shared_ptr<const IWordBase>>
|
||||
ExprRule::parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const IWordBase> head) const {
|
||||
std::shared_ptr<ExprInst> elm_ast = this->newEmptyInstance();
|
||||
auto text_present = this->token_present();
|
||||
|
||||
rt_inst->pushExpressionRule(this->shared_from_this());
|
||||
rt_inst->pushInst(elm_ast);
|
||||
|
||||
try {
|
||||
auto rstg = child_store->parse(rt_inst, head);
|
||||
|
||||
auto tokens_decl = this->filter_proc(elm_ast->tokens());
|
||||
elm_ast->tokensReset(tokens_decl);
|
||||
|
||||
switch (std::get<0>(rstg)) {
|
||||
case BaseRule::MatchResult::Fail:
|
||||
case BaseRule::MatchResult::Part:
|
||||
rt_inst->popInst();
|
||||
rt_inst->popExpressionRule();
|
||||
return std::make_tuple(elm_ast, std::get<1>(rstg));
|
||||
}
|
||||
catch (...) {
|
||||
break;
|
||||
case BaseRule::MatchResult::Success: {
|
||||
rt_inst->clearErrors(tokens_decl.first()->position());
|
||||
rt_inst->popInst();
|
||||
rt_inst->popExpressionRule();
|
||||
throw;
|
||||
|
||||
if (rt_inst->currentInst()) {
|
||||
rt_inst->currentInst()->addChild(elm_ast);
|
||||
}
|
||||
else {
|
||||
rt_inst->appendDoc(elm_ast);
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QString ExpressionRule::token_present() const {
|
||||
return rstg;
|
||||
}
|
||||
|
||||
QString ExprRule::token_present() const {
|
||||
return QString(u8"(%1)").arg(child_store->token_present());
|
||||
}
|
||||
|
||||
MismatchException::MismatchException(std::shared_ptr<const lib_token::IWordBase> inst) :SyntaxException(
|
||||
QString(u8"Syntax[0x00001]语法匹配错误,不能识别token:%1<%2,%3>(%4)")
|
||||
.arg(inst->content()).arg(inst->row()).arg(inst->column()).arg(inst->file())), target(inst) {}
|
||||
|
||||
std::shared_ptr<const IWordBase>MismatchException::targetWord() const {
|
||||
return this->target;
|
||||
}
|
||||
|
||||
InputTerminal::InputTerminal(const QString& file_path)
|
||||
:SyntaxException(QString(u8"Syntax[0x0000]token流(%1)提前终止").arg(file_path)) {}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <tuple>
|
||||
#include <functional>
|
||||
namespace ast_basic {
|
||||
class Expression;
|
||||
class ExprInst;
|
||||
class ExpressionElement;
|
||||
}
|
||||
|
||||
|
@ -42,14 +42,17 @@ namespace lib_syntax {
|
|||
virtual QStringList errors() const = 0;
|
||||
virtual void clearErrors(int start) = 0;
|
||||
|
||||
virtual void appendDoc(std::shared_ptr<ast_basic::ExprInst> inst) = 0;
|
||||
virtual QList<std::shared_ptr<const ast_basic::ExprInst>> getDocs() const = 0;
|
||||
|
||||
/**
|
||||
* \brief 当前表达式元素.
|
||||
*
|
||||
* \return 返回当前表达式
|
||||
*/
|
||||
virtual std::shared_ptr<ast_basic::Expression> currentInst() const = 0;
|
||||
virtual void pushInst(std::shared_ptr<ast_basic::Expression> current_inst) = 0;
|
||||
virtual std::shared_ptr<ast_basic::Expression> popInst() = 0;
|
||||
virtual std::shared_ptr<ast_basic::ExprInst> currentInst() const = 0;
|
||||
virtual void pushInst(std::shared_ptr<ast_basic::ExprInst> current_inst) = 0;
|
||||
virtual std::shared_ptr<ast_basic::ExprInst> popInst() = 0;
|
||||
|
||||
virtual std::shared_ptr<const BaseRule> currentExpressionRule() const = 0;
|
||||
virtual void pushExpressionRule(std::shared_ptr<const BaseRule> inst) = 0;
|
||||
|
@ -84,7 +87,7 @@ namespace lib_syntax {
|
|||
* @param head 列表头
|
||||
* @return 返回结果<匹配完成新列表头,匹配长度>
|
||||
*/
|
||||
virtual std::tuple<std::shared_ptr<const ast_basic::Expression>, std::shared_ptr<const lib_token::IWordBase>>
|
||||
virtual std::tuple<BaseRule::MatchResult, std::shared_ptr<const lib_token::IWordBase>>
|
||||
parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const lib_token::IWordBase> head) const = 0;
|
||||
|
||||
/**
|
||||
|
@ -109,7 +112,7 @@ namespace lib_syntax {
|
|||
// BaseRule interface
|
||||
public:
|
||||
virtual QList<std::shared_ptr<const BaseRule>> children() const override;
|
||||
virtual std::tuple<std::shared_ptr<const ast_basic::Expression>, std::shared_ptr<const lib_token::IWordBase>>
|
||||
virtual std::tuple<BaseRule::MatchResult, std::shared_ptr<const lib_token::IWordBase>>
|
||||
parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const lib_token::IWordBase> head) const override;
|
||||
virtual QString token_present() const override;
|
||||
};
|
||||
|
@ -129,7 +132,7 @@ namespace lib_syntax {
|
|||
// BaseRule interface
|
||||
public:
|
||||
virtual QList<std::shared_ptr<const BaseRule>> children() const override;
|
||||
virtual std::tuple<std::shared_ptr<const ast_basic::Expression>, std::shared_ptr<const lib_token::IWordBase>>
|
||||
virtual std::tuple<BaseRule::MatchResult, std::shared_ptr<const lib_token::IWordBase>>
|
||||
parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const lib_token::IWordBase> head) const override;
|
||||
virtual QString token_present() const override;
|
||||
};
|
||||
|
@ -147,7 +150,7 @@ namespace lib_syntax {
|
|||
// BaseRule interface
|
||||
public:
|
||||
virtual QList<std::shared_ptr<const BaseRule>> children() const override;
|
||||
virtual std::tuple<std::shared_ptr<const ast_basic::Expression>, std::shared_ptr<const lib_token::IWordBase>>
|
||||
virtual std::tuple<BaseRule::MatchResult, std::shared_ptr<const lib_token::IWordBase>>
|
||||
parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const lib_token::IWordBase> head) const override;
|
||||
virtual QString token_present() const override;
|
||||
};
|
||||
|
@ -166,7 +169,7 @@ namespace lib_syntax {
|
|||
// BaseRule interface
|
||||
public:
|
||||
virtual QList<std::shared_ptr<const BaseRule>> children() const override;
|
||||
virtual std::tuple<std::shared_ptr<const ast_basic::Expression>, std::shared_ptr<const lib_token::IWordBase>>
|
||||
virtual std::tuple<BaseRule::MatchResult, std::shared_ptr<const lib_token::IWordBase>>
|
||||
parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const lib_token::IWordBase> head) const override;
|
||||
virtual QString token_present() const override;
|
||||
};
|
||||
|
@ -175,22 +178,22 @@ namespace lib_syntax {
|
|||
/**
|
||||
* @brief 对应语法表达式解析规则
|
||||
*/
|
||||
class LIBSYNTAX_EXPORT ExpressionRule : public lib_syntax::BaseRule, public std::enable_shared_from_this<ExpressionRule> {
|
||||
class LIBSYNTAX_EXPORT ExprRule : public lib_syntax::BaseRule, public std::enable_shared_from_this<ExprRule> {
|
||||
public:
|
||||
typedef QList<std::shared_ptr<const lib_token::IToken>> TokenSeqs;
|
||||
ExpressionRule(const QString& rule_name, int expr_mark);
|
||||
ExprRule(const QString& rule_name, int expr_mark);
|
||||
|
||||
virtual std::shared_ptr<const ExpressionRule> reloadRule(std::function<TokenSeqs(const TokenSeqs&)> filter, std::shared_ptr<const BaseRule> rule);
|
||||
virtual std::shared_ptr<const ExprRule> reloadRule(std::function<TokenSeqs(const TokenSeqs&)> filter, std::shared_ptr<const BaseRule> rule);
|
||||
virtual QString name() const;
|
||||
virtual int typeMark() const;
|
||||
|
||||
virtual std::shared_ptr<ast_basic::Expression> newEmptyInstance() const = 0;
|
||||
virtual std::shared_ptr<ExpressionRule> makeCopy() const = 0;
|
||||
virtual std::shared_ptr<ast_basic::ExprInst> newEmptyInstance() const = 0;
|
||||
virtual std::shared_ptr<ExprRule> makeCopy() const = 0;
|
||||
|
||||
// BaseRule interface
|
||||
public:
|
||||
virtual QList<std::shared_ptr<const lib_syntax::BaseRule>> children() const override;
|
||||
virtual std::tuple<std::shared_ptr<const ast_basic::Expression>, std::shared_ptr<const lib_token::IWordBase>>
|
||||
virtual std::tuple<BaseRule::MatchResult, std::shared_ptr<const lib_token::IWordBase>>
|
||||
parse(std::shared_ptr<ParseContext> rt_inst, std::shared_ptr<const lib_token::IWordBase> head) const override;
|
||||
virtual QString token_present() const override;
|
||||
|
||||
|
@ -205,35 +208,18 @@ namespace lib_syntax {
|
|||
* 语法元素解析规则.
|
||||
*/
|
||||
template<class ExprType>
|
||||
class ElementRule : public ExpressionRule {
|
||||
class ElementRule : public ExprRule {
|
||||
public:
|
||||
ElementRule(const QString& rule_name, int expr_mark)
|
||||
:ExpressionRule(rule_name, expr_mark){}
|
||||
:ExprRule(rule_name, expr_mark){}
|
||||
|
||||
virtual std::shared_ptr<ast_basic::Expression> newEmptyInstance() const {
|
||||
return std::dynamic_pointer_cast<ast_basic::Expression>(
|
||||
virtual std::shared_ptr<ast_basic::ExprInst> newEmptyInstance() const {
|
||||
return std::dynamic_pointer_cast<ast_basic::ExprInst>(
|
||||
std::make_shared<ExprType>(this->shared_from_this()));
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<ExpressionRule> makeCopy() const {
|
||||
virtual std::shared_ptr<ExprRule> makeCopy() const {
|
||||
return std::make_shared<ElementRule<ExprType>>(name(), typeMark());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class MismatchException : public SyntaxException {
|
||||
private:
|
||||
std::shared_ptr<const lib_token::IWordBase> target;
|
||||
|
||||
public:
|
||||
MismatchException(std::shared_ptr<const lib_token::IWordBase> inst);
|
||||
virtual ~MismatchException() = default;
|
||||
|
||||
virtual std::shared_ptr<const lib_token::IWordBase> targetWord() const;
|
||||
};
|
||||
|
||||
class InputTerminal : public SyntaxException {
|
||||
public:
|
||||
InputTerminal(const QString &file_path);
|
||||
};
|
||||
} // namespace lib_syntax
|
|
@ -52,8 +52,8 @@ QList<std::shared_ptr<const BaseRule>> LinesMerge(std::shared_ptr<const BaseRule
|
|||
}
|
||||
|
||||
// remove-return
|
||||
auto remove_nl = [](const ExpressionRule::TokenSeqs& p)->ExpressionRule::TokenSeqs {
|
||||
ExpressionRule::TokenSeqs result;
|
||||
auto remove_nl = [](const ExprRule::TokenSeqs& p)->ExprRule::TokenSeqs {
|
||||
ExprRule::TokenSeqs result;
|
||||
for (auto& n : p) {
|
||||
if (n->define()->typeMark() == newl->typeMark())
|
||||
continue;
|
||||
|
@ -109,7 +109,7 @@ auto document_define = ElementRule<Document>(u8"decls-doc", (int)NovelExprs::DOC
|
|||
}
|
||||
));
|
||||
|
||||
std::shared_ptr<const ExpressionRule> NovalSyntax::getParseTree() { return document_define; }
|
||||
std::shared_ptr<const ExprRule> NovalSyntax::getParseTree() { return document_define; }
|
||||
std::shared_ptr<const ast_gen::SyntaxElement> NovalSyntax::tidy(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> children)
|
||||
{
|
||||
cache_load(root, children);
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace example_novel {
|
|||
* @brief 获取novel语法解析树
|
||||
* @return
|
||||
*/
|
||||
static std::shared_ptr<const lib_syntax::ExpressionRule> getParseTree();
|
||||
static std::shared_ptr<const lib_syntax::ExprRule> getParseTree();
|
||||
|
||||
static std::shared_ptr<const ast_gen::SyntaxElement> tidy(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue