main.cc 691 B

123456789101112131415161718192021222324252627282930313233
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include "../libs/hsql/include/SQLParser.h"
  4. #include "../libs/hsql/include/util/sqlhelper.h"
  5. #include "re_comm.h"
  6. #include "re_load.h"
  7. #include "re_match.h"
  8. #include "re_cache.h"
  9. #include "log.h"
  10. #include "rule.h"
  11. using namespace std;
  12. int main(int argc, char* argv[])
  13. {
  14. printf("hello dtc, ./bin KEY SQL\n");
  15. std::string key = "";
  16. std::string sql = argv[2];
  17. char szkey[50] = {0};
  18. cout<<"sql: "<<sql<<endl;
  19. hsql::SQLParserResult sql_ast;
  20. if(re_parse_sql(sql, &sql_ast) != 0)
  21. {
  22. cout<<"parsing failed."<<endl;
  23. return -1;
  24. }
  25. cout<<"parsing success."<<sql_ast.isValid()<<endl;
  26. return 0;
  27. }