[Swift-commit] r5214 - provenancedb

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Sat Oct 8 23:38:12 CDT 2011


Author: lgadelha
Date: 2011-10-08 23:38:12 -0500 (Sat, 08 Oct 2011)
New Revision: 5214

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


Modified: provenancedb/ProvSQL.g
===================================================================
--- provenancedb/ProvSQL.g	2011-10-07 22:56:25 UTC (rev 5213)
+++ provenancedb/ProvSQL.g	2011-10-09 04:38:12 UTC (rev 5214)
@@ -262,20 +262,56 @@
 		;     
 
 selectExpression
-	:	a=entityAttribute 
+	:	(
+		a=entityAttribute 
 		{ 
 			selectClause += $a.text; 
 			relations.add($a.text.split("\\.")[0]);
 			if($a.text.split("\\.").length == 1)
 				selectClause +=  ".*";
 		}
-		(COLON b=entityAttribute 
+		|
+		b=AGGRFUN
+		{
+			selectclause+=$b.text;
+		} 
+		'(' 	{ selectclause+="("; }
+		c=entityAttribute  
 		{ 
-			selectClause += "," + $b.text; 
-			relations.add($b.text.split("\\.")[0]);
-			if($b.text.split("\\.").length == 1)
+			selectClause += $c.text; 
+			relations.add($c.text.split("\\.")[0]);
+			if($c.text.split("\\.").length == 1)
 				selectClause +=  ".*";
 		}
+		')' 	{ selectclause+=")"; }
+
+		)
+		(COLON 
+		(
+		d=entityAttribute 
+		{ 
+			selectClause += "," + $d.text; 
+			relations.add($d.text.split("\\.")[0]);
+			if($d.text.split("\\.").length == 1)
+				selectClause +=  ".*";
+		}
+		|
+		e=AGGRFUN
+		{
+			selectclause+=$e.text;
+		} 
+		'(' 	{ selectclause+="("; }
+		f=entityAttribute  
+		{ 
+			selectClause += $f.text; 
+			relations.add($f.text.split("\\.")[0]);
+			if($f.text.split("\\.").length == 1)
+				selectClause +=  ".*";
+		}
+		')' 	{ selectclause+=")"; }
+
+
+		)
 		)*
 	;
 
@@ -389,6 +425,8 @@
 
 OP	:	'=' | '>' | '>=' | '<' | '<=';
 
+AGGRFUN	:	'avg' | 'max' | 'min' | 'count' | 'sum';
+
 SELECT 	:	's' 'e' 'l' 'e' 'c' 't';
 
 DISTINCT 




More information about the Swift-commit mailing list