Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Roseseed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wanxin Li
Roseseed
Commits
0bae462b
Commit
0bae462b
authored
5 years ago
by
JasonJPu
Browse files
Options
Downloads
Patches
Plain Diff
Change everything to rename
parent
8d57d576
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
SQLPGrammar.y
+4
-4
4 additions, 4 deletions
SQLPGrammar.y
SQLPParser
+0
-0
0 additions, 0 deletions
SQLPParser
util.c
+0
-9
0 additions, 9 deletions
util.c
util.h
+0
-4
0 additions, 4 deletions
util.h
with
4 additions
and
17 deletions
SQLPGrammar.y
+
4
−
4
View file @
0bae462b
...
@@ -62,11 +62,11 @@ Body
...
@@ -62,11 +62,11 @@ Body
TablePath
TablePath
: TableIdentifier VarIdentifier
: TableIdentifier VarIdentifier
{ printf("last table path\n");
{ printf("last table path\n");
$$ = create_
assign
_operator($1, $2);
$$ = create_
rename
_operator($1, $2);
}
}
| TableIdentifier VarIdentifier ',' TablePath
| TableIdentifier VarIdentifier ',' TablePath
{ printf("table path2\n");
{ 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
...
@@ -89,11 +89,11 @@ Select_List
}
}
| Col
| Col
{ printf("select list attr path\n");
{ printf("select list attr path\n");
$$ = create_
assign
_operator($1, NULL);
$$ = create_
rename
_operator($1, NULL);
}
}
| Col ',' Select_List
| Col ',' Select_List
{ printf("Select list\n");
{ printf("Select list\n");
$$ = create_
assign
_operator($1, $2);
$$ = create_
rename
_operator($1, $2);
}
}
;
;
...
...
This diff is collapsed.
Click to expand it.
SQLPParser
+
0
−
0
View file @
0bae462b
No preview for this file type
This diff is collapsed.
Click to expand it.
util.c
+
0
−
9
View file @
0bae462b
...
@@ -128,15 +128,6 @@ cons_cell* create_rename_operator(cons_cell* table, cons_cell* var) {
...
@@ -128,15 +128,6 @@ cons_cell* create_rename_operator(cons_cell* table, cons_cell* var) {
return
operator_cons
;
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
*
create_proj_operator
(
cons_cell
*
assign
,
cons_cell
*
ra
)
{
cons_cell
*
ra_cons
=
create_cons_cell
(
ra
,
NULL
);
cons_cell
*
ra_cons
=
create_cons_cell
(
ra
,
NULL
);
cons_cell
*
assign_cons
=
create_cons_cell
(
assign
,
ra_cons
);
cons_cell
*
assign_cons
=
create_cons_cell
(
assign
,
ra_cons
);
...
...
This diff is collapsed.
Click to expand it.
util.h
+
0
−
4
View file @
0bae462b
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
#include
<stdbool.h>
#include
<stdbool.h>
#include
<string.h>
#include
<string.h>
#include
<assert.h>
#include
<assert.h>
//#include <glib.h>
// Basic building blocks that contain char values
// Basic building blocks that contain char values
typedef
struct
atom
{
typedef
struct
atom
{
...
@@ -23,8 +22,6 @@ typedef struct cons_cell {
...
@@ -23,8 +22,6 @@ typedef struct cons_cell {
bool
is_atom
;
bool
is_atom
;
}
cons_cell
;
}
cons_cell
;
//static GHashTable* hash = NULL;
// Creates a cons_cell
// Creates a cons_cell
cons_cell
*
create_cons_cell
(
void
*
car
,
cons_cell
*
cdr
);
cons_cell
*
create_cons_cell
(
void
*
car
,
cons_cell
*
cdr
);
// Creates an atom
// Creates an atom
...
@@ -77,7 +74,6 @@ cons_cell* create_atom_operator(cons_cell* table, cons_cell* var);
...
@@ -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_union_all_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
);
cons_cell
*
create_cross_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_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_proj_operator
(
cons_cell
*
assign
,
cons_cell
*
ra
);
cons_cell
*
create_not_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
);
cons_cell
*
create_not_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
);
cons_cell
*
create_limit_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
);
cons_cell
*
create_limit_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment