Skip to content
Snippets Groups Projects
Commit 232d708f authored by Julien Lopez's avatar Julien Lopez
Browse files

[MINOR] Cleanup and print the name of a variable if visited

parent 082f8443
Branches
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -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();
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment