Add labels and edge type test nodes to ast
Reviewers: teon.banek Reviewed By: teon.banek Differential Revision: https://phabricator.memgraph.io/D343
This commit is contained in:
parent
0968224a3d
commit
d2f9affb4c
@ -487,6 +487,48 @@ class PropertyLookup : public Expression {
|
|||||||
: Expression(uid), expression_(expression), property_(property) {}
|
: Expression(uid), expression_(expression), property_(property) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LabelsTest : public Expression {
|
||||||
|
friend class AstTreeStorage;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void Accept(TreeVisitorBase &visitor) override {
|
||||||
|
if (visitor.PreVisit(*this)) {
|
||||||
|
visitor.Visit(*this);
|
||||||
|
expression_->Accept(visitor);
|
||||||
|
visitor.PostVisit(*this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Expression *expression_ = nullptr;
|
||||||
|
std::vector<GraphDbTypes::Label> labels_;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
LabelsTest(int uid, Expression *expression,
|
||||||
|
std::vector<GraphDbTypes::Label> labels)
|
||||||
|
: Expression(uid), expression_(expression), labels_(labels) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class EdgeTypeTest : public Expression {
|
||||||
|
friend class AstTreeStorage;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void Accept(TreeVisitorBase &visitor) override {
|
||||||
|
if (visitor.PreVisit(*this)) {
|
||||||
|
visitor.Visit(*this);
|
||||||
|
expression_->Accept(visitor);
|
||||||
|
visitor.PostVisit(*this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Expression *expression_ = nullptr;
|
||||||
|
std::vector<GraphDbTypes::EdgeType> edge_types_;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
EdgeTypeTest(int uid, Expression *expression,
|
||||||
|
std::vector<GraphDbTypes::EdgeType> edge_types)
|
||||||
|
: Expression(uid), expression_(expression), edge_types_(edge_types) {}
|
||||||
|
};
|
||||||
|
|
||||||
class Function : public Expression {
|
class Function : public Expression {
|
||||||
friend class AstTreeStorage;
|
friend class AstTreeStorage;
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ class Query;
|
|||||||
class NamedExpression;
|
class NamedExpression;
|
||||||
class Identifier;
|
class Identifier;
|
||||||
class PropertyLookup;
|
class PropertyLookup;
|
||||||
|
class LabelsTest;
|
||||||
|
class EdgeTypeTest;
|
||||||
class Aggregation;
|
class Aggregation;
|
||||||
class Function;
|
class Function;
|
||||||
class Create;
|
class Create;
|
||||||
@ -57,8 +59,9 @@ using TreeVisitorBase = ::utils::Visitor<
|
|||||||
LessOperator, GreaterOperator, LessEqualOperator, GreaterEqualOperator,
|
LessOperator, GreaterOperator, LessEqualOperator, GreaterEqualOperator,
|
||||||
ListIndexingOperator, ListSlicingOperator, UnaryPlusOperator,
|
ListIndexingOperator, ListSlicingOperator, UnaryPlusOperator,
|
||||||
UnaryMinusOperator, IsNullOperator, Identifier, PrimitiveLiteral,
|
UnaryMinusOperator, IsNullOperator, Identifier, PrimitiveLiteral,
|
||||||
ListLiteral, PropertyLookup, Aggregation, Function, Create, Match, Return,
|
ListLiteral, PropertyLookup, LabelsTest, EdgeTypeTest, Aggregation,
|
||||||
With, Pattern, NodeAtom, EdgeAtom, Delete, Where, SetProperty,
|
Function, Create, Match, Return, With, Pattern, NodeAtom, EdgeAtom, Delete,
|
||||||
SetProperties, SetLabels, RemoveProperty, RemoveLabels, Merge, Unwind>;
|
Where, SetProperty, SetProperties, SetLabels, RemoveProperty, RemoveLabels,
|
||||||
|
Merge, Unwind>;
|
||||||
|
|
||||||
} // namespace query
|
} // namespace query
|
||||||
|
Loading…
Reference in New Issue
Block a user