Add "collection" as a synonym to "table" in SQL++.

Change-Id: I95f87a1b6e8365f2148afdfb86f942a5dfef0dc9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/755
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index ec915e9..38b4429 100644
--- a/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -433,7 +433,7 @@
 }
 {
   (
-    <EXTERNAL> <DATASET> nameComponents = QualifiedName()
+    <EXTERNAL> Dataset() nameComponents = QualifiedName()
     <LEFTPAREN> typeComponents = TypeName() <RIGHTPAREN>
     ifNotExists = IfNotExists()
     <USING> adapterName = AdapterName() properties = Configuration()
@@ -460,7 +460,7 @@
       }
 
     | (<INTERNAL> | <TEMPORARY> { temp = true; })?
-    <DATASET> nameComponents = QualifiedName()
+    Dataset() nameComponents = QualifiedName()
     <LEFTPAREN> typeComponents = TypeName() <RIGHTPAREN>
     (
         { String name; }
@@ -516,7 +516,7 @@
   String datasetName = null;
 }
 {
-    <REFRESH> <EXTERNAL> <DATASET> nameComponents = QualifiedName()
+    <REFRESH> <EXTERNAL> Dataset() nameComponents = QualifiedName()
     {
     redss.setDataverseName(nameComponents.first);
     redss.setDatasetName(nameComponents.second);
@@ -538,8 +538,8 @@
       parameters.add(tmp);
     }
   )*<RIGHTPAREN>
-  <FROM> <DATASET> nameComponentsFrom  = QualifiedName()
-  <TO> <DATASET> nameComponentsTo  = QualifiedName()
+  <FROM> Dataset() nameComponentsFrom  = QualifiedName()
+  <TO> Dataset() nameComponentsTo  = QualifiedName()
     {
       return new RunStatement(system, parameters, nameComponentsFrom.first, nameComponentsFrom.second, nameComponentsTo.first, nameComponentsTo.second);
     }
@@ -866,7 +866,7 @@
 {
   <DROP>
   (
-    <DATASET> pairId = QualifiedName() ifExists = IfExists()
+    Dataset() pairId = QualifiedName() ifExists = IfExists()
       {
         stmt = new DropStatement(pairId.first, pairId.second, ifExists);
       }
@@ -1041,7 +1041,7 @@
   Pair<Identifier,Identifier> nameComponents = null;
 }
 {
-  <LOAD> <DATASET> nameComponents = QualifiedName()
+  <LOAD> Dataset() nameComponents = QualifiedName()
     {
       dataverseName = nameComponents.first;
       datasetName = nameComponents.second;
@@ -1075,7 +1075,7 @@
   Statement stmt = null;
 }
 {
-  <COMPACT> <DATASET> nameComponents = QualifiedName()
+  <COMPACT> Dataset() nameComponents = QualifiedName()
     {
       stmt = new CompactStatement(nameComponents.first, nameComponents.second);
     }
@@ -1095,11 +1095,11 @@
 }
 {
   (
-    <CONNECT> <FEED> feedNameComponents = QualifiedName() <TO> <DATASET> datasetNameComponents = QualifiedName() (policy = GetPolicy())?
+    <CONNECT> <FEED> feedNameComponents = QualifiedName() <TO> Dataset() datasetNameComponents = QualifiedName() (policy = GetPolicy())?
       {
         stmt = new ConnectFeedStatement(feedNameComponents, datasetNameComponents, policy, getVarCounter());
       }
-    | <DISCONNECT> <FEED> feedNameComponents = QualifiedName() <FROM> <DATASET> datasetNameComponents = QualifiedName()
+    | <DISCONNECT> <FEED> feedNameComponents = QualifiedName() <FROM> Dataset() datasetNameComponents = QualifiedName()
       {
         stmt = new DisconnectFeedStatement(feedNameComponents, datasetNameComponents);
       }
@@ -1389,6 +1389,13 @@
   )
 }
 
+void Dataset() throws ParseException:
+{
+}
+{
+    (<DATASET>|<COLLECTION>)
+}
+
 Pair<Integer, Pair<List<String>, TypeExpression>> OpenField() throws ParseException:
 {
   TypeExpression fieldType = null;
@@ -2671,6 +2678,7 @@
   | <CONNECT : "connect">
   | <CORRELATE : "correlate">
   | <DATASET : "table">
+  | <COLLECTION : "collection">
   | <DATAVERSE : "database">
   | <DECLARE : "declare">
   | <DEFINITION : "definition">