memgraph/cypher/compiler.hpp

30 lines
473 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"
namespace cypher
{
class Compiler
{
public:
Compiler() = default;
2015-10-30 08:24:01 +08:00
ast::Ast syntax_tree(const std::string& input)
2015-10-19 01:44:00 +08:00
{
auto parser = cypher::Parser();
auto tokenizer = lexer.tokenize(input);
auto tree = parser.parse(tokenizer);
2015-10-30 08:24:01 +08:00
return std::move(tree);
2015-10-19 01:44:00 +08:00
}
private:
CypherLexer lexer;
};
}
#endif