-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into disable-yield-var
Showing
43 changed files
with
5,143 additions
and
1,607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
#include "storage/ExprVisitorBase.h" | ||
namespace nebula { | ||
namespace storage { | ||
void ExprVisitorBase::visit(ConstantExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(UnaryExpression *expr) { expr->operand()->accept(this); } | ||
void ExprVisitorBase::visit(TypeCastingExpression *expr) { expr->operand()->accept(this); } | ||
void ExprVisitorBase::visit(LabelExpression *expr) { fatal(expr); } | ||
void ExprVisitorBase::visit(LabelAttributeExpression *expr) { fatal(expr); } | ||
// binary expression | ||
void ExprVisitorBase::visit(ArithmeticExpression *expr) { | ||
expr->left()->accept(this); | ||
expr->right()->accept(this); | ||
} | ||
void ExprVisitorBase::visit(RelationalExpression *expr) { | ||
expr->left()->accept(this); | ||
expr->right()->accept(this); | ||
} | ||
void ExprVisitorBase::visit(SubscriptExpression *expr) { | ||
expr->left()->accept(this); | ||
expr->right()->accept(this); | ||
} | ||
void ExprVisitorBase::visit(AttributeExpression *expr) { fatal(expr); } | ||
void ExprVisitorBase::visit(LogicalExpression *expr) { | ||
for (auto operand : expr->operands()) { | ||
operand->accept(this); | ||
} | ||
} | ||
// function call | ||
void ExprVisitorBase::visit(FunctionCallExpression *expr) { | ||
for (auto arg : expr->args()->args()) { | ||
arg->accept(this); | ||
} | ||
} | ||
void ExprVisitorBase::visit(AggregateExpression *expr) { fatal(expr); } | ||
void ExprVisitorBase::visit(UUIDExpression *expr) { UNUSED(expr); } | ||
// variable expression | ||
void ExprVisitorBase::visit(VariableExpression *expr) { fatal(expr); } | ||
void ExprVisitorBase::visit(VersionedVariableExpression *expr) { fatal(expr); } | ||
// container expression | ||
void ExprVisitorBase::visit(ListExpression *expr) { | ||
for (auto item : expr->items()) { | ||
item->accept(this); | ||
} | ||
} | ||
void ExprVisitorBase::visit(SetExpression *expr) { | ||
for (auto item : expr->items()) { | ||
item->accept(this); | ||
} | ||
} | ||
void ExprVisitorBase::visit(MapExpression *expr) { UNUSED(expr); } | ||
// property Expression | ||
void ExprVisitorBase::visit(TagPropertyExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(EdgePropertyExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(InputPropertyExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(VariablePropertyExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(DestPropertyExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(SourcePropertyExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(EdgeSrcIdExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(EdgeTypeExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(EdgeRankExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(EdgeDstIdExpression *expr) { UNUSED(expr); } | ||
// vertex/edge expression | ||
void ExprVisitorBase::visit(VertexExpression *expr) { UNUSED(expr); } | ||
void ExprVisitorBase::visit(EdgeExpression *expr) { UNUSED(expr); } | ||
// case expression | ||
void ExprVisitorBase::visit(CaseExpression *expr) { UNUSED(expr); } | ||
// path build expression | ||
void ExprVisitorBase::visit(PathBuildExpression *expr) { fatal(expr); } | ||
// column expression | ||
void ExprVisitorBase::visit(ColumnExpression *expr) { fatal(expr); } | ||
// predicate expression | ||
void ExprVisitorBase::visit(PredicateExpression *expr) { fatal(expr); } | ||
// list comprehension expression | ||
void ExprVisitorBase::visit(ListComprehensionExpression *expr) { fatal(expr); } | ||
// reduce expression | ||
void ExprVisitorBase::visit(ReduceExpression *expr) { fatal(expr); } | ||
// subscript range expression | ||
void ExprVisitorBase::visit(SubscriptRangeExpression *expr) { fatal(expr); } | ||
|
||
} // namespace storage | ||
} // namespace nebula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* Copyright (c) 2021 vesoft inc. All rights reserved. | ||
* | ||
* This source code is licensed under Apache 2.0 License. | ||
*/ | ||
|
||
#pragma once | ||
#include "common/expression/ExprVisitor.h" | ||
namespace nebula { | ||
namespace storage { | ||
|
||
class ExprVisitorBase : public ::nebula::ExprVisitor { | ||
public: | ||
void visit(ConstantExpression *expr) override; | ||
void visit(UnaryExpression *expr) override; | ||
void visit(TypeCastingExpression *expr) override; | ||
void visit(LabelExpression *expr) override; | ||
void visit(LabelAttributeExpression *expr) override; | ||
// binary expression | ||
void visit(ArithmeticExpression *expr) override; | ||
void visit(RelationalExpression *expr) override; | ||
void visit(SubscriptExpression *expr) override; | ||
void visit(AttributeExpression *expr) override; | ||
void visit(LogicalExpression *expr) override; | ||
// function call | ||
void visit(FunctionCallExpression *expr) override; | ||
void visit(AggregateExpression *expr) override; | ||
void visit(UUIDExpression *expr) override; | ||
// variable expression | ||
void visit(VariableExpression *expr) override; | ||
void visit(VersionedVariableExpression *expr) override; | ||
// container expression | ||
void visit(ListExpression *expr) override; | ||
void visit(SetExpression *expr) override; | ||
void visit(MapExpression *expr) override; | ||
// property Expression | ||
void visit(TagPropertyExpression *expr) override; | ||
void visit(EdgePropertyExpression *expr) override; | ||
void visit(InputPropertyExpression *expr) override; | ||
void visit(VariablePropertyExpression *expr) override; | ||
void visit(DestPropertyExpression *expr) override; | ||
void visit(SourcePropertyExpression *expr) override; | ||
void visit(EdgeSrcIdExpression *expr) override; | ||
void visit(EdgeTypeExpression *expr) override; | ||
void visit(EdgeRankExpression *expr) override; | ||
void visit(EdgeDstIdExpression *expr) override; | ||
// vertex/edge expression | ||
void visit(VertexExpression *expr) override; | ||
void visit(EdgeExpression *expr) override; | ||
// case expression | ||
void visit(CaseExpression *expr) override; | ||
// path build expression | ||
void visit(PathBuildExpression *expr) override; | ||
// column expression | ||
void visit(ColumnExpression *expr) override; | ||
// predicate expression | ||
void visit(PredicateExpression *expr) override; | ||
// list comprehension expression | ||
void visit(ListComprehensionExpression *expr) override; | ||
// reduce expression | ||
void visit(ReduceExpression *expr) override; | ||
// subscript range expression | ||
void visit(SubscriptRangeExpression *expr) override; | ||
|
||
private: | ||
using ::nebula::ExprVisitor::visit; | ||
inline void fatal(Expression *expr) { | ||
LOG(FATAL) << "Unexpect expression kind " << static_cast<int>(expr->kind()) << " at storage"; | ||
} | ||
}; | ||
} // namespace storage | ||
} // namespace nebula |
Oops, something went wrong.