memgraph/tests/manual/cypher_ast.cpp
Marko Budiselic 0fcda94162 Hardcoded query infrastructure - first concrete version - USEFUL FOR: POCs & pilots
Summary: Hardcoded query infrastructure - first concrete version - USEFUL FOR: POCs & pilots

Test Plan: manual + jenkins

Reviewers: sale, florijan

Reviewed By: florijan

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D45
2017-02-14 09:40:31 +01:00

44 lines
1.0 KiB
C++

/**
* DEPRICATED!
*
* TODO: print AST (just for one query) using Antlr's visitor or listener
* the new file name should be opencypher_ast.cpp
*/
#include <cstdlib>
#include <vector>
#include <vector>
#include "query/language/cypher/common.hpp"
#include "query/language/cypher/compiler.hpp"
#include "query/language/cypher/debug/tree_print.hpp"
#include "utils/command_line/arguments.hpp"
#include "utils/terminate_handler.hpp"
#include "utils/variadic/variadic.hpp"
using utils::println;
using std::cout;
int main(int argc, char *argv[])
{
std::set_terminate(&terminate_handler);
// // arguments parsing
auto arguments = all_arguments(argc, argv);
// // query extraction
auto queries = extract_queries(arguments);
for (auto &query : queries)
{
println("QUERY: ", query);
auto print_visitor = new PrintVisitor(cout);
cypher::Compiler compiler;
auto tree = compiler.syntax_tree(query);
tree.root->accept(*print_visitor);
println("");
}
return 0;
}