diff --git a/Makefile b/Makefile index e2e166c..92e97c3 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ clean: cleanparser: make -C $(SRCPARSER)/ clean +cleanall: clean cleanparser ############ ### Test ### diff --git a/example/example.cpp b/example/example.cpp index 66ebb9d..a77c645 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -1,4 +1,5 @@ +// include the sql parser #include "SQLParser.h" int main(int argc, char *argv[]) { @@ -6,12 +7,12 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Usage: ./example \"SELECT * FROM test;\"\n"); return -1; } - - std::string query = argv[1]; + // parse a given query hsql::SQLStatementList* stmt_list = hsql::SQLParser::parseSQLString(query); + // check whether the parsing was successful if (stmt_list->isValid) { printf("Parsed successfully!\n"); printf("Number of statements: %lu\n", stmt_list->numStatements());