Skip to content
Snippets Groups Projects
Commit 0bae462b authored by JasonJPu's avatar JasonJPu
Browse files

Change everything to rename

parent 8d57d576
No related branches found
No related tags found
No related merge requests found
......@@ -62,11 +62,11 @@ Body
TablePath
: TableIdentifier VarIdentifier
{ printf("last table path\n");
$$ = create_assign_operator($1, $2);
$$ = create_rename_operator($1, $2);
}
| TableIdentifier VarIdentifier ',' TablePath
{ printf("table path2\n");
$$ = create_cross_operator(create_assign_operator($1, $2), $4);
$$ = create_cross_operator(create_rename_operator($1, $2), $4);
}
;
......@@ -89,11 +89,11 @@ Select_List
}
| Col
{ printf("select list attr path\n");
$$ = create_assign_operator($1, NULL);
$$ = create_rename_operator($1, NULL);
}
| Col ',' Select_List
{ printf("Select list\n");
$$ = create_assign_operator($1, $2);
$$ = create_rename_operator($1, $2);
}
;
......
No preview for this file type
......@@ -128,15 +128,6 @@ cons_cell* create_rename_operator(cons_cell* table, cons_cell* var) {
return operator_cons;
}
// For when you want to assign a var to a table
cons_cell* create_assign_operator(cons_cell* table, cons_cell* var) {
// cdr to get to cons atom, car to get atom itself
cons_cell* assign_cons = create_cons_cell(table, var);
char operator[3] = "AS\0";
cons_cell* operator_cons = create_cons_cell_w_atom(operator, assign_cons);
return operator_cons;
}
cons_cell* create_proj_operator(cons_cell* assign, cons_cell* ra) {
cons_cell* ra_cons = create_cons_cell(ra, NULL);
cons_cell* assign_cons = create_cons_cell(assign, ra_cons);
......
......@@ -6,7 +6,6 @@
#include <stdbool.h>
#include <string.h>
#include <assert.h>
//#include <glib.h>
// Basic building blocks that contain char values
typedef struct atom {
......@@ -23,8 +22,6 @@ typedef struct cons_cell {
bool is_atom;
} cons_cell;
//static GHashTable* hash = NULL;
// Creates a cons_cell
cons_cell* create_cons_cell(void* car, cons_cell* cdr);
// Creates an atom
......@@ -77,7 +74,6 @@ cons_cell* create_atom_operator(cons_cell* table, cons_cell* var);
cons_cell* create_union_all_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_cross_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_rename_operator(cons_cell* table, cons_cell* var);
cons_cell* create_assign_operator(cons_cell* table, cons_cell* var);
cons_cell* create_proj_operator(cons_cell* assign, cons_cell* ra);
cons_cell* create_not_operator(cons_cell* ra1, cons_cell* ra2);
cons_cell* create_limit_operator(cons_cell* ra1, cons_cell* ra2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment