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
Snippets
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
Eva Feng
LDI
Commits
61f1cc60
Commit
61f1cc60
authored
5 years ago
by
w328li
Browse files
Options
Downloads
Patches
Plain Diff
clean up code
parent
667a2f3e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util_new.c
+0
-18
0 additions, 18 deletions
util_new.c
with
0 additions
and
18 deletions
util_new.c
+
0
−
18
View file @
61f1cc60
...
...
@@ -83,9 +83,7 @@ cons_cell* create_op(char *op) {
return
create_cons_cell_w_atom
(
operator
,
op_cons
);
}
// todo: why need ra
cons_cell
*
create_comp_operator
(
cons_cell
*
op
,
cons_cell
*
term1
,
cons_cell
*
term2
)
{
cons_cell
*
term2_cons
=
create_cons_cell
(
term2
,
NULL
);
cons_cell
*
term1_cons
=
create_cons_cell
(
term1
,
term2_cons
);
cons_cell
*
op_cons
=
create_cons_cell
(
op
,
term1_cons
);
...
...
@@ -120,12 +118,6 @@ cons_cell* create_union_operator(cons_cell* ra1, cons_cell* ra2) {
}
cons_cell
*
create_and_operator
(
cons_cell
*
ra1
,
cons_cell
*
ra2
)
{
// cons_cell* create_and_operator(cons_cell* ra1) {
// cons_cell* ra_cons = create_cons_cell(ra1, NULL);
// char operator[4] = "AND\0";
// cons_cell* operator_cons = create_cons_cell_w_atom(operator, ra_cons);
// return operator_cons;
printf
(
"create_and_operator called
\n
"
);
cons_cell
*
ra2_cons
=
create_cons_cell
(
ra2
,
NULL
);
cons_cell
*
ra1_cons
=
create_cons_cell
(
ra1
,
ra2_cons
);
...
...
@@ -158,7 +150,6 @@ cons_cell* create_cross_operator(cons_cell* ra1, cons_cell* ra2) {
return
operator_cons
;
}
// For when you want to assign column names to another name
cons_cell
*
create_rename_operator
(
cons_cell
*
table
,
cons_cell
*
var
)
{
cons_cell
*
original_cons
=
create_cons_cell
(
table
,
var
);
char
operator
[
7
]
=
"RENAME
\0
"
;
...
...
@@ -223,30 +214,21 @@ void print_cons_tree(cons_cell *root) {
}
void
print_cons_tree_helper
(
cons_cell
*
root
,
int
indent
)
{
// ("eight\n");
if
(
root
==
NULL
)
{
// printf("six\n");
return
;
}
// printf("nine\n");
bool
tmp_atom
=
root
->
is_atom
;
// printf("ten\n");
if
(
root
->
is_atom
)
{
// printf("four\n");
for
(
int
i
=
0
;
i
<
indent
;
i
++
)
{
printf
(
" "
);
}
printf
(
"%s"
,
((
atom
*
)
root
->
car
)
->
val
);
printf
(
"
\n
"
);
// printf("one\n");
print_cons_tree_helper
(
root
->
cdr
,
indent
+
1
);
}
else
{
// printf("five\n");
cons_cell
*
tmp
=
(
cons_cell
*
)
root
->
car
;
// printf("seven\n");
print_cons_tree_helper
((
cons_cell
*
)
root
->
car
,
indent
);
// printf("three\n");
print_cons_tree_helper
(
root
->
cdr
,
indent
);
}
}
...
...
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