You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@vitalstatistix.ics.uci.edu> on 2019/11/26 23:03:44 UTC

Change in asterixdb-bad[master]: Coordinated change for SQL++ grammar refactoring

From Dmitry Lychagin <dm...@couchbase.com>:

Dmitry Lychagin has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366 )


Change subject: Coordinated change for SQL++ grammar refactoring
......................................................................

Coordinated change for SQL++ grammar refactoring

Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
---
M asterix-bad/src/main/resources/lang-extension/lang.txt
1 file changed, 56 insertions(+), 17 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-bad refs/changes/66/4366/1

diff --git a/asterix-bad/src/main/resources/lang-extension/lang.txt b/asterix-bad/src/main/resources/lang-extension/lang.txt
index 42c4223..1c729a7 100644
--- a/asterix-bad/src/main/resources/lang-extension/lang.txt
+++ b/asterix-bad/src/main/resources/lang-extension/lang.txt
@@ -59,7 +59,10 @@
   (
     // merge area 2
     before:
-    after:    | stmt = ChannelSpecification() | stmt = BrokerSpecification() | stmt = ProcedureSpecification())
+    after:    | stmt = CreateChannelStatement()
+              | stmt = CreateBrokerStatement()
+              | stmt = CreateProcedureStatement()
+  )
   {
     // merge area 3
   }
@@ -76,26 +79,17 @@
   (
     // merge area 2
     before:
-    after:    | "channel" pairId = QualifiedName() ifExists = IfExists()
-      {
-        stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
-      }
-              | "broker" pairId = QualifiedName() ifExists = IfExists()
-      {
-        stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);
-      }
-              | "procedure" funcSig = FunctionSignature() ifExists = IfExists()
-      {
-        stmt = new ProcedureDropStatement(funcSig, ifExists);
-      }
-      )
+    after:    | stmt = DropChannelStatement(startToken)
+              | stmt = DropBrokerStatement(startToken)
+              | stmt = DropProcedureStatement(startToken)
+  )
   {
     // merge area 3
   }
 }
 
 @new
-CreateChannelStatement ChannelSpecification() throws ParseException:
+CreateChannelStatement CreateChannelStatement() throws ParseException:
 {
   Pair<DataverseName,Identifier> nameComponents = null;
   FunctionSignature appliedFunction = null;
@@ -122,7 +116,7 @@
 }
 
 @new
-CreateProcedureStatement ProcedureSpecification() throws ParseException:
+CreateProcedureStatement CreateProcedureStatement() throws ParseException:
 {
   FunctionName fctName = null;
   FunctionSignature signature;
@@ -197,7 +191,7 @@
 }
 
 @new
-CreateBrokerStatement BrokerSpecification() throws ParseException:
+CreateBrokerStatement CreateBrokerStatement() throws ParseException:
 {
   CreateBrokerStatement cbs = null;
   Pair<DataverseName,Identifier> name = null;
@@ -266,4 +260,49 @@
     {
       return stmt;
     }
+}
+
+@new
+ChannelDropStatement DropChannelStatement(Token startStmtToken) throws ParseException:
+{
+  ChannelDropStatement stmt = null;
+  Pair<DataverseName,Identifier> pairId = null;
+  boolean ifExists = false;
+}
+{
+  "channel" pairId = QualifiedName() ifExists = IfExists()
+  {
+    stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
+}
+
+@new
+BrokerDropStatement DropBrokerStatement(Token startStmtToken) throws ParseException:
+{
+  BrokerDropStatement stmt = null;
+  Pair<DataverseName,Identifier> pairId = null;
+  boolean ifExists = false;
+}
+{
+  "broker" pairId = QualifiedName() ifExists = IfExists()
+  {
+    stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
+}
+
+@new
+ProcedureDropStatement DropProcedureStatement(Token startStmtToken) throws ParseException:
+{
+  ProcedureDropStatement stmt = null;
+  FunctionSignature funcSig = null;
+  boolean ifExists = false;
+}
+{
+  "procedure" funcSig = FunctionSignature() ifExists = IfExists()
+  {
+    stmt = new ProcedureDropStatement(funcSig, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
 }
\ No newline at end of file

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
Gerrit-Change-Number: 4366
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-MessageType: newchange

Change in asterixdb-bad[master]: Coordinated change for SQL++ grammar refactoring

Posted by AsterixDB Code Review <do...@vitalstatistix.ics.uci.edu>.
From Ali Alsuliman <al...@gmail.com>:

Ali Alsuliman has posted comments on this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366 )

Change subject: Coordinated change for SQL++ grammar refactoring
......................................................................


Patch Set 1: Code-Review+2


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
Gerrit-Change-Number: 4366
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-Reviewer: Ali Alsuliman <al...@gmail.com>
Gerrit-Reviewer: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Xikui Wang <xk...@gmail.com>
Gerrit-Comment-Date: Tue, 03 Dec 2019 18:01:43 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Change in asterixdb-bad[master]: Coordinated change for SQL++ grammar refactoring

Posted by AsterixDB Code Review <do...@vitalstatistix.ics.uci.edu>.
From Dmitry Lychagin <dm...@couchbase.com>:

Dmitry Lychagin has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366 )


Change subject: Coordinated change for SQL++ grammar refactoring
......................................................................

Coordinated change for SQL++ grammar refactoring

Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
---
M asterix-bad/src/main/resources/lang-extension/lang.txt
1 file changed, 56 insertions(+), 17 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-bad refs/changes/66/4366/1

diff --git a/asterix-bad/src/main/resources/lang-extension/lang.txt b/asterix-bad/src/main/resources/lang-extension/lang.txt
index 42c4223..1c729a7 100644
--- a/asterix-bad/src/main/resources/lang-extension/lang.txt
+++ b/asterix-bad/src/main/resources/lang-extension/lang.txt
@@ -59,7 +59,10 @@
   (
     // merge area 2
     before:
-    after:    | stmt = ChannelSpecification() | stmt = BrokerSpecification() | stmt = ProcedureSpecification())
+    after:    | stmt = CreateChannelStatement()
+              | stmt = CreateBrokerStatement()
+              | stmt = CreateProcedureStatement()
+  )
   {
     // merge area 3
   }
@@ -76,26 +79,17 @@
   (
     // merge area 2
     before:
-    after:    | "channel" pairId = QualifiedName() ifExists = IfExists()
-      {
-        stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
-      }
-              | "broker" pairId = QualifiedName() ifExists = IfExists()
-      {
-        stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);
-      }
-              | "procedure" funcSig = FunctionSignature() ifExists = IfExists()
-      {
-        stmt = new ProcedureDropStatement(funcSig, ifExists);
-      }
-      )
+    after:    | stmt = DropChannelStatement(startToken)
+              | stmt = DropBrokerStatement(startToken)
+              | stmt = DropProcedureStatement(startToken)
+  )
   {
     // merge area 3
   }
 }
 
 @new
-CreateChannelStatement ChannelSpecification() throws ParseException:
+CreateChannelStatement CreateChannelStatement() throws ParseException:
 {
   Pair<DataverseName,Identifier> nameComponents = null;
   FunctionSignature appliedFunction = null;
@@ -122,7 +116,7 @@
 }
 
 @new
-CreateProcedureStatement ProcedureSpecification() throws ParseException:
+CreateProcedureStatement CreateProcedureStatement() throws ParseException:
 {
   FunctionName fctName = null;
   FunctionSignature signature;
@@ -197,7 +191,7 @@
 }
 
 @new
-CreateBrokerStatement BrokerSpecification() throws ParseException:
+CreateBrokerStatement CreateBrokerStatement() throws ParseException:
 {
   CreateBrokerStatement cbs = null;
   Pair<DataverseName,Identifier> name = null;
@@ -266,4 +260,49 @@
     {
       return stmt;
     }
+}
+
+@new
+ChannelDropStatement DropChannelStatement(Token startStmtToken) throws ParseException:
+{
+  ChannelDropStatement stmt = null;
+  Pair<DataverseName,Identifier> pairId = null;
+  boolean ifExists = false;
+}
+{
+  "channel" pairId = QualifiedName() ifExists = IfExists()
+  {
+    stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
+}
+
+@new
+BrokerDropStatement DropBrokerStatement(Token startStmtToken) throws ParseException:
+{
+  BrokerDropStatement stmt = null;
+  Pair<DataverseName,Identifier> pairId = null;
+  boolean ifExists = false;
+}
+{
+  "broker" pairId = QualifiedName() ifExists = IfExists()
+  {
+    stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
+}
+
+@new
+ProcedureDropStatement DropProcedureStatement(Token startStmtToken) throws ParseException:
+{
+  ProcedureDropStatement stmt = null;
+  FunctionSignature funcSig = null;
+  boolean ifExists = false;
+}
+{
+  "procedure" funcSig = FunctionSignature() ifExists = IfExists()
+  {
+    stmt = new ProcedureDropStatement(funcSig, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
 }
\ No newline at end of file

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
Gerrit-Change-Number: 4366
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-MessageType: newchange

Change in asterixdb-bad[master]: Coordinated change for SQL++ grammar refactoring

Posted by AsterixDB Code Review <do...@vitalstatistix.ics.uci.edu>.
From Dmitry Lychagin <dm...@couchbase.com>:

Dmitry Lychagin has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366 )

Change subject: Coordinated change for SQL++ grammar refactoring
......................................................................

Coordinated change for SQL++ grammar refactoring

Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
---
M asterix-bad/src/main/resources/lang-extension/lang.txt
1 file changed, 56 insertions(+), 17 deletions(-)

Approvals:
  Jenkins: Verified
  Ali Alsuliman: Looks good to me, approved



diff --git a/asterix-bad/src/main/resources/lang-extension/lang.txt b/asterix-bad/src/main/resources/lang-extension/lang.txt
index 42c4223..1c729a7 100644
--- a/asterix-bad/src/main/resources/lang-extension/lang.txt
+++ b/asterix-bad/src/main/resources/lang-extension/lang.txt
@@ -59,7 +59,10 @@
   (
     // merge area 2
     before:
-    after:    | stmt = ChannelSpecification() | stmt = BrokerSpecification() | stmt = ProcedureSpecification())
+    after:    | stmt = CreateChannelStatement()
+              | stmt = CreateBrokerStatement()
+              | stmt = CreateProcedureStatement()
+  )
   {
     // merge area 3
   }
@@ -76,26 +79,17 @@
   (
     // merge area 2
     before:
-    after:    | "channel" pairId = QualifiedName() ifExists = IfExists()
-      {
-        stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
-      }
-              | "broker" pairId = QualifiedName() ifExists = IfExists()
-      {
-        stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);
-      }
-              | "procedure" funcSig = FunctionSignature() ifExists = IfExists()
-      {
-        stmt = new ProcedureDropStatement(funcSig, ifExists);
-      }
-      )
+    after:    | stmt = DropChannelStatement(startToken)
+              | stmt = DropBrokerStatement(startToken)
+              | stmt = DropProcedureStatement(startToken)
+  )
   {
     // merge area 3
   }
 }
 
 @new
-CreateChannelStatement ChannelSpecification() throws ParseException:
+CreateChannelStatement CreateChannelStatement() throws ParseException:
 {
   Pair<DataverseName,Identifier> nameComponents = null;
   FunctionSignature appliedFunction = null;
@@ -122,7 +116,7 @@
 }
 
 @new
-CreateProcedureStatement ProcedureSpecification() throws ParseException:
+CreateProcedureStatement CreateProcedureStatement() throws ParseException:
 {
   FunctionName fctName = null;
   FunctionSignature signature;
@@ -197,7 +191,7 @@
 }
 
 @new
-CreateBrokerStatement BrokerSpecification() throws ParseException:
+CreateBrokerStatement CreateBrokerStatement() throws ParseException:
 {
   CreateBrokerStatement cbs = null;
   Pair<DataverseName,Identifier> name = null;
@@ -266,4 +260,49 @@
     {
       return stmt;
     }
+}
+
+@new
+ChannelDropStatement DropChannelStatement(Token startStmtToken) throws ParseException:
+{
+  ChannelDropStatement stmt = null;
+  Pair<DataverseName,Identifier> pairId = null;
+  boolean ifExists = false;
+}
+{
+  "channel" pairId = QualifiedName() ifExists = IfExists()
+  {
+    stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
+}
+
+@new
+BrokerDropStatement DropBrokerStatement(Token startStmtToken) throws ParseException:
+{
+  BrokerDropStatement stmt = null;
+  Pair<DataverseName,Identifier> pairId = null;
+  boolean ifExists = false;
+}
+{
+  "broker" pairId = QualifiedName() ifExists = IfExists()
+  {
+    stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
+}
+
+@new
+ProcedureDropStatement DropProcedureStatement(Token startStmtToken) throws ParseException:
+{
+  ProcedureDropStatement stmt = null;
+  FunctionSignature funcSig = null;
+  boolean ifExists = false;
+}
+{
+  "procedure" funcSig = FunctionSignature() ifExists = IfExists()
+  {
+    stmt = new ProcedureDropStatement(funcSig, ifExists);
+    return addSourceLocation(stmt, startStmtToken);
+  }
 }
\ No newline at end of file

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb-bad/+/4366
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
Gerrit-Change-Number: 4366
Gerrit-PatchSet: 1
Gerrit-Owner: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-Reviewer: Ali Alsuliman <al...@gmail.com>
Gerrit-Reviewer: Dmitry Lychagin <dm...@couchbase.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Xikui Wang <xk...@gmail.com>
Gerrit-MessageType: merged