Merge branch 'compiler_prototype' into dev

This commit is contained in:
Marko Budiselic 2017-03-13 13:35:23 +01:00
commit 3e0b12f646
38 changed files with 2010 additions and 15965 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ cmake-build-*
.idea
cmake/DownloadProject/
dist/
src/query/frontend/opencypher/generated/

View File

@ -350,8 +350,10 @@ set(memgraph_src_files
${src_dir}/database/graph_db.cpp
${src_dir}/database/graph_db_accessor.cpp
${src_dir}/query/stripper.cpp
${src_dir}/query/backend/cpp/cypher_main_visitor.cpp
${src_dir}/query/frontend/ast/cypher_main_visitor.cpp
${src_dir}/query/context.cpp
${src_dir}/query/backend/cpp/typed_value.cpp
${src_dir}/query/frontend/ast/ast.cpp
)
# -----------------------------------------------------------------------------

View File

@ -61,12 +61,12 @@ State state_executor_run(RecordStream<Socket> &output_stream, BoltDecoder &decod
{{"code", "Memgraph.SyntaxException"}, {"message", "Syntax error"}});
output_stream.send();
return ERROR;
} catch (const backend::cpp::GeneratorException &e) {
output_stream.write_failure(
{{"code", "Memgraph.GeneratorException"},
{"message", "Unsupported query"}});
output_stream.send();
return ERROR;
// } catch (const backend::cpp::GeneratorException &e) {
// output_stream.write_failure(
// {{"code", "Memgraph.GeneratorException"},
// {"message", "Unsupported query"}});
// output_stream.send();
// return ERROR;
} catch (const QueryEngineException &e) {
output_stream.write_failure(
{{"code", "Memgraph.QueryEngineException"},

View File

@ -1,15 +0,0 @@
#pragma once
#include <string>
#include <vector>
#include "query/frontend/opencypher/generated/CypherBaseVisitor.h"
#include "antlr4-runtime.h"
using antlropencypher::CypherParser;
class CodeGenerator {
void GenerateExpresssion();
private:
std::string code_;
};

View File

@ -1,525 +0,0 @@
#include "query/backend/cpp/cypher_main_visitor.hpp"
#include <climits>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "query/backend/cpp/compiler_structures.hpp"
#include "query/backend/cpp/named_antlr_tokens.hpp"
#include "utils/assert.hpp"
namespace backend {
namespace cpp {
namespace {
// Map children tokens of antlr node to Function enum.
std::vector<Function> MapTokensToOperators(
antlr4::ParserRuleContext *node,
const std::unordered_map<size_t, Function> token_to_operator) {
std::vector<antlr4::tree::TerminalNode *> tokens;
for (const auto &x : token_to_operator) {
tokens.insert(tokens.end(), node->getTokens(x.first).begin(),
node->getTokens(x.first).end());
}
sort(tokens.begin(), tokens.end(), [](antlr4::tree::TerminalNode *a,
antlr4::tree::TerminalNode *b) {
return a->getSourceInterval().startsBeforeDisjoint(b->getSourceInterval());
});
std::vector<Function> ops;
for (auto *token : tokens) {
auto it = token_to_operator.find(token->getSymbol()->getType());
debug_assert(it != token_to_operator.end(),
"Wrong mapping sent to function.");
ops.push_back(it->second);
}
return ops;
}
}
antlrcpp::Any CypherMainVisitor::visitNodePattern(
CypherParser::NodePatternContext *ctx) {
bool new_node = true;
Node node;
if (ctx->variable()) {
auto variable = ctx->variable()->accept(this).as<std::string>();
auto &curr_id_map = ids_map_.back();
if (curr_id_map.find(variable) != curr_id_map.end()) {
if (!symbol_table_[curr_id_map[variable]].is<Node>()) {
throw SemanticException();
}
new_node = false;
node = symbol_table_[curr_id_map[variable]].as<Node>();
} else {
node.output_id = new_id();
curr_id_map[variable] = node.output_id;
}
} else {
node.output_id = new_id();
}
if (!new_node && (ctx->nodeLabels() || ctx->properties())) {
// If variable is already declared, we cannot list properties or labels.
// This is slightly incompatible with neo4j. In neo4j it is valid to write
// MATCH (n {a: 5})--(n {b: 10}) which is equivalent to MATCH(n {a:5, b:
// 10})--(n). Neo4j also allows MATCH (n) RETURN (n {x: 5}) which is
// equivalent to MATCH (n) RETURN ({x: 5}).
// TODO: The way in which we are storing nodes is not suitable for optional
// match. For example: MATCH (n {a: 5}) OPTIONAL MATCH (n {b: 10}) RETURN
// n.a, n.b. would not work. Think more about that case.
throw SemanticException();
}
if (ctx->nodeLabels()) {
node.labels =
ctx->nodeLabels()->accept(this).as<std::vector<std::string>>();
}
if (ctx->properties()) {
node.properties = ctx->properties()
->accept(this)
.as<std::unordered_map<std::string, std::string>>();
}
symbol_table_[node.output_id] = node;
return node.output_id;
}
antlrcpp::Any CypherMainVisitor::visitNodeLabels(
CypherParser::NodeLabelsContext *ctx) {
std::vector<std::string> labels;
for (auto *node_label : ctx->nodeLabel()) {
labels.push_back(node_label->accept(this).as<std::string>());
}
return labels;
}
antlrcpp::Any CypherMainVisitor::visitProperties(
CypherParser::PropertiesContext *ctx) {
if (!ctx->mapLiteral()) {
// If child is not mapLiteral that means child is params. At the moment
// memgraph doesn't support params.
throw SemanticException();
}
return ctx->mapLiteral()->accept(this);
}
antlrcpp::Any CypherMainVisitor::visitMapLiteral(
CypherParser::MapLiteralContext *ctx) {
std::unordered_map<std::string, std::string> map;
for (int i = 0; i < (int)ctx->propertyKeyName().size(); ++i) {
map[ctx->propertyKeyName()[i]->accept(this).as<std::string>()] =
ctx->expression()[i]->accept(this).as<std::string>();
}
return map;
}
antlrcpp::Any CypherMainVisitor::visitSymbolicName(
CypherParser::SymbolicNameContext *ctx) {
if (ctx->EscapedSymbolicName()) {
// We don't allow at this point for variable to be EscapedSymbolicName
// because we would have t ofigure out how escaping works since same
// variable can be referenced in two ways: escaped and unescaped.
throw SemanticException();
}
return std::string(ctx->getText());
}
antlrcpp::Any CypherMainVisitor::visitPattern(
CypherParser::PatternContext *ctx) {
std::vector<std::string> pattern;
for (auto *pattern_part : ctx->patternPart()) {
pattern.push_back(pattern_part->accept(this).as<std::string>());
}
return pattern;
}
antlrcpp::Any CypherMainVisitor::visitPatternPart(
CypherParser::PatternPartContext *ctx) {
PatternPart pattern_part =
ctx->anonymousPatternPart()->accept(this).as<PatternPart>();
if (ctx->variable()) {
std::string variable = ctx->variable()->accept(this).as<std::string>();
auto &curr_id_map = ids_map_.back();
if (curr_id_map.find(variable) != curr_id_map.end()) {
throw SemanticException();
}
curr_id_map[variable] = pattern_part.output_id;
}
symbol_table_[pattern_part.output_id] = pattern_part;
return pattern_part.output_id;
}
antlrcpp::Any CypherMainVisitor::visitPatternElement(
CypherParser::PatternElementContext *ctx) {
if (ctx->patternElement()) {
return ctx->patternElement()->accept(this);
}
PatternPart pattern_part;
pattern_part.output_id = new_id();
pattern_part.nodes.push_back(
ctx->nodePattern()->accept(this).as<std::string>());
for (auto *pattern_element_chain : ctx->patternElementChain()) {
auto element = pattern_element_chain->accept(this)
.as<std::pair<std::string, std::string>>();
pattern_part.relationships.push_back(element.first);
pattern_part.nodes.push_back(element.second);
}
return pattern_part;
}
antlrcpp::Any CypherMainVisitor::visitPatternElementChain(
CypherParser::PatternElementChainContext *ctx) {
return std::pair<std::string, std::string>(
ctx->relationshipPattern()->accept(this).as<std::string>(),
ctx->nodePattern()->accept(this).as<std::string>());
}
antlrcpp::Any CypherMainVisitor::visitRelationshipPattern(
CypherParser::RelationshipPatternContext *ctx) {
bool new_relationship = true;
Relationship relationship;
if (ctx->relationshipDetail()) {
if (ctx->relationshipDetail()->variable()) {
auto variable =
ctx->relationshipDetail()->variable()->accept(this).as<std::string>();
auto &curr_id_map = ids_map_.back();
if (curr_id_map.find(variable) != curr_id_map.end()) {
if (!symbol_table_[curr_id_map[variable]].is<Relationship>()) {
throw SemanticException();
}
new_relationship = false;
relationship = symbol_table_[curr_id_map[variable]].as<Relationship>();
} else {
relationship.output_id = new_id();
curr_id_map[variable] = relationship.output_id;
}
}
if (!new_relationship && (ctx->relationshipDetail()->relationshipTypes() ||
ctx->relationshipDetail()->properties() ||
ctx->relationshipDetail()->rangeLiteral())) {
// Neo4j doesn't allow multiple edges with same variable name, but if we
// are going to support different types of morphisms then there is no
// reason to disallow that.
throw SemanticException();
}
if (ctx->relationshipDetail()->relationshipTypes()) {
relationship.types = ctx->relationshipDetail()
->relationshipTypes()
->accept(this)
.as<std::vector<std::string>>();
}
if (ctx->relationshipDetail()->properties()) {
relationship.properties =
ctx->relationshipDetail()
->properties()
->accept(this)
.as<std::unordered_map<std::string, std::string>>();
}
if (ctx->relationshipDetail()->rangeLiteral()) {
relationship.has_range = true;
auto range = ctx->relationshipDetail()
->rangeLiteral()
->accept(this)
.as<std::pair<int64_t, int64_t>>();
relationship.lower_bound = range.first;
relationship.upper_bound = range.second;
}
}
if (ctx->leftArrowHead() && !ctx->rightArrowHead()) {
relationship.direction = Relationship::Direction::LEFT;
} else if (!ctx->leftArrowHead() && ctx->rightArrowHead()) {
relationship.direction = Relationship::Direction::RIGHT;
} else {
// <-[]-> and -[]- is the same thing as far as we understand openCypher
// grammar.
relationship.direction = Relationship::Direction::BOTH;
}
symbol_table_[relationship.output_id] = relationship;
return relationship.output_id;
}
antlrcpp::Any CypherMainVisitor::visitRelationshipDetail(
CypherParser::RelationshipDetailContext *) {
debug_assert(false, "Should never be called. See documentation in hpp.");
return 0;
}
antlrcpp::Any CypherMainVisitor::visitRelationshipTypes(
CypherParser::RelationshipTypesContext *ctx) {
std::vector<std::string> types;
for (auto *label : ctx->relTypeName()) {
types.push_back(label->accept(this).as<std::string>());
}
return types;
}
antlrcpp::Any CypherMainVisitor::visitRangeLiteral(
CypherParser::RangeLiteralContext *ctx) {
if (ctx->integerLiteral().size() == 0U) {
// -[*]-
return std::pair<int64_t, int64_t>(1LL, LLONG_MAX);
} else if (ctx->integerLiteral().size() == 1U) {
auto dots_tokens = ctx->getTokens(kDotsTokenId);
int64_t bound = ctx->integerLiteral()[0]->accept(this).as<int64_t>();
if (!dots_tokens.size()) {
// -[*2]-
return std::pair<int64_t, int64_t>(bound, bound);
}
if (dots_tokens[0]->getSourceInterval().startsAfter(
ctx->integerLiteral()[0]->getSourceInterval())) {
// -[*2..]-
return std::pair<int64_t, int64_t>(bound, LLONG_MAX);
} else {
// -[*..2]-
return std::pair<int64_t, int64_t>(1LL, bound);
}
} else {
int64_t lbound = ctx->integerLiteral()[0]->accept(this).as<int64_t>();
int64_t rbound = ctx->integerLiteral()[1]->accept(this).as<int64_t>();
// -[*2..5]-
return std::pair<int64_t, int64_t>(lbound, rbound);
}
}
antlrcpp::Any CypherMainVisitor::visitExpression(
CypherParser::ExpressionContext *ctx) {
return visitChildren(ctx);
}
// OR.
antlrcpp::Any CypherMainVisitor::visitExpression12(
CypherParser::Expression12Context *ctx) {
return LeftAssociativeOperatorExpression(ctx->expression11(),
Function::LOGICAL_OR);
}
// XOR.
antlrcpp::Any CypherMainVisitor::visitExpression11(
CypherParser::Expression11Context *ctx) {
return LeftAssociativeOperatorExpression(ctx->expression10(),
Function::LOGICAL_XOR);
}
// AND.
antlrcpp::Any CypherMainVisitor::visitExpression10(
CypherParser::Expression10Context *ctx) {
return LeftAssociativeOperatorExpression(ctx->expression9(),
Function::LOGICAL_AND);
}
// NOT.
antlrcpp::Any CypherMainVisitor::visitExpression9(
CypherParser::Expression9Context *ctx) {
// TODO: make template similar to LeftAssociativeOperatorExpression for unary
// expresssions.
auto operand = ctx->expression8()->accept(this).as<std::string>();
for (int i = 0; i < (int)ctx->NOT().size(); ++i) {
auto lhs_id = new_id();
symbol_table_[lhs_id] = SimpleExpression{Function::LOGICAL_NOT, {operand}};
operand = lhs_id;
}
return operand;
}
// Comparisons.
antlrcpp::Any CypherMainVisitor::visitExpression8(
CypherParser::Expression8Context *ctx) {
if (!ctx->partialComparisonExpression().size()) {
// There is no comparison operators. We generate expression7.
return ctx->expression7()->accept(this);
}
// There is at least one comparison. We need to generate code for each of
// them. We don't call visitPartialComparisonExpression but do everything in
// this function and call expression7-s directly. Since every expression7
// can be generated twice (because it can appear in two comparisons) code
// generated by whole subtree of expression7 must not have any sideeffects.
// We handle chained comparisons as defined by mathematics, neo4j handles
// them in a very interesting, illogical and incomprehensible way. For
// example in neo4j:
// 1 < 2 < 3 -> true,
// 1 < 2 < 3 < 4 -> false,
// 5 > 3 < 5 > 3 -> true,
// 4 <= 5 < 7 > 6 -> false
// All of those comparisons evaluate to true in memgraph.
std::vector<std::string> children_ids;
children_ids.push_back(ctx->expression7()->accept(this).as<std::string>());
auto partial_comparison_expressions = ctx->partialComparisonExpression();
for (auto *child : partial_comparison_expressions) {
children_ids.push_back(child->accept(this).as<std::string>());
}
// Make all comparisons.
std::string first_operand = children_ids[0];
std::vector<std::string> comparison_ids;
for (int i = 0; i < (int)partial_comparison_expressions.size(); ++i) {
auto *expr = partial_comparison_expressions[i];
auto op = [](CypherParser::PartialComparisonExpressionContext *expr) {
if (expr->getToken(kEqTokenId, 0)) {
return Function::EQ;
} else if (expr->getToken(kNeTokenId1, 0) ||
expr->getToken(kNeTokenId2, 0)) {
return Function::NE;
} else if (expr->getToken(kLtTokenId, 0)) {
return Function::LT;
} else if (expr->getToken(kGtTokenId, 0)) {
return Function::GT;
} else if (expr->getToken(kLeTokenId, 0)) {
return Function::LE;
} else if (expr->getToken(kGeTokenId, 0)) {
return Function::GE;
}
assert(false);
return Function::GE;
}(expr);
auto lhs_id = new_id();
symbol_table_[lhs_id] =
SimpleExpression{op, {first_operand, children_ids[i + 1]}};
first_operand = lhs_id;
comparison_ids.push_back(lhs_id);
}
first_operand = comparison_ids[0];
// Calculate logical and of results of comparisons.
for (int i = 1; i < (int)comparison_ids.size(); ++i) {
auto lhs_id = new_id();
symbol_table_[lhs_id] = SimpleExpression{
Function::LOGICAL_AND, {first_operand, comparison_ids[i]}};
first_operand = lhs_id;
}
return first_operand;
}
antlrcpp::Any CypherMainVisitor::visitPartialComparisonExpression(
CypherParser::PartialComparisonExpressionContext *) {
debug_assert(false, "Should never be called. See documentation in hpp.");
return 0;
}
// Addition and subtraction.
antlrcpp::Any CypherMainVisitor::visitExpression7(
CypherParser::Expression7Context *ctx) {
return LeftAssociativeOperatorExpression(
ctx->expression6(),
MapTokensToOperators(ctx, {{kPlusTokenId, Function::ADDITION},
{kMinusTokenId, Function::SUBTRACTION}}));
}
// Multiplication, division, modding.
antlrcpp::Any CypherMainVisitor::visitExpression6(
CypherParser::Expression6Context *ctx) {
return LeftAssociativeOperatorExpression(
ctx->expression5(),
MapTokensToOperators(ctx, {{kMultTokenId, Function::MULTIPLICATION},
{kDivTokenId, Function::DIVISION},
{kModTokenId, Function::MODULO}}));
}
// Power.
antlrcpp::Any CypherMainVisitor::visitExpression5(
CypherParser::Expression5Context *ctx) {
if (ctx->expression4().size() > 1u) {
// TODO: implement power operator. In neo4j power is right associative and
// int^int -> float.
throw SemanticException();
}
return visitChildren(ctx);
}
// Unary minus and plus.
antlrcpp::Any CypherMainVisitor::visitExpression4(
CypherParser::Expression4Context *ctx) {
auto ops =
MapTokensToOperators(ctx, {{kUnaryPlusTokenId, Function::UNARY_PLUS},
{kUnaryMinusTokenId, Function::UNARY_MINUS}});
auto operand = ctx->expression3()->accept(this).as<std::string>();
for (int i = 0; i < (int)ops.size(); ++i) {
auto lhs_id = new_id();
symbol_table_[lhs_id] = SimpleExpression{ops[i], {operand}};
operand = lhs_id;
}
return operand;
}
antlrcpp::Any CypherMainVisitor::visitExpression3(
CypherParser::Expression3Context *ctx) {
// If there is only one child we don't need to generate any code in this since
// that child is expression2. Other operations are not implemented at the
// moment.
// TODO: implement this.
if (ctx->children.size() > 1u) {
throw SemanticException();
}
return visitChildren(ctx);
}
antlrcpp::Any CypherMainVisitor::visitExpression2(
CypherParser::Expression2Context *ctx) {
if (ctx->nodeLabels().size()) {
// TODO: Implement this. We don't currently support label checking in
// expresssion.
throw SemanticException();
}
auto operand = ctx->atom()->accept(this).as<std::string>();
for (int i = 0; i < (int)ctx->propertyLookup().size(); ++i) {
auto lhs_id = new_id();
symbol_table_[lhs_id] =
SimpleExpression{Function::PROPERTY_GETTER, {operand}};
operand = lhs_id;
}
return operand;
}
antlrcpp::Any CypherMainVisitor::visitAtom(CypherParser::AtomContext *ctx) {
if (ctx->literal()) {
// This is not very nice since we didn't parse text given in query, but we
// left that job to the code generator. Correct approach would be to parse
// it and store it in a structure of appropriate type, int, string... And
// then code generator would generate its own text based on structure. This
// is also a security risk if code generator doesn't parse and escape
// text appropriately. At the moment we don;t care much since literal will
// appear only in tests and real queries will be stripped.
// TODO: Either parse it correctly or raise exception. If exception is
// raised it tests should also use params instead of literals.
auto text = ctx->literal()->getText();
auto lhs_id = new_id();
symbol_table_[lhs_id] = SimpleExpression{Function::LITERAL, {text}};
return lhs_id;
} else if (ctx->parameter()) {
// This is once again potential security risk. We shouldn't output text
// given in user query as parameter name directly to the code. Stripper
// should either replace user's parameter name with generic one or we should
// allow only parameters with numeric names. At the moment this is not a
// problem since we don't accept user's parameters but only ours.
// TODO: revise this.
auto text = ctx->literal()->getText();
auto lhs_id = new_id();
symbol_table_[lhs_id] = SimpleExpression{Function::PARAMETER, {text}};
return lhs_id;
} else if (ctx->parenthesizedExpression()) {
return ctx->parenthesizedExpression()->accept(this);
} else if (ctx->variable()) {
// TODO: revise this. Is it possible in some atom to use not declared
// variable. Is it correct to always use last ids_map?
auto &curr_id_map = ids_map_.back();
auto variable = ctx->variable()->accept(this).as<std::string>();
if (curr_id_map.find(variable) == curr_id_map.end()) {
throw SemanticException();
}
return curr_id_map[variable];
}
// TODO: Implement this. We don't support comprehensions, functions,
// filtering... at the moment.
throw SemanticException();
}
antlrcpp::Any CypherMainVisitor::visitIntegerLiteral(
CypherParser::IntegerLiteralContext *ctx) {
int64_t t = 0LL;
try {
t = std::stoll(ctx->getText(), 0, 0);
} catch (std::out_of_range) {
throw SemanticException();
}
return t;
}
}
}

View File

@ -1,292 +0,0 @@
#pragma once
#include <string>
#include "query/frontend/opencypher/generated/CypherBaseVisitor.h"
#include "antlr4-runtime.h"
#include "query/backend/cpp/compiler_structures.hpp"
namespace backend {
namespace cpp {
using antlropencypher::CypherParser;
class CypherMainVisitor : public antlropencypher::CypherBaseVisitor {
private:
// Return new output code id.
// TODO: Should we generate ids with more readable names: node_1,
// relationship_5, temporary_2...?
std::string new_id() const {
static int next_id = 0;
return "id" + std::to_string(next_id++);
}
template <typename TExpression>
antlrcpp::Any LeftAssociativeOperatorExpression(
std::vector<TExpression *> children, std::vector<Function> ops) {
assert(children.size());
std::vector<std::string> children_ids;
for (auto *child : children) {
children_ids.push_back(child->accept(this).template as<std::string>());
}
std::string first_operand = children_ids[0];
for (int i = 0; i < (int)ops.size(); ++i) {
auto lhs_id = new_id();
symbol_table_[lhs_id] =
SimpleExpression{ops[i], {first_operand, children_ids[i + 1]}};
first_operand = lhs_id;
}
return first_operand;
}
template <typename TExpression>
antlrcpp::Any LeftAssociativeOperatorExpression(
std::vector<TExpression *> children, Function op) {
return LeftAssociativeOperatorExpression(
children, std::vector<Function>((int)children.size() - 1, op));
}
/**
* Creates Node and stores it in symbol_table_. If variable is defined it is
* stored in ids_map_.
*
* @return string - node id.
*/
antlrcpp::Any visitNodePattern(
CypherParser::NodePatternContext *ctx) override;
/**
* @return vector<string> labels.
*/
antlrcpp::Any visitNodeLabels(CypherParser::NodeLabelsContext *ctx) override;
/**
* @return unordered_map<string, string> properties - property key to
* expression id.
*/
antlrcpp::Any visitProperties(CypherParser::PropertiesContext *ctx) override;
/**
* @return unordered_map<string, string> map - key to expression id.
*/
antlrcpp::Any visitMapLiteral(CypherParser::MapLiteralContext *ctx) override;
/**
* @return string.
*/
antlrcpp::Any visitSymbolicName(
CypherParser::SymbolicNameContext *ctx) override;
/**
* @return vector<PatternPart> pattern.
*/
antlrcpp::Any visitPattern(CypherParser::PatternContext *ctx) override;
/**
* Stores PatternPart in symbol_table_. If variable is defined it is stored
*in
* ids_map_.
*
* @return string - pattern part id.
*/
antlrcpp::Any visitPatternPart(
CypherParser::PatternPartContext *ctx) override;
/**
* Creates PatternPart.
*
* @return PatternPart.
*/
antlrcpp::Any visitPatternElement(
CypherParser::PatternElementContext *ctx) override;
/**
* @return pair<string, string> - node and relationship ids.
*/
antlrcpp::Any visitPatternElementChain(
CypherParser::PatternElementChainContext *ctx) override;
/**
* Creates Relationship and stores it in symbol_table_. If variable is defined
* it is stored in symbol_table_.
*
* @return string - relationship id.
*/
antlrcpp::Any visitRelationshipPattern(
CypherParser::RelationshipPatternContext *ctx) override;
/**
* This should never be called. Everything is done directly in
* visitRelationshipPattern.
*/
antlrcpp::Any visitRelationshipDetail(
CypherParser::RelationshipDetailContext *ctx) override;
/**
* @return vector<string>.
*/
antlrcpp::Any visitRelationshipTypes(
CypherParser::RelationshipTypesContext *ctx) override;
/**
* @return pair<int64_t, int64_t>.
*/
antlrcpp::Any visitRangeLiteral(
CypherParser::RangeLiteralContext *ctx) override;
/**
* Top level expression.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression(CypherParser::ExpressionContext *ctx) override;
/**
* OR.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression12(
CypherParser::Expression12Context *ctx) override;
/**
* XOR.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression11(
CypherParser::Expression11Context *ctx) override;
/**
* AND.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression10(
CypherParser::Expression10Context *ctx) override;
/**
* NOT.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression9(
CypherParser::Expression9Context *ctx) override;
/**
* Comparisons.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression8(
CypherParser::Expression8Context *ctx) override;
/**
* Never call this. Everything related to generating code for comparison
* operators should be done in visitExpression8.
*/
antlrcpp::Any visitPartialComparisonExpression(
CypherParser::PartialComparisonExpressionContext *ctx) override;
/**
* Addition and subtraction.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression7(
CypherParser::Expression7Context *ctx) override;
/**
* Multiplication, division, modding.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression6(
CypherParser::Expression6Context *ctx) override;
/**
* Power.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression5(
CypherParser::Expression5Context *ctx) override;
/**
* Unary minus and plus.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression4(
CypherParser::Expression4Context *ctx) override;
/**
* Element of a list, range of a list...
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression3(
CypherParser::Expression3Context *ctx) override;
/**
* Property lookup, test for node labels existence...
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression2(
CypherParser::Expression2Context *ctx) override;
/**
* Literals, params, list comprehension...
*
* @return string - expression id.
*/
antlrcpp::Any visitAtom(CypherParser::AtomContext *ctx) override;
// antlrcpp::Any visitLiteral(CypherParser::LiteralContext *ctx) override {
// return visitChildren(ctx);
// }
//
// antlrcpp::Any visitBooleanLiteral(
// CypherParser::BooleanLiteralContext *ctx) override {
// return visitChildren(ctx);
// }
//
// antlrcpp::Any visitListLiteral(
// CypherParser::ListLiteralContext *ctx) override {
// return visitChildren(ctx);
// }
//
// antlrcpp::Any visitParenthesizedExpression(
// CypherParser::ParenthesizedExpressionContext *ctx) override {
// return visitChildren(ctx);
// }
/**
* @return int64_t.
*/
antlrcpp::Any visitIntegerLiteral(
CypherParser::IntegerLiteralContext *ctx) override;
public:
// TODO: These temporary getters should eventually be replaced with
// something
// else once we figure out where and how those strctures will be used.
// Currently there are needed for testing. cypher_main_visitor test should
// be
// refactored once these getters are deleted.
const auto &ids_map() const { return ids_map_; }
const auto &symbol_table() const { return symbol_table_; }
private:
// Mapping of ids (nodes, relationships, values, lists ...) from
// query
// code to id that is used in generated code;
std::vector<std::unordered_map<std::string, std::string>> ids_map_{1};
// Mapping of output (generated) code ids to appropriate parser
// structure.
std::unordered_map<std::string, antlrcpp::Any> symbol_table_;
};
}
}

View File

@ -1,38 +0,0 @@
#pragma once
#include <experimental/filesystem>
#include "antlr4-runtime.h"
#include "query/backend/cpp/cypher_main_visitor.hpp"
namespace fs = std::experimental::filesystem;
namespace backend {
namespace cpp {
using namespace antlr4;
class GeneratorException : public BasicException {
public:
using BasicException::BasicException;
GeneratorException() : BasicException("") {}
};
/**
* Traverse Antlr tree::ParseTree generated from Cypher grammar and generate
* C++.
*/
class Generator {
public:
/**
* Generates cpp code inside file on the path.
*/
Generator(tree::ParseTree *tree, const std::string &query,
const uint64_t stripped_hash, const fs::path &path) {
throw GeneratorException("unsupported query");
CypherMainVisitor visitor;
visitor.visit(tree);
}
};
}
}

View File

@ -26,7 +26,7 @@ typedef traversal_template::Path<VertexAccessor, EdgeAccessor> Path;
* TypedValue::Type. Each such type corresponds to exactly one C++ type.
*/
class TypedValue : public TotalOrdering<TypedValue, TypedValue, TypedValue> {
private:
public:
/** Private default constructor, makes Null */
TypedValue() : type_(Type::Null) {}
@ -98,7 +98,7 @@ class TypedValue : public TotalOrdering<TypedValue, TypedValue, TypedValue> {
template <typename T>
T Value() const;
friend std::ostream& operator<<(std::ostream& stream, const TypedValue& prop);
friend std::ostream& operator<<(std::ostream& stream, const TypedValue&prop);
private:
// storage for the value of the property

12
src/query/context.cpp Normal file
View File

@ -0,0 +1,12 @@
#include "query/context.hpp"
#include "query/frontend/ast/cypher_main_visitor.hpp"
namespace query {
std::shared_ptr<Query> HighLevelAstConversion::Apply(Context &ctx,
antlr4::tree::ParseTree *tree) {
query::frontend::CypherMainVisitor visitor(ctx);
visitor.visit(tree);
return visitor.query();
}
}

54
src/query/context.hpp Normal file
View File

@ -0,0 +1,54 @@
#pragma once
#include "antlr4-runtime.h"
#include "database/graph_db_accessor.hpp"
namespace query {
class TypedcheckedTree {};
class LogicalPlan {};
class Context;
class Query;
class LogicalPlanGenerator {
public:
std::vector<LogicalPlan> Generate(TypedcheckedTree &, Context &) {
return {LogicalPlan()};
}
};
struct Config {
LogicalPlanGenerator logical_plan_generator;
};
class Context {
public:
Context(Config config, GraphDbAccessor &db_accessor)
: config_(config), db_accessor_(db_accessor) {}
int next_uid() { return uid_counter_++; }
Config config_;
GraphDbAccessor &db_accessor_;
int uid_counter_ = 0;
};
class LogicalPlanner {
public:
LogicalPlanner(Context ctx) : ctx_(ctx) {}
LogicalPlan Apply(TypedcheckedTree typedchecked_tree) {
return ctx_.config_.logical_plan_generator.Generate(typedchecked_tree,
ctx_)[0];
}
private:
Context ctx_;
};
class HighLevelAstConversion {
public:
std::shared_ptr<Query> Apply(Context &ctx, antlr4::tree::ParseTree *tree);
};
}

View File

@ -7,7 +7,6 @@ namespace fs = std::experimental::filesystem;
#include "data_structures/concurrent/concurrent_map.hpp"
#include "database/graph_db.hpp"
#include "logging/loggable.hpp"
#include "query/backend/cpp/generator.hpp"
#include "query/exception/query_engine.hpp"
#include "query/frontend/opencypher/parser.hpp"
#include "query/plan_compiler.hpp"
@ -26,12 +25,11 @@ namespace fs = std::experimental::filesystem;
* the results should be returned (more optimal then just return
* the whole result set)
*/
template <typename Stream>
class QueryEngine : public Loggable {
private:
template <typename Stream> class QueryEngine : public Loggable {
private:
using QueryPlanLib = DynamicLib<QueryPlanTrait<Stream>>;
public:
public:
QueryEngine() : Loggable("QueryEngine") {}
/**
@ -104,12 +102,12 @@ class QueryEngine : public Loggable {
*
* @return size_t the number of loaded query plans
*/
auto Size() { // TODO: const once whan ConcurrentMap::Accessor becomes const
auto Size() { // TODO: const once whan ConcurrentMap::Accessor becomes const
return query_plans.access().size();
}
// return query_plans.access().size(); }
private:
private:
/**
* Loads query plan eather from hardcoded folder or from the file that is
* generated in this method.
@ -138,8 +136,8 @@ class QueryEngine : public Loggable {
std::to_string(stripped.hash) + ".cpp");
frontend::opencypher::Parser parser(stripped.query);
backend::cpp::Generator(parser.tree(), stripped.query, stripped.hash,
generated_path);
// backend::cpp::Generator(parser.tree(), stripped.query, stripped.hash,
// generated_path);
return LoadCpp(generated_path, stripped.hash);
}
@ -176,7 +174,7 @@ class QueryEngine : public Loggable {
// TODO: underlying object has to be live during query execution
// fix that when Antler will be introduced into the database
auto query_plan_instance = query_plan->instance(); // because of move
auto query_plan_instance = query_plan->instance(); // because of move
plans_accessor.insert(hash, std::move(query_plan));
// return an instance of runnable code (PlanInterface)

55
src/query/entry.hpp Normal file
View File

@ -0,0 +1,55 @@
#pragma once
#include "query/frontend/interpret/interpret.hpp"
#include "query/frontend/logical/planner.hpp"
#include "query/context.hpp"
#include "database/graph_db_accessor.hpp"
#include "query/context.hpp"
#include "query/frontend/opencypher/parser.hpp"
#include "query/frontend/typecheck/typecheck.hpp"
namespace query {
template <typename Stream>
class Engine {
public:
Engine() {}
auto Execute(const std::string &query, GraphDbAccessor &db_accessor,
Stream &stream) {
Config config;
Context ctx(config, db_accessor);
// query -> AST
::frontend::opencypher::Parser parser(query);
auto low_level_tree = parser.tree();
// AST -> high level tree
HighLevelAstConversion low2high_tree;
auto high_level_tree = low2high_tree.Apply(ctx, low_level_tree);
// symbol table fill
SymbolTable symbol_table;
TypeCheckVisitor typecheck_visitor(symbol_table);
high_level_tree->Accept(typecheck_visitor);
// high level tree -> logical plan
auto logical_plan = Apply(*high_level_tree);
// generate frame based on symbol table max_position
Frame frame(symbol_table.max_position());
// interpret
auto cursor = logical_plan->MakeCursor(db_accessor);
logical_plan->WriteHeader(stream);
auto symbols = logical_plan->OutputSymbols(symbol_table);
while (cursor->pull(frame, symbol_table)) {
std::vector<TypedValue> values;
for (auto symbol : symbols) {
values.emplace_back(frame[symbol.position_]);
}
stream.Result(values);
}
stream.Summary({{std::string("type"), TypedValue("r")}});
}
};
}

View File

@ -0,0 +1,13 @@
#include "query/frontend/interpret/interpret.hpp"
#include "query/frontend/typecheck/symbol_table.hpp"
namespace query {
TypedValue Ident::Evaluate(Frame &frame, SymbolTable &symbol_table) {
return frame[symbol_table[*this].position_];
}
void NamedExpr::Evaluate(Frame &frame, SymbolTable &symbol_table) {
frame[symbol_table[*ident_].position_] = expr_->Evaluate(frame, symbol_table);
}
}

View File

@ -0,0 +1,202 @@
#pragma once
#include <memory>
#include <vector>
#include "database/graph_db.hpp"
#include "query/backend/cpp/typed_value.hpp"
namespace query {
class Frame;
class SymbolTable;
// Forward declares for TreeVisitorBase
class Query;
class NamedExpr;
class Ident;
class Match;
class Return;
class Pattern;
class NodePart;
class EdgePart;
class TreeVisitorBase {
public:
// Start of the tree is a Query.
virtual void PreVisit(Query &) {}
virtual void Visit(Query &query) = 0;
virtual void PostVisit(Query &) {}
// Expressions
virtual void PreVisit(NamedExpr &) {}
virtual void Visit(NamedExpr &) = 0;
virtual void PostVisit(NamedExpr &) {}
virtual void PreVisit(Ident &) {}
virtual void Visit(Ident &ident) = 0;
virtual void PostVisit(Ident &) {}
// Clauses
virtual void PreVisit(Match &) {}
virtual void Visit(Match &match) = 0;
virtual void PostVisit(Match &) {}
virtual void PreVisit(Return &) {}
virtual void Visit(Return &ret) = 0;
virtual void PostVisit(Return &) {}
// Pattern and its subparts.
virtual void PreVisit(Pattern &) {}
virtual void Visit(Pattern &pattern) = 0;
virtual void PostVisit(Pattern &) {}
virtual void PreVisit(NodePart &) {}
virtual void Visit(NodePart &node_part) = 0;
virtual void PostVisit(NodePart &) {}
virtual void PreVisit(EdgePart &) {}
virtual void Visit(EdgePart &edge_part) = 0;
virtual void PostVisit(EdgePart &) {}
};
class Tree {
public:
Tree(int uid) : uid_(uid) {}
int uid() const { return uid_; }
virtual void Accept(TreeVisitorBase &visitor) = 0;
private:
const int uid_;
};
class Expr : public Tree {
public:
Expr(int uid) : Tree(uid) {}
virtual TypedValue Evaluate(Frame &, SymbolTable &) = 0;
};
class Ident : public Expr {
public:
Ident(int) = delete;
Ident(int uid, const std::string &identifier)
: Expr(uid), identifier_(identifier) {}
TypedValue Evaluate(Frame &frame, SymbolTable &symbol_table) override;
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
visitor.Visit(*this);
visitor.PostVisit(*this);
}
std::string identifier_;
};
class Part : public Tree {
public:
Part(int uid) : Tree(uid) {}
};
class NamedExpr : public Tree {
public:
NamedExpr(int uid) : Tree(uid) {}
void Evaluate(Frame &frame, SymbolTable &symbol_table);
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
ident_->Accept(visitor);
expr_->Accept(visitor);
visitor.Visit(*this);
visitor.PostVisit(*this);
}
std::shared_ptr<Ident> ident_;
std::shared_ptr<Expr> expr_;
};
class NodePart : public Part {
public:
NodePart(int uid) : Part(uid) {}
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
identifier_->Accept(visitor);
visitor.Visit(*this);
visitor.PostVisit(*this);
}
std::shared_ptr<Ident> identifier_;
std::vector<GraphDb::Label> labels_;
};
class EdgePart : public Part {
public:
enum class Direction { LEFT, RIGHT, BOTH };
EdgePart(int uid) : Part(uid) {}
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
identifier_->Accept(visitor);
visitor.Visit(*this);
visitor.PostVisit(*this);
}
Direction direction = Direction::BOTH;
std::shared_ptr<Ident> identifier_;
};
class Clause : public Tree {
public:
Clause(int uid) : Tree(uid) {}
};
class Pattern : public Tree {
public:
Pattern(int uid) : Tree(uid) {}
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
for (auto &part : parts_) {
part->Accept(visitor);
}
visitor.Visit(*this);
visitor.PostVisit(*this);
}
std::shared_ptr<Ident> identifier_;
std::vector<std::shared_ptr<Part>> parts_;
};
class Query : public Tree {
public:
Query(int uid) : Tree(uid) {}
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
for (auto &clause : clauses_) {
clause->Accept(visitor);
}
visitor.Visit(*this);
visitor.PostVisit(*this);
}
std::vector<std::shared_ptr<Clause>> clauses_;
};
class Match : public Clause {
public:
Match(int uid) : Clause(uid) {}
std::vector<std::shared_ptr<Pattern>> patterns_;
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
for (auto &pattern : patterns_) {
pattern->Accept(visitor);
}
visitor.Visit(*this);
visitor.PostVisit(*this);
}
};
class Return : public Clause {
public:
Return(int uid) : Clause(uid) {}
void Accept(TreeVisitorBase &visitor) override {
visitor.PreVisit(*this);
for (auto &expr : named_exprs_) {
expr->Accept(visitor);
}
visitor.Visit(*this);
visitor.PostVisit(*this);
}
std::shared_ptr<Ident> identifier_;
std::vector<std::shared_ptr<NamedExpr>> named_exprs_;
};
}

View File

@ -0,0 +1,539 @@
#include "query/frontend/ast/cypher_main_visitor.hpp"
#include <climits>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "database/graph_db.hpp"
#include "query/frontend/ast/named_antlr_tokens.hpp"
#include "utils/assert.hpp"
namespace query {
namespace frontend {
namespace {
// Map children tokens of antlr node to Function enum.
// std::vector<Function> MapTokensToOperators(
// antlr4::ParserRuleContext *node,
// const std::unordered_map<size_t, Function> token_to_operator) {
// std::vector<antlr4::tree::TerminalNode *> tokens;
// for (const auto &x : token_to_operator) {
// tokens.insert(tokens.end(), node->getTokens(x.first).begin(),
// node->getTokens(x.first).end());
// }
// sort(tokens.begin(), tokens.end(), [](antlr4::tree::TerminalNode *a,
// antlr4::tree::TerminalNode *b) {
// return
// a->getSourceInterval().startsBeforeDisjoint(b->getSourceInterval());
// });
// std::vector<Function> ops;
// for (auto *token : tokens) {
// auto it = token_to_operator.find(token->getSymbol()->getType());
// debug_assert(it != token_to_operator.end(),
// "Wrong mapping sent to function.");
// ops.push_back(it->second);
// }
// return ops;
//}
}
antlrcpp::Any
CypherMainVisitor::visitSingleQuery(CypherParser::SingleQueryContext *ctx) {
query_ = std::make_shared<Query>(ctx_.next_uid());
for (auto *child : ctx->clause()) {
query_->clauses_.push_back(child->accept(this).as<std::shared_ptr<Clause>>());
}
return query_;
}
antlrcpp::Any
CypherMainVisitor::visitCypherMatch(CypherParser::CypherMatchContext *ctx) {
auto match = std::make_shared<Match>(ctx_.next_uid());
if (ctx->OPTIONAL() || ctx->where()) {
throw std::exception();
}
match->patterns_ =
ctx->pattern()->accept(this).as<std::vector<std::shared_ptr<Pattern>>>();
return std::shared_ptr<Clause>(std::move(match));
}
antlrcpp::Any CypherMainVisitor::visitReturnBody(CypherParser::ReturnBodyContext *ctx) {
return ctx->returnItems()->accept(this);
}
antlrcpp::Any
CypherMainVisitor::visitReturnItems(CypherParser::ReturnItemsContext *ctx) {
auto return_clause = std::make_shared<Return>(ctx_.next_uid());
for (auto *item : ctx->returnItem()) {
return_clause->named_exprs_.push_back(item->accept(this));
}
return std::shared_ptr<Clause>(std::move(return_clause));
}
antlrcpp::Any
CypherMainVisitor::visitReturnItem(CypherParser::ReturnItemContext *ctx) {
auto named_expr = std::make_shared<NamedExpr>(ctx_.next_uid());
if (ctx->variable()) {
named_expr->ident_ =
std::make_shared<Ident>(ctx_.next_uid(), ctx->variable()->accept(this));
} else {
named_expr->ident_ =
std::make_shared<Ident>(ctx_.next_uid(), ctx->getText());
}
named_expr->expr_ = ctx->expression()->accept(this);
return named_expr;
}
antlrcpp::Any
CypherMainVisitor::visitNodePattern(CypherParser::NodePatternContext *ctx) {
auto node = std::make_shared<NodePart>(ctx_.next_uid());
if (ctx->variable()) {
std::string variable = ctx->variable()->accept(this);
node->identifier_ =
std::make_shared<Ident>(ctx_.next_uid(), kUserIdentPrefix + variable);
} else {
node->identifier_ = std::make_shared<Ident>(
ctx_.next_uid(), kAnonIdentPrefix + std::to_string(next_ident_id_++));
}
if (ctx->nodeLabels()) {
std::vector<std::string> labels = ctx->nodeLabels()->accept(this);
for (const auto &label : labels) {
node->labels_.push_back(ctx_.db_accessor_.label(label));
}
}
if (ctx->properties()) {
throw std::exception();
// node.properties = ctx->properties()
// ->accept(this)
// .as<std::unordered_map<std::string,
// std::string>>();
}
return std::shared_ptr<Part>(std::move(node));
}
antlrcpp::Any
CypherMainVisitor::visitNodeLabels(CypherParser::NodeLabelsContext *ctx) {
std::vector<std::string> labels;
for (auto *node_label : ctx->nodeLabel()) {
labels.push_back(node_label->accept(this));
}
return labels;
}
antlrcpp::Any
CypherMainVisitor::visitProperties(CypherParser::PropertiesContext *ctx) {
if (!ctx->mapLiteral()) {
// If child is not mapLiteral that means child is params. At the moment
// memgraph doesn't support params.
throw std::exception();
}
return ctx->mapLiteral()->accept(this);
}
antlrcpp::Any
CypherMainVisitor::visitMapLiteral(CypherParser::MapLiteralContext *ctx) {
throw std::exception();
std::unordered_map<std::string, std::string> map;
for (int i = 0; i < (int)ctx->propertyKeyName().size(); ++i) {
map[ctx->propertyKeyName()[i]->accept(this).as<std::string>()] =
ctx->expression()[i]->accept(this).as<std::string>();
}
return map;
}
antlrcpp::Any
CypherMainVisitor::visitSymbolicName(CypherParser::SymbolicNameContext *ctx) {
if (ctx->EscapedSymbolicName()) {
// We don't allow at this point for variable to be EscapedSymbolicName
// because we would have t ofigure out how escaping works since same
// variable can be referenced in two ways: escaped and unescaped.
throw std::exception();
}
return std::string(ctx->getText());
}
antlrcpp::Any
CypherMainVisitor::visitPattern(CypherParser::PatternContext *ctx) {
std::vector<std::shared_ptr<Pattern>> patterns;
for (auto *pattern_part : ctx->patternPart()) {
patterns.push_back(pattern_part->accept(this));
}
return patterns;
}
antlrcpp::Any
CypherMainVisitor::visitPatternPart(CypherParser::PatternPartContext *ctx) {
std::shared_ptr<Pattern> pattern = ctx->anonymousPatternPart()->accept(this);
if (ctx->variable()) {
std::string variable = ctx->variable()->accept(this);
pattern->identifier_ =
std::make_shared<Ident>(ctx_.next_uid(), kUserIdentPrefix + variable);
} else {
pattern->identifier_ = std::make_shared<Ident>(
ctx_.next_uid(), kAnonIdentPrefix + std::to_string(next_ident_id_++));
}
return pattern;
}
antlrcpp::Any CypherMainVisitor::visitPatternElement(
CypherParser::PatternElementContext *ctx) {
if (ctx->patternElement()) {
return ctx->patternElement()->accept(this);
}
auto pattern = std::make_shared<Pattern>(ctx_.next_uid());
pattern->parts_.push_back(
ctx->nodePattern()->accept(this).as<std::shared_ptr<Part>>());
for (auto *pattern_element_chain : ctx->patternElementChain()) {
auto element =
pattern_element_chain->accept(this)
.as<std::pair<std::shared_ptr<Part>, std::shared_ptr<Part>>>();
pattern->parts_.push_back(element.first);
pattern->parts_.push_back(element.second);
}
return pattern;
}
antlrcpp::Any CypherMainVisitor::visitPatternElementChain(
CypherParser::PatternElementChainContext *ctx) {
return std::pair<std::shared_ptr<Part>, std::shared_ptr<Part>>(
ctx->relationshipPattern()->accept(this).as<std::shared_ptr<Part>>(),
ctx->nodePattern()->accept(this).as<std::shared_ptr<Part>>());
}
antlrcpp::Any CypherMainVisitor::visitRelationshipPattern(
CypherParser::RelationshipPatternContext *ctx) {
auto edge = std::make_shared<EdgePart>(ctx_.next_uid());
if (ctx->relationshipDetail()) {
if (ctx->relationshipDetail()->variable()) {
std::string variable =
ctx->relationshipDetail()->variable()->accept(this);
edge->identifier_ =
std::make_shared<Ident>(ctx_.next_uid(), kUserIdentPrefix + variable);
} else {
edge->identifier_ = std::make_shared<Ident>(
ctx_.next_uid(), kAnonIdentPrefix + std::to_string(next_ident_id_++));
}
}
if (ctx->relationshipDetail()->relationshipTypes()) {
throw std::exception();
}
if (ctx->relationshipDetail()->properties()) {
throw std::exception();
}
if (ctx->relationshipDetail()->rangeLiteral()) {
throw std::exception();
// relationship.has_range = true;
// auto range = ctx->relationshipDetail()
// ->rangeLiteral()
// ->accept(this)
// .as<std::pair<int64_t, int64_t>>();
// relationship.lower_bound = range.first;
// relationship.upper_bound = range.second;
}
if (ctx->leftArrowHead() && !ctx->rightArrowHead()) {
edge->direction = EdgePart::Direction::LEFT;
} else if (!ctx->leftArrowHead() && ctx->rightArrowHead()) {
edge->direction = EdgePart::Direction::RIGHT;
} else {
// <-[]-> and -[]- is the same thing as far as we understand openCypher
// grammar.
edge->direction = EdgePart::Direction::BOTH;
}
return std::shared_ptr<Part>(edge);
}
antlrcpp::Any CypherMainVisitor::visitRelationshipDetail(
CypherParser::RelationshipDetailContext *) {
debug_assert(false, "Should never be called. See documentation in hpp.");
return 0;
}
antlrcpp::Any CypherMainVisitor::visitRelationshipTypes(
CypherParser::RelationshipTypesContext *ctx) {
std::vector<std::string> types;
for (auto *label : ctx->relTypeName()) {
types.push_back(label->accept(this).as<std::string>());
}
return types;
}
antlrcpp::Any
CypherMainVisitor::visitRangeLiteral(CypherParser::RangeLiteralContext *ctx) {
if (ctx->integerLiteral().size() == 0U) {
// -[*]-
return std::pair<int64_t, int64_t>(1LL, LLONG_MAX);
} else if (ctx->integerLiteral().size() == 1U) {
auto dots_tokens = ctx->getTokens(kDotsTokenId);
int64_t bound = ctx->integerLiteral()[0]->accept(this).as<int64_t>();
if (!dots_tokens.size()) {
// -[*2]-
return std::pair<int64_t, int64_t>(bound, bound);
}
if (dots_tokens[0]->getSourceInterval().startsAfter(
ctx->integerLiteral()[0]->getSourceInterval())) {
// -[*2..]-
return std::pair<int64_t, int64_t>(bound, LLONG_MAX);
} else {
// -[*..2]-
return std::pair<int64_t, int64_t>(1LL, bound);
}
} else {
int64_t lbound = ctx->integerLiteral()[0]->accept(this).as<int64_t>();
int64_t rbound = ctx->integerLiteral()[1]->accept(this).as<int64_t>();
// -[*2..5]-
return std::pair<int64_t, int64_t>(lbound, rbound);
}
}
antlrcpp::Any
CypherMainVisitor::visitExpression(CypherParser::ExpressionContext *ctx) {
return visitChildren(ctx);
}
//// OR.
// antlrcpp::Any
// CypherMainVisitor::visitExpression12(CypherParser::Expression12Context *ctx)
// {
// return LeftAssociativeOperatorExpression(ctx->expression11(),
// Function::LOGICAL_OR);
//}
//
//// XOR.
// antlrcpp::Any
// CypherMainVisitor::visitExpression11(CypherParser::Expression11Context *ctx)
// {
// return LeftAssociativeOperatorExpression(ctx->expression10(),
// Function::LOGICAL_XOR);
//}
//
//// AND.
// antlrcpp::Any
// CypherMainVisitor::visitExpression10(CypherParser::Expression10Context *ctx)
// {
// return LeftAssociativeOperatorExpression(ctx->expression9(),
// Function::LOGICAL_AND);
//}
//
//// NOT.
// antlrcpp::Any
// CypherMainVisitor::visitExpression9(CypherParser::Expression9Context *ctx) {
// // TODO: make template similar to LeftAssociativeOperatorExpression for
// unary
// // expresssions.
// auto operand = ctx->expression8()->accept(this).as<std::string>();
// for (int i = 0; i < (int)ctx->NOT().size(); ++i) {
// auto lhs_id = new_id();
// symbol_table_[lhs_id] = SimpleExpression{Function::LOGICAL_NOT,
// {operand}};
// operand = lhs_id;
// }
// return operand;
//}
//
//// Comparisons.
// antlrcpp::Any
// CypherMainVisitor::visitExpression8(CypherParser::Expression8Context *ctx) {
// if (!ctx->partialComparisonExpression().size()) {
// // There is no comparison operators. We generate expression7.
// return ctx->expression7()->accept(this);
// }
//
// // There is at least one comparison. We need to generate code for each of
// // them. We don't call visitPartialComparisonExpression but do everything in
// // this function and call expression7-s directly. Since every expression7
// // can be generated twice (because it can appear in two comparisons) code
// // generated by whole subtree of expression7 must not have any sideeffects.
// // We handle chained comparisons as defined by mathematics, neo4j handles
// // them in a very interesting, illogical and incomprehensible way. For
// // example in neo4j:
// // 1 < 2 < 3 -> true,
// // 1 < 2 < 3 < 4 -> false,
// // 5 > 3 < 5 > 3 -> true,
// // 4 <= 5 < 7 > 6 -> false
// // All of those comparisons evaluate to true in memgraph.
// std::vector<std::string> children_ids;
// children_ids.push_back(ctx->expression7()->accept(this).as<std::string>());
// auto partial_comparison_expressions = ctx->partialComparisonExpression();
// for (auto *child : partial_comparison_expressions) {
// children_ids.push_back(child->accept(this).as<std::string>());
// }
//
// // Make all comparisons.
// std::string first_operand = children_ids[0];
// std::vector<std::string> comparison_ids;
// for (int i = 0; i < (int)partial_comparison_expressions.size(); ++i) {
// auto *expr = partial_comparison_expressions[i];
// auto op = [](CypherParser::PartialComparisonExpressionContext *expr) {
// if (expr->getToken(kEqTokenId, 0)) {
// return Function::EQ;
// } else if (expr->getToken(kNeTokenId1, 0) ||
// expr->getToken(kNeTokenId2, 0)) {
// return Function::NE;
// } else if (expr->getToken(kLtTokenId, 0)) {
// return Function::LT;
// } else if (expr->getToken(kGtTokenId, 0)) {
// return Function::GT;
// } else if (expr->getToken(kLeTokenId, 0)) {
// return Function::LE;
// } else if (expr->getToken(kGeTokenId, 0)) {
// return Function::GE;
// }
// assert(false);
// return Function::GE;
// }(expr);
// auto lhs_id = new_id();
// symbol_table_[lhs_id] =
// SimpleExpression{op, {first_operand, children_ids[i + 1]}};
// first_operand = lhs_id;
// comparison_ids.push_back(lhs_id);
// }
//
// first_operand = comparison_ids[0];
// // Calculate logical and of results of comparisons.
// for (int i = 1; i < (int)comparison_ids.size(); ++i) {
// auto lhs_id = new_id();
// symbol_table_[lhs_id] = SimpleExpression{
// Function::LOGICAL_AND, {first_operand, comparison_ids[i]}};
// first_operand = lhs_id;
// }
// return first_operand;
//}
//
// antlrcpp::Any CypherMainVisitor::visitPartialComparisonExpression(
// CypherParser::PartialComparisonExpressionContext *) {
// debug_assert(false, "Should never be called. See documentation in hpp.");
// return 0;
//}
//
//// Addition and subtraction.
// antlrcpp::Any
// CypherMainVisitor::visitExpression7(CypherParser::Expression7Context *ctx) {
// return LeftAssociativeOperatorExpression(
// ctx->expression6(),
// MapTokensToOperators(ctx, {{kPlusTokenId, Function::ADDITION},
// {kMinusTokenId, Function::SUBTRACTION}}));
//}
//
//// Multiplication, division, modding.
// antlrcpp::Any
// CypherMainVisitor::visitExpression6(CypherParser::Expression6Context *ctx) {
// return LeftAssociativeOperatorExpression(
// ctx->expression5(),
// MapTokensToOperators(ctx, {{kMultTokenId, Function::MULTIPLICATION},
// {kDivTokenId, Function::DIVISION},
// {kModTokenId, Function::MODULO}}));
//}
//
//// Power.
// antlrcpp::Any
// CypherMainVisitor::visitExpression5(CypherParser::Expression5Context *ctx) {
// if (ctx->expression4().size() > 1u) {
// // TODO: implement power operator. In neo4j power is right associative and
// // int^int -> float.
// throw SemanticException();
// }
// return visitChildren(ctx);
//}
//
//// Unary minus and plus.
// antlrcpp::Any
// CypherMainVisitor::visitExpression4(CypherParser::Expression4Context *ctx) {
// auto ops =
// MapTokensToOperators(ctx, {{kUnaryPlusTokenId, Function::UNARY_PLUS},
// {kUnaryMinusTokenId,
// Function::UNARY_MINUS}});
// auto operand = ctx->expression3()->accept(this).as<std::string>();
// for (int i = 0; i < (int)ops.size(); ++i) {
// auto lhs_id = new_id();
// symbol_table_[lhs_id] = SimpleExpression{ops[i], {operand}};
// operand = lhs_id;
// }
// return operand;
//}
//
// antlrcpp::Any
// CypherMainVisitor::visitExpression3(CypherParser::Expression3Context *ctx) {
// // If there is only one child we don't need to generate any code in this
// since
// // that child is expression2. Other operations are not implemented at the
// // moment.
// // TODO: implement this.
// if (ctx->children.size() > 1u) {
// throw SemanticException();
// }
// return visitChildren(ctx);
//}
//
// antlrcpp::Any
// CypherMainVisitor::visitExpression2(CypherParser::Expression2Context *ctx) {
// if (ctx->nodeLabels().size()) {
// // TODO: Implement this. We don't currently support label checking in
// // expresssion.
// throw SemanticException();
// }
// auto operand = ctx->atom()->accept(this).as<std::string>();
// for (int i = 0; i < (int)ctx->propertyLookup().size(); ++i) {
// auto lhs_id = new_id();
// symbol_table_[lhs_id] =
// SimpleExpression{Function::PROPERTY_GETTER, {operand}};
// operand = lhs_id;
// }
// return operand;
//}
antlrcpp::Any CypherMainVisitor::visitAtom(CypherParser::AtomContext *ctx) {
if (ctx->literal()) {
// This is not very nice since we didn't parse text given in query, but we
// left that job to the code generator. Correct approach would be to parse
// it and store it in a structure of appropriate type, int, string... And
// then code generator would generate its own text based on structure. This
// is also a security risk if code generator doesn't parse and escape
// text appropriately. At the moment we don;t care much since literal will
// appear only in tests and real queries will be stripped.
// TODO: Either parse it correctly or raise exception. If exception is
// raised it tests should also use params instead of literals.
// auto text = ctx->literal()->getText();
// auto lhs_id = new_id();
// symbol_table_[lhs_id] = SimpleExpression{Function::LITERAL, {text}};
// return lhs_id;
throw std::exception();
} else if (ctx->parameter()) {
// This is once again potential security risk. We shouldn't output text
// given in user query as parameter name directly to the code. Stripper
// should either replace user's parameter name with generic one or we should
// allow only parameters with numeric names. At the moment this is not a
// problem since we don't accept user's parameters but only ours.
// TODO: revise this.
// auto text = ctx->literal()->getText();
// auto lhs_id = new_id();
// symbol_table_[lhs_id] = SimpleExpression{Function::PARAMETER, {text}};
throw std::exception();
// return lhs_id;
} else if (ctx->parenthesizedExpression()) {
return ctx->parenthesizedExpression()->accept(this);
} else if (ctx->variable()) {
std::string variable = ctx->variable()->accept(this);
return std::shared_ptr<Expr>(std::make_shared<Ident>(ctx_.next_uid(),
kUserIdentPrefix +
variable));
}
// TODO: Implement this. We don't support comprehensions, functions,
// filtering... at the moment.
throw std::exception();
}
antlrcpp::Any CypherMainVisitor::visitIntegerLiteral(
CypherParser::IntegerLiteralContext *ctx) {
int64_t t = 0LL;
try {
t = std::stoll(ctx->getText(), 0, 0);
} catch (std::out_of_range) {
throw std::exception();
}
return t;
}
}
}

View File

@ -0,0 +1,297 @@
#pragma once
#include <string>
#include <unordered_set>
#include "antlr4-runtime.h"
#include "query/context.hpp"
#include "query/frontend/ast/ast.hpp"
#include "query/frontend/opencypher/generated/CypherBaseVisitor.h"
namespace query {
namespace frontend {
using query::Context;
using antlropencypher::CypherParser;
class CypherMainVisitor : public antlropencypher::CypherBaseVisitor {
public:
CypherMainVisitor(Context &ctx) : ctx_(ctx) {}
private:
// template <typename TExpression>
// antlrcpp::Any
// LeftAssociativeOperatorExpression(std::vector<TExpression *> children,
// std::vector<Function> ops) {
// assert(children.size());
// std::vector<std::string> children_ids;
//
// for (auto *child : children) {
// children_ids.push_back(child->accept(this).template
// as<std::string>());
// }
//
// std::string first_operand = children_ids[0];
// for (int i = 0; i < (int)ops.size(); ++i) {
// auto lhs_id = new_id();
// symbol_table_[lhs_id] =
// SimpleExpression{ops[i], {first_operand, children_ids[i + 1]}};
// first_operand = lhs_id;
// }
// return first_operand;
// }
//
// template <typename TExpression>
// antlrcpp::Any
// LeftAssociativeOperatorExpression(std::vector<TExpression *> children,
// Function op) {
// return LeftAssociativeOperatorExpression(
// children, std::vector<Function>((int)children.size() - 1, op));
// }
antlrcpp::Any
visitSingleQuery(CypherParser::SingleQueryContext *ctx) override;
antlrcpp::Any
visitCypherMatch(CypherParser::CypherMatchContext *ctx) override;
antlrcpp::Any visitReturnBody(CypherParser::ReturnBodyContext *ctx) override;
antlrcpp::Any
visitReturnItems(CypherParser::ReturnItemsContext *ctx) override;
antlrcpp::Any visitReturnItem(CypherParser::ReturnItemContext *ctx) override;
/**
* Creates Node and stores it in symbol_table_. If variable is defined it is
* stored in ids_map_.
*
* @return string - node id.
*/
antlrcpp::Any
visitNodePattern(CypherParser::NodePatternContext *ctx) override;
/**
* @return vector<string> labels.
*/
antlrcpp::Any visitNodeLabels(CypherParser::NodeLabelsContext *ctx) override;
/**
* @return unordered_map<string, string> properties - property key to
* expression id.
*/
antlrcpp::Any visitProperties(CypherParser::PropertiesContext *ctx) override;
/**
* @return unordered_map<string, string> map - key to expression id.
*/
antlrcpp::Any visitMapLiteral(CypherParser::MapLiteralContext *ctx) override;
/**
* @return string.
*/
antlrcpp::Any
visitSymbolicName(CypherParser::SymbolicNameContext *ctx) override;
/**
* @return vector<PatternPart> pattern.
*/
antlrcpp::Any visitPattern(CypherParser::PatternContext *ctx) override;
/**
* Stores PatternPart in symbol_table_. If variable is defined it is stored
*in
* ids_map_.
*
* @return string - pattern part id.
*/
antlrcpp::Any
visitPatternPart(CypherParser::PatternPartContext *ctx) override;
/**
* Creates PatternPart.
*
* @return PatternPart.
*/
antlrcpp::Any
visitPatternElement(CypherParser::PatternElementContext *ctx) override;
/**
* @return pair<string, string> - node and relationship ids.
*/
antlrcpp::Any visitPatternElementChain(
CypherParser::PatternElementChainContext *ctx) override;
/**
* Creates Relationship and stores it in symbol_table_. If variable is defined
* it is stored in symbol_table_.
*
* @return string - relationship id.
*/
antlrcpp::Any visitRelationshipPattern(
CypherParser::RelationshipPatternContext *ctx) override;
/**
* This should never be called. Everything is done directly in
* visitRelationshipPattern.
*/
antlrcpp::Any visitRelationshipDetail(
CypherParser::RelationshipDetailContext *ctx) override;
/**
* @return vector<string>.
*/
antlrcpp::Any
visitRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) override;
/**
* @return pair<int64_t, int64_t>.
*/
antlrcpp::Any
visitRangeLiteral(CypherParser::RangeLiteralContext *ctx) override;
/**
* Top level expression.
*
* @return string - expression id.
*/
antlrcpp::Any visitExpression(CypherParser::ExpressionContext *ctx) override;
///**
//* OR.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression12(CypherParser::Expression12Context *ctx) override;
///**
//* XOR.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression11(CypherParser::Expression11Context *ctx) override;
///**
//* AND.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression10(CypherParser::Expression10Context *ctx) override;
///**
//* NOT.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression9(CypherParser::Expression9Context *ctx) override;
///**
//* Comparisons.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression8(CypherParser::Expression8Context *ctx) override;
///**
//* Never call this. Everything related to generating code for comparison
//* operators should be done in visitExpression8.
//*/
// antlrcpp::Any visitPartialComparisonExpression(
// CypherParser::PartialComparisonExpressionContext *ctx) override;
///**
//* Addition and subtraction.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression7(CypherParser::Expression7Context *ctx) override;
///**
//* Multiplication, division, modding.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression6(CypherParser::Expression6Context *ctx) override;
///**
//* Power.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression5(CypherParser::Expression5Context *ctx) override;
///**
//* Unary minus and plus.
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression4(CypherParser::Expression4Context *ctx) override;
///**
//* Element of a list, range of a list...
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression3(CypherParser::Expression3Context *ctx) override;
///**
//* Property lookup, test for node labels existence...
//*
//* @return string - expression id.
//*/
// antlrcpp::Any
// visitExpression2(CypherParser::Expression2Context *ctx) override;
/**
* Literals, params, list comprehension...
*
* @return string - expression id.
*/
antlrcpp::Any visitAtom(CypherParser::AtomContext *ctx) override;
// antlrcpp::Any visitLiteral(CypherParser::LiteralContext *ctx) override {
// return visitChildren(ctx);
// }
//
// antlrcpp::Any visitBooleanLiteral(
// CypherParser::BooleanLiteralContext *ctx) override {
// return visitChildren(ctx);
// }
//
// antlrcpp::Any visitListLiteral(
// CypherParser::ListLiteralContext *ctx) override {
// return visitChildren(ctx);
// }
//
// antlrcpp::Any visitParenthesizedExpression(
// CypherParser::ParenthesizedExpressionContext *ctx) override {
// return visitChildren(ctx);
// }
/**
* @return int64_t.
*/
antlrcpp::Any
visitIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) override;
public:
std::shared_ptr<Query> query() { return query_; }
private:
Context &ctx_;
int next_ident_id_;
const std::string kUserIdentPrefix = "u_";
const std::string kAnonIdentPrefix = "a_";
std::shared_ptr<Query> query_;
};
}
}

View File

@ -0,0 +1,21 @@
#pragma once
#include <vector>
#include "query/backend/cpp/typed_value.hpp"
namespace query {
class Frame {
public:
Frame(int size) : size_(size), elems_(size_) {}
auto& operator[](int pos) { return elems_[pos]; }
const auto& operator[](int pos) const { return elems_[pos]; }
private:
int size_;
std::vector<TypedValue> elems_;
};
}

View File

@ -0,0 +1,151 @@
#pragma once
#include <memory>
#include <sstream>
#include <vector>
#include "database/graph_db_accessor.hpp"
#include "query/frontend/ast/ast.hpp"
#include "query/frontend/interpret/interpret.hpp"
#include "query/frontend/typecheck/symbol_table.hpp"
namespace query {
class ConsoleResultStream : public Loggable {
public:
ConsoleResultStream() : Loggable("ConsoleResultStream") {}
void Header(const std::vector<std::string>&) { logger.info("header"); }
void Result(std::vector<TypedValue>& values) {
for (auto value : values) {
auto va = value.Value<VertexAccessor>();
logger.info(" {}", va.labels().size());
}
}
void Summary(const std::map<std::string, TypedValue>&) {
logger.info("summary");
}
};
class Cursor {
public:
virtual bool pull(Frame&, SymbolTable&) = 0;
virtual ~Cursor() {}
};
class LogicalOperator {
public:
auto children() { return children_; };
virtual std::unique_ptr<Cursor> MakeCursor(GraphDbAccessor& db) = 0;
virtual void WriteHeader(ConsoleResultStream&) {}
virtual std::vector<Symbol> OutputSymbols(SymbolTable& symbol_table) {
return {};
}
virtual ~LogicalOperator() {}
protected:
std::vector<std::shared_ptr<LogicalOperator>> children_;
};
class ScanAll : public LogicalOperator {
public:
ScanAll(std::shared_ptr<NodePart> node_part) : node_part_(node_part) {}
private:
class ScanAllCursor : public Cursor {
public:
ScanAllCursor(ScanAll& self, GraphDbAccessor& db)
: self_(self),
db_(db),
vertices_(db.vertices()),
vertices_it_(vertices_.begin()) {}
bool pull(Frame& frame, SymbolTable& symbol_table) override {
while (vertices_it_ != vertices_.end()) {
auto vertex = *vertices_it_++;
if (evaluate(frame, symbol_table, vertex)) {
return true;
}
}
return false;
}
private:
ScanAll& self_;
GraphDbAccessor& db_;
decltype(db_.vertices()) vertices_;
decltype(vertices_.begin()) vertices_it_;
bool evaluate(Frame& frame, SymbolTable& symbol_table,
VertexAccessor& vertex) {
auto node_part = self_.node_part_;
for (auto label : node_part->labels_) {
if (!vertex.has_label(label)) return false;
}
frame[symbol_table[*node_part->identifier_].position_] = vertex;
return true;
}
};
public:
std::unique_ptr<Cursor> MakeCursor(GraphDbAccessor& db) override {
return std::make_unique<ScanAllCursor>(*this, db);
}
private:
friend class ScanAll::ScanAllCursor;
std::shared_ptr<NodePart> node_part_;
};
class Produce : public LogicalOperator {
public:
Produce(std::shared_ptr<LogicalOperator> input,
std::vector<std::shared_ptr<NamedExpr>> exprs)
: input_(input), exprs_(exprs) {
children_.emplace_back(input);
}
void WriteHeader(ConsoleResultStream& stream) override {
// TODO: write real result
stream.Header({"n"});
}
std::unique_ptr<Cursor> MakeCursor(GraphDbAccessor& db) override {
return std::make_unique<ProduceCursor>(*this, db);
}
std::vector<Symbol> OutputSymbols(SymbolTable& symbol_table) override {
std::vector<Symbol> result;
for (auto named_expr : exprs_) {
result.emplace_back(symbol_table[*named_expr->ident_]);
}
return result;
}
private:
class ProduceCursor : public Cursor {
public:
ProduceCursor(Produce& self, GraphDbAccessor& db)
: self_(self), self_cursor_(self_.input_->MakeCursor(db)) {}
bool pull(Frame& frame, SymbolTable& symbol_table) override {
if (self_cursor_->pull(frame, symbol_table)) {
for (auto expr : self_.exprs_) {
expr->Evaluate(frame, symbol_table);
}
return true;
}
return false;
}
private:
Produce& self_;
std::unique_ptr<Cursor> self_cursor_;
};
private:
std::shared_ptr<LogicalOperator> input_;
std::vector<std::shared_ptr<NamedExpr>> exprs_;
};
}

View File

@ -0,0 +1,55 @@
#pragma once
#include <memory>
#include <stdexcept>
#include "query/frontend/ast/ast.hpp"
#include "query/frontend/logical/operator.hpp"
namespace query {
std::shared_ptr<LogicalOperator> GenMatch(
Match& match, std::shared_ptr<LogicalOperator> current_op)
{
if (current_op) {
throw std::runtime_error("Not implemented");
}
if (match.patterns_.size() != 1) {
throw std::runtime_error("Not implemented");
}
auto& pattern = match.patterns_[0];
if (pattern->parts_.size() != 1) {
throw std::runtime_error("Not implemented");
}
auto node_part = std::dynamic_pointer_cast<NodePart>(pattern->parts_[0]);
return std::make_shared<ScanAll>(node_part);
}
std::shared_ptr<LogicalOperator> GenReturn(
Return& ret, std::shared_ptr<LogicalOperator> current_op)
{
if (!current_op) {
throw std::runtime_error("Not implemented");
}
return std::make_shared<Produce>(current_op, ret.named_exprs_);
}
std::shared_ptr<LogicalOperator> Apply(Query& query)
{
std::shared_ptr<LogicalOperator> current_op;
for (auto& clause : query.clauses_) {
auto* clause_ptr = clause.get();
auto* match = dynamic_cast<Match*>(clause_ptr);
auto* ret = dynamic_cast<Return*>(clause_ptr);
if (match) {
current_op = GenMatch(*match, current_op);
} else if (ret) {
return GenReturn(*ret, current_op);
} else {
throw std::runtime_error("Not implemented");
}
}
return current_op;
}
}

View File

@ -1,159 +0,0 @@
T__0=1
T__1=2
T__2=3
T__3=4
T__4=5
T__5=6
T__6=7
T__7=8
T__8=9
T__9=10
T__10=11
T__11=12
T__12=13
T__13=14
T__14=15
T__15=16
T__16=17
T__17=18
T__18=19
T__19=20
T__20=21
T__21=22
T__22=23
T__23=24
T__24=25
T__25=26
T__26=27
T__27=28
T__28=29
T__29=30
T__30=31
T__31=32
T__32=33
T__33=34
T__34=35
T__35=36
T__36=37
T__37=38
T__38=39
T__39=40
T__40=41
T__41=42
T__42=43
T__43=44
T__44=45
T__45=46
T__46=47
StringLiteral=48
EscapedChar=49
HexInteger=50
DecimalInteger=51
OctalInteger=52
HexLetter=53
HexDigit=54
Digit=55
NonZeroDigit=56
NonZeroOctDigit=57
OctDigit=58
ZeroDigit=59
ExponentDecimalReal=60
RegularDecimalReal=61
UNION=62
ALL=63
OPTIONAL=64
MATCH=65
UNWIND=66
AS=67
MERGE=68
ON=69
CREATE=70
SET=71
DETACH=72
DELETE=73
REMOVE=74
WITH=75
DISTINCT=76
RETURN=77
ORDER=78
BY=79
L_SKIP=80
LIMIT=81
ASCENDING=82
ASC=83
DESCENDING=84
DESC=85
WHERE=86
OR=87
XOR=88
AND=89
NOT=90
IN=91
STARTS=92
ENDS=93
CONTAINS=94
IS=95
CYPHERNULL=96
COUNT=97
FILTER=98
EXTRACT=99
ANY=100
NONE=101
SINGLE=102
TRUE=103
FALSE=104
UnescapedSymbolicName=105
IdentifierStart=106
IdentifierPart=107
EscapedSymbolicName=108
SP=109
WHITESPACE=110
Comment=111
';'=1
','=2
'='=3
'+='=4
'*'=5
'('=6
')'=7
'['=8
']'=9
':'=10
'|'=11
'..'=12
'+'=13
'-'=14
'/'=15
'%'=16
'^'=17
'=~'=18
'<>'=19
'!='=20
'<'=21
'>'=22
'<='=23
'>='=24
'.'=25
'{'=26
'}'=27
'$'=28
'⟨'=29
'〈'=30
'﹤'=31
''=32
'⟩'=33
'〉'=34
'﹥'=35
''=36
'­'=37
''=38
''=39
''=40
''=41
'—'=42
'―'=43
''=44
''=45
'﹣'=46
''=47
'0'=59

View File

@ -1,9 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#include "CypherBaseListener.h"
using namespace antlropencypher;

View File

@ -1,269 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#pragma once
#include "antlr4-runtime.h"
#include "CypherListener.h"
namespace antlropencypher {
/**
* This class provides an empty implementation of CypherListener,
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
class CypherBaseListener : public CypherListener {
public:
virtual void enterCypher(CypherParser::CypherContext * /*ctx*/) override { }
virtual void exitCypher(CypherParser::CypherContext * /*ctx*/) override { }
virtual void enterStatement(CypherParser::StatementContext * /*ctx*/) override { }
virtual void exitStatement(CypherParser::StatementContext * /*ctx*/) override { }
virtual void enterQuery(CypherParser::QueryContext * /*ctx*/) override { }
virtual void exitQuery(CypherParser::QueryContext * /*ctx*/) override { }
virtual void enterRegularQuery(CypherParser::RegularQueryContext * /*ctx*/) override { }
virtual void exitRegularQuery(CypherParser::RegularQueryContext * /*ctx*/) override { }
virtual void enterSingleQuery(CypherParser::SingleQueryContext * /*ctx*/) override { }
virtual void exitSingleQuery(CypherParser::SingleQueryContext * /*ctx*/) override { }
virtual void enterCypherUnion(CypherParser::CypherUnionContext * /*ctx*/) override { }
virtual void exitCypherUnion(CypherParser::CypherUnionContext * /*ctx*/) override { }
virtual void enterClause(CypherParser::ClauseContext * /*ctx*/) override { }
virtual void exitClause(CypherParser::ClauseContext * /*ctx*/) override { }
virtual void enterCypherMatch(CypherParser::CypherMatchContext * /*ctx*/) override { }
virtual void exitCypherMatch(CypherParser::CypherMatchContext * /*ctx*/) override { }
virtual void enterUnwind(CypherParser::UnwindContext * /*ctx*/) override { }
virtual void exitUnwind(CypherParser::UnwindContext * /*ctx*/) override { }
virtual void enterMerge(CypherParser::MergeContext * /*ctx*/) override { }
virtual void exitMerge(CypherParser::MergeContext * /*ctx*/) override { }
virtual void enterMergeAction(CypherParser::MergeActionContext * /*ctx*/) override { }
virtual void exitMergeAction(CypherParser::MergeActionContext * /*ctx*/) override { }
virtual void enterCreate(CypherParser::CreateContext * /*ctx*/) override { }
virtual void exitCreate(CypherParser::CreateContext * /*ctx*/) override { }
virtual void enterSet(CypherParser::SetContext * /*ctx*/) override { }
virtual void exitSet(CypherParser::SetContext * /*ctx*/) override { }
virtual void enterSetItem(CypherParser::SetItemContext * /*ctx*/) override { }
virtual void exitSetItem(CypherParser::SetItemContext * /*ctx*/) override { }
virtual void enterCypherDelete(CypherParser::CypherDeleteContext * /*ctx*/) override { }
virtual void exitCypherDelete(CypherParser::CypherDeleteContext * /*ctx*/) override { }
virtual void enterRemove(CypherParser::RemoveContext * /*ctx*/) override { }
virtual void exitRemove(CypherParser::RemoveContext * /*ctx*/) override { }
virtual void enterRemoveItem(CypherParser::RemoveItemContext * /*ctx*/) override { }
virtual void exitRemoveItem(CypherParser::RemoveItemContext * /*ctx*/) override { }
virtual void enterWith(CypherParser::WithContext * /*ctx*/) override { }
virtual void exitWith(CypherParser::WithContext * /*ctx*/) override { }
virtual void enterCypherReturn(CypherParser::CypherReturnContext * /*ctx*/) override { }
virtual void exitCypherReturn(CypherParser::CypherReturnContext * /*ctx*/) override { }
virtual void enterReturnBody(CypherParser::ReturnBodyContext * /*ctx*/) override { }
virtual void exitReturnBody(CypherParser::ReturnBodyContext * /*ctx*/) override { }
virtual void enterReturnItems(CypherParser::ReturnItemsContext * /*ctx*/) override { }
virtual void exitReturnItems(CypherParser::ReturnItemsContext * /*ctx*/) override { }
virtual void enterReturnItem(CypherParser::ReturnItemContext * /*ctx*/) override { }
virtual void exitReturnItem(CypherParser::ReturnItemContext * /*ctx*/) override { }
virtual void enterOrder(CypherParser::OrderContext * /*ctx*/) override { }
virtual void exitOrder(CypherParser::OrderContext * /*ctx*/) override { }
virtual void enterSkip(CypherParser::SkipContext * /*ctx*/) override { }
virtual void exitSkip(CypherParser::SkipContext * /*ctx*/) override { }
virtual void enterLimit(CypherParser::LimitContext * /*ctx*/) override { }
virtual void exitLimit(CypherParser::LimitContext * /*ctx*/) override { }
virtual void enterSortItem(CypherParser::SortItemContext * /*ctx*/) override { }
virtual void exitSortItem(CypherParser::SortItemContext * /*ctx*/) override { }
virtual void enterWhere(CypherParser::WhereContext * /*ctx*/) override { }
virtual void exitWhere(CypherParser::WhereContext * /*ctx*/) override { }
virtual void enterPattern(CypherParser::PatternContext * /*ctx*/) override { }
virtual void exitPattern(CypherParser::PatternContext * /*ctx*/) override { }
virtual void enterPatternPart(CypherParser::PatternPartContext * /*ctx*/) override { }
virtual void exitPatternPart(CypherParser::PatternPartContext * /*ctx*/) override { }
virtual void enterAnonymousPatternPart(CypherParser::AnonymousPatternPartContext * /*ctx*/) override { }
virtual void exitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext * /*ctx*/) override { }
virtual void enterPatternElement(CypherParser::PatternElementContext * /*ctx*/) override { }
virtual void exitPatternElement(CypherParser::PatternElementContext * /*ctx*/) override { }
virtual void enterNodePattern(CypherParser::NodePatternContext * /*ctx*/) override { }
virtual void exitNodePattern(CypherParser::NodePatternContext * /*ctx*/) override { }
virtual void enterPatternElementChain(CypherParser::PatternElementChainContext * /*ctx*/) override { }
virtual void exitPatternElementChain(CypherParser::PatternElementChainContext * /*ctx*/) override { }
virtual void enterRelationshipPattern(CypherParser::RelationshipPatternContext * /*ctx*/) override { }
virtual void exitRelationshipPattern(CypherParser::RelationshipPatternContext * /*ctx*/) override { }
virtual void enterRelationshipDetail(CypherParser::RelationshipDetailContext * /*ctx*/) override { }
virtual void exitRelationshipDetail(CypherParser::RelationshipDetailContext * /*ctx*/) override { }
virtual void enterProperties(CypherParser::PropertiesContext * /*ctx*/) override { }
virtual void exitProperties(CypherParser::PropertiesContext * /*ctx*/) override { }
virtual void enterRelationshipTypes(CypherParser::RelationshipTypesContext * /*ctx*/) override { }
virtual void exitRelationshipTypes(CypherParser::RelationshipTypesContext * /*ctx*/) override { }
virtual void enterNodeLabels(CypherParser::NodeLabelsContext * /*ctx*/) override { }
virtual void exitNodeLabels(CypherParser::NodeLabelsContext * /*ctx*/) override { }
virtual void enterNodeLabel(CypherParser::NodeLabelContext * /*ctx*/) override { }
virtual void exitNodeLabel(CypherParser::NodeLabelContext * /*ctx*/) override { }
virtual void enterRangeLiteral(CypherParser::RangeLiteralContext * /*ctx*/) override { }
virtual void exitRangeLiteral(CypherParser::RangeLiteralContext * /*ctx*/) override { }
virtual void enterLabelName(CypherParser::LabelNameContext * /*ctx*/) override { }
virtual void exitLabelName(CypherParser::LabelNameContext * /*ctx*/) override { }
virtual void enterRelTypeName(CypherParser::RelTypeNameContext * /*ctx*/) override { }
virtual void exitRelTypeName(CypherParser::RelTypeNameContext * /*ctx*/) override { }
virtual void enterExpression(CypherParser::ExpressionContext * /*ctx*/) override { }
virtual void exitExpression(CypherParser::ExpressionContext * /*ctx*/) override { }
virtual void enterExpression12(CypherParser::Expression12Context * /*ctx*/) override { }
virtual void exitExpression12(CypherParser::Expression12Context * /*ctx*/) override { }
virtual void enterExpression11(CypherParser::Expression11Context * /*ctx*/) override { }
virtual void exitExpression11(CypherParser::Expression11Context * /*ctx*/) override { }
virtual void enterExpression10(CypherParser::Expression10Context * /*ctx*/) override { }
virtual void exitExpression10(CypherParser::Expression10Context * /*ctx*/) override { }
virtual void enterExpression9(CypherParser::Expression9Context * /*ctx*/) override { }
virtual void exitExpression9(CypherParser::Expression9Context * /*ctx*/) override { }
virtual void enterExpression8(CypherParser::Expression8Context * /*ctx*/) override { }
virtual void exitExpression8(CypherParser::Expression8Context * /*ctx*/) override { }
virtual void enterExpression7(CypherParser::Expression7Context * /*ctx*/) override { }
virtual void exitExpression7(CypherParser::Expression7Context * /*ctx*/) override { }
virtual void enterExpression6(CypherParser::Expression6Context * /*ctx*/) override { }
virtual void exitExpression6(CypherParser::Expression6Context * /*ctx*/) override { }
virtual void enterExpression5(CypherParser::Expression5Context * /*ctx*/) override { }
virtual void exitExpression5(CypherParser::Expression5Context * /*ctx*/) override { }
virtual void enterExpression4(CypherParser::Expression4Context * /*ctx*/) override { }
virtual void exitExpression4(CypherParser::Expression4Context * /*ctx*/) override { }
virtual void enterExpression3(CypherParser::Expression3Context * /*ctx*/) override { }
virtual void exitExpression3(CypherParser::Expression3Context * /*ctx*/) override { }
virtual void enterExpression2(CypherParser::Expression2Context * /*ctx*/) override { }
virtual void exitExpression2(CypherParser::Expression2Context * /*ctx*/) override { }
virtual void enterAtom(CypherParser::AtomContext * /*ctx*/) override { }
virtual void exitAtom(CypherParser::AtomContext * /*ctx*/) override { }
virtual void enterLiteral(CypherParser::LiteralContext * /*ctx*/) override { }
virtual void exitLiteral(CypherParser::LiteralContext * /*ctx*/) override { }
virtual void enterBooleanLiteral(CypherParser::BooleanLiteralContext * /*ctx*/) override { }
virtual void exitBooleanLiteral(CypherParser::BooleanLiteralContext * /*ctx*/) override { }
virtual void enterListLiteral(CypherParser::ListLiteralContext * /*ctx*/) override { }
virtual void exitListLiteral(CypherParser::ListLiteralContext * /*ctx*/) override { }
virtual void enterPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext * /*ctx*/) override { }
virtual void exitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext * /*ctx*/) override { }
virtual void enterParenthesizedExpression(CypherParser::ParenthesizedExpressionContext * /*ctx*/) override { }
virtual void exitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext * /*ctx*/) override { }
virtual void enterRelationshipsPattern(CypherParser::RelationshipsPatternContext * /*ctx*/) override { }
virtual void exitRelationshipsPattern(CypherParser::RelationshipsPatternContext * /*ctx*/) override { }
virtual void enterFilterExpression(CypherParser::FilterExpressionContext * /*ctx*/) override { }
virtual void exitFilterExpression(CypherParser::FilterExpressionContext * /*ctx*/) override { }
virtual void enterIdInColl(CypherParser::IdInCollContext * /*ctx*/) override { }
virtual void exitIdInColl(CypherParser::IdInCollContext * /*ctx*/) override { }
virtual void enterFunctionInvocation(CypherParser::FunctionInvocationContext * /*ctx*/) override { }
virtual void exitFunctionInvocation(CypherParser::FunctionInvocationContext * /*ctx*/) override { }
virtual void enterFunctionName(CypherParser::FunctionNameContext * /*ctx*/) override { }
virtual void exitFunctionName(CypherParser::FunctionNameContext * /*ctx*/) override { }
virtual void enterListComprehension(CypherParser::ListComprehensionContext * /*ctx*/) override { }
virtual void exitListComprehension(CypherParser::ListComprehensionContext * /*ctx*/) override { }
virtual void enterPatternComprehension(CypherParser::PatternComprehensionContext * /*ctx*/) override { }
virtual void exitPatternComprehension(CypherParser::PatternComprehensionContext * /*ctx*/) override { }
virtual void enterPropertyLookup(CypherParser::PropertyLookupContext * /*ctx*/) override { }
virtual void exitPropertyLookup(CypherParser::PropertyLookupContext * /*ctx*/) override { }
virtual void enterVariable(CypherParser::VariableContext * /*ctx*/) override { }
virtual void exitVariable(CypherParser::VariableContext * /*ctx*/) override { }
virtual void enterNumberLiteral(CypherParser::NumberLiteralContext * /*ctx*/) override { }
virtual void exitNumberLiteral(CypherParser::NumberLiteralContext * /*ctx*/) override { }
virtual void enterMapLiteral(CypherParser::MapLiteralContext * /*ctx*/) override { }
virtual void exitMapLiteral(CypherParser::MapLiteralContext * /*ctx*/) override { }
virtual void enterParameter(CypherParser::ParameterContext * /*ctx*/) override { }
virtual void exitParameter(CypherParser::ParameterContext * /*ctx*/) override { }
virtual void enterPropertyExpression(CypherParser::PropertyExpressionContext * /*ctx*/) override { }
virtual void exitPropertyExpression(CypherParser::PropertyExpressionContext * /*ctx*/) override { }
virtual void enterPropertyKeyName(CypherParser::PropertyKeyNameContext * /*ctx*/) override { }
virtual void exitPropertyKeyName(CypherParser::PropertyKeyNameContext * /*ctx*/) override { }
virtual void enterIntegerLiteral(CypherParser::IntegerLiteralContext * /*ctx*/) override { }
virtual void exitIntegerLiteral(CypherParser::IntegerLiteralContext * /*ctx*/) override { }
virtual void enterDoubleLiteral(CypherParser::DoubleLiteralContext * /*ctx*/) override { }
virtual void exitDoubleLiteral(CypherParser::DoubleLiteralContext * /*ctx*/) override { }
virtual void enterSymbolicName(CypherParser::SymbolicNameContext * /*ctx*/) override { }
virtual void exitSymbolicName(CypherParser::SymbolicNameContext * /*ctx*/) override { }
virtual void enterLeftArrowHead(CypherParser::LeftArrowHeadContext * /*ctx*/) override { }
virtual void exitLeftArrowHead(CypherParser::LeftArrowHeadContext * /*ctx*/) override { }
virtual void enterRightArrowHead(CypherParser::RightArrowHeadContext * /*ctx*/) override { }
virtual void exitRightArrowHead(CypherParser::RightArrowHeadContext * /*ctx*/) override { }
virtual void enterDash(CypherParser::DashContext * /*ctx*/) override { }
virtual void exitDash(CypherParser::DashContext * /*ctx*/) override { }
virtual void enterEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { }
virtual void exitEveryRule(antlr4::ParserRuleContext * /*ctx*/) override { }
virtual void visitTerminal(antlr4::tree::TerminalNode * /*node*/) override { }
virtual void visitErrorNode(antlr4::tree::ErrorNode * /*node*/) override { }
};
} // namespace antlropencypher

View File

@ -1,9 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#include "CypherBaseVisitor.h"
using namespace antlropencypher;

View File

@ -1,343 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#pragma once
#include "antlr4-runtime.h"
#include "CypherVisitor.h"
namespace antlropencypher {
/**
* This class provides an empty implementation of CypherVisitor, which can be
* extended to create a visitor which only needs to handle a subset of the available methods.
*/
class CypherBaseVisitor : public CypherVisitor {
public:
virtual antlrcpp::Any visitCypher(CypherParser::CypherContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitStatement(CypherParser::StatementContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitQuery(CypherParser::QueryContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRegularQuery(CypherParser::RegularQueryContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitSingleQuery(CypherParser::SingleQueryContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitCypherUnion(CypherParser::CypherUnionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitClause(CypherParser::ClauseContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitCypherMatch(CypherParser::CypherMatchContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitUnwind(CypherParser::UnwindContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitMerge(CypherParser::MergeContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitMergeAction(CypherParser::MergeActionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitCreate(CypherParser::CreateContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitSet(CypherParser::SetContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitSetItem(CypherParser::SetItemContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitCypherDelete(CypherParser::CypherDeleteContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRemove(CypherParser::RemoveContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRemoveItem(CypherParser::RemoveItemContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitWith(CypherParser::WithContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitCypherReturn(CypherParser::CypherReturnContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitReturnBody(CypherParser::ReturnBodyContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitReturnItems(CypherParser::ReturnItemsContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitReturnItem(CypherParser::ReturnItemContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitOrder(CypherParser::OrderContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitSkip(CypherParser::SkipContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitLimit(CypherParser::LimitContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitSortItem(CypherParser::SortItemContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitWhere(CypherParser::WhereContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPattern(CypherParser::PatternContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPatternPart(CypherParser::PatternPartContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPatternElement(CypherParser::PatternElementContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitNodePattern(CypherParser::NodePatternContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPatternElementChain(CypherParser::PatternElementChainContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRelationshipPattern(CypherParser::RelationshipPatternContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRelationshipDetail(CypherParser::RelationshipDetailContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitProperties(CypherParser::PropertiesContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitNodeLabels(CypherParser::NodeLabelsContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitNodeLabel(CypherParser::NodeLabelContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRangeLiteral(CypherParser::RangeLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitLabelName(CypherParser::LabelNameContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRelTypeName(CypherParser::RelTypeNameContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression(CypherParser::ExpressionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression12(CypherParser::Expression12Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression11(CypherParser::Expression11Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression10(CypherParser::Expression10Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression9(CypherParser::Expression9Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression8(CypherParser::Expression8Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression7(CypherParser::Expression7Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression6(CypherParser::Expression6Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression5(CypherParser::Expression5Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression4(CypherParser::Expression4Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression3(CypherParser::Expression3Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitExpression2(CypherParser::Expression2Context *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitAtom(CypherParser::AtomContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitLiteral(CypherParser::LiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitBooleanLiteral(CypherParser::BooleanLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitListLiteral(CypherParser::ListLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRelationshipsPattern(CypherParser::RelationshipsPatternContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitFilterExpression(CypherParser::FilterExpressionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitIdInColl(CypherParser::IdInCollContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitFunctionInvocation(CypherParser::FunctionInvocationContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitFunctionName(CypherParser::FunctionNameContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitListComprehension(CypherParser::ListComprehensionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPatternComprehension(CypherParser::PatternComprehensionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPropertyLookup(CypherParser::PropertyLookupContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitVariable(CypherParser::VariableContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitNumberLiteral(CypherParser::NumberLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitMapLiteral(CypherParser::MapLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitParameter(CypherParser::ParameterContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPropertyExpression(CypherParser::PropertyExpressionContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitPropertyKeyName(CypherParser::PropertyKeyNameContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitDoubleLiteral(CypherParser::DoubleLiteralContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitSymbolicName(CypherParser::SymbolicNameContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitLeftArrowHead(CypherParser::LeftArrowHeadContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitRightArrowHead(CypherParser::RightArrowHeadContext *ctx) override {
return visitChildren(ctx);
}
virtual antlrcpp::Any visitDash(CypherParser::DashContext *ctx) override {
return visitChildren(ctx);
}
};
} // namespace antlropencypher

View File

@ -1,929 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#include "CypherLexer.h"
using namespace antlr4;
using namespace antlropencypher;
CypherLexer::CypherLexer(CharStream *input) : Lexer(input) {
_interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache);
}
CypherLexer::~CypherLexer() {
delete _interpreter;
}
std::string CypherLexer::getGrammarFileName() const {
return "Cypher.g4";
}
const std::vector<std::string>& CypherLexer::getRuleNames() const {
return _ruleNames;
}
const std::vector<std::string>& CypherLexer::getModeNames() const {
return _modeNames;
}
const std::vector<std::string>& CypherLexer::getTokenNames() const {
return _tokenNames;
}
dfa::Vocabulary& CypherLexer::getVocabulary() const {
return _vocabulary;
}
const std::vector<uint16_t> CypherLexer::getSerializedATN() const {
return _serializedATN;
}
const atn::ATN& CypherLexer::getATN() const {
return _atn;
}
// Static vars and initialization.
std::vector<dfa::DFA> CypherLexer::_decisionToDFA;
atn::PredictionContextCache CypherLexer::_sharedContextCache;
// We own the ATN which in turn owns the ATN states.
atn::ATN CypherLexer::_atn;
std::vector<uint16_t> CypherLexer::_serializedATN;
std::vector<std::string> CypherLexer::_ruleNames = {
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
"T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16",
"T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24",
"T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32",
"T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40",
"T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "StringLiteral",
"EscapedChar", "HexInteger", "DecimalInteger", "OctalInteger", "HexLetter",
"HexDigit", "Digit", "NonZeroDigit", "NonZeroOctDigit", "OctDigit", "ZeroDigit",
"ExponentDecimalReal", "RegularDecimalReal", "UNION", "ALL", "OPTIONAL",
"MATCH", "UNWIND", "AS", "MERGE", "ON", "CREATE", "SET", "DETACH", "DELETE",
"REMOVE", "WITH", "DISTINCT", "RETURN", "ORDER", "BY", "L_SKIP", "LIMIT",
"ASCENDING", "ASC", "DESCENDING", "DESC", "WHERE", "OR", "XOR", "AND",
"NOT", "IN", "STARTS", "ENDS", "CONTAINS", "IS", "CYPHERNULL", "COUNT",
"FILTER", "EXTRACT", "ANY", "NONE", "SINGLE", "TRUE", "FALSE", "UnescapedSymbolicName",
"IdentifierStart", "IdentifierPart", "EscapedSymbolicName", "SP", "WHITESPACE",
"Comment", "FF", "EscapedSymbolicName_0", "RS", "ID_Continue", "Comment_1",
"StringLiteral_1", "Comment_3", "Comment_2", "GS", "FS", "CR", "Sc", "SPACE",
"TAB", "StringLiteral_0", "LF", "VT", "US", "ID_Start"
};
std::vector<std::string> CypherLexer::_modeNames = {
"DEFAULT_MODE"
};
std::vector<std::string> CypherLexer::_literalNames = {
"", "';'", "','", "'='", "'+='", "'*'", "'('", "')'", "'['", "']'", "':'",
"'|'", "'..'", "'+'", "'-'", "'/'", "'%'", "'^'", "'=~'", "'<>'", "'!='",
"'<'", "'>'", "'<='", "'>='", "'.'", "'{'", "'}'", "'$'", "'⟨'", "'〈'",
"'﹤'", "''", "'⟩'", "'〉'", "'﹥'", "''", "'­'", "''", "''", "''",
"''", "'—'", "'―'", "''", "''", "'﹣'", "''", "", "", "", "", "", "",
"", "", "", "", "", "'0'"
};
std::vector<std::string> CypherLexer::_symbolicNames = {
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "StringLiteral", "EscapedChar",
"HexInteger", "DecimalInteger", "OctalInteger", "HexLetter", "HexDigit",
"Digit", "NonZeroDigit", "NonZeroOctDigit", "OctDigit", "ZeroDigit", "ExponentDecimalReal",
"RegularDecimalReal", "UNION", "ALL", "OPTIONAL", "MATCH", "UNWIND", "AS",
"MERGE", "ON", "CREATE", "SET", "DETACH", "DELETE", "REMOVE", "WITH",
"DISTINCT", "RETURN", "ORDER", "BY", "L_SKIP", "LIMIT", "ASCENDING", "ASC",
"DESCENDING", "DESC", "WHERE", "OR", "XOR", "AND", "NOT", "IN", "STARTS",
"ENDS", "CONTAINS", "IS", "CYPHERNULL", "COUNT", "FILTER", "EXTRACT",
"ANY", "NONE", "SINGLE", "TRUE", "FALSE", "UnescapedSymbolicName", "IdentifierStart",
"IdentifierPart", "EscapedSymbolicName", "SP", "WHITESPACE", "Comment"
};
dfa::Vocabulary CypherLexer::_vocabulary(_literalNames, _symbolicNames);
std::vector<std::string> CypherLexer::_tokenNames;
CypherLexer::Initializer::Initializer() {
// This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there.
for (size_t i = 0; i < _symbolicNames.size(); ++i) {
std::string name = _vocabulary.getLiteralName(i);
if (name.empty()) {
name = _vocabulary.getSymbolicName(i);
}
if (name.empty()) {
_tokenNames.push_back("<INVALID>");
} else {
_tokenNames.push_back(name);
}
}
_serializedATN = {
0x3, 0x430, 0xd6d1, 0x8206, 0xad2d, 0x4417, 0xaef1, 0x8d80, 0xaadd,
0x2, 0x71, 0x35d, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3,
0x4, 0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7,
0x9, 0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa,
0x4, 0xb, 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, 0xe,
0x9, 0xe, 0x4, 0xf, 0x9, 0xf, 0x4, 0x10, 0x9, 0x10, 0x4, 0x11, 0x9,
0x11, 0x4, 0x12, 0x9, 0x12, 0x4, 0x13, 0x9, 0x13, 0x4, 0x14, 0x9, 0x14,
0x4, 0x15, 0x9, 0x15, 0x4, 0x16, 0x9, 0x16, 0x4, 0x17, 0x9, 0x17, 0x4,
0x18, 0x9, 0x18, 0x4, 0x19, 0x9, 0x19, 0x4, 0x1a, 0x9, 0x1a, 0x4, 0x1b,
0x9, 0x1b, 0x4, 0x1c, 0x9, 0x1c, 0x4, 0x1d, 0x9, 0x1d, 0x4, 0x1e, 0x9,
0x1e, 0x4, 0x1f, 0x9, 0x1f, 0x4, 0x20, 0x9, 0x20, 0x4, 0x21, 0x9, 0x21,
0x4, 0x22, 0x9, 0x22, 0x4, 0x23, 0x9, 0x23, 0x4, 0x24, 0x9, 0x24, 0x4,
0x25, 0x9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51, 0x71, 0x71, 0x4, 0x2, 0x43, 0x43, 0x63,
0x63, 0x4, 0x2, 0x4e, 0x4e, 0x6e, 0x6e, 0x4, 0x2, 0x52, 0x52, 0x72,
0x72, 0x4, 0x2, 0x56, 0x56, 0x76, 0x76, 0x4, 0x2, 0x4f, 0x4f, 0x6f,
0x6f, 0x4, 0x2, 0x45, 0x45, 0x65, 0x65, 0x4, 0x2, 0x4a, 0x4a, 0x6a,
0x6a, 0x4, 0x2, 0x59, 0x59, 0x79, 0x79, 0x4, 0x2, 0x46, 0x46, 0x66,
0x66, 0x4, 0x2, 0x55, 0x55, 0x75, 0x75, 0x4, 0x2, 0x54, 0x54, 0x74,
0x74, 0x4, 0x2, 0x49, 0x49, 0x69, 0x69, 0x4, 0x2, 0x58, 0x58, 0x78,
0x78, 0x4, 0x2, 0x44, 0x44, 0x64, 0x64, 0x4, 0x2, 0x5b, 0x5b, 0x7b,
0x7b, 0x4, 0x2, 0x4d, 0x4d, 0x6d, 0x6d, 0x4, 0x2, 0x5a, 0x5a, 0x7a,
0x7a, 0x4, 0x2, 0x48, 0x48, 0x68, 0x68, 0x8, 0x2, 0x61, 0x61, 0x2041,
0x2042, 0x2056, 0x2056, 0xfe35, 0xfe36, 0xfe4f, 0xfe51, 0xff41, 0xff41,
0xa, 0x2, 0xa2, 0xa2, 0x1682, 0x1682, 0x1810, 0x1810, 0x2002, 0x200c,
0x202a, 0x202b, 0x2031, 0x2031, 0x2061, 0x2061, 0x3002, 0x3002, 0x3,
0x2, 0xe, 0xe, 0x4, 0x2, 0x2, 0x61, 0x63, 0x1, 0x3, 0x2, 0x20, 0x20,
0x1af, 0x2, 0x32, 0x3b, 0x43, 0x5c, 0x61, 0x61, 0x63, 0x7c, 0xac, 0xac,
0xb7, 0xb7, 0xb9, 0xb9, 0xbc, 0xbc, 0xc2, 0xd8, 0xda, 0xf8, 0xfa, 0x2c3,
0x2c8, 0x2d3, 0x2e2, 0x2e6, 0x2ee, 0x2ee, 0x2f0, 0x2f0, 0x302, 0x376,
0x378, 0x379, 0x37c, 0x37f, 0x388, 0x38c, 0x38e, 0x38e, 0x390, 0x3a3,
0x3a5, 0x3f7, 0x3f9, 0x483, 0x485, 0x489, 0x48c, 0x529, 0x533, 0x558,
0x55b, 0x55b, 0x563, 0x589, 0x593, 0x5bf, 0x5c1, 0x5c1, 0x5c3, 0x5c4,
0x5c6, 0x5c7, 0x5c9, 0x5c9, 0x5d2, 0x5ec, 0x5f2, 0x5f4, 0x612, 0x61c,
0x622, 0x66b, 0x670, 0x6d5, 0x6d7, 0x6de, 0x6e1, 0x6ea, 0x6ec, 0x6fe,
0x701, 0x701, 0x712, 0x74c, 0x74f, 0x7b3, 0x7c2, 0x7f7, 0x7fc, 0x7fc,
0x802, 0x82f, 0x842, 0x85d, 0x8a2, 0x8a2, 0x8a4, 0x8ae, 0x8e6, 0x900,
0x902, 0x965, 0x968, 0x971, 0x973, 0x979, 0x97b, 0x981, 0x983, 0x985,
0x987, 0x98e, 0x991, 0x992, 0x995, 0x9aa, 0x9ac, 0x9b2, 0x9b4, 0x9b4,
0x9b8, 0x9bb, 0x9be, 0x9c6, 0x9c9, 0x9ca, 0x9cd, 0x9d0, 0x9d9, 0x9d9,
0x9de, 0x9df, 0x9e1, 0x9e5, 0x9e8, 0x9f3, 0xa03, 0xa05, 0xa07, 0xa0c,
0xa11, 0xa12, 0xa15, 0xa2a, 0xa2c, 0xa32, 0xa34, 0xa35, 0xa37, 0xa38,
0xa3a, 0xa3b, 0xa3e, 0xa3e, 0xa40, 0xa44, 0xa49, 0xa4a, 0xa4d, 0xa4f,
0xa53, 0xa53, 0xa5b, 0xa5e, 0xa60, 0xa60, 0xa68, 0xa77, 0xa83, 0xa85,
0xa87, 0xa8f, 0xa91, 0xa93, 0xa95, 0xaaa, 0xaac, 0xab2, 0xab4, 0xab5,
0xab7, 0xabb, 0xabe, 0xac7, 0xac9, 0xacb, 0xacd, 0xacf, 0xad2, 0xad2,
0xae2, 0xae5, 0xae8, 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1, 0xdf4, 0xdf5, 0xe03, 0xe3c, 0xe42, 0xe50, 0xe52, 0xe5b,
0xe83, 0xe84, 0xe86, 0xe86, 0xe89, 0xe8a, 0xe8c, 0xe8c, 0xe8f, 0xe8f,
0xe96, 0xe99, 0xe9b, 0xea1, 0xea3, 0xea5, 0xea7, 0xea7, 0xea9, 0xea9,
0xeac, 0xead, 0xeaf, 0xebb, 0xebd, 0xebf, 0xec2, 0xec6, 0xec8, 0xec8,
0xeca, 0xecf, 0xed2, 0xedb, 0xede, 0xee1, 0xf02, 0xf02, 0xf1a, 0xf1b,
0xf22, 0xf2b, 0xf37, 0xf37, 0xf39, 0xf39, 0xf3b, 0xf3b, 0xf40, 0xf49,
0xf4b, 0xf6e, 0xf73, 0xf86, 0xf88, 0xf99, 0xf9b, 0xfbe, 0xfc8, 0xfc8,
0x1002, 0x104b, 0x1052, 0x109f, 0x10a2, 0x10c7, 0x10c9, 0x10c9, 0x10cf,
0x10cf, 0x10d2, 0x10fc, 0x10fe, 0x124a, 0x124c, 0x124f, 0x1252, 0x1258,
0x125a, 0x125a, 0x125c, 0x125f, 0x1262, 0x128a, 0x128c, 0x128f, 0x1292,
0x12b2, 0x12b4, 0x12b7, 0x12ba, 0x12c0, 0x12c2, 0x12c2, 0x12c4, 0x12c7,
0x12ca, 0x12d8, 0x12da, 0x1312, 0x1314, 0x1317, 0x131a, 0x135c, 0x135f,
0x1361, 0x136b, 0x1373, 0x1382, 0x1391, 0x13a2, 0x13f6, 0x1403, 0x166e,
0x1671, 0x1681, 0x1683, 0x169c, 0x16a2, 0x16ec, 0x16f0, 0x16f2, 0x1702,
0x170e, 0x1710, 0x1716, 0x1722, 0x1736, 0x1742, 0x1755, 0x1762, 0x176e,
0x1770, 0x1772, 0x1774, 0x1775, 0x1782, 0x17d5, 0x17d9, 0x17d9, 0x17de,
0x17df, 0x17e2, 0x17eb, 0x180d, 0x180f, 0x1812, 0x181b, 0x1822, 0x1879,
0x1882, 0x18ac, 0x18b2, 0x18f7, 0x1902, 0x191e, 0x1922, 0x192d, 0x1932,
0x193d, 0x1948, 0x196f, 0x1972, 0x1976, 0x1982, 0x19ad, 0x19b2, 0x19cb,
0x19d2, 0x19dc, 0x1a02, 0x1a1d, 0x1a22, 0x1a60, 0x1a62, 0x1a7e, 0x1a81,
0x1a8b, 0x1a92, 0x1a9b, 0x1aa9, 0x1aa9, 0x1b02, 0x1b4d, 0x1b52, 0x1b5b,
0x1b6d, 0x1b75, 0x1b82, 0x1bf5, 0x1c02, 0x1c39, 0x1c42, 0x1c4b, 0x1c4f,
0x1c7f, 0x1cd2, 0x1cd4, 0x1cd6, 0x1cf8, 0x1d02, 0x1de8, 0x1dfe, 0x1f17,
0x1f1a, 0x1f1f, 0x1f22, 0x1f47, 0x1f4a, 0x1f4f, 0x1f52, 0x1f59, 0x1f5b,
0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f5f, 0x1f61, 0x1f7f, 0x1f82, 0x1fb6,
0x1fb8, 0x1fbe, 0x1fc0, 0x1fc0, 0x1fc4, 0x1fc6, 0x1fc8, 0x1fce, 0x1fd2,
0x1fd5, 0x1fd8, 0x1fdd, 0x1fe2, 0x1fee, 0x1ff4, 0x1ff6, 0x1ff8, 0x1ffe,
0x2041, 0x2042, 0x2056, 0x2056, 0x2073, 0x2073, 0x2081, 0x2081, 0x2092,
0x209e, 0x20d2, 0x20de, 0x20e3, 0x20e3, 0x20e7, 0x20f2, 0x2104, 0x2104,
0x2109, 0x2109, 0x210c, 0x2115, 0x2117, 0x2117, 0x211a, 0x211f, 0x2126,
0x2126, 0x2128, 0x2128, 0x212a, 0x212a, 0x212c, 0x213b, 0x213e, 0x2141,
0x2147, 0x214b, 0x2150, 0x2150, 0x2162, 0x218a, 0x2c02, 0x2c30, 0x2c32,
0x2c60, 0x2c62, 0x2ce6, 0x2ced, 0x2cf5, 0x2d02, 0x2d27, 0x2d29, 0x2d29,
0x2d2f, 0x2d2f, 0x2d32, 0x2d69, 0x2d71, 0x2d71, 0x2d81, 0x2d98, 0x2da2,
0x2da8, 0x2daa, 0x2db0, 0x2db2, 0x2db8, 0x2dba, 0x2dc0, 0x2dc2, 0x2dc8,
0x2dca, 0x2dd0, 0x2dd2, 0x2dd8, 0x2dda, 0x2de0, 0x2de2, 0x2e01, 0x3007,
0x3009, 0x3023, 0x3031, 0x3033, 0x3037, 0x303a, 0x303e, 0x3043, 0x3098,
0x309b, 0x30a1, 0x30a3, 0x30fc, 0x30fe, 0x3101, 0x3107, 0x312f, 0x3133,
0x3190, 0x31a2, 0x31bc, 0x31f2, 0x3201, 0x3402, 0x4db7, 0x4e02, 0x9fce,
0xa002, 0xa48e, 0xa4d2, 0xa4ff, 0xa502, 0xa60e, 0xa612, 0xa62d, 0xa642,
0xa671, 0xa676, 0xa67f, 0xa681, 0xa699, 0xa6a1, 0xa6f3, 0xa719, 0xa721,
0xa724, 0xa78a, 0xa78d, 0xa790, 0xa792, 0xa795, 0xa7a2, 0xa7ac, 0xa7fa,
0xa829, 0xa842, 0xa875, 0xa882, 0xa8c6, 0xa8d2, 0xa8db, 0xa8e2, 0xa8f9,
0xa8fd, 0xa8fd, 0xa902, 0xa92f, 0xa932, 0xa955, 0xa962, 0xa97e, 0xa982,
0xa9c2, 0xa9d1, 0xa9db, 0xaa02, 0xaa38, 0xaa42, 0xaa4f, 0xaa52, 0xaa5b,
0xaa62, 0xaa78, 0xaa7c, 0xaa7d, 0xaa82, 0xaac4, 0xaadd, 0xaadf, 0xaae2,
0xaaf1, 0xaaf4, 0xaaf8, 0xab03, 0xab08, 0xab0b, 0xab10, 0xab13, 0xab18,
0xab22, 0xab28, 0xab2a, 0xab30, 0xabc2, 0xabec, 0xabee, 0xabef, 0xabf2,
0xabfb, 0xac02, 0xd7a5, 0xd7b2, 0xd7c8, 0xd7cd, 0xd7fd, 0xf902, 0xfa6f,
0xfa72, 0xfadb, 0xfb02, 0xfb08, 0xfb15, 0xfb19, 0xfb1f, 0xfb2a, 0xfb2c,
0xfb38, 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3, 0x2c8,
0x2d3, 0x2e2, 0x2e6, 0x2ee, 0x2ee, 0x2f0, 0x2f0, 0x372, 0x376, 0x378,
0x379, 0x37c, 0x37f, 0x388, 0x388, 0x38a, 0x38c, 0x38e, 0x38e, 0x390,
0x3a3, 0x3a5, 0x3f7, 0x3f9, 0x483, 0x48c, 0x529, 0x533, 0x558, 0x55b,
0x55b, 0x563, 0x589, 0x5d2, 0x5ec, 0x5f2, 0x5f4, 0x622, 0x64c, 0x670,
0x671, 0x673, 0x6d5, 0x6d7, 0x6d7, 0x6e7, 0x6e8, 0x6f0, 0x6f1, 0x6fc,
0x6fe, 0x701, 0x701, 0x712, 0x712, 0x714, 0x731, 0x74f, 0x7a7, 0x7b3,
0x7b3, 0x7cc, 0x7ec, 0x7f6, 0x7f7, 0x7fc, 0x7fc, 0x802, 0x817, 0x81c,
0x81c, 0x826, 0x826, 0x82a, 0x82a, 0x842, 0x85a, 0x8a2, 0x8a2, 0x8a4,
0x8ae, 0x906, 0x93b, 0x93f, 0x93f, 0x952, 0x952, 0x95a, 0x963, 0x973,
0x979, 0x97b, 0x981, 0x987, 0x98e, 0x991, 0x992, 0x995, 0x9aa, 0x9ac,
0x9b2, 0x9b4, 0x9b4, 0x9b8, 0x9bb, 0x9bf, 0x9bf, 0x9d0, 0x9d0, 0x9de,
0x9df, 0x9e1, 0x9e3, 0x9f2, 0x9f3, 0xa07, 0xa0c, 0xa11, 0xa12, 0xa15,
0xa2a, 0xa2c, 0xa32, 0xa34, 0xa35, 0xa37, 0xa38, 0xa3a, 0xa3b, 0xa5b,
0xa5e, 0xa60, 0xa60, 0xa74, 0xa76, 0xa87, 0xa8f, 0xa91, 0xa93, 0xa95,
0xaaa, 0xaac, 0xab2, 0xab4, 0xab5, 0xab7, 0xabb, 0xabf, 0xabf, 0xad2,
0xad2, 0xae2, 0xae3, 0xb07, 0xb0e, 0xb11, 0xb12, 0xb15, 0xb2a, 0xb2c,
0xb32, 0xb34, 0xb35, 0xb37, 0xb3b, 0xb3f, 0xb3f, 0xb5e, 0xb5f, 0xb61,
0xb63, 0xb73, 0xb73, 0xb85, 0xb85, 0xb87, 0xb8c, 0xb90, 0xb92, 0xb94,
0xb97, 0xb9b, 0xb9c, 0xb9e, 0xb9e, 0xba0, 0xba1, 0xba5, 0xba6, 0xbaa,
0xbac, 0xbb0, 0xbbb, 0xbd2, 0xbd2, 0xc07, 0xc0e, 0xc10, 0xc12, 0xc14,
0xc2a, 0xc2c, 0xc35, 0xc37, 0xc3b, 0xc3f, 0xc3f, 0xc5a, 0xc5b, 0xc62,
0xc63, 0xc87, 0xc8e, 0xc90, 0xc92, 0xc94, 0xcaa, 0xcac, 0xcb5, 0xcb7,
0xcbb, 0xcbf, 0xcbf, 0xce0, 0xce0, 0xce2, 0xce3, 0xcf3, 0xcf4, 0xd07,
0xd0e, 0xd10, 0xd12, 0xd14, 0xd3c, 0xd3f, 0xd3f, 0xd50, 0xd50, 0xd62,
0xd63, 0xd7c, 0xd81, 0xd87, 0xd98, 0xd9c, 0xdb3, 0xdb5, 0xdbd, 0xdbf,
0xdbf, 0xdc2, 0xdc8, 0xe03, 0xe32, 0xe34, 0xe35, 0xe42, 0xe48, 0xe83,
0xe84, 0xe86, 0xe86, 0xe89, 0xe8a, 0xe8c, 0xe8c, 0xe8f, 0xe8f, 0xe96,
0xe99, 0xe9b, 0xea1, 0xea3, 0xea5, 0xea7, 0xea7, 0xea9, 0xea9, 0xeac,
0xead, 0xeaf, 0xeb2, 0xeb4, 0xeb5, 0xebf, 0xebf, 0xec2, 0xec6, 0xec8,
0xec8, 0xede, 0xee1, 0xf02, 0xf02, 0xf42, 0xf49, 0xf4b, 0xf6e, 0xf8a,
0xf8e, 0x1002, 0x102c, 0x1041, 0x1041, 0x1052, 0x1057, 0x105c, 0x105f,
0x1063, 0x1063, 0x1067, 0x1068, 0x1070, 0x1072, 0x1077, 0x1083, 0x1090,
0x1090, 0x10a2, 0x10c7, 0x10c9, 0x10c9, 0x10cf, 0x10cf, 0x10d2, 0x10fc,
0x10fe, 0x124a, 0x124c, 0x124f, 0x1252, 0x1258, 0x125a, 0x125a, 0x125c,
0x125f, 0x1262, 0x128a, 0x128c, 0x128f, 0x1292, 0x12b2, 0x12b4, 0x12b7,
0x12ba, 0x12c0, 0x12c2, 0x12c2, 0x12c4, 0x12c7, 0x12ca, 0x12d8, 0x12da,
0x1312, 0x1314, 0x1317, 0x131a, 0x135c, 0x1382, 0x1391, 0x13a2, 0x13f6,
0x1403, 0x166e, 0x1671, 0x1681, 0x1683, 0x169c, 0x16a2, 0x16ec, 0x16f0,
0x16f2, 0x1702, 0x170e, 0x1710, 0x1713, 0x1722, 0x1733, 0x1742, 0x1753,
0x1762, 0x176e, 0x1770, 0x1772, 0x1782, 0x17b5, 0x17d9, 0x17d9, 0x17de,
0x17de, 0x1822, 0x1879, 0x1882, 0x18aa, 0x18ac, 0x18ac, 0x18b2, 0x18f7,
0x1902, 0x191e, 0x1952, 0x196f, 0x1972, 0x1976, 0x1982, 0x19ad, 0x19c3,
0x19c9, 0x1a02, 0x1a18, 0x1a22, 0x1a56, 0x1aa9, 0x1aa9, 0x1b07, 0x1b35,
0x1b47, 0x1b4d, 0x1b85, 0x1ba2, 0x1bb0, 0x1bb1, 0x1bbc, 0x1be7, 0x1c02,
0x1c25, 0x1c4f, 0x1c51, 0x1c5c, 0x1c7f, 0x1ceb, 0x1cee, 0x1cf0, 0x1cf3,
0x1cf7, 0x1cf8, 0x1d02, 0x1dc1, 0x1e02, 0x1f17, 0x1f1a, 0x1f1f, 0x1f22,
0x1f47, 0x1f4a, 0x1f4f, 0x1f52, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d,
0x1f5f, 0x1f5f, 0x1f61, 0x1f7f, 0x1f82, 0x1fb6, 0x1fb8, 0x1fbe, 0x1fc0,
0x1fc0, 0x1fc4, 0x1fc6, 0x1fc8, 0x1fce, 0x1fd2, 0x1fd5, 0x1fd8, 0x1fdd,
0x1fe2, 0x1fee, 0x1ff4, 0x1ff6, 0x1ff8, 0x1ffe, 0x2073, 0x2073, 0x2081,
0x2081, 0x2092, 0x209e, 0x2104, 0x2104, 0x2109, 0x2109, 0x210c, 0x2115,
0x2117, 0x2117, 0x211a, 0x211f, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a,
0x212a, 0x212c, 0x213b, 0x213e, 0x2141, 0x2147, 0x214b, 0x2150, 0x2150,
0x2162, 0x218a, 0x2c02, 0x2c30, 0x2c32, 0x2c60, 0x2c62, 0x2ce6, 0x2ced,
0x2cf0, 0x2cf4, 0x2cf5, 0x2d02, 0x2d27, 0x2d29, 0x2d29, 0x2d2f, 0x2d2f,
0x2d32, 0x2d69, 0x2d71, 0x2d71, 0x2d82, 0x2d98, 0x2da2, 0x2da8, 0x2daa,
0x2db0, 0x2db2, 0x2db8, 0x2dba, 0x2dc0, 0x2dc2, 0x2dc8, 0x2dca, 0x2dd0,
0x2dd2, 0x2dd8, 0x2dda, 0x2de0, 0x3007, 0x3009, 0x3023, 0x302b, 0x3033,
0x3037, 0x303a, 0x303e, 0x3043, 0x3098, 0x309d, 0x30a1, 0x30a3, 0x30fc,
0x30fe, 0x3101, 0x3107, 0x312f, 0x3133, 0x3190, 0x31a2, 0x31bc, 0x31f2,
0x3201, 0x3402, 0x4db7, 0x4e02, 0x9fce, 0xa002, 0xa48e, 0xa4d2, 0xa4ff,
0xa502, 0xa60e, 0xa612, 0xa621, 0xa62c, 0xa62d, 0xa642, 0xa670, 0xa681,
0xa699, 0xa6a2, 0xa6f1, 0xa719, 0xa721, 0xa724, 0xa78a, 0xa78d, 0xa790,
0xa792, 0xa795, 0xa7a2, 0xa7ac, 0xa7fa, 0xa803, 0xa805, 0xa807, 0xa809,
0xa80c, 0xa80e, 0xa824, 0xa842, 0xa875, 0xa884, 0xa8b5, 0xa8f4, 0xa8f9,
0xa8fd, 0xa8fd, 0xa90c, 0xa927, 0xa932, 0xa948, 0xa962, 0xa97e, 0xa986,
0xa9b4, 0xa9d1, 0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7, 0xfe66, 0x2, 0x2, 0x14b, 0x40, 0x3, 0x2, 0x2, 0x2, 0x14c,
0x14d, 0x7, 0xff1e, 0x2, 0x2, 0x14d, 0x42, 0x3, 0x2, 0x2, 0x2, 0x14e,
0x14f, 0x7, 0x27eb, 0x2, 0x2, 0x14f, 0x44, 0x3, 0x2, 0x2, 0x2, 0x150,
0x151, 0x7, 0x300b, 0x2, 0x2, 0x151, 0x46, 0x3, 0x2, 0x2, 0x2, 0x152,
0x153, 0x7, 0xfe67, 0x2, 0x2, 0x153, 0x48, 0x3, 0x2, 0x2, 0x2, 0x154,
0x155, 0x7, 0xff20, 0x2, 0x2, 0x155, 0x4a, 0x3, 0x2, 0x2, 0x2, 0x156,
0x157, 0x7, 0xaf, 0x2, 0x2, 0x157, 0x4c, 0x3, 0x2, 0x2, 0x2, 0x158,
0x159, 0x7, 0x2012, 0x2, 0x2, 0x159, 0x4e, 0x3, 0x2, 0x2, 0x2, 0x15a,
0x15b, 0x7, 0x2013, 0x2, 0x2, 0x15b, 0x50, 0x3, 0x2, 0x2, 0x2, 0x15c,
0x15d, 0x7, 0x2014, 0x2, 0x2, 0x15d, 0x52, 0x3, 0x2, 0x2, 0x2, 0x15e,
0x15f, 0x7, 0x2015, 0x2, 0x2, 0x15f, 0x54, 0x3, 0x2, 0x2, 0x2, 0x160,
0x161, 0x7, 0x2016, 0x2, 0x2, 0x161, 0x56, 0x3, 0x2, 0x2, 0x2, 0x162,
0x163, 0x7, 0x2017, 0x2, 0x2, 0x163, 0x58, 0x3, 0x2, 0x2, 0x2, 0x164,
0x165, 0x7, 0x2214, 0x2, 0x2, 0x165, 0x5a, 0x3, 0x2, 0x2, 0x2, 0x166,
0x167, 0x7, 0xfe5a, 0x2, 0x2, 0x167, 0x5c, 0x3, 0x2, 0x2, 0x2, 0x168,
0x169, 0x7, 0xfe65, 0x2, 0x2, 0x169, 0x5e, 0x3, 0x2, 0x2, 0x2, 0x16a,
0x16b, 0x7, 0xff0f, 0x2, 0x2, 0x16b, 0x60, 0x3, 0x2, 0x2, 0x2, 0x16c,
0x171, 0x7, 0x24, 0x2, 0x2, 0x16d, 0x170, 0x5, 0xfd, 0x7f, 0x2, 0x16e,
0x170, 0x5, 0x63, 0x32, 0x2, 0x16f, 0x16d, 0x3, 0x2, 0x2, 0x2, 0x16f,
0x16e, 0x3, 0x2, 0x2, 0x2, 0x170, 0x173, 0x3, 0x2, 0x2, 0x2, 0x171,
0x16f, 0x3, 0x2, 0x2, 0x2, 0x171, 0x172, 0x3, 0x2, 0x2, 0x2, 0x172,
0x174, 0x3, 0x2, 0x2, 0x2, 0x173, 0x171, 0x3, 0x2, 0x2, 0x2, 0x174,
0x17f, 0x7, 0x24, 0x2, 0x2, 0x175, 0x17a, 0x7, 0x29, 0x2, 0x2, 0x176,
0x179, 0x5, 0xeb, 0x76, 0x2, 0x177, 0x179, 0x5, 0x63, 0x32, 0x2, 0x178,
0x176, 0x3, 0x2, 0x2, 0x2, 0x178, 0x177, 0x3, 0x2, 0x2, 0x2, 0x179,
0x17c, 0x3, 0x2, 0x2, 0x2, 0x17a, 0x178, 0x3, 0x2, 0x2, 0x2, 0x17a,
0x17b, 0x3, 0x2, 0x2, 0x2, 0x17b, 0x17d, 0x3, 0x2, 0x2, 0x2, 0x17c,
0x17a, 0x3, 0x2, 0x2, 0x2, 0x17d, 0x17f, 0x7, 0x29, 0x2, 0x2, 0x17e,
0x16c, 0x3, 0x2, 0x2, 0x2, 0x17e, 0x175, 0x3, 0x2, 0x2, 0x2, 0x17f,
0x62, 0x3, 0x2, 0x2, 0x2, 0x180, 0x192, 0x7, 0x5e, 0x2, 0x2, 0x181,
0x193, 0x9, 0x2, 0x2, 0x2, 0x182, 0x183, 0x9, 0x3, 0x2, 0x2, 0x183,
0x184, 0x5, 0x6d, 0x37, 0x2, 0x184, 0x185, 0x5, 0x6d, 0x37, 0x2, 0x185,
0x186, 0x5, 0x6d, 0x37, 0x2, 0x186, 0x187, 0x5, 0x6d, 0x37, 0x2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0x2, 0x2, 0x20e, 0x20f, 0x9, 0x7, 0x2, 0x2,
0x20f, 0x210, 0x9, 0x6, 0x2, 0x2, 0x210, 0x211, 0x9, 0x11, 0x2, 0x2,
0x211, 0x86, 0x3, 0x2, 0x2, 0x2, 0x212, 0x213, 0x9, 0x9, 0x2, 0x2, 0x213,
0x214, 0x9, 0x12, 0x2, 0x2, 0x214, 0x88, 0x3, 0x2, 0x2, 0x2, 0x215,
0x216, 0x9, 0xd, 0x2, 0x2, 0x216, 0x217, 0x9, 0x5, 0x2, 0x2, 0x217,
0x218, 0x9, 0x13, 0x2, 0x2, 0x218, 0x219, 0x9, 0x14, 0x2, 0x2, 0x219,
0x21a, 0x9, 0x5, 0x2, 0x2, 0x21a, 0x8a, 0x3, 0x2, 0x2, 0x2, 0x21b, 0x21c,
0x9, 0x8, 0x2, 0x2, 0x21c, 0x21d, 0x9, 0x6, 0x2, 0x2, 0x21d, 0x8c, 0x3,
0x2, 0x2, 0x2, 0x21e, 0x21f, 0x9, 0xe, 0x2, 0x2, 0x21f, 0x220, 0x9,
0x13, 0x2, 0x2, 0x220, 0x221, 0x9, 0x5, 0x2, 0x2, 0x221, 0x222, 0x9,
0x9, 0x2, 0x2, 0x222, 0x223, 0x9, 0xc, 0x2, 0x2, 0x223, 0x224, 0x9,
0x5, 0x2, 0x2, 0x224, 0x8e, 0x3, 0x2, 0x2, 0x2, 0x225, 0x226, 0x9, 0x12,
0x2, 0x2, 0x226, 0x227, 0x9, 0x5, 0x2, 0x2, 0x227, 0x228, 0x9, 0xc,
0x2, 0x2, 0x228, 0x90, 0x3, 0x2, 0x2, 0x2, 0x229, 0x22a, 0x9, 0x11,
0x2, 0x2, 0x22a, 0x22b, 0x9, 0x5, 0x2, 0x2, 0x22b, 0x22c, 0x9, 0xc,
0x2, 0x2, 0x22c, 0x22d, 0x9, 0x9, 0x2, 0x2, 0x22d, 0x22e, 0x9, 0xe,
0x2, 0x2, 0x22e, 0x22f, 0x9, 0xf, 0x2, 0x2, 0x22f, 0x92, 0x3, 0x2, 0x2,
0x2, 0x230, 0x231, 0x9, 0x11, 0x2, 0x2, 0x231, 0x232, 0x9, 0x5, 0x2,
0x2, 0x232, 0x233, 0x9, 0xa, 0x2, 0x2, 0x233, 0x234, 0x9, 0x5, 0x2,
0x2, 0x234, 0x235, 0x9, 0xc, 0x2, 0x2, 0x235, 0x236, 0x9, 0x5, 0x2,
0x2, 0x236, 0x94, 0x3, 0x2, 0x2, 0x2, 0x237, 0x238, 0x9, 0x13, 0x2,
0x2, 0x238, 0x239, 0x9, 0x5, 0x2, 0x2, 0x239, 0x23a, 0x9, 0xd, 0x2,
0x2, 0x23a, 0x23b, 0x9, 0x8, 0x2, 0x2, 0x23b, 0x23c, 0x9, 0x15, 0x2,
0x2, 0x23c, 0x23d, 0x9, 0x5, 0x2, 0x2, 0x23d, 0x96, 0x3, 0x2, 0x2, 0x2,
0x23e, 0x23f, 0x9, 0x10, 0x2, 0x2, 0x23f, 0x240, 0x9, 0x7, 0x2, 0x2,
0x240, 0x241, 0x9, 0xc, 0x2, 0x2, 0x241, 0x242, 0x9, 0xf, 0x2, 0x2,
0x242, 0x98, 0x3, 0x2, 0x2, 0x2, 0x243, 0x244, 0x9, 0x11, 0x2, 0x2,
0x244, 0x245, 0x9, 0x7, 0x2, 0x2, 0x245, 0x246, 0x9, 0x12, 0x2, 0x2,
0x246, 0x247, 0x9, 0xc, 0x2, 0x2, 0x247, 0x248, 0x9, 0x7, 0x2, 0x2,
0x248, 0x249, 0x9, 0x6, 0x2, 0x2, 0x249, 0x24a, 0x9, 0xe, 0x2, 0x2,
0x24a, 0x24b, 0x9, 0xc, 0x2, 0x2, 0x24b, 0x9a, 0x3, 0x2, 0x2, 0x2, 0x24c,
0x24d, 0x9, 0x13, 0x2, 0x2, 0x24d, 0x24e, 0x9, 0x5, 0x2, 0x2, 0x24e,
0x24f, 0x9, 0xc, 0x2, 0x2, 0x24f, 0x250, 0x9, 0x3, 0x2, 0x2, 0x250,
0x251, 0x9, 0x13, 0x2, 0x2, 0x251, 0x252, 0x9, 0x6, 0x2, 0x2, 0x252,
0x9c, 0x3, 0x2, 0x2, 0x2, 0x253, 0x254, 0x9, 0x8, 0x2, 0x2, 0x254, 0x255,
0x9, 0x13, 0x2, 0x2, 0x255, 0x256, 0x9, 0x11, 0x2, 0x2, 0x256, 0x257,
0x9, 0x5, 0x2, 0x2, 0x257, 0x258, 0x9, 0x13, 0x2, 0x2, 0x258, 0x9e,
0x3, 0x2, 0x2, 0x2, 0x259, 0x25a, 0x9, 0x16, 0x2, 0x2, 0x25a, 0x25b,
0x9, 0x17, 0x2, 0x2, 0x25b, 0xa0, 0x3, 0x2, 0x2, 0x2, 0x25c, 0x25d,
0x9, 0x12, 0x2, 0x2, 0x25d, 0x25e, 0x9, 0x18, 0x2, 0x2, 0x25e, 0x25f,
0x9, 0x7, 0x2, 0x2, 0x25f, 0x260, 0x9, 0xb, 0x2, 0x2, 0x260, 0xa2, 0x3,
0x2, 0x2, 0x2, 0x261, 0x262, 0x9, 0xa, 0x2, 0x2, 0x262, 0x263, 0x9,
0x7, 0x2, 0x2, 0x263, 0x264, 0x9, 0xd, 0x2, 0x2, 0x264, 0x265, 0x9,
0x7, 0x2, 0x2, 0x265, 0x266, 0x9, 0xc, 0x2, 0x2, 0x266, 0xa4, 0x3, 0x2,
0x2, 0x2, 0x267, 0x268, 0x9, 0x9, 0x2, 0x2, 0x268, 0x269, 0x9, 0x12,
0x2, 0x2, 0x269, 0x26a, 0x9, 0xe, 0x2, 0x2, 0x26a, 0x26b, 0x9, 0x5,
0x2, 0x2, 0x26b, 0x26c, 0x9, 0x6, 0x2, 0x2, 0x26c, 0x26d, 0x9, 0x11,
0x2, 0x2, 0x26d, 0x26e, 0x9, 0x7, 0x2, 0x2, 0x26e, 0x26f, 0x9, 0x6,
0x2, 0x2, 0x26f, 0x270, 0x9, 0x14, 0x2, 0x2, 0x270, 0xa6, 0x3, 0x2,
0x2, 0x2, 0x271, 0x272, 0x9, 0x9, 0x2, 0x2, 0x272, 0x273, 0x9, 0x12,
0x2, 0x2, 0x273, 0x274, 0x9, 0xe, 0x2, 0x2, 0x274, 0xa8, 0x3, 0x2, 0x2,
0x2, 0x275, 0x276, 0x9, 0x11, 0x2, 0x2, 0x276, 0x277, 0x9, 0x5, 0x2,
0x2, 0x277, 0x278, 0x9, 0x12, 0x2, 0x2, 0x278, 0x279, 0x9, 0xe, 0x2,
0x2, 0x279, 0x27a, 0x9, 0x5, 0x2, 0x2, 0x27a, 0x27b, 0x9, 0x6, 0x2,
0x2, 0x27b, 0x27c, 0x9, 0x11, 0x2, 0x2, 0x27c, 0x27d, 0x9, 0x7, 0x2,
0x2, 0x27d, 0x27e, 0x9, 0x6, 0x2, 0x2, 0x27e, 0x27f, 0x9, 0x14, 0x2,
0x2, 0x27f, 0xaa, 0x3, 0x2, 0x2, 0x2, 0x280, 0x281, 0x9, 0x11, 0x2,
0x2, 0x281, 0x282, 0x9, 0x5, 0x2, 0x2, 0x282, 0x283, 0x9, 0x12, 0x2,
0x2, 0x283, 0x284, 0x9, 0xe, 0x2, 0x2, 0x284, 0xac, 0x3, 0x2, 0x2, 0x2,
0x285, 0x286, 0x9, 0x10, 0x2, 0x2, 0x286, 0x287, 0x9, 0xf, 0x2, 0x2,
0x287, 0x288, 0x9, 0x5, 0x2, 0x2, 0x288, 0x289, 0x9, 0x13, 0x2, 0x2,
0x289, 0x28a, 0x9, 0x5, 0x2, 0x2, 0x28a, 0xae, 0x3, 0x2, 0x2, 0x2, 0x28b,
0x28c, 0x9, 0x8, 0x2, 0x2, 0x28c, 0x28d, 0x9, 0x13, 0x2, 0x2, 0x28d,
0xb0, 0x3, 0x2, 0x2, 0x2, 0x28e, 0x28f, 0x9, 0x19, 0x2, 0x2, 0x28f,
0x290, 0x9, 0x8, 0x2, 0x2, 0x290, 0x291, 0x9, 0x13, 0x2, 0x2, 0x291,
0xb2, 0x3, 0x2, 0x2, 0x2, 0x292, 0x293, 0x9, 0x9, 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, 0x308, 0x309, 0x3, 0x2, 0x2, 0x2, 0x309,
0xdc, 0x3, 0x2, 0x2, 0x2, 0x30a, 0x317, 0x5, 0xf9, 0x7d, 0x2, 0x30b,
0x317, 0x5, 0xfb, 0x7e, 0x2, 0x30c, 0x317, 0x5, 0xff, 0x80, 0x2, 0x30d,
0x317, 0x5, 0x101, 0x81, 0x2, 0x30e, 0x317, 0x5, 0xe1, 0x71, 0x2, 0x30f,
0x317, 0x5, 0xf5, 0x7b, 0x2, 0x310, 0x317, 0x5, 0xf3, 0x7a, 0x2, 0x311,
0x317, 0x5, 0xf1, 0x79, 0x2, 0x312, 0x317, 0x5, 0xe5, 0x73, 0x2, 0x313,
0x317, 0x5, 0x103, 0x82, 0x2, 0x314, 0x317, 0x9, 0x1c, 0x2, 0x2, 0x315,
0x317, 0x5, 0xdf, 0x70, 0x2, 0x316, 0x30a, 0x3, 0x2, 0x2, 0x2, 0x316,
0x30b, 0x3, 0x2, 0x2, 0x2, 0x316, 0x30c, 0x3, 0x2, 0x2, 0x2, 0x316,
0x30d, 0x3, 0x2, 0x2, 0x2, 0x316, 0x30e, 0x3, 0x2, 0x2, 0x2, 0x316,
0x30f, 0x3, 0x2, 0x2, 0x2, 0x316, 0x310, 0x3, 0x2, 0x2, 0x2, 0x316,
0x311, 0x3, 0x2, 0x2, 0x2, 0x316, 0x312, 0x3, 0x2, 0x2, 0x2, 0x316,
0x313, 0x3, 0x2, 0x2, 0x2, 0x316, 0x314, 0x3, 0x2, 0x2, 0x2, 0x316,
0x315, 0x3, 0x2, 0x2, 0x2, 0x317, 0xde, 0x3, 0x2, 0x2, 0x2, 0x318, 0x319,
0x7, 0x31, 0x2, 0x2, 0x319, 0x31a, 0x7, 0x2c, 0x2, 0x2, 0x31a, 0x320,
0x3, 0x2, 0x2, 0x2, 0x31b, 0x31f, 0x5, 0xe9, 0x75, 0x2, 0x31c, 0x31d,
0x7, 0x2c, 0x2, 0x2, 0x31d, 0x31f, 0x5, 0xef, 0x78, 0x2, 0x31e, 0x31b,
0x3, 0x2, 0x2, 0x2, 0x31e, 0x31c, 0x3, 0x2, 0x2, 0x2, 0x31f, 0x322,
0x3, 0x2, 0x2, 0x2, 0x320, 0x31e, 0x3, 0x2, 0x2, 0x2, 0x320, 0x321,
0x3, 0x2, 0x2, 0x2, 0x321, 0x323, 0x3, 0x2, 0x2, 0x2, 0x322, 0x320,
0x3, 0x2, 0x2, 0x2, 0x323, 0x324, 0x7, 0x2c, 0x2, 0x2, 0x324, 0x336,
0x7, 0x31, 0x2, 0x2, 0x325, 0x326, 0x7, 0x31, 0x2, 0x2, 0x326, 0x327,
0x7, 0x31, 0x2, 0x2, 0x327, 0x32b, 0x3, 0x2, 0x2, 0x2, 0x328, 0x32a,
0x5, 0xed, 0x77, 0x2, 0x329, 0x328, 0x3, 0x2, 0x2, 0x2, 0x32a, 0x32d,
0x3, 0x2, 0x2, 0x2, 0x32b, 0x329, 0x3, 0x2, 0x2, 0x2, 0x32b, 0x32c,
0x3, 0x2, 0x2, 0x2, 0x32c, 0x32f, 0x3, 0x2, 0x2, 0x2, 0x32d, 0x32b,
0x3, 0x2, 0x2, 0x2, 0x32e, 0x330, 0x5, 0xf5, 0x7b, 0x2, 0x32f, 0x32e,
0x3, 0x2, 0x2, 0x2, 0x32f, 0x330, 0x3, 0x2, 0x2, 0x2, 0x330, 0x333,
0x3, 0x2, 0x2, 0x2, 0x331, 0x334, 0x5, 0xff, 0x80, 0x2, 0x332, 0x334,
0x7, 0x2, 0x2, 0x3, 0x333, 0x331, 0x3, 0x2, 0x2, 0x2, 0x333, 0x332,
0x3, 0x2, 0x2, 0x2, 0x334, 0x336, 0x3, 0x2, 0x2, 0x2, 0x335, 0x318,
0x3, 0x2, 0x2, 0x2, 0x335, 0x325, 0x3, 0x2, 0x2, 0x2, 0x336, 0xe0, 0x3,
0x2, 0x2, 0x2, 0x337, 0x338, 0x9, 0x1d, 0x2, 0x2, 0x338, 0xe2, 0x3,
0x2, 0x2, 0x2, 0x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 0x35a, 0x104, 0x3,
0x2, 0x2, 0x2, 0x35b, 0x35c, 0x9, 0x2f, 0x2, 0x2, 0x35c, 0x106, 0x3,
0x2, 0x2, 0x2, 0x29, 0x2, 0x16f, 0x171, 0x178, 0x17a, 0x17e, 0x192,
0x19a, 0x1a1, 0x1a4, 0x1aa, 0x1ad, 0x1b1, 0x1b5, 0x1b9, 0x1bf, 0x1c6,
0x1cb, 0x1d1, 0x1d7, 0x1d9, 0x1dc, 0x1df, 0x1e4, 0x1e9, 0x1f0, 0x2ee,
0x2f3, 0x2f7, 0x2fd, 0x303, 0x308, 0x316, 0x31e, 0x320, 0x32b, 0x32f,
0x333, 0x335, 0x2,
};
atn::ATNDeserializer deserializer;
_atn = deserializer.deserialize(_serializedATN);
size_t count = _atn.getNumberOfDecisions();
_decisionToDFA.reserve(count);
for (size_t i = 0; i < count; i++) {
_decisionToDFA.emplace_back(_atn.getDecisionState(i), i);
}
}
CypherLexer::Initializer CypherLexer::_init;

View File

@ -1,75 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#pragma once
#include "antlr4-runtime.h"
namespace antlropencypher {
class CypherLexer : public antlr4::Lexer {
public:
enum {
T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7,
T__7 = 8, T__8 = 9, T__9 = 10, T__10 = 11, T__11 = 12, T__12 = 13, T__13 = 14,
T__14 = 15, T__15 = 16, T__16 = 17, T__17 = 18, T__18 = 19, T__19 = 20,
T__20 = 21, T__21 = 22, T__22 = 23, T__23 = 24, T__24 = 25, T__25 = 26,
T__26 = 27, T__27 = 28, T__28 = 29, T__29 = 30, T__30 = 31, T__31 = 32,
T__32 = 33, T__33 = 34, T__34 = 35, T__35 = 36, T__36 = 37, T__37 = 38,
T__38 = 39, T__39 = 40, T__40 = 41, T__41 = 42, T__42 = 43, T__43 = 44,
T__44 = 45, T__45 = 46, T__46 = 47, StringLiteral = 48, EscapedChar = 49,
HexInteger = 50, DecimalInteger = 51, OctalInteger = 52, HexLetter = 53,
HexDigit = 54, Digit = 55, NonZeroDigit = 56, NonZeroOctDigit = 57,
OctDigit = 58, ZeroDigit = 59, ExponentDecimalReal = 60, RegularDecimalReal = 61,
UNION = 62, ALL = 63, OPTIONAL = 64, MATCH = 65, UNWIND = 66, AS = 67,
MERGE = 68, ON = 69, CREATE = 70, SET = 71, DETACH = 72, DELETE = 73,
REMOVE = 74, WITH = 75, DISTINCT = 76, RETURN = 77, ORDER = 78, BY = 79,
L_SKIP = 80, LIMIT = 81, ASCENDING = 82, ASC = 83, DESCENDING = 84,
DESC = 85, WHERE = 86, OR = 87, XOR = 88, AND = 89, NOT = 90, IN = 91,
STARTS = 92, ENDS = 93, CONTAINS = 94, IS = 95, CYPHERNULL = 96, COUNT = 97,
FILTER = 98, EXTRACT = 99, ANY = 100, NONE = 101, SINGLE = 102, TRUE = 103,
FALSE = 104, UnescapedSymbolicName = 105, IdentifierStart = 106, IdentifierPart = 107,
EscapedSymbolicName = 108, SP = 109, WHITESPACE = 110, Comment = 111
};
CypherLexer(antlr4::CharStream *input);
~CypherLexer();
virtual std::string getGrammarFileName() const override;
virtual const std::vector<std::string>& getRuleNames() const override;
virtual const std::vector<std::string>& getModeNames() const override;
virtual const std::vector<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
virtual antlr4::dfa::Vocabulary& getVocabulary() const override;
virtual const std::vector<uint16_t> getSerializedATN() const override;
virtual const antlr4::atn::ATN& getATN() const override;
private:
static std::vector<antlr4::dfa::DFA> _decisionToDFA;
static antlr4::atn::PredictionContextCache _sharedContextCache;
static std::vector<std::string> _ruleNames;
static std::vector<std::string> _tokenNames;
static std::vector<std::string> _modeNames;
static std::vector<std::string> _literalNames;
static std::vector<std::string> _symbolicNames;
static antlr4::dfa::Vocabulary _vocabulary;
static antlr4::atn::ATN _atn;
static std::vector<uint16_t> _serializedATN;
// Individual action functions triggered by action() above.
// Individual semantic predicate functions triggered by sempred() above.
struct Initializer {
Initializer();
};
static Initializer _init;
};
} // namespace antlropencypher

View File

@ -1,159 +0,0 @@
T__0=1
T__1=2
T__2=3
T__3=4
T__4=5
T__5=6
T__6=7
T__7=8
T__8=9
T__9=10
T__10=11
T__11=12
T__12=13
T__13=14
T__14=15
T__15=16
T__16=17
T__17=18
T__18=19
T__19=20
T__20=21
T__21=22
T__22=23
T__23=24
T__24=25
T__25=26
T__26=27
T__27=28
T__28=29
T__29=30
T__30=31
T__31=32
T__32=33
T__33=34
T__34=35
T__35=36
T__36=37
T__37=38
T__38=39
T__39=40
T__40=41
T__41=42
T__42=43
T__43=44
T__44=45
T__45=46
T__46=47
StringLiteral=48
EscapedChar=49
HexInteger=50
DecimalInteger=51
OctalInteger=52
HexLetter=53
HexDigit=54
Digit=55
NonZeroDigit=56
NonZeroOctDigit=57
OctDigit=58
ZeroDigit=59
ExponentDecimalReal=60
RegularDecimalReal=61
UNION=62
ALL=63
OPTIONAL=64
MATCH=65
UNWIND=66
AS=67
MERGE=68
ON=69
CREATE=70
SET=71
DETACH=72
DELETE=73
REMOVE=74
WITH=75
DISTINCT=76
RETURN=77
ORDER=78
BY=79
L_SKIP=80
LIMIT=81
ASCENDING=82
ASC=83
DESCENDING=84
DESC=85
WHERE=86
OR=87
XOR=88
AND=89
NOT=90
IN=91
STARTS=92
ENDS=93
CONTAINS=94
IS=95
CYPHERNULL=96
COUNT=97
FILTER=98
EXTRACT=99
ANY=100
NONE=101
SINGLE=102
TRUE=103
FALSE=104
UnescapedSymbolicName=105
IdentifierStart=106
IdentifierPart=107
EscapedSymbolicName=108
SP=109
WHITESPACE=110
Comment=111
';'=1
','=2
'='=3
'+='=4
'*'=5
'('=6
')'=7
'['=8
']'=9
':'=10
'|'=11
'..'=12
'+'=13
'-'=14
'/'=15
'%'=16
'^'=17
'=~'=18
'<>'=19
'!='=20
'<'=21
'>'=22
'<='=23
'>='=24
'.'=25
'{'=26
'}'=27
'$'=28
'⟨'=29
'〈'=30
'﹤'=31
''=32
'⟩'=33
'〉'=34
'﹥'=35
''=36
'­'=37
''=38
''=39
''=40
''=41
'—'=42
'―'=43
''=44
''=45
'﹣'=46
''=47
'0'=59

View File

@ -1,9 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#include "CypherListener.h"
using namespace antlropencypher;

View File

@ -1,262 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#pragma once
#include "antlr4-runtime.h"
#include "CypherParser.h"
namespace antlropencypher {
/**
* This interface defines an abstract listener for a parse tree produced by CypherParser.
*/
class CypherListener : public antlr4::tree::ParseTreeListener {
public:
virtual void enterCypher(CypherParser::CypherContext *ctx) = 0;
virtual void exitCypher(CypherParser::CypherContext *ctx) = 0;
virtual void enterStatement(CypherParser::StatementContext *ctx) = 0;
virtual void exitStatement(CypherParser::StatementContext *ctx) = 0;
virtual void enterQuery(CypherParser::QueryContext *ctx) = 0;
virtual void exitQuery(CypherParser::QueryContext *ctx) = 0;
virtual void enterRegularQuery(CypherParser::RegularQueryContext *ctx) = 0;
virtual void exitRegularQuery(CypherParser::RegularQueryContext *ctx) = 0;
virtual void enterSingleQuery(CypherParser::SingleQueryContext *ctx) = 0;
virtual void exitSingleQuery(CypherParser::SingleQueryContext *ctx) = 0;
virtual void enterCypherUnion(CypherParser::CypherUnionContext *ctx) = 0;
virtual void exitCypherUnion(CypherParser::CypherUnionContext *ctx) = 0;
virtual void enterClause(CypherParser::ClauseContext *ctx) = 0;
virtual void exitClause(CypherParser::ClauseContext *ctx) = 0;
virtual void enterCypherMatch(CypherParser::CypherMatchContext *ctx) = 0;
virtual void exitCypherMatch(CypherParser::CypherMatchContext *ctx) = 0;
virtual void enterUnwind(CypherParser::UnwindContext *ctx) = 0;
virtual void exitUnwind(CypherParser::UnwindContext *ctx) = 0;
virtual void enterMerge(CypherParser::MergeContext *ctx) = 0;
virtual void exitMerge(CypherParser::MergeContext *ctx) = 0;
virtual void enterMergeAction(CypherParser::MergeActionContext *ctx) = 0;
virtual void exitMergeAction(CypherParser::MergeActionContext *ctx) = 0;
virtual void enterCreate(CypherParser::CreateContext *ctx) = 0;
virtual void exitCreate(CypherParser::CreateContext *ctx) = 0;
virtual void enterSet(CypherParser::SetContext *ctx) = 0;
virtual void exitSet(CypherParser::SetContext *ctx) = 0;
virtual void enterSetItem(CypherParser::SetItemContext *ctx) = 0;
virtual void exitSetItem(CypherParser::SetItemContext *ctx) = 0;
virtual void enterCypherDelete(CypherParser::CypherDeleteContext *ctx) = 0;
virtual void exitCypherDelete(CypherParser::CypherDeleteContext *ctx) = 0;
virtual void enterRemove(CypherParser::RemoveContext *ctx) = 0;
virtual void exitRemove(CypherParser::RemoveContext *ctx) = 0;
virtual void enterRemoveItem(CypherParser::RemoveItemContext *ctx) = 0;
virtual void exitRemoveItem(CypherParser::RemoveItemContext *ctx) = 0;
virtual void enterWith(CypherParser::WithContext *ctx) = 0;
virtual void exitWith(CypherParser::WithContext *ctx) = 0;
virtual void enterCypherReturn(CypherParser::CypherReturnContext *ctx) = 0;
virtual void exitCypherReturn(CypherParser::CypherReturnContext *ctx) = 0;
virtual void enterReturnBody(CypherParser::ReturnBodyContext *ctx) = 0;
virtual void exitReturnBody(CypherParser::ReturnBodyContext *ctx) = 0;
virtual void enterReturnItems(CypherParser::ReturnItemsContext *ctx) = 0;
virtual void exitReturnItems(CypherParser::ReturnItemsContext *ctx) = 0;
virtual void enterReturnItem(CypherParser::ReturnItemContext *ctx) = 0;
virtual void exitReturnItem(CypherParser::ReturnItemContext *ctx) = 0;
virtual void enterOrder(CypherParser::OrderContext *ctx) = 0;
virtual void exitOrder(CypherParser::OrderContext *ctx) = 0;
virtual void enterSkip(CypherParser::SkipContext *ctx) = 0;
virtual void exitSkip(CypherParser::SkipContext *ctx) = 0;
virtual void enterLimit(CypherParser::LimitContext *ctx) = 0;
virtual void exitLimit(CypherParser::LimitContext *ctx) = 0;
virtual void enterSortItem(CypherParser::SortItemContext *ctx) = 0;
virtual void exitSortItem(CypherParser::SortItemContext *ctx) = 0;
virtual void enterWhere(CypherParser::WhereContext *ctx) = 0;
virtual void exitWhere(CypherParser::WhereContext *ctx) = 0;
virtual void enterPattern(CypherParser::PatternContext *ctx) = 0;
virtual void exitPattern(CypherParser::PatternContext *ctx) = 0;
virtual void enterPatternPart(CypherParser::PatternPartContext *ctx) = 0;
virtual void exitPatternPart(CypherParser::PatternPartContext *ctx) = 0;
virtual void enterAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *ctx) = 0;
virtual void exitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *ctx) = 0;
virtual void enterPatternElement(CypherParser::PatternElementContext *ctx) = 0;
virtual void exitPatternElement(CypherParser::PatternElementContext *ctx) = 0;
virtual void enterNodePattern(CypherParser::NodePatternContext *ctx) = 0;
virtual void exitNodePattern(CypherParser::NodePatternContext *ctx) = 0;
virtual void enterPatternElementChain(CypherParser::PatternElementChainContext *ctx) = 0;
virtual void exitPatternElementChain(CypherParser::PatternElementChainContext *ctx) = 0;
virtual void enterRelationshipPattern(CypherParser::RelationshipPatternContext *ctx) = 0;
virtual void exitRelationshipPattern(CypherParser::RelationshipPatternContext *ctx) = 0;
virtual void enterRelationshipDetail(CypherParser::RelationshipDetailContext *ctx) = 0;
virtual void exitRelationshipDetail(CypherParser::RelationshipDetailContext *ctx) = 0;
virtual void enterProperties(CypherParser::PropertiesContext *ctx) = 0;
virtual void exitProperties(CypherParser::PropertiesContext *ctx) = 0;
virtual void enterRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) = 0;
virtual void exitRelationshipTypes(CypherParser::RelationshipTypesContext *ctx) = 0;
virtual void enterNodeLabels(CypherParser::NodeLabelsContext *ctx) = 0;
virtual void exitNodeLabels(CypherParser::NodeLabelsContext *ctx) = 0;
virtual void enterNodeLabel(CypherParser::NodeLabelContext *ctx) = 0;
virtual void exitNodeLabel(CypherParser::NodeLabelContext *ctx) = 0;
virtual void enterRangeLiteral(CypherParser::RangeLiteralContext *ctx) = 0;
virtual void exitRangeLiteral(CypherParser::RangeLiteralContext *ctx) = 0;
virtual void enterLabelName(CypherParser::LabelNameContext *ctx) = 0;
virtual void exitLabelName(CypherParser::LabelNameContext *ctx) = 0;
virtual void enterRelTypeName(CypherParser::RelTypeNameContext *ctx) = 0;
virtual void exitRelTypeName(CypherParser::RelTypeNameContext *ctx) = 0;
virtual void enterExpression(CypherParser::ExpressionContext *ctx) = 0;
virtual void exitExpression(CypherParser::ExpressionContext *ctx) = 0;
virtual void enterExpression12(CypherParser::Expression12Context *ctx) = 0;
virtual void exitExpression12(CypherParser::Expression12Context *ctx) = 0;
virtual void enterExpression11(CypherParser::Expression11Context *ctx) = 0;
virtual void exitExpression11(CypherParser::Expression11Context *ctx) = 0;
virtual void enterExpression10(CypherParser::Expression10Context *ctx) = 0;
virtual void exitExpression10(CypherParser::Expression10Context *ctx) = 0;
virtual void enterExpression9(CypherParser::Expression9Context *ctx) = 0;
virtual void exitExpression9(CypherParser::Expression9Context *ctx) = 0;
virtual void enterExpression8(CypherParser::Expression8Context *ctx) = 0;
virtual void exitExpression8(CypherParser::Expression8Context *ctx) = 0;
virtual void enterExpression7(CypherParser::Expression7Context *ctx) = 0;
virtual void exitExpression7(CypherParser::Expression7Context *ctx) = 0;
virtual void enterExpression6(CypherParser::Expression6Context *ctx) = 0;
virtual void exitExpression6(CypherParser::Expression6Context *ctx) = 0;
virtual void enterExpression5(CypherParser::Expression5Context *ctx) = 0;
virtual void exitExpression5(CypherParser::Expression5Context *ctx) = 0;
virtual void enterExpression4(CypherParser::Expression4Context *ctx) = 0;
virtual void exitExpression4(CypherParser::Expression4Context *ctx) = 0;
virtual void enterExpression3(CypherParser::Expression3Context *ctx) = 0;
virtual void exitExpression3(CypherParser::Expression3Context *ctx) = 0;
virtual void enterExpression2(CypherParser::Expression2Context *ctx) = 0;
virtual void exitExpression2(CypherParser::Expression2Context *ctx) = 0;
virtual void enterAtom(CypherParser::AtomContext *ctx) = 0;
virtual void exitAtom(CypherParser::AtomContext *ctx) = 0;
virtual void enterLiteral(CypherParser::LiteralContext *ctx) = 0;
virtual void exitLiteral(CypherParser::LiteralContext *ctx) = 0;
virtual void enterBooleanLiteral(CypherParser::BooleanLiteralContext *ctx) = 0;
virtual void exitBooleanLiteral(CypherParser::BooleanLiteralContext *ctx) = 0;
virtual void enterListLiteral(CypherParser::ListLiteralContext *ctx) = 0;
virtual void exitListLiteral(CypherParser::ListLiteralContext *ctx) = 0;
virtual void enterPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *ctx) = 0;
virtual void exitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *ctx) = 0;
virtual void enterParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *ctx) = 0;
virtual void exitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *ctx) = 0;
virtual void enterRelationshipsPattern(CypherParser::RelationshipsPatternContext *ctx) = 0;
virtual void exitRelationshipsPattern(CypherParser::RelationshipsPatternContext *ctx) = 0;
virtual void enterFilterExpression(CypherParser::FilterExpressionContext *ctx) = 0;
virtual void exitFilterExpression(CypherParser::FilterExpressionContext *ctx) = 0;
virtual void enterIdInColl(CypherParser::IdInCollContext *ctx) = 0;
virtual void exitIdInColl(CypherParser::IdInCollContext *ctx) = 0;
virtual void enterFunctionInvocation(CypherParser::FunctionInvocationContext *ctx) = 0;
virtual void exitFunctionInvocation(CypherParser::FunctionInvocationContext *ctx) = 0;
virtual void enterFunctionName(CypherParser::FunctionNameContext *ctx) = 0;
virtual void exitFunctionName(CypherParser::FunctionNameContext *ctx) = 0;
virtual void enterListComprehension(CypherParser::ListComprehensionContext *ctx) = 0;
virtual void exitListComprehension(CypherParser::ListComprehensionContext *ctx) = 0;
virtual void enterPatternComprehension(CypherParser::PatternComprehensionContext *ctx) = 0;
virtual void exitPatternComprehension(CypherParser::PatternComprehensionContext *ctx) = 0;
virtual void enterPropertyLookup(CypherParser::PropertyLookupContext *ctx) = 0;
virtual void exitPropertyLookup(CypherParser::PropertyLookupContext *ctx) = 0;
virtual void enterVariable(CypherParser::VariableContext *ctx) = 0;
virtual void exitVariable(CypherParser::VariableContext *ctx) = 0;
virtual void enterNumberLiteral(CypherParser::NumberLiteralContext *ctx) = 0;
virtual void exitNumberLiteral(CypherParser::NumberLiteralContext *ctx) = 0;
virtual void enterMapLiteral(CypherParser::MapLiteralContext *ctx) = 0;
virtual void exitMapLiteral(CypherParser::MapLiteralContext *ctx) = 0;
virtual void enterParameter(CypherParser::ParameterContext *ctx) = 0;
virtual void exitParameter(CypherParser::ParameterContext *ctx) = 0;
virtual void enterPropertyExpression(CypherParser::PropertyExpressionContext *ctx) = 0;
virtual void exitPropertyExpression(CypherParser::PropertyExpressionContext *ctx) = 0;
virtual void enterPropertyKeyName(CypherParser::PropertyKeyNameContext *ctx) = 0;
virtual void exitPropertyKeyName(CypherParser::PropertyKeyNameContext *ctx) = 0;
virtual void enterIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) = 0;
virtual void exitIntegerLiteral(CypherParser::IntegerLiteralContext *ctx) = 0;
virtual void enterDoubleLiteral(CypherParser::DoubleLiteralContext *ctx) = 0;
virtual void exitDoubleLiteral(CypherParser::DoubleLiteralContext *ctx) = 0;
virtual void enterSymbolicName(CypherParser::SymbolicNameContext *ctx) = 0;
virtual void exitSymbolicName(CypherParser::SymbolicNameContext *ctx) = 0;
virtual void enterLeftArrowHead(CypherParser::LeftArrowHeadContext *ctx) = 0;
virtual void exitLeftArrowHead(CypherParser::LeftArrowHeadContext *ctx) = 0;
virtual void enterRightArrowHead(CypherParser::RightArrowHeadContext *ctx) = 0;
virtual void exitRightArrowHead(CypherParser::RightArrowHeadContext *ctx) = 0;
virtual void enterDash(CypherParser::DashContext *ctx) = 0;
virtual void exitDash(CypherParser::DashContext *ctx) = 0;
};
} // namespace antlropencypher

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#include "CypherVisitor.h"
using namespace antlropencypher;

View File

@ -1,186 +0,0 @@
// Generated from /home/mislav/code/memgraph/memgraph/src/query/frontend/opencypher/grammar/Cypher.g4 by ANTLR 4.6
#pragma once
#include "antlr4-runtime.h"
#include "CypherParser.h"
namespace antlropencypher {
/**
* This class defines an abstract visitor for a parse tree
* produced by CypherParser.
*/
class CypherVisitor : public antlr4::tree::AbstractParseTreeVisitor {
public:
/**
* Visit parse trees produced by CypherParser.
*/
virtual antlrcpp::Any visitCypher(CypherParser::CypherContext *context) = 0;
virtual antlrcpp::Any visitStatement(CypherParser::StatementContext *context) = 0;
virtual antlrcpp::Any visitQuery(CypherParser::QueryContext *context) = 0;
virtual antlrcpp::Any visitRegularQuery(CypherParser::RegularQueryContext *context) = 0;
virtual antlrcpp::Any visitSingleQuery(CypherParser::SingleQueryContext *context) = 0;
virtual antlrcpp::Any visitCypherUnion(CypherParser::CypherUnionContext *context) = 0;
virtual antlrcpp::Any visitClause(CypherParser::ClauseContext *context) = 0;
virtual antlrcpp::Any visitCypherMatch(CypherParser::CypherMatchContext *context) = 0;
virtual antlrcpp::Any visitUnwind(CypherParser::UnwindContext *context) = 0;
virtual antlrcpp::Any visitMerge(CypherParser::MergeContext *context) = 0;
virtual antlrcpp::Any visitMergeAction(CypherParser::MergeActionContext *context) = 0;
virtual antlrcpp::Any visitCreate(CypherParser::CreateContext *context) = 0;
virtual antlrcpp::Any visitSet(CypherParser::SetContext *context) = 0;
virtual antlrcpp::Any visitSetItem(CypherParser::SetItemContext *context) = 0;
virtual antlrcpp::Any visitCypherDelete(CypherParser::CypherDeleteContext *context) = 0;
virtual antlrcpp::Any visitRemove(CypherParser::RemoveContext *context) = 0;
virtual antlrcpp::Any visitRemoveItem(CypherParser::RemoveItemContext *context) = 0;
virtual antlrcpp::Any visitWith(CypherParser::WithContext *context) = 0;
virtual antlrcpp::Any visitCypherReturn(CypherParser::CypherReturnContext *context) = 0;
virtual antlrcpp::Any visitReturnBody(CypherParser::ReturnBodyContext *context) = 0;
virtual antlrcpp::Any visitReturnItems(CypherParser::ReturnItemsContext *context) = 0;
virtual antlrcpp::Any visitReturnItem(CypherParser::ReturnItemContext *context) = 0;
virtual antlrcpp::Any visitOrder(CypherParser::OrderContext *context) = 0;
virtual antlrcpp::Any visitSkip(CypherParser::SkipContext *context) = 0;
virtual antlrcpp::Any visitLimit(CypherParser::LimitContext *context) = 0;
virtual antlrcpp::Any visitSortItem(CypherParser::SortItemContext *context) = 0;
virtual antlrcpp::Any visitWhere(CypherParser::WhereContext *context) = 0;
virtual antlrcpp::Any visitPattern(CypherParser::PatternContext *context) = 0;
virtual antlrcpp::Any visitPatternPart(CypherParser::PatternPartContext *context) = 0;
virtual antlrcpp::Any visitAnonymousPatternPart(CypherParser::AnonymousPatternPartContext *context) = 0;
virtual antlrcpp::Any visitPatternElement(CypherParser::PatternElementContext *context) = 0;
virtual antlrcpp::Any visitNodePattern(CypherParser::NodePatternContext *context) = 0;
virtual antlrcpp::Any visitPatternElementChain(CypherParser::PatternElementChainContext *context) = 0;
virtual antlrcpp::Any visitRelationshipPattern(CypherParser::RelationshipPatternContext *context) = 0;
virtual antlrcpp::Any visitRelationshipDetail(CypherParser::RelationshipDetailContext *context) = 0;
virtual antlrcpp::Any visitProperties(CypherParser::PropertiesContext *context) = 0;
virtual antlrcpp::Any visitRelationshipTypes(CypherParser::RelationshipTypesContext *context) = 0;
virtual antlrcpp::Any visitNodeLabels(CypherParser::NodeLabelsContext *context) = 0;
virtual antlrcpp::Any visitNodeLabel(CypherParser::NodeLabelContext *context) = 0;
virtual antlrcpp::Any visitRangeLiteral(CypherParser::RangeLiteralContext *context) = 0;
virtual antlrcpp::Any visitLabelName(CypherParser::LabelNameContext *context) = 0;
virtual antlrcpp::Any visitRelTypeName(CypherParser::RelTypeNameContext *context) = 0;
virtual antlrcpp::Any visitExpression(CypherParser::ExpressionContext *context) = 0;
virtual antlrcpp::Any visitExpression12(CypherParser::Expression12Context *context) = 0;
virtual antlrcpp::Any visitExpression11(CypherParser::Expression11Context *context) = 0;
virtual antlrcpp::Any visitExpression10(CypherParser::Expression10Context *context) = 0;
virtual antlrcpp::Any visitExpression9(CypherParser::Expression9Context *context) = 0;
virtual antlrcpp::Any visitExpression8(CypherParser::Expression8Context *context) = 0;
virtual antlrcpp::Any visitExpression7(CypherParser::Expression7Context *context) = 0;
virtual antlrcpp::Any visitExpression6(CypherParser::Expression6Context *context) = 0;
virtual antlrcpp::Any visitExpression5(CypherParser::Expression5Context *context) = 0;
virtual antlrcpp::Any visitExpression4(CypherParser::Expression4Context *context) = 0;
virtual antlrcpp::Any visitExpression3(CypherParser::Expression3Context *context) = 0;
virtual antlrcpp::Any visitExpression2(CypherParser::Expression2Context *context) = 0;
virtual antlrcpp::Any visitAtom(CypherParser::AtomContext *context) = 0;
virtual antlrcpp::Any visitLiteral(CypherParser::LiteralContext *context) = 0;
virtual antlrcpp::Any visitBooleanLiteral(CypherParser::BooleanLiteralContext *context) = 0;
virtual antlrcpp::Any visitListLiteral(CypherParser::ListLiteralContext *context) = 0;
virtual antlrcpp::Any visitPartialComparisonExpression(CypherParser::PartialComparisonExpressionContext *context) = 0;
virtual antlrcpp::Any visitParenthesizedExpression(CypherParser::ParenthesizedExpressionContext *context) = 0;
virtual antlrcpp::Any visitRelationshipsPattern(CypherParser::RelationshipsPatternContext *context) = 0;
virtual antlrcpp::Any visitFilterExpression(CypherParser::FilterExpressionContext *context) = 0;
virtual antlrcpp::Any visitIdInColl(CypherParser::IdInCollContext *context) = 0;
virtual antlrcpp::Any visitFunctionInvocation(CypherParser::FunctionInvocationContext *context) = 0;
virtual antlrcpp::Any visitFunctionName(CypherParser::FunctionNameContext *context) = 0;
virtual antlrcpp::Any visitListComprehension(CypherParser::ListComprehensionContext *context) = 0;
virtual antlrcpp::Any visitPatternComprehension(CypherParser::PatternComprehensionContext *context) = 0;
virtual antlrcpp::Any visitPropertyLookup(CypherParser::PropertyLookupContext *context) = 0;
virtual antlrcpp::Any visitVariable(CypherParser::VariableContext *context) = 0;
virtual antlrcpp::Any visitNumberLiteral(CypherParser::NumberLiteralContext *context) = 0;
virtual antlrcpp::Any visitMapLiteral(CypherParser::MapLiteralContext *context) = 0;
virtual antlrcpp::Any visitParameter(CypherParser::ParameterContext *context) = 0;
virtual antlrcpp::Any visitPropertyExpression(CypherParser::PropertyExpressionContext *context) = 0;
virtual antlrcpp::Any visitPropertyKeyName(CypherParser::PropertyKeyNameContext *context) = 0;
virtual antlrcpp::Any visitIntegerLiteral(CypherParser::IntegerLiteralContext *context) = 0;
virtual antlrcpp::Any visitDoubleLiteral(CypherParser::DoubleLiteralContext *context) = 0;
virtual antlrcpp::Any visitSymbolicName(CypherParser::SymbolicNameContext *context) = 0;
virtual antlrcpp::Any visitLeftArrowHead(CypherParser::LeftArrowHeadContext *context) = 0;
virtual antlrcpp::Any visitRightArrowHead(CypherParser::RightArrowHeadContext *context) = 0;
virtual antlrcpp::Any visitDash(CypherParser::DashContext *context) = 0;
};
} // namespace antlropencypher

View File

@ -0,0 +1,31 @@
#pragma once
#include <map>
#include <string>
#include "query/frontend/ast/ast.hpp"
namespace query {
struct Symbol {
Symbol() {}
Symbol(const std::string& name, int position) : name_(name), position_(position) {}
std::string name_;
int position_;
};
class SymbolTable {
public:
Symbol CreateSymbol(const std::string& name) {
int position = position_++;
return Symbol(name, position);
}
auto& operator[](const Tree& tree) { return table_[tree.uid()]; }
int max_position() const { return position_; }
private:
int position_{0};
std::map<int, Symbol> table_;
};
}

View File

@ -0,0 +1,110 @@
#pragma once
#include <iostream>
#include "utils/exceptions/basic_exception.hpp"
#include "query/frontend/ast/ast.hpp"
#include "query/frontend/typecheck/symbol_table.hpp"
namespace query {
class TypeCheckVisitor : public TreeVisitorBase {
public:
TypeCheckVisitor(SymbolTable& symbol_table) : symbol_table_(symbol_table) {}
// Start of the tree is a Query.
void Visit(Query& query) override {}
// Expressions
void PreVisit(NamedExpr& named_expr) override {
scope_.in_named_expr = true;
}
void Visit(NamedExpr& named_expr) override {}
void Visit(Ident& ident) override {
Symbol symbol;
std::cout << ident.identifier_ << std::endl;
if (scope_.in_named_expr) {
// TODO: Handle this better, so that the `with` variables aren't
// shadowed.
if (HasSymbol(ident.identifier_)) {
scope_.revert_variable = true;
scope_.old_symbol = scope_.variables[ident.identifier_];
}
symbol = CreateSymbol(ident.identifier_);
} else if (scope_.in_pattern) {
symbol = GetOrCreateSymbol(ident.identifier_);
} else {
if (!HasSymbol(ident.identifier_))
// TODO: Special exception for type check
throw BasicException("Unbound identifier: " + ident.identifier_);
symbol = scope_.variables[ident.identifier_];
}
symbol_table_[ident] = symbol;
}
void PostVisit(Ident& ident) override {
if (scope_.in_named_expr) {
if (scope_.revert_variable) {
scope_.variables[ident.identifier_] = scope_.old_symbol;
}
scope_.in_named_expr = false;
scope_.revert_variable = false;
}
}
// Clauses
void Visit(Match& match) override {}
void PreVisit(Return& ret) override {
scope_.in_return = true;
}
void PostVisit(Return& ret) override {
scope_.in_return = false;
}
void Visit(Return& ret) override {}
// Pattern and its subparts.
void PreVisit(Pattern& pattern) override {
scope_.in_pattern = true;
}
void PostVisit(Pattern& pattern) override {
scope_.in_pattern = false;
}
void Visit(Pattern& pattern) override {}
void Visit(NodePart& node_part) override {}
void Visit(EdgePart& edge_part) override {}
private:
struct Scope {
Scope()
: in_pattern(false), in_return(false), in_named_expr(false),
revert_variable(false) {}
bool in_pattern;
bool in_return;
bool in_named_expr;
bool revert_variable;
Symbol old_symbol;
std::map<std::string, Symbol> variables;
};
bool HasSymbol(const std::string& name)
{
return scope_.variables.find(name) != scope_.variables.end();
}
Symbol CreateSymbol(const std::string &name)
{
auto symbol = symbol_table_.CreateSymbol(name);
scope_.variables[name] = symbol;
return symbol;
}
Symbol GetOrCreateSymbol(const std::string& name)
{
auto search = scope_.variables.find(name);
if (search != scope_.variables.end()) {
return search->second;
}
return CreateSymbol(name);
}
SymbolTable& symbol_table_;
Scope scope_;
};
}

View File

@ -0,0 +1,102 @@
#include <iostream>
#include "dbms/dbms.hpp"
#include "logging/default.hpp"
#include "logging/streams/stdout.cpp"
#include "query/entry.hpp"
#include "query/backend/cpp/typed_value.hpp"
#include "query/frontend/logical/operator.hpp"
using std::cout;
using std::cin;
using std::endl;
int main(int argc, char* argv[]) {
// init arguments
REGISTER_ARGS(argc, argv);
// init logger
logging::init_sync();
logging::log->pipe(std::make_unique<Stdout>());
// init db context
Dbms dbms;
query::ConsoleResultStream stream;
query::Engine<query::ConsoleResultStream> query_engine;
// initialize the database
auto dba = dbms.active();
// labels
auto company = dba.label("Company");
auto person = dba.label("Person");
auto device = dba.label("Device");
// props
auto name = dba.property("name");
auto age = dba.property("age");
auto type = dba.property("type");
// vertices
auto memgraph = dba.insert_vertex();
memgraph.PropsSet(name, "Memgraph");
memgraph.add_label(company);
auto teon = dba.insert_vertex();
memgraph.PropsSet(name, "Teon");
memgraph.PropsSet(age, 26);
teon.add_label(person);
auto mislav = dba.insert_vertex();
memgraph.PropsSet(name, "Mislav");
memgraph.PropsSet(age, 22);
mislav.add_label(person);
auto florijan = dba.insert_vertex();
memgraph.PropsSet(name, "Florijan");
memgraph.PropsSet(age, 31);
florijan.add_label(person);
auto xps_15 = dba.insert_vertex();
memgraph.PropsSet(type, "PC");
memgraph.PropsSet(name, "Dell XPS 15");
xps_15.add_label(device);
// edges
dba.insert_edge(teon, memgraph, dba.edge_type("MEMBER_OF"));
dba.insert_edge(mislav, memgraph, dba.edge_type("MEMBER_OF"));
dba.insert_edge(florijan, memgraph, dba.edge_type("MEMBER_OF"));
dba.insert_edge(teon, mislav, dba.edge_type("FRIEND_OF"));
dba.insert_edge(mislav, teon, dba.edge_type("FRIEND_OF"));
dba.insert_edge(florijan, mislav, dba.edge_type("FRIEND_OF"));
dba.insert_edge(mislav, florijan, dba.edge_type("FRIEND_OF"));
dba.insert_edge(florijan, teon, dba.edge_type("FRIEND_OF"));
dba.insert_edge(teon, florijan, dba.edge_type("FRIEND_OF"));
dba.insert_edge(memgraph, xps_15, dba.edge_type("OWNS"));
dba.insert_edge(teon, xps_15, dba.edge_type("USES"));
dba.insert_edge(mislav, xps_15, dba.edge_type("USES"));
dba.insert_edge(florijan, xps_15, dba.edge_type("USES"));
dba.advance_command();
cout << "-- Memgraph Query Engine --" << endl;
while (true) {
// read command
cout << "> ";
std::string command;
std::getline(cin, command);
if (command == "quit") break;
// execute command / query
// try {
// auto db_accessor = dbms.active();
query_engine.Execute(command, dba, stream);
// } catch (const std::exception& e) {
// cout << e.what() << endl;
// } catch (...) {
// // pass
// }
//
}
return 0;
}

View File

@ -1,356 +1,360 @@
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <vector>
#include "antlr4-runtime.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "query/backend/cpp/cypher_main_visitor.cpp"
#include "query/context.hpp"
#include "query/frontend/ast/cypher_main_visitor.hpp"
#include "query/frontend/opencypher/parser.hpp"
#include "gtest/gtest.h"
using namespace ::testing;
namespace {
using namespace backend::cpp;
class ParserTables {
template <typename T>
auto FilterAnies(std::unordered_map<std::string, antlrcpp::Any> map) {
std::unordered_map<std::string, T> filtered;
for (auto x : map) {
if (x.second.is<T>()) {
filtered[x.first] = x.second.as<T>();
}
}
return filtered;
}
public:
ParserTables(const std::string &query) {
frontend::opencypher::Parser parser(query);
auto *tree = parser.tree();
CypherMainVisitor visitor;
visitor.visit(tree);
identifiers_map_ = visitor.ids_map().back();
symbol_table_ = visitor.symbol_table();
pattern_parts_ = FilterAnies<PatternPart>(symbol_table_);
nodes_ = FilterAnies<Node>(symbol_table_);
relationships_ = FilterAnies<Relationship>(symbol_table_);
}
std::unordered_map<std::string, std::string> identifiers_map_;
std::unordered_map<std::string, antlrcpp::Any> symbol_table_;
std::unordered_map<std::string, PatternPart> pattern_parts_;
std::unordered_map<std::string, Node> nodes_;
std::unordered_map<std::string, Relationship> relationships_;
};
// TODO: Once expression evaluation is implemented, we should also test if
// property values are equal.
void CompareNodes(std::pair<std::string, Node> node_entry,
std::vector<std::string> labels,
std::vector<std::string> property_keys) {
auto node = node_entry.second;
ASSERT_EQ(node_entry.first, node.output_id);
ASSERT_THAT(node.labels,
UnorderedElementsAreArray(labels.begin(), labels.end()));
std::vector<std::string> node_property_keys;
for (auto x : node.properties) {
node_property_keys.push_back(x.first);
}
ASSERT_THAT(
node_property_keys,
UnorderedElementsAreArray(property_keys.begin(), property_keys.end()));
}
// If has_range is false, lower and upper bound values are ignored.
// TODO: Once expression evaluation is implemented, we should also test if
// property values are equal.
void CompareRelationships(
std::pair<std::string, Relationship> relationship_entry,
Relationship::Direction direction, std::vector<std::string> types,
std::vector<std::string> property_keys, bool has_range,
int64_t lower_bound = 1LL, int64_t upper_bound = LLONG_MAX) {
auto relationship = relationship_entry.second;
ASSERT_EQ(relationship_entry.first, relationship.output_id);
ASSERT_EQ(relationship.direction, direction);
ASSERT_THAT(relationship.types,
UnorderedElementsAreArray(types.begin(), types.end()));
std::vector<std::string> relationship_property_keys;
for (auto x : relationship.properties) {
relationship_property_keys.push_back(x.first);
}
ASSERT_THAT(
relationship_property_keys,
UnorderedElementsAreArray(property_keys.begin(), property_keys.end()));
ASSERT_EQ(relationship.has_range, has_range);
if (!has_range) return;
ASSERT_EQ(relationship.lower_bound, lower_bound);
ASSERT_EQ(relationship.upper_bound, upper_bound);
}
// SyntaxException on incorrect syntax.
TEST(CompilerStructuresTest, SyntaxException) {
ASSERT_THROW(ParserTables("CREATE ()-[*1...2]-()"),
frontend::opencypher::SyntaxException);
}
// Empty node.
TEST(CompilerStructuresTest, NodePatternEmpty) {
ParserTables parser("CREATE ()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.nodes_.size(), 1U);
CompareNodes(*parser.nodes_.begin(), {}, {});
}
// Node with variable.
TEST(CompilerStructuresTest, NodePatternVariable) {
ParserTables parser("CREATE (var)");
ASSERT_EQ(parser.identifiers_map_.size(), 1U);
ASSERT_NE(parser.identifiers_map_.find("var"), parser.identifiers_map_.end());
ASSERT_EQ(parser.nodes_.size(), 1U);
auto output_identifier = parser.identifiers_map_["var"];
ASSERT_NE(parser.nodes_.find(output_identifier), parser.nodes_.end());
CompareNodes(*parser.nodes_.begin(), {}, {});
}
// Node with labels.
TEST(CompilerStructuresTest, NodePatternLabels) {
ParserTables parser("CREATE (:label1:label2:label3)");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.nodes_.size(), 1U);
CompareNodes(*parser.nodes_.begin(), {"label1", "label2", "label3"}, {});
}
// Node with properties.
TEST(CompilerStructuresTest, NodePatternProperties) {
ParserTables parser("CREATE ({age: 5, name: \"John\", surname: \"Smith\"})");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.nodes_.size(), 1U);
CompareNodes(*parser.nodes_.begin(), {}, {"age", "name", "surname"});
}
// Relationship without relationship details.
TEST(CompilerStructuresTest, RelationshipPatternNoDetails) {
ParserTables parser("CREATE ()--()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, false);
}
// Relationship with empty relationship details.
TEST(CompilerStructuresTest, RelationshipPatternEmptyDetails) {
ParserTables parser("CREATE ()-[]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, false);
}
// Relationship with left direction.
TEST(CompilerStructuresTest, RelationshipPatternLeftDirection) {
ParserTables parser("CREATE ()<--()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::LEFT, {}, {}, false);
}
// Relationship with right direction.
TEST(CompilerStructuresTest, RelationshipPatternRightDirection) {
ParserTables parser("CREATE ()-[]->()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::RIGHT, {}, {}, false);
}
// Relationship with both directions.
TEST(CompilerStructuresTest, RelationshipPatternBothDirection) {
ParserTables parser("CREATE ()<-[]->()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, false);
}
// Relationship with unbounded variable range.
TEST(CompilerStructuresTest, RelationshipPatternUnbounded) {
ParserTables parser("CREATE ()-[*]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, true, 1,
LLONG_MAX);
}
// Relationship with lower bounded variable range.
TEST(CompilerStructuresTest, RelationshipPatternLowerBounded) {
ParserTables parser("CREATE ()-[*5..]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, true, 5,
LLONG_MAX);
}
// Relationship with upper bounded variable range.
TEST(CompilerStructuresTest, RelationshipPatternUpperBounded) {
ParserTables parser("CREATE ()-[*..10]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, true, 1, 10);
}
// Relationship with lower and upper bounded variable range.
TEST(CompilerStructuresTest, RelationshipPatternLowerUpperBounded) {
ParserTables parser("CREATE ()-[*5..10]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, true, 5, 10);
}
// Relationship with fixed number of edges.
TEST(CompilerStructuresTest, RelationshipPatternFixedRange) {
ParserTables parser("CREATE ()-[*10]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, true, 10, 10);
}
// Relationship with invalid bound (larger than long long).
TEST(CompilerStructuresTest, RelationshipPatternInvalidBound) {
ASSERT_THROW(
ParserTables parser("CREATE ()-[*100000000000000000000000000]-()"),
SemanticException);
}
// Relationship with variable
TEST(CompilerStructuresTest, RelationshipPatternVariable) {
ParserTables parser("CREATE ()-[var]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 1U);
ASSERT_NE(parser.identifiers_map_.find("var"), parser.identifiers_map_.end());
ASSERT_EQ(parser.relationships_.size(), 1U);
auto output_identifier = parser.identifiers_map_["var"];
ASSERT_NE(parser.relationships_.find(output_identifier),
parser.relationships_.end());
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {}, {}, false);
}
// Relationship with labels.
TEST(CompilerStructuresTest, RelationshipPatternLabels) {
ParserTables parser("CREATE ()-[:label1|label2|:label3]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH,
{"label1", "label2", "label3"}, {}, false);
}
// Relationship with properties.
TEST(CompilerStructuresTest, RelationshipPatternProperties) {
ParserTables parser(
"CREATE ()-[{age: 5, name: \"John\", surname: \"Smith\"}]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.relationships_.size(), 1U);
CompareRelationships(*parser.relationships_.begin(),
Relationship::Direction::BOTH, {},
{"age", "name", "surname"}, false);
}
// PatternPart.
TEST(CompilerStructuresTest, PatternPart) {
ParserTables parser("CREATE ()--()");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.pattern_parts_.size(), 1U);
ASSERT_EQ(parser.relationships_.size(), 1U);
ASSERT_EQ(parser.nodes_.size(), 2U);
ASSERT_EQ(parser.pattern_parts_.begin()->second.nodes.size(), 2U);
ASSERT_EQ(parser.pattern_parts_.begin()->second.relationships.size(), 1U);
}
// PatternPart in braces.
TEST(CompilerStructuresTest, PatternPartBraces) {
ParserTables parser("CREATE ((()--()))");
ASSERT_EQ(parser.identifiers_map_.size(), 0U);
ASSERT_EQ(parser.pattern_parts_.size(), 1U);
ASSERT_EQ(parser.relationships_.size(), 1U);
ASSERT_EQ(parser.nodes_.size(), 2U);
ASSERT_EQ(parser.pattern_parts_.begin()->second.nodes.size(), 2U);
ASSERT_EQ(parser.pattern_parts_.begin()->second.relationships.size(), 1U);
}
// PatternPart with variable.
TEST(CompilerStructuresTest, PatternPartVariable) {
ParserTables parser("CREATE var=()--()");
ASSERT_EQ(parser.identifiers_map_.size(), 1U);
ASSERT_EQ(parser.pattern_parts_.size(), 1U);
ASSERT_EQ(parser.relationships_.size(), 1U);
ASSERT_EQ(parser.nodes_.size(), 2U);
ASSERT_EQ(parser.pattern_parts_.begin()->second.nodes.size(), 2U);
ASSERT_EQ(parser.pattern_parts_.begin()->second.relationships.size(), 1U);
ASSERT_NE(parser.identifiers_map_.find("var"), parser.identifiers_map_.end());
auto output_identifier = parser.identifiers_map_["var"];
ASSERT_NE(parser.pattern_parts_.find(output_identifier),
parser.pattern_parts_.end());
}
// Multiple nodes with same variable and properties.
TEST(CompilerStructuresTest, MultipleNodesWithVariableAndProperties) {
ASSERT_THROW(ParserTables parser("CREATE (a {b: 5})-[]-(a {c: 5})"),
SemanticException);
}
// Multiple nodes with same variable name.
TEST(CompilerStructuresTest, MultipleNodesWithVariable) {
ParserTables parser("CREATE (a {b: 5, c: 5})-[]-(a)");
ASSERT_EQ(parser.identifiers_map_.size(), 1U);
ASSERT_EQ(parser.pattern_parts_.size(), 1U);
ASSERT_EQ(parser.relationships_.size(), 1U);
ASSERT_EQ(parser.nodes_.size(), 1U);
auto pattern_part = parser.pattern_parts_.begin()->second;
ASSERT_EQ(pattern_part.nodes.size(), 2U);
ASSERT_EQ(pattern_part.relationships.size(), 1U);
ASSERT_EQ(pattern_part.nodes[0], pattern_part.nodes[1]);
}
// Multiple relationships with same variable name and properties.
TEST(CompilerStructuresTest, MultipleRelationshipsWithVariableAndProperties) {
ASSERT_THROW(ParserTables parser("CREATE ()-[e {a: 5}]-()-[e {c: 5}]-()"),
SemanticException);
}
// Multiple relationships with same variable name.
TEST(CompilerStructuresTest, MultipleRelationshipsWithVariable) {
ParserTables parser("CREATE ()-[a {a: 5}]-()-[a]-()");
ASSERT_EQ(parser.identifiers_map_.size(), 1U);
ASSERT_EQ(parser.pattern_parts_.size(), 1U);
ASSERT_EQ(parser.relationships_.size(), 1U);
ASSERT_EQ(parser.nodes_.size(), 3U);
auto pattern_part = parser.pattern_parts_.begin()->second;
ASSERT_EQ(pattern_part.nodes.size(), 3U);
ASSERT_EQ(pattern_part.relationships.size(), 2U);
ASSERT_NE(pattern_part.nodes[0], pattern_part.nodes[1]);
ASSERT_NE(pattern_part.nodes[1], pattern_part.nodes[2]);
ASSERT_NE(pattern_part.nodes[0], pattern_part.nodes[2]);
ASSERT_EQ(pattern_part.relationships[0], pattern_part.relationships[1]);
}
// Different structures (nodes, realtionships, patterns) with same variable
// name.
TEST(CompilerStructuresTest, DifferentTypesWithVariable) {
ASSERT_THROW(ParserTables parser("CREATE a=(a)"), SemanticException);
ASSERT_THROW(ParserTables parser("CREATE (a)-[a]-()"), SemanticException);
ASSERT_THROW(ParserTables parser("CREATE a=()-[a]-()"), SemanticException);
}
}
// namespace {
//
// using query::Context;
// using namespace query::frontend;
//
// class ParserTables {
// template <typename T>
// auto FilterAnies(std::unordered_map<std::string, antlrcpp::Any> map) {
// std::unordered_map<std::string, T> filtered;
// for (auto x : map) {
// if (x.second.is<T>()) {
// filtered[x.first] = x.second.as<T>();
// }
// }
// return filtered;
// }
//
// public:
// ParserTables(const std::string &query) {
// frontend::opencypher::Parser parser(query);
// auto *tree = parser.tree();
// CypherMainVisitor visitor;
// visitor.visit(tree);
// identifiers_map_ = visitor.ids_map().back();
// symbol_table_ = visitor.symbol_table();
// pattern_parts_ = FilterAnies<PatternPart>(symbol_table_);
// nodes_ = FilterAnies<Node>(symbol_table_);
// relationships_ = FilterAnies<Relationship>(symbol_table_);
// }
//
// std::unordered_map<std::string, std::string> identifiers_map_;
// std::unordered_map<std::string, antlrcpp::Any> symbol_table_;
// std::unordered_map<std::string, PatternPart> pattern_parts_;
// std::unordered_map<std::string, Node> nodes_;
// std::unordered_map<std::string, Relationship> relationships_;
// };
//
// // TODO: Once expression evaluation is implemented, we should also test if
// // property values are equal.
// void CompareNodes(std::pair<std::string, Node> node_entry,
// std::vector<std::string> labels,
// std::vector<std::string> property_keys) {
// auto node = node_entry.second;
// ASSERT_EQ(node_entry.first, node.output_id);
// ASSERT_THAT(node.labels,
// UnorderedElementsAreArray(labels.begin(), labels.end()));
// std::vector<std::string> node_property_keys;
// for (auto x : node.properties) {
// node_property_keys.push_back(x.first);
// }
// ASSERT_THAT(
// node_property_keys,
// UnorderedElementsAreArray(property_keys.begin(), property_keys.end()));
// }
//
// // If has_range is false, lower and upper bound values are ignored.
// // TODO: Once expression evaluation is implemented, we should also test if
// // property values are equal.
// void CompareRelationships(
// std::pair<std::string, Relationship> relationship_entry,
// Relationship::Direction direction, std::vector<std::string> types,
// std::vector<std::string> property_keys, bool has_range,
// int64_t lower_bound = 1LL, int64_t upper_bound = LLONG_MAX) {
// auto relationship = relationship_entry.second;
// ASSERT_EQ(relationship_entry.first, relationship.output_id);
// ASSERT_EQ(relationship.direction, direction);
// ASSERT_THAT(relationship.types,
// UnorderedElementsAreArray(types.begin(), types.end()));
// std::vector<std::string> relationship_property_keys;
// for (auto x : relationship.properties) {
// relationship_property_keys.push_back(x.first);
// }
// ASSERT_THAT(
// relationship_property_keys,
// UnorderedElementsAreArray(property_keys.begin(), property_keys.end()));
// ASSERT_EQ(relationship.has_range, has_range);
// if (!has_range)
// return;
// ASSERT_EQ(relationship.lower_bound, lower_bound);
// ASSERT_EQ(relationship.upper_bound, upper_bound);
// }
//
// // SyntaxException on incorrect syntax.
// TEST(CompilerStructuresTest, SyntaxException) {
// ASSERT_THROW(ParserTables("CREATE ()-[*1...2]-()"),
// frontend::opencypher::SyntaxException);
// }
//
// // Empty node.
// TEST(CompilerStructuresTest, NodePatternEmpty) {
// ParserTables parser("CREATE ()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.nodes_.size(), 1U);
// CompareNodes(*parser.nodes_.begin(), {}, {});
// }
//
// // Node with variable.
// TEST(CompilerStructuresTest, NodePatternVariable) {
// ParserTables parser("CREATE (var)");
// ASSERT_EQ(parser.identifiers_map_.size(), 1U);
// ASSERT_NE(parser.identifiers_map_.find("var"), parser.identifiers_map_.end());
// ASSERT_EQ(parser.nodes_.size(), 1U);
// auto output_identifier = parser.identifiers_map_["var"];
// ASSERT_NE(parser.nodes_.find(output_identifier), parser.nodes_.end());
// CompareNodes(*parser.nodes_.begin(), {}, {});
// }
//
// // Node with labels.
// TEST(CompilerStructuresTest, NodePatternLabels) {
// ParserTables parser("CREATE (:label1:label2:label3)");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.nodes_.size(), 1U);
// CompareNodes(*parser.nodes_.begin(), {"label1", "label2", "label3"}, {});
// }
//
// // Node with properties.
// TEST(CompilerStructuresTest, NodePatternProperties) {
// ParserTables parser("CREATE ({age: 5, name: \"John\", surname: \"Smith\"})");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.nodes_.size(), 1U);
// CompareNodes(*parser.nodes_.begin(), {}, {"age", "name", "surname"});
// }
//
// // Relationship without relationship details.
// TEST(CompilerStructuresTest, RelationshipPatternNoDetails) {
// ParserTables parser("CREATE ()--()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, false);
// }
//
// // Relationship with empty relationship details.
// TEST(CompilerStructuresTest, RelationshipPatternEmptyDetails) {
// ParserTables parser("CREATE ()-[]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, false);
// }
//
// // Relationship with left direction.
// TEST(CompilerStructuresTest, RelationshipPatternLeftDirection) {
// ParserTables parser("CREATE ()<--()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::LEFT, {}, {}, false);
// }
//
// // Relationship with right direction.
// TEST(CompilerStructuresTest, RelationshipPatternRightDirection) {
// ParserTables parser("CREATE ()-[]->()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::RIGHT, {}, {}, false);
// }
//
// // Relationship with both directions.
// TEST(CompilerStructuresTest, RelationshipPatternBothDirection) {
// ParserTables parser("CREATE ()<-[]->()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, false);
// }
//
// // Relationship with unbounded variable range.
// TEST(CompilerStructuresTest, RelationshipPatternUnbounded) {
// ParserTables parser("CREATE ()-[*]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, true, 1,
// LLONG_MAX);
// }
//
// // Relationship with lower bounded variable range.
// TEST(CompilerStructuresTest, RelationshipPatternLowerBounded) {
// ParserTables parser("CREATE ()-[*5..]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, true, 5,
// LLONG_MAX);
// }
//
// // Relationship with upper bounded variable range.
// TEST(CompilerStructuresTest, RelationshipPatternUpperBounded) {
// ParserTables parser("CREATE ()-[*..10]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, true, 1, 10);
// }
//
// // Relationship with lower and upper bounded variable range.
// TEST(CompilerStructuresTest, RelationshipPatternLowerUpperBounded) {
// ParserTables parser("CREATE ()-[*5..10]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, true, 5, 10);
// }
//
// // Relationship with fixed number of edges.
// TEST(CompilerStructuresTest, RelationshipPatternFixedRange) {
// ParserTables parser("CREATE ()-[*10]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, true, 10, 10);
// }
//
// // Relationship with invalid bound (larger than long long).
// TEST(CompilerStructuresTest, RelationshipPatternInvalidBound) {
// ASSERT_THROW(
// ParserTables parser("CREATE ()-[*100000000000000000000000000]-()"),
// SemanticException);
// }
//
// // Relationship with variable
// TEST(CompilerStructuresTest, RelationshipPatternVariable) {
// ParserTables parser("CREATE ()-[var]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 1U);
// ASSERT_NE(parser.identifiers_map_.find("var"), parser.identifiers_map_.end());
// ASSERT_EQ(parser.relationships_.size(), 1U);
// auto output_identifier = parser.identifiers_map_["var"];
// ASSERT_NE(parser.relationships_.find(output_identifier),
// parser.relationships_.end());
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {}, {}, false);
// }
//
// // Relationship with labels.
// TEST(CompilerStructuresTest, RelationshipPatternLabels) {
// ParserTables parser("CREATE ()-[:label1|label2|:label3]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH,
// {"label1", "label2", "label3"}, {}, false);
// }
//
// // Relationship with properties.
// TEST(CompilerStructuresTest, RelationshipPatternProperties) {
// ParserTables parser(
// "CREATE ()-[{age: 5, name: \"John\", surname: \"Smith\"}]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// CompareRelationships(*parser.relationships_.begin(),
// Relationship::Direction::BOTH, {},
// {"age", "name", "surname"}, false);
// }
//
// // PatternPart.
// TEST(CompilerStructuresTest, PatternPart) {
// ParserTables parser("CREATE ()--()");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.pattern_parts_.size(), 1U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// ASSERT_EQ(parser.nodes_.size(), 2U);
// ASSERT_EQ(parser.pattern_parts_.begin()->second.nodes.size(), 2U);
// ASSERT_EQ(parser.pattern_parts_.begin()->second.relationships.size(), 1U);
// }
//
// // PatternPart in braces.
// TEST(CompilerStructuresTest, PatternPartBraces) {
// ParserTables parser("CREATE ((()--()))");
// ASSERT_EQ(parser.identifiers_map_.size(), 0U);
// ASSERT_EQ(parser.pattern_parts_.size(), 1U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// ASSERT_EQ(parser.nodes_.size(), 2U);
// ASSERT_EQ(parser.pattern_parts_.begin()->second.nodes.size(), 2U);
// ASSERT_EQ(parser.pattern_parts_.begin()->second.relationships.size(), 1U);
// }
//
// // PatternPart with variable.
// TEST(CompilerStructuresTest, PatternPartVariable) {
// ParserTables parser("CREATE var=()--()");
// ASSERT_EQ(parser.identifiers_map_.size(), 1U);
// ASSERT_EQ(parser.pattern_parts_.size(), 1U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// ASSERT_EQ(parser.nodes_.size(), 2U);
// ASSERT_EQ(parser.pattern_parts_.begin()->second.nodes.size(), 2U);
// ASSERT_EQ(parser.pattern_parts_.begin()->second.relationships.size(), 1U);
// ASSERT_NE(parser.identifiers_map_.find("var"), parser.identifiers_map_.end());
// auto output_identifier = parser.identifiers_map_["var"];
// ASSERT_NE(parser.pattern_parts_.find(output_identifier),
// parser.pattern_parts_.end());
// }
//
// // Multiple nodes with same variable and properties.
// TEST(CompilerStructuresTest, MultipleNodesWithVariableAndProperties) {
// ASSERT_THROW(ParserTables parser("CREATE (a {b: 5})-[]-(a {c: 5})"),
// SemanticException);
// }
//
// // Multiple nodes with same variable name.
// TEST(CompilerStructuresTest, MultipleNodesWithVariable) {
// ParserTables parser("CREATE (a {b: 5, c: 5})-[]-(a)");
// ASSERT_EQ(parser.identifiers_map_.size(), 1U);
// ASSERT_EQ(parser.pattern_parts_.size(), 1U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// ASSERT_EQ(parser.nodes_.size(), 1U);
// auto pattern_part = parser.pattern_parts_.begin()->second;
// ASSERT_EQ(pattern_part.nodes.size(), 2U);
// ASSERT_EQ(pattern_part.relationships.size(), 1U);
// ASSERT_EQ(pattern_part.nodes[0], pattern_part.nodes[1]);
// }
//
// // Multiple relationships with same variable name and properties.
// TEST(CompilerStructuresTest, MultipleRelationshipsWithVariableAndProperties) {
// ASSERT_THROW(ParserTables parser("CREATE ()-[e {a: 5}]-()-[e {c: 5}]-()"),
// SemanticException);
// }
//
// // Multiple relationships with same variable name.
// TEST(CompilerStructuresTest, MultipleRelationshipsWithVariable) {
// ParserTables parser("CREATE ()-[a {a: 5}]-()-[a]-()");
// ASSERT_EQ(parser.identifiers_map_.size(), 1U);
// ASSERT_EQ(parser.pattern_parts_.size(), 1U);
// ASSERT_EQ(parser.relationships_.size(), 1U);
// ASSERT_EQ(parser.nodes_.size(), 3U);
// auto pattern_part = parser.pattern_parts_.begin()->second;
// ASSERT_EQ(pattern_part.nodes.size(), 3U);
// ASSERT_EQ(pattern_part.relationships.size(), 2U);
// ASSERT_NE(pattern_part.nodes[0], pattern_part.nodes[1]);
// ASSERT_NE(pattern_part.nodes[1], pattern_part.nodes[2]);
// ASSERT_NE(pattern_part.nodes[0], pattern_part.nodes[2]);
// ASSERT_EQ(pattern_part.relationships[0], pattern_part.relationships[1]);
// }
//
// // Different structures (nodes, realtionships, patterns) with same variable
// // name.
// TEST(CompilerStructuresTest, DifferentTypesWithVariable) {
// ASSERT_THROW(ParserTables parser("CREATE a=(a)"), SemanticException);
// ASSERT_THROW(ParserTables parser("CREATE (a)-[a]-()"), SemanticException);
// ASSERT_THROW(ParserTables parser("CREATE a=()-[a]-()"), SemanticException);
// }
// }
int main(int argc, char **argv) {
InitGoogleTest(&argc, argv);