[Swift-commit] r5479 - provenancedb
lgadelha at ci.uchicago.edu
lgadelha at ci.uchicago.edu
Tue Jan 3 04:47:28 CST 2012
Author: lgadelha
Date: 2012-01-03 04:47:26 -0600 (Tue, 03 Jan 2012)
New Revision: 5479
Modified:
provenancedb/ProvSQL.g
Log:
Minor changes
Modified: provenancedb/ProvSQL.g
===================================================================
--- provenancedb/ProvSQL.g 2011-12-30 15:21:09 UTC (rev 5478)
+++ provenancedb/ProvSQL.g 2012-01-03 10:47:26 UTC (rev 5479)
@@ -308,17 +308,29 @@
{
System.out.print(" ORDER BY ");
}
+ (
c=entityAndAttribute
{
System.out.print($c.text);
}
+ |
+ COUNT { System.out.print(" COUNT "); }
+ |
+ e=AGGRFUN { System.out.print(" " + $e.text + " "); }
+ )
(
- COLON
+ COLON { System.out.print(","); }
+ (
d=entityAndAttribute
{
- System.out.print(",");
System.out.print($d.text);
}
+ |
+ COUNT { System.out.print(" COUNT "); }
+ |
+ f=AGGRFUN { System.out.print(" " + $f.text + " "); }
+
+ )
)*
(
DESC { System.out.print(" DESC "); }
@@ -332,6 +344,7 @@
')' { System.out.print(")"); }
;
+
selectAtom
: a=entityAttribute
{
@@ -355,7 +368,25 @@
}
')' { selectClause+=")"; }
|
- builtInProcedureAttribute
+ d=COUNT
+ {
+ selectClause+=$d.text;
+ }
+ '(' { selectClause+="("; }
+ (
+ e=entityAttribute
+ {
+ selectClause += $e.text;
+ relations.add($e.text.split("\\.")[0]);
+ if($e.text.split("\\.").length == 1)
+ selectClause += ".*";
+ }
+ |
+ '*' { selectClause+="*"; }
+ )
+ ')' { selectClause+=")"; }
+ |
+ builtInProcedureAttribute
;
selectExpression
@@ -657,8 +688,10 @@
BY : 'by';
-AGGRFUN : 'avg' | 'max' | 'min' | 'count' | 'sum';
+AGGRFUN : 'avg' | 'max' | 'min' | 'sum';
+COUNT : 'count';
+
SELECT : 'select';
DESC : 'desc';
More information about the Swift-commit
mailing list