Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LDI
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
Grant Weddell
LDI
Commits
8be58de3
Commit
8be58de3
authored
6 years ago
by
JasonJPu
Browse files
Options
Downloads
Patches
Plain Diff
Compiles
parent
31f67726
No related branches found
No related tags found
1 merge request
!1
SQLP parser with cons cells
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
SQLPGrammar.y
+3
-7
3 additions, 7 deletions
SQLPGrammar.y
SQLPParser
+0
-0
0 additions, 0 deletions
SQLPParser
util.h
+22
-0
22 additions, 0 deletions
util.h
util.o
+0
-0
0 additions, 0 deletions
util.o
with
25 additions
and
7 deletions
SQLPGrammar.y
+
3
−
7
View file @
8be58de3
...
...
@@ -2,11 +2,7 @@
#include "util.h"
%}
// %union {
// struct node *n;
//}
%define api.value.type {struct node *}
%define api.value.type {cons_cell *}
%token IMPLIES OR AND NOT LE GE LT GT NE HAS MAX MIN AS ASC DESC MOD ASSIGN EQ STAR COMMA DOT
%token SIZE SELECTIVITY OVERLAP
...
...
@@ -96,8 +92,8 @@ Union_Query
Select_List
: STAR
{ printf("star\n");
$$ = new_node(1, Select_List);
$$->children[0] = new_node(0, STAR);
//
$$ = new_node(1, Select_List);
//
$$->children[0] = new_node(0, STAR);
}
| Col
{ printf("select list attr path\n");
...
...
This diff is collapsed.
Click to expand it.
SQLPParser
0 → 100755
+
0
−
0
View file @
8be58de3
File added
This diff is collapsed.
Click to expand it.
util.h
+
22
−
0
View file @
8be58de3
...
...
@@ -48,9 +48,31 @@ enum type {
Pred
};
cons_cell
*
create_cons_cell
(
void
*
car
,
cons_cell
*
cdr
);
atom
*
create_atom
(
char
*
val
);
cons_cell
*
create_cons_cell_w_atom
(
char
*
val
,
cons_cell
*
cdr
);
cons_cell
*
create_spcol
(
cons_cell
*
var
,
cons_cell
*
pf
);
cons_cell
*
create_pf
(
cons_cell
*
attr
,
cons_cell
*
next_attr
);
cons_cell
*
create_table
(
char
*
table
);
cons_cell
*
create_term
(
char
*
term
);
cons_cell
*
create_col
(
char
*
col
);
cons_cell
*
create_attr
(
char
*
attr
);
cons_cell
*
create_var
(
char
*
var
);
cons_cell
*
create_comp_operator
(
char
*
op
,
cons_cell
*
term1
,
cons_cell
*
term2
,
cons_cell
*
ra
);
cons_cell
*
create_atom_operator
(
char
*
tab_name
,
char
*
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_assign_operator
(
char
*
original
,
char
*
new_name
,
cons_cell
*
next
);
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
);
cons_cell
*
create_elim_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
);
cons_cell
*
create_eval_operator
(
cons_cell
*
logic
,
cons_cell
*
cross
);
struct
node
*
new_node
(
int
count
,
int
type
);
void
translate
(
struct
linked_node
*
linked_tree
,
struct
node
*
tree
);
void
print_cons_tree
(
cons_cell
*
root
,
int
indent
);
void
print_tree
(
struct
node
*
root
,
int
indent
);
void
print_linked_tree
(
struct
linked_node
*
root
,
int
indent
);
void
destroy_tree
(
struct
node
*
root
);
...
...
This diff is collapsed.
Click to expand it.
util.o
+
0
−
0
View file @
8be58de3
No preview for this file type
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