minor changes

This commit is contained in:
Pedro 2014-11-13 17:54:24 +01:00
parent 6d9a7b661c
commit 48dbab8258
6 changed files with 15 additions and 11 deletions

View File

@ -1,7 +1,7 @@
CC = g++
CFLAGS = -O3 -Ilib/ -I./ -Iparser/ -std=c++11 -pthread
CFLAGS = -O3 -Ilib/ -I./ -Iparser/ -std=c++11 -pthread -Wall -g
SOURCES = $(shell find lib/ -name '*.cpp') parser/bison_parser.cpp parser/flex_lexer.cpp parser/SQLParser.cpp
BUILD_DIR = ../build/
BIN_DIR = ../bin

View File

@ -17,7 +17,7 @@ char* substr(const char* source, int from, int to) {
Expr* Expr::makeOpUnary(OperatorType op, Expr* expr) {
ALLOC_EXPR(e, kExprOperator);
Expr* e = new Expr(kExprOperator);
e->op_type = op;
e->expr = expr;
e->expr2 = NULL;
@ -27,7 +27,7 @@ Expr* Expr::makeOpUnary(OperatorType op, Expr* expr) {
Expr* Expr::makeOpBinary(Expr* expr1, OperatorType op, Expr* expr2) {
ALLOC_EXPR(e, kExprOperator);
Expr* e = new Expr(kExprOperator);
e->op_type = op;
e->op_char = 0;
e->expr = expr1;
@ -36,7 +36,7 @@ Expr* Expr::makeOpBinary(Expr* expr1, OperatorType op, Expr* expr2) {
}
Expr* Expr::makeOpBinary(Expr* expr1, char op, Expr* expr2) {
ALLOC_EXPR(e, kExprOperator);
Expr* e = new Expr(kExprOperator);
e->op_type = SIMPLE_OP;
e->op_char = op;
e->expr = expr1;
@ -47,39 +47,39 @@ Expr* Expr::makeOpBinary(Expr* expr1, char op, Expr* expr2) {
Expr* Expr::makeLiteral(int64_t val) {
ALLOC_EXPR(e, kExprLiteralInt);
Expr* e = new Expr(kExprLiteralInt);
e->ival = val;
return e;
}
Expr* Expr::makeLiteral(double value) {
ALLOC_EXPR(e, kExprLiteralFloat);
Expr* e = new Expr(kExprLiteralFloat);
e->fval = value;
return e;
}
Expr* Expr::makeLiteral(char* string) {
ALLOC_EXPR(e, kExprLiteralString);
Expr* e = new Expr(kExprLiteralString);
e->name = string;
return e;
}
Expr* Expr::makeColumnRef(char* name) {
ALLOC_EXPR(e, kExprColumnRef);
Expr* e = new Expr(kExprColumnRef);
e->name = name;
return e;
}
Expr* Expr::makeColumnRef(char* table, char* name) {
ALLOC_EXPR(e, kExprTableColumnRef);
Expr* e = new Expr(kExprTableColumnRef);
e->name = name;
e->table = table;
return e;
}
Expr* Expr::makeFunctionRef(char* func_name, Expr* expr) {
ALLOC_EXPR(e, kExprFunctionRef);
Expr* e = new Expr(kExprFunctionRef);
e->name = func_name;
e->expr = expr;
return e;

View File

@ -91,6 +91,7 @@ struct Expr {
// Zero initializes an Expr object and assigns it to a space in the heap
// For Hyrise we still had to put in the explicit NULL constructor
// http://www.ex-parrot.com/~chris/random/initialise.html
// Unused
#define ALLOC_EXPR(var, type) \
Expr* var; \
do { \
@ -98,6 +99,7 @@ struct Expr {
var = (Expr*)malloc(sizeof *var); \
*var = zero; \
} while(0);
#undef ALLOC_EXPR
} // namespace hsql

View File

@ -48,6 +48,7 @@ struct LimitDescription {
/**
* @struct SelectStatement
* Representation of a full select statement.
* TODO: add union_order and union_limit
*/
struct SelectStatement : Statement {
SelectStatement() :

View File

@ -35,6 +35,7 @@
/* other flags */
%option noyywrap
%option nounput
%option warn
%option case-insensitive
%option prefix="hsql_"

View File

@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {
bool expect_false = false;
bool use_file = false;
char* file_path;
std::string file_path = "";
// Parse command line arguments
int i = 1;