add cleanall task
This commit is contained in:
parent
d5fad5ea56
commit
3719745fb4
1
Makefile
1
Makefile
|
@ -42,6 +42,7 @@ clean:
|
||||||
cleanparser:
|
cleanparser:
|
||||||
make -C $(SRCPARSER)/ clean
|
make -C $(SRCPARSER)/ clean
|
||||||
|
|
||||||
|
cleanall: clean cleanparser
|
||||||
|
|
||||||
############
|
############
|
||||||
### Test ###
|
### Test ###
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
// include the sql parser
|
||||||
#include "SQLParser.h"
|
#include "SQLParser.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
@ -6,12 +7,12 @@ int main(int argc, char *argv[]) {
|
||||||
fprintf(stderr, "Usage: ./example \"SELECT * FROM test;\"\n");
|
fprintf(stderr, "Usage: ./example \"SELECT * FROM test;\"\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string query = argv[1];
|
std::string query = argv[1];
|
||||||
|
|
||||||
|
// parse a given query
|
||||||
hsql::SQLStatementList* stmt_list = hsql::SQLParser::parseSQLString(query);
|
hsql::SQLStatementList* stmt_list = hsql::SQLParser::parseSQLString(query);
|
||||||
|
|
||||||
|
// check whether the parsing was successful
|
||||||
if (stmt_list->isValid) {
|
if (stmt_list->isValid) {
|
||||||
printf("Parsed successfully!\n");
|
printf("Parsed successfully!\n");
|
||||||
printf("Number of statements: %lu\n", stmt_list->numStatements());
|
printf("Number of statements: %lu\n", stmt_list->numStatements());
|
||||||
|
|
Loading…
Reference in New Issue