添加cache机制,降低后续执行时间
This commit is contained in:
parent
c8fedda85b
commit
8404719d26
|
@ -6,12 +6,12 @@
|
||||||
<LocalDebuggerCommandArguments>--path "D:\手作小说\科学+修仙+创造世界"</LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>--path "D:\手作小说\科学+修仙+创造世界"</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.0960465Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.5896562Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.2054213Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.6990325Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.4574393Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.8553531Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.5199406Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.9178555Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -13,8 +13,8 @@ void GlobalElement::clearCache() { node_cache.clear(); }
|
||||||
void GlobalElement::appendToCache(std::shared_ptr<const SyntaxElement> named_node) {
|
void GlobalElement::appendToCache(std::shared_ptr<const SyntaxElement> named_node) {
|
||||||
auto mixed_key = QString(u8"%1<%2>").arg(named_node->signature()).arg(named_node->typeMark());
|
auto mixed_key = QString(u8"%1<%2>").arg(named_node->signature()).arg(named_node->typeMark());
|
||||||
if (node_cache.contains(mixed_key))
|
if (node_cache.contains(mixed_key))
|
||||||
throw new lib_syntax::SyntaxException(
|
throw new lib_syntax::SyntaxException(QString(u8"Parse[0x0004]系统中包含同类型重名命名节点:%1<type:%2>")
|
||||||
QString(u8"Parse[0x0004]系统中包含同类型重名命名节点:%1<type:%2>").arg(named_node->signature()).arg(named_node->typeMark()));
|
.arg(named_node->signature()).arg(named_node->typeMark()));
|
||||||
node_cache[mixed_key] = named_node;
|
node_cache[mixed_key] = named_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,10 @@ std::shared_ptr<const ast_basic::Expression> ast_gen::GlobalElement::bindExpress
|
||||||
return bind_exprs;
|
return bind_exprs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ast_gen::GlobalElement::cacheLoad()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void GlobalElement::addChild(std::shared_ptr<ast_gen::SyntaxElement> citem) {
|
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::Expression>(citem);
|
||||||
bind_exprs->addChild(convx);
|
bind_exprs->addChild(convx);
|
||||||
|
|
|
@ -60,6 +60,7 @@ namespace ast_gen
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual QList<std::shared_ptr<const TokenAccess>> selfTokens() const = 0;
|
virtual QList<std::shared_ptr<const TokenAccess>> selfTokens() const = 0;
|
||||||
|
virtual void cacheLoad() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,6 +132,7 @@ namespace ast_gen
|
||||||
virtual QList<std::shared_ptr<const TokenAccess>> selfTokens() const override;
|
virtual QList<std::shared_ptr<const TokenAccess>> selfTokens() const override;
|
||||||
|
|
||||||
// 通过 SyntaxElement 继承
|
// 通过 SyntaxElement 继承
|
||||||
std::shared_ptr<const ast_basic::Expression> bindExpression() const override;
|
virtual std::shared_ptr<const ast_basic::Expression> bindExpression() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -8,11 +8,7 @@ TextSection::TextSection(std::shared_ptr<const lib_syntax::ExpressionRule> rule_
|
||||||
|
|
||||||
QString example_novel::TextSection::content() const
|
QString example_novel::TextSection::content() const
|
||||||
{
|
{
|
||||||
QString text;
|
return context_store;
|
||||||
for (auto& t : selfTokens()) {
|
|
||||||
text += t->token()->content() + " ";
|
|
||||||
}
|
|
||||||
return text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TextSection::typeMark() const { return (int)NovelNode::TextSection; }
|
int TextSection::typeMark() const { return (int)NovelNode::TextSection; }
|
||||||
|
@ -24,13 +20,27 @@ bool example_novel::TextSection::isAnonymous() const
|
||||||
|
|
||||||
QString TextSection::signature() const { return u8"::section"; }
|
QString TextSection::signature() const { return u8"::section"; }
|
||||||
|
|
||||||
|
void example_novel::TextSection::cacheLoad()
|
||||||
|
{
|
||||||
|
QString text;
|
||||||
|
for (auto& t : selfTokens()) {
|
||||||
|
text += t->token()->content() + " ";
|
||||||
|
}
|
||||||
|
context_store = text;
|
||||||
|
}
|
||||||
|
|
||||||
FragmentRefers::FragmentRefers(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
FragmentRefers::FragmentRefers(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
||||||
: AbstractImpl(rule_bind) {}
|
: AbstractImpl(rule_bind) {}
|
||||||
|
|
||||||
QString FragmentRefers::storyRefer() const { return selfTokens()[5]->token()->content(); }
|
QString FragmentRefers::storyRefer() const { return story_refs; }
|
||||||
|
|
||||||
QString FragmentRefers::fragmentRefer() const { return selfTokens()[3]->token()->content(); }
|
QString FragmentRefers::fragmentRefer() const { return fragment_ref; }
|
||||||
|
|
||||||
|
void example_novel::FragmentRefers::cacheLoad()
|
||||||
|
{
|
||||||
|
this->story_refs = selfTokens()[5]->token()->content();
|
||||||
|
this->fragment_ref = selfTokens()[3]->token()->content();
|
||||||
|
}
|
||||||
QString FragmentRefers::referSignature() const {
|
QString FragmentRefers::referSignature() const {
|
||||||
return storyRefer() + u8"&" + fragmentRefer();
|
return storyRefer() + u8"&" + fragmentRefer();
|
||||||
}
|
}
|
||||||
|
@ -47,11 +57,16 @@ QString FragmentRefers::signature() const {
|
||||||
return parent()->signature() + signature;
|
return parent()->signature() + signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FragmentDefine::FragmentDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
FragmentDefine::FragmentDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
||||||
: AbstractImpl(rule_bind) {}
|
: AbstractImpl(rule_bind) {}
|
||||||
|
|
||||||
QString FragmentDefine::name() const { return selfTokens()[2]->token()->content(); }
|
QString FragmentDefine::name() const { return name_store; }
|
||||||
|
|
||||||
|
void example_novel::FragmentDefine::cacheLoad()
|
||||||
|
{
|
||||||
|
name_store = selfTokens()[2]->token()->content();
|
||||||
|
}
|
||||||
int FragmentDefine::typeMark() const { return (int)NovelNode::FragmentDefine; }
|
int FragmentDefine::typeMark() const { return (int)NovelNode::FragmentDefine; }
|
||||||
|
|
||||||
bool example_novel::FragmentDefine::isAnonymous() const
|
bool example_novel::FragmentDefine::isAnonymous() const
|
||||||
|
@ -61,12 +76,19 @@ bool example_novel::FragmentDefine::isAnonymous() const
|
||||||
|
|
||||||
QString FragmentDefine::signature() const { return parent()->signature() + u8"&" + name(); }
|
QString FragmentDefine::signature() const { return parent()->signature() + u8"&" + name(); }
|
||||||
|
|
||||||
|
|
||||||
StoryDefine::StoryDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
StoryDefine::StoryDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
||||||
: AbstractImpl(rule_bind) {}
|
: AbstractImpl(rule_bind) {}
|
||||||
|
|
||||||
QString StoryDefine::name() const { return selfTokens()[3]->token()->content(); }
|
QString StoryDefine::name() const { return name_store; }
|
||||||
|
|
||||||
int StoryDefine::sort() const { return selfTokens()[2]->token()->content().toInt(); }
|
int StoryDefine::sort() const { return sort_index; }
|
||||||
|
|
||||||
|
void example_novel::StoryDefine::cacheLoad()
|
||||||
|
{
|
||||||
|
name_store = selfTokens()[3]->token()->content();
|
||||||
|
sort_index = selfTokens()[2]->token()->content().toInt();
|
||||||
|
}
|
||||||
|
|
||||||
int StoryDefine::typeMark() const { return (int)NovelNode::StoryDefine; }
|
int StoryDefine::typeMark() const { return (int)NovelNode::StoryDefine; }
|
||||||
|
|
||||||
|
@ -90,6 +112,10 @@ bool example_novel::Document::isAnonymous() const
|
||||||
|
|
||||||
QString Document::signature() const { return QString(u8"::document<%1>").arg(path()); }
|
QString Document::signature() const { return QString(u8"::document<%1>").arg(path()); }
|
||||||
|
|
||||||
|
void example_novel::Document::cacheLoad()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
example_novel::AbstractImpl::AbstractImpl(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
example_novel::AbstractImpl::AbstractImpl(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
||||||
: ExpressionElement(rule_bind) {}
|
: ExpressionElement(rule_bind) {}
|
||||||
|
|
||||||
|
@ -127,7 +153,12 @@ QString example_novel::AbstractImpl::path() const
|
||||||
VolumeDefine::VolumeDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
VolumeDefine::VolumeDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
||||||
: AbstractImpl(rule_bind) {}
|
: AbstractImpl(rule_bind) {}
|
||||||
|
|
||||||
QString VolumeDefine::name() const { return selfTokens()[2]->token()->content(); }
|
QString VolumeDefine::name() const { return name_store; }
|
||||||
|
|
||||||
|
void example_novel::VolumeDefine::cacheLoad()
|
||||||
|
{
|
||||||
|
name_store = selfTokens()[2]->token()->content();
|
||||||
|
}
|
||||||
|
|
||||||
int VolumeDefine::typeMark() const { return (int)NovelNode::VolumeDefine; }
|
int VolumeDefine::typeMark() const { return (int)NovelNode::VolumeDefine; }
|
||||||
|
|
||||||
|
@ -141,7 +172,12 @@ QString VolumeDefine::signature() const { return name(); }
|
||||||
ArticleDefine::ArticleDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
ArticleDefine::ArticleDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind)
|
||||||
: AbstractImpl(rule_bind) {}
|
: AbstractImpl(rule_bind) {}
|
||||||
|
|
||||||
QString ArticleDefine::name() const { return selfTokens()[2]->token()->content(); }
|
QString ArticleDefine::name() const { return name_store; }
|
||||||
|
|
||||||
|
void example_novel::ArticleDefine::cacheLoad()
|
||||||
|
{
|
||||||
|
name_store = selfTokens()[2]->token()->content();
|
||||||
|
}
|
||||||
|
|
||||||
int ArticleDefine::typeMark() const { return (int)NovelNode::ArticleDefine; }
|
int ArticleDefine::typeMark() const { return (int)NovelNode::ArticleDefine; }
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,10 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString context_store;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBSYNTAX_EXPORT FragmentRefers : public AbstractImpl {
|
class LIBSYNTAX_EXPORT FragmentRefers : public AbstractImpl {
|
||||||
|
@ -57,6 +61,10 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString story_refs, fragment_ref;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBSYNTAX_EXPORT FragmentDefine : public AbstractImpl {
|
class LIBSYNTAX_EXPORT FragmentDefine : public AbstractImpl {
|
||||||
|
@ -70,6 +78,10 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString name_store;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBSYNTAX_EXPORT ArticleDefine : public AbstractImpl {
|
class LIBSYNTAX_EXPORT ArticleDefine : public AbstractImpl {
|
||||||
|
@ -83,6 +95,10 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString name_store;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBSYNTAX_EXPORT VolumeDefine : public AbstractImpl {
|
class LIBSYNTAX_EXPORT VolumeDefine : public AbstractImpl {
|
||||||
|
@ -96,6 +112,10 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString name_store;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBSYNTAX_EXPORT StoryDefine : public AbstractImpl {
|
class LIBSYNTAX_EXPORT StoryDefine : public AbstractImpl {
|
||||||
|
@ -110,6 +130,11 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString name_store;
|
||||||
|
int sort_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBSYNTAX_EXPORT Document : public AbstractImpl {
|
class LIBSYNTAX_EXPORT Document : public AbstractImpl {
|
||||||
|
@ -121,5 +146,6 @@ namespace example_novel
|
||||||
virtual int typeMark() const override;
|
virtual int typeMark() const override;
|
||||||
virtual bool isAnonymous() const override;
|
virtual bool isAnonymous() const override;
|
||||||
virtual QString signature() const override;
|
virtual QString signature() const override;
|
||||||
|
virtual void cacheLoad() override;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.2523510Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.7302802Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.3148604Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.8084783Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -104,12 +104,18 @@ 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 ExpressionRule> NovalSyntax::getParseTree() { return document_define; }
|
||||||
std::shared_ptr<const ast_gen::SyntaxElement> example_novel::NovalSyntax::tidy(std::shared_ptr<const ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> children)
|
std::shared_ptr<const ast_gen::SyntaxElement> example_novel::NovalSyntax::tidy(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> children)
|
||||||
{
|
{
|
||||||
|
cache_load(root, children);
|
||||||
|
node_register(root, children);
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
void example_novel::NovalSyntax::cache_load(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> children)
|
||||||
|
{
|
||||||
|
std::const_pointer_cast<ast_gen::SyntaxElement>(root)->cacheLoad();
|
||||||
|
|
||||||
for (auto& cinst : children) {
|
for (auto& cinst : children) {
|
||||||
cinst->setParent(root);
|
cinst->setParent(root);
|
||||||
if (!cinst->isAnonymous())
|
|
||||||
ast_gen::GlobalElement::UniquePtr->appendToCache(cinst);
|
|
||||||
|
|
||||||
QList<std::shared_ptr<ast_gen::SyntaxElement>> child_items;
|
QList<std::shared_ptr<ast_gen::SyntaxElement>> child_items;
|
||||||
for (auto& it : cinst->bindExpression()->children()) {
|
for (auto& it : cinst->bindExpression()->children()) {
|
||||||
|
@ -117,10 +123,23 @@ std::shared_ptr<const ast_gen::SyntaxElement> example_novel::NovalSyntax::tidy(s
|
||||||
child_items.append(std::const_pointer_cast<ast_gen::SyntaxElement>(const_it));
|
child_items.append(std::const_pointer_cast<ast_gen::SyntaxElement>(const_it));
|
||||||
}
|
}
|
||||||
|
|
||||||
tidy(cinst, child_items);
|
cache_load(cinst, child_items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void example_novel::NovalSyntax::node_register(std::shared_ptr<const ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> children)
|
||||||
|
{
|
||||||
|
for (auto& child : children) {
|
||||||
|
if (!child->isAnonymous())
|
||||||
|
ast_gen::GlobalElement::UniquePtr->appendToCache(child);
|
||||||
|
|
||||||
|
QList<std::shared_ptr<ast_gen::SyntaxElement>> next_child_items;
|
||||||
|
for (auto& it : child->bindExpression()->children()) {
|
||||||
|
auto const_it = std::dynamic_pointer_cast<const ast_gen::SyntaxElement>(it);
|
||||||
|
next_child_items.append(std::const_pointer_cast<ast_gen::SyntaxElement>(const_it));
|
||||||
}
|
}
|
||||||
|
|
||||||
return root;
|
node_register(child, next_child_items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::shared_ptr<const TokenReader> NovalSyntax::getLexReader()
|
std::shared_ptr<const TokenReader> NovalSyntax::getLexReader()
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,11 @@ namespace example_novel {
|
||||||
*/
|
*/
|
||||||
static std::shared_ptr<const lib_syntax::ExpressionRule> getParseTree();
|
static std::shared_ptr<const lib_syntax::ExpressionRule> getParseTree();
|
||||||
|
|
||||||
static std::shared_ptr<const ast_gen::SyntaxElement> tidy(std::shared_ptr<const ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
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:
|
||||||
|
static void cache_load(std::shared_ptr<ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
||||||
|
static void node_register(std::shared_ptr<const ast_gen::SyntaxElement> root, QList<std::shared_ptr<ast_gen::SyntaxElement>> docs);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace example_novel
|
} // namespace example_novel
|
|
@ -2,12 +2,12 @@
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.3461410Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:54.9646551Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-06-15T14:08:20.4105452Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-06-18T03:59:55.0271675Z</QtLastBackgroundBuild>
|
||||||
<QtTouchProperty>
|
<QtTouchProperty>
|
||||||
</QtTouchProperty>
|
</QtTouchProperty>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
Loading…
Reference in New Issue