expression can be eather pattern expression or value expression
This commit is contained in:
parent
b5536d70fa
commit
04319c09e3
@ -141,6 +141,7 @@ EXECUTE_PROCESS(
|
||||
|
||||
# add main executable
|
||||
add_executable(memgraph src/memgraph.cpp)
|
||||
add_dependencies(memgraph cypher_lib)
|
||||
|
||||
# link libraries
|
||||
target_link_libraries(memgraph Threads::Threads)
|
||||
|
@ -390,11 +390,11 @@ value_expr(E) ::= BOOL(V). {
|
||||
E = ast->create<ast::Boolean>(value);
|
||||
}
|
||||
|
||||
// %type pattern_expr {ast::Expr*}
|
||||
//
|
||||
// patter_expr(E) ::= pattern(P). {
|
||||
// E = ast->create<ast::PatternExpr>(P);
|
||||
// }
|
||||
%type pattern_expr {ast::Expr*}
|
||||
|
||||
pattern_expr(E) ::= pattern(P). {
|
||||
E = ast->create<ast::PatternExpr>(P);
|
||||
}
|
||||
|
||||
%type expr {ast::Expr*}
|
||||
|
||||
@ -402,9 +402,9 @@ expr(E) ::= value_expr(V). {
|
||||
E = V;
|
||||
}
|
||||
|
||||
// expr(E) ::= patter_expr(P). {
|
||||
// E = P;
|
||||
// }
|
||||
expr(E) ::= pattern_expr(P). {
|
||||
E = P;
|
||||
}
|
||||
|
||||
//%type alias {ast::Alias*}
|
||||
//
|
||||
|
@ -106,6 +106,12 @@ public:
|
||||
Traverser::visit(pattern);
|
||||
}
|
||||
|
||||
void visit(ast::PatternExpr& pattern_expr) override
|
||||
{
|
||||
auto entry = printer.advance("Pattern Expression");
|
||||
Traverser::visit(pattern_expr);
|
||||
}
|
||||
|
||||
void visit(ast::Node& node) override
|
||||
{
|
||||
auto entry = printer.advance("Node");
|
||||
|
@ -39,6 +39,11 @@ public:
|
||||
accept(pattern.next);
|
||||
}
|
||||
|
||||
void visit(ast::PatternExpr& pattern_expr) override
|
||||
{
|
||||
accept(pattern_expr.pattern);
|
||||
}
|
||||
|
||||
void visit(ast::Node& node) override
|
||||
{
|
||||
accept(node.idn);
|
||||
|
@ -1 +1 @@
|
||||
# MATCH (p:Personnel)-[:CREATED]->(o:Opportunity)-[:HAS_MATCH]->(c:Company {id: "321"}) RETURN (a:Account {id: "123"})-[:IS]->(p)
|
||||
MATCH (p:Personnel)-[:CREATED]->(o:Opportunity)-[:HAS_MATCH]->(c:Company {id: "321"}) RETURN (a:Account {id: "123"})-[:IS]->(p)
|
||||
|
Loading…
Reference in New Issue
Block a user