diff --git a/src/Makefile b/src/Makefile index 96b80a8..d97d665 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,10 +18,6 @@ build: clean cp $(LIB_HEADERS) $(BUILD_DIR) -analysis: $(LIB_SOURCES) sql_analysis.cpp - $(CC) $(CFLAGS) $(LIB_SOURCES) sql_analysis.cpp -o $(BIN_DIR)/analysis - - grammar_test: $(LIB_SOURCES) sql_grammar_test.cpp $(CC) $(CFLAGS) $(LIB_SOURCES) sql_grammar_test.cpp -o $(BIN_DIR)/grammar_test diff --git a/src/sql_analysis.cpp b/src/sql_analysis.cpp deleted file mode 100644 index 9f4ffe7..0000000 --- a/src/sql_analysis.cpp +++ /dev/null @@ -1,44 +0,0 @@ - -#include -#include -#include "lib/sqlhelper.h" -#include "SQLParser.h" - -using namespace hsql; - -int main(int argc, char *argv[]) { - if (argc <= 1) { - fprintf(stderr, "No SQL-Statement given!\n"); - return -1; - } - - for (int n = 1; n < argc; ++n) { - char* sql = argv[n]; - - printf("\nEvaluating Query \"%s\"\n", sql); - SQLStatementList* stmt_list = SQLParser::parseSQLString(sql); - - if (!stmt_list->isValid) { - fprintf(stderr, "Parsing of \"%s\" failed! Reason: %s\n", sql, stmt_list->parser_msg); - continue; - } - - int i = 0; - for (SQLStatement* stmt : stmt_list->vector()) { - printf("Statement %d:\n", i++); - switch (stmt->type) { - case kStmtSelect: printSelectStatementInfo((SelectStatement*) stmt, 1); break; - case kStmtImport: printImportStatementInfo((ImportStatement*) stmt, 1); break; - case kStmtCreate: printCreateStatementInfo((CreateStatement*) stmt, 1); break; - case kStmtInsert: printInsertStatementInfo((InsertStatement*) stmt, 1); break; - default: - fprintf(stderr, "\tStatement Type %u. No detailed print method available.\n", stmt->type); - break; - } - // delete stmt; - } - delete stmt_list; - } - - return 0; -} \ No newline at end of file