Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qir
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
qir
Commits
232d708f
Commit
232d708f
authored
Jan 20, 2016
by
Julien Lopez
Browse files
Options
Downloads
Patches
Plain Diff
[MINOR] Cleanup and print the name of a variable if visited
parent
082f8443
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/qir/driver/OracleDriver.java
+0
-1
0 additions, 1 deletion
src/qir/driver/OracleDriver.java
src/qir/driver/PostgreSQLDriver.java
+0
-5
0 additions, 5 deletions
src/qir/driver/PostgreSQLDriver.java
src/qir/util/IQIRVisitor.java
+1
-1
1 addition, 1 deletion
src/qir/util/IQIRVisitor.java
with
1 addition
and
7 deletions
src/qir/driver/OracleDriver.java
+
0
−
1
View file @
232d708f
...
...
@@ -38,7 +38,6 @@ public final class OracleDriver extends SQLDriver {
public
QIRList
run
(
QIRNode
root
)
{
QIRSQLVisitor
visitor
=
new
QIRSQLVisitor
();
String
query
=
root
.
accept
(
visitor
);
System
.
out
.
println
(
"Query: "
+
query
);
Map
<
String
,
String
>
funs
=
visitor
.
popProlog
();
try
{
enableWalnut
();
...
...
This diff is collapsed.
Click to expand it.
src/qir/driver/PostgreSQLDriver.java
+
0
−
5
View file @
232d708f
...
...
@@ -6,7 +6,6 @@ import java.util.*;
import
qir.ast.*
;
import
qir.ast.data.*
;
import
qir.driver.ConnectionData
;
import
qir.util.QIRPrintVisitor
;
/**
* This driver is the intermediate between QIR and the PostgreSQL database.
...
...
@@ -33,15 +32,11 @@ public final class PostgreSQLDriver extends SQLDriver {
@Override
public
QIRList
run
(
QIRNode
root
)
{
QIRSQLVisitor
visitor
=
new
QIRSQLVisitor
();
QIRPrintVisitor
debugVisitor
=
new
QIRPrintVisitor
();
System
.
out
.
println
(
"Query qir: "
+
root
.
accept
(
debugVisitor
));
String
query
=
root
.
accept
(
visitor
);
// TODO: Fix this.
query
=
query
.
startsWith
(
"from "
)
?
"select * "
+
query
:
query
;
System
.
out
.
println
(
"Query: "
+
query
);
try
{
QIRList
result
=
executeQuery
(
query
);
System
.
out
.
println
(
"Results qir: "
+
result
.
accept
(
debugVisitor
));
return
result
;
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
src/qir/util/IQIRVisitor.java
+
1
−
1
View file @
232d708f
...
...
@@ -31,7 +31,7 @@ public interface IQIRVisitor<T> {
* @param qirVariable A variable that should have been handled elsewhere.
*/
public
default
T
visit
(
QIRVariable
qirVariable
)
{
throw
new
UnsupportedOperationException
(
"Error: we should not visit a QIRVariable.
"
);
throw
new
UnsupportedOperationException
(
"Error: we should not visit a QIRVariable.
Tried to visit: "
+
qirVariable
.
getId
()
);
}
public
abstract
T
visit
(
QIRLambda
qirLambda
);
...
...
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
sign in
to comment