Coordinated change for SQL++ grammar refactoring

Change-Id: Ifcaea927a5f7583e4254031c7496b1744be2abb4
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