添加cache机制,降低后续执行时间
This commit is contained in:
parent
c8fedda85b
commit
8404719d26
|
@ -6,12 +6,12 @@
|
|||
<LocalDebuggerCommandArguments>--path "D:\手作小说\科学+修仙+创造世界"</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -13,8 +13,8 @@ void GlobalElement::clearCache() { node_cache.clear(); }
|
|||
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());
|
||||
if (node_cache.contains(mixed_key))
|
||||
throw new lib_syntax::SyntaxException(
|
||||
QString(u8"Parse[0x0004]系统中包含同类型重名命名节点:%1<type:%2>").arg(named_node->signature()).arg(named_node->typeMark()));
|
||||
throw new lib_syntax::SyntaxException(QString(u8"Parse[0x0004]系统中包含同类型重名命名节点:%1<type:%2>")
|
||||
.arg(named_node->signature()).arg(named_node->typeMark()));
|
||||
node_cache[mixed_key] = named_node;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,10 @@ std::shared_ptr<const ast_basic::Expression> ast_gen::GlobalElement::bindExpress
|
|||
return bind_exprs;
|
||||
}
|
||||
|
||||
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);
|
||||
bind_exprs->addChild(convx);
|
||||
|
|
|
@ -60,6 +60,7 @@ namespace ast_gen
|
|||
* @return
|
||||
*/
|
||||
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;
|
||||
|
||||
// 通过 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 text;
|
||||
for (auto& t : selfTokens()) {
|
||||
text += t->token()->content() + " ";
|
||||
}
|
||||
return text;
|
||||
return context_store;
|
||||
}
|
||||
|
||||
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"; }
|
||||
|
||||
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)
|
||||
: 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 {
|
||||
return storyRefer() + u8"&" + fragmentRefer();
|
||||
}
|
||||
|
@ -47,11 +57,16 @@ QString FragmentRefers::signature() const {
|
|||
return parent()->signature() + signature;
|
||||
}
|
||||
|
||||
|
||||
FragmentDefine::FragmentDefine(std::shared_ptr<const lib_syntax::ExpressionRule> 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; }
|
||||
|
||||
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(); }
|
||||
|
||||
|
||||
StoryDefine::StoryDefine(std::shared_ptr<const lib_syntax::ExpressionRule> 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; }
|
||||
|
||||
|
@ -90,6 +112,10 @@ bool example_novel::Document::isAnonymous() const
|
|||
|
||||
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)
|
||||
: ExpressionElement(rule_bind) {}
|
||||
|
||||
|
@ -127,7 +153,12 @@ QString example_novel::AbstractImpl::path() const
|
|||
VolumeDefine::VolumeDefine(std::shared_ptr<const lib_syntax::ExpressionRule> 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; }
|
||||
|
||||
|
@ -141,7 +172,12 @@ QString VolumeDefine::signature() const { return name(); }
|
|||
ArticleDefine::ArticleDefine(std::shared_ptr<const lib_syntax::ExpressionRule> 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; }
|
||||
|
||||
|
|
|
@ -4,122 +4,148 @@
|
|||
|
||||
namespace example_novel
|
||||
{
|
||||
enum class NovelNode {
|
||||
TextSection = 1,
|
||||
FragmentRefer = 2,
|
||||
FragmentDefine = 3,
|
||||
StoryDefine = 4,
|
||||
Document = 5,
|
||||
ArticleDefine = 6,
|
||||
VolumeDefine = 7,
|
||||
};
|
||||
enum class NovelNode {
|
||||
TextSection = 1,
|
||||
FragmentRefer = 2,
|
||||
FragmentDefine = 3,
|
||||
StoryDefine = 4,
|
||||
Document = 5,
|
||||
ArticleDefine = 6,
|
||||
VolumeDefine = 7,
|
||||
};
|
||||
|
||||
class LIBSYNTAX_EXPORT AbstractImpl :
|
||||
public ast_basic::ExpressionElement, public ast_gen::SyntaxElement {
|
||||
private:
|
||||
std::shared_ptr<const SyntaxElement> parent_store = nullptr;
|
||||
class LIBSYNTAX_EXPORT AbstractImpl :
|
||||
public ast_basic::ExpressionElement, public ast_gen::SyntaxElement {
|
||||
private:
|
||||
std::shared_ptr<const SyntaxElement> parent_store = nullptr;
|
||||
|
||||
public:
|
||||
explicit AbstractImpl(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
public:
|
||||
explicit AbstractImpl(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
// ͨ¹ý SyntaxElement ¼Ì³Ð
|
||||
virtual std::shared_ptr<const ast_basic::Expression> 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;
|
||||
virtual QList<std::shared_ptr<const ast_gen::TokenAccess>> selfTokens() const override;
|
||||
};
|
||||
// ͨ¹ý SyntaxElement ¼Ì³Ð
|
||||
virtual std::shared_ptr<const ast_basic::Expression> 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;
|
||||
virtual QList<std::shared_ptr<const ast_gen::TokenAccess>> selfTokens() const override;
|
||||
};
|
||||
|
||||
|
||||
class LIBSYNTAX_EXPORT TextSection : public AbstractImpl {
|
||||
public:
|
||||
TextSection(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
class LIBSYNTAX_EXPORT TextSection : public AbstractImpl {
|
||||
public:
|
||||
TextSection(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
QString content() const;
|
||||
QString content() const;
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
|
||||
class LIBSYNTAX_EXPORT FragmentRefers : public AbstractImpl {
|
||||
public:
|
||||
FragmentRefers(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
private:
|
||||
QString context_store;
|
||||
};
|
||||
|
||||
QString storyRefer() const;
|
||||
QString fragmentRefer() const;
|
||||
QString referSignature() const;
|
||||
class LIBSYNTAX_EXPORT FragmentRefers : public AbstractImpl {
|
||||
public:
|
||||
FragmentRefers(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
QString storyRefer() const;
|
||||
QString fragmentRefer() const;
|
||||
QString referSignature() const;
|
||||
|
||||
class LIBSYNTAX_EXPORT FragmentDefine : public AbstractImpl {
|
||||
public:
|
||||
FragmentDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
|
||||
QString name() const;
|
||||
private:
|
||||
QString story_refs, fragment_ref;
|
||||
};
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
class LIBSYNTAX_EXPORT FragmentDefine : public AbstractImpl {
|
||||
public:
|
||||
FragmentDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
class LIBSYNTAX_EXPORT ArticleDefine : public AbstractImpl{
|
||||
public:
|
||||
ArticleDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
QString name() const;
|
||||
|
||||
QString name() const;
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
private:
|
||||
QString name_store;
|
||||
};
|
||||
|
||||
class LIBSYNTAX_EXPORT VolumeDefine : public AbstractImpl {
|
||||
public:
|
||||
VolumeDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
class LIBSYNTAX_EXPORT ArticleDefine : public AbstractImpl {
|
||||
public:
|
||||
ArticleDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
QString name() const;
|
||||
QString name() const;
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
|
||||
class LIBSYNTAX_EXPORT StoryDefine : public AbstractImpl {
|
||||
public:
|
||||
StoryDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
private:
|
||||
QString name_store;
|
||||
};
|
||||
|
||||
QString name() const;
|
||||
int sort() const;
|
||||
class LIBSYNTAX_EXPORT VolumeDefine : public AbstractImpl {
|
||||
public:
|
||||
VolumeDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
QString name() const;
|
||||
|
||||
class LIBSYNTAX_EXPORT Document : public AbstractImpl {
|
||||
public:
|
||||
Document(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
|
||||
private:
|
||||
QString name_store;
|
||||
};
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
};
|
||||
class LIBSYNTAX_EXPORT StoryDefine : public AbstractImpl {
|
||||
public:
|
||||
StoryDefine(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
QString name() const;
|
||||
int sort() const;
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
|
||||
private:
|
||||
QString name_store;
|
||||
int sort_index;
|
||||
};
|
||||
|
||||
class LIBSYNTAX_EXPORT Document : public AbstractImpl {
|
||||
public:
|
||||
Document(std::shared_ptr<const lib_syntax::ExpressionRule> rule_bind);
|
||||
|
||||
// SyntaxElement interface
|
||||
public:
|
||||
virtual int typeMark() const override;
|
||||
virtual bool isAnonymous() const override;
|
||||
virtual QString signature() const override;
|
||||
virtual void cacheLoad() override;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</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 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) {
|
||||
cinst->setParent(root);
|
||||
if (!cinst->isAnonymous())
|
||||
ast_gen::GlobalElement::UniquePtr->appendToCache(cinst);
|
||||
|
||||
QList<std::shared_ptr<ast_gen::SyntaxElement>> child_items;
|
||||
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));
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
return root;
|
||||
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));
|
||||
}
|
||||
|
||||
node_register(child, next_child_items);
|
||||
}
|
||||
}
|
||||
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 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
|
|
@ -2,12 +2,12 @@
|
|||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
|
|
Loading…
Reference in New Issue