[Swift-commit] r5216 - provenancedb

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Sun Oct 9 17:38:10 CDT 2011


Author: lgadelha
Date: 2011-10-09 17:38:09 -0500 (Sun, 09 Oct 2011)
New Revision: 5216

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


Modified: provenancedb/ProvSQL.g
===================================================================
--- provenancedb/ProvSQL.g	2011-10-09 21:19:23 UTC (rev 5215)
+++ provenancedb/ProvSQL.g	2011-10-09 22:38:09 UTC (rev 5216)
@@ -271,7 +271,11 @@
  			System.out.print($b.text);
  		}
  		)*
+ 		(
+ 		HAVING { System.out.print(" HAVING "); }
+ 		havingExpression
  		)?
+ 		)?
  		(
  		ORDER BY 
  		{
@@ -289,7 +293,12 @@
  			System.out.print($d.text);
  		}
  		)*
+ 		(
+ 			DESC { System.out.print(" DESC "); }
+ 			| 
+ 			ASC  { System.out.print(" ASC "); }
  		)?
+ 		)?
 		|
 		'(' { System.out.print("("); }
 		squery
@@ -456,6 +465,113 @@
 	)
 	;
 	
+havingExpression	
+	:	havingAtom
+		(
+			(AND 
+			{
+				System.out.print(" AND ");
+			}
+			| OR
+			{
+				System.out.print(" OR ");
+			}
+			) havingAtom
+		)* 
+	;
+
+	
+havingAtom 
+	:	a=entityAndAttribute 
+		{ 
+			System.out.print($a.text);
+		}
+			(
+		NOT
+		{
+			System.out.print(" NOT ");
+		}
+	)? 
+
+	(
+	b=OP
+	{
+		System.out.print($b.text);
+	} 
+	(
+	c=STRING
+	{
+		System.out.print($c.text);
+	} 
+	| 
+	d=INT
+	{
+		System.out.print($d.text);
+	} 
+	|
+	e=FLOAT
+	{
+		System.out.print($e.text);
+	} 
+	)
+	|
+	BETWEEN 
+	{
+		System.out.print(" BETWEEN ");
+	} 
+	f=STRING 
+	{
+		System.out.print($f.text);
+	} 
+	AND 
+	{
+		System.out.print(" AND ");
+	} 
+	g=STRING
+	{
+		System.out.print($g.text);
+	} 
+	|
+	LIKE
+	{
+		System.out.print(" BETWEEN ");
+	} 
+	h=STRING 
+	{
+		System.out.print($h.text);
+	} 
+		|
+	(
+	IN 
+	{
+		System.out.print(" IN ");
+	}
+	|
+		i=OP 
+	{
+		System.out.print($i.text);
+	} 
+
+	(
+		ALL 
+		{
+			System.out.print(" ALL ");
+		}
+		| 
+		ANY
+		{
+			System.out.print(" ANY ");
+		}
+	)
+
+	)
+		'(' { System.out.print("("); }
+		squery
+		')' { System.out.print(")"); }
+	)
+	;
+
+
 entityAttribute	:	ID (DOT ID)?;
 
 entityAndAttribute
@@ -473,6 +589,10 @@
 
 SELECT 	:	's' 'e' 'l' 'e' 'c' 't';
 
+DESC	:	'desc';
+
+ASC	:	'asc';
+
 DISTINCT 
 	:	'd' 'i' 's' 't' 'i' 'n' 'c' 't';
 	
@@ -503,6 +623,8 @@
 
 BETWEEN	:	'b' 'e' 't' 'w' 'e' 'e' 'n';
 
+HAVING	:	'having';
+
 LIKE 	:	'l' 'i' 'k' 'e';
 
 SEMICOLON	:	';';




More information about the Swift-commit mailing list