[Swift-commit] r4987 - provenancedb

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Tue Aug 16 14:33:59 CDT 2011


Author: lgadelha
Date: 2011-08-16 14:33:59 -0500 (Tue, 16 Aug 2011)
New Revision: 4987

Modified:
   provenancedb/ProvSQL.g
Log:
Minor fixes.


Modified: provenancedb/ProvSQL.g
===================================================================
--- provenancedb/ProvSQL.g	2011-08-16 13:42:42 UTC (rev 4986)
+++ provenancedb/ProvSQL.g	2011-08-16 19:33:59 UTC (rev 4987)
@@ -212,12 +212,17 @@
 
 squery	:	SELECT selectExpression 
 		{ 
+
+			System.out.print("SELECT " + selectClause);
+			
+
+		}
+		(WHERE whereExpression
+		{
 			schemaGraph = buildGraph();
 			joinEdges = computeJoinEdges(schemaGraph, relations);
 			hasWhereJoinExpression=false;
 
-			System.out.print("SELECT " + selectClause);
-			
 			fromClause += computeFrom(schemaGraph, joinEdges, relations);
 
 			System.out.print(fromClause);
@@ -229,9 +234,6 @@
 				System.out.print(" WHERE " + whereClauseJoinExpressions);
 			}
 
-		}
-		(WHERE whereExpression
-		{
 			if(hasWhereJoinExpression)
 				System.out.print(" AND ");
 			else
@@ -285,10 +287,18 @@
 	;
 
 whereAtom 
-	:	entityAttribute 
+	:	a=entityAttribute 
+		{ 
+			relations.add($a.text.split("\\.")[0]);
+		}
+
 	OP 
 	(STRING | INT | FLOAT)
-	|	entityAttribute 
+	|	b=entityAttribute 
+		{ 
+			relations.add($b.text.split("\\.")[0]);
+		}
+
 	BETWEEN STRING AND STRING;
 
 entityAttribute	:	ID (DOT ID)?;




More information about the Swift-commit mailing list