memgraph/cypher/compiler.hpp

34 lines
544 B
C++
Raw Normal View History

2015-10-19 01:44:00 +08:00
#ifndef MEMGRAPH_CYPHER_COMPILER_HPP
#define MEMGRAPH_CYPHER_COMPILER_HPP
#include "cypher_lexer.hpp"
#include "parser.hpp"
#include "debug/tree_print.hpp"
namespace cypher
{
class Compiler
{
public:
Compiler() = default;
void compile(const std::string& input)
{
auto parser = cypher::Parser();
auto tokenizer = lexer.tokenize(input);
auto tree = parser.parse(tokenizer);
PrintVisitor printer(std::cout);
tree.root->accept(printer);
}
private:
CypherLexer lexer;
};
}
#endif