2015-08-30 07:12:46 +08:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <vector>
|
|
|
|
#include <vector>
|
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
#include "compiler.hpp"
|
2015-08-30 07:12:46 +08:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2015-10-19 01:44:00 +08:00
|
|
|
cypher::Compiler compiler;
|
|
|
|
|
|
|
|
//std::string input("MATCH (user:User { name: 'Dominik', age: 24})-[has:HAS]->(item:Item) WHERE item.name = 'XPS 13' AND item.price = 11999.99 RETURN user, has, item");
|
|
|
|
|
|
|
|
std::string input("create n return n");
|
|
|
|
|
|
|
|
compiler.compile(input);
|
|
|
|
|
|
|
|
/* void* parser = cy */
|
|
|
|
/* CypherLexer lexer; */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* //std::string input("matcH (user:User { name: 'Dominik', age: 8 + 4})-[has:HAS|IS|CAN { duration: 'PERMANENT'}]->(item:Item)--(shop)"); */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* std::string input("MATCH (user:User { name: 'Dominik', age: 24})-[has:HAS]->(item:Item) WHERE item.name = 'XPS 13' AND item.price = 11999.99 RETURN user, has, item"); */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* auto tokenizer = lexer.tokenize(input); */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* std::vector<Token> v; */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* while(true) */
|
|
|
|
/* { */
|
|
|
|
/* v.push_back(tokenizer.lookup()); */
|
|
|
|
/* auto token = v.back(); */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* //std::cout << token->id << " -> " << token->value << std::endl; */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* auto ast = new ast::Ast(); */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* try */
|
|
|
|
/* { */
|
|
|
|
/* cypher_parser(parser, token.id, &token, ast); */
|
|
|
|
/* } */
|
|
|
|
/* catch(...) */
|
|
|
|
/* { */
|
|
|
|
/* std::cout << "caught exception." << std::endl; */
|
|
|
|
/* exit(0); */
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
/* if(token.id == 0) */
|
|
|
|
/* break; */
|
|
|
|
/* } */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
2015-10-19 01:44:00 +08:00
|
|
|
/* cypher_parserFree(parser, free); */
|
2015-08-30 07:12:46 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|