removed obsolete analysis code

This commit is contained in:
Pedro 2015-02-04 19:07:08 +01:00
parent ce5b78f79a
commit c0c39b8bec
2 changed files with 0 additions and 48 deletions

View File

@ -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

View File

@ -1,44 +0,0 @@
#include <stdio.h>
#include <string>
#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;
}