Synced preproc.y with gram.y.
authorMichael Meskes
Wed, 25 Oct 2000 19:28:09 +0000 (19:28 +0000)
committerMichael Meskes
Wed, 25 Oct 2000 19:28:09 +0000 (19:28 +0000)
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/preproc/preproc.y

index 99f6f26355e62f43a59206afebf3d848cfe46ed1..ed909933d15a93c572c138557750739f8a228cc2 100644 (file)
@@ -985,5 +985,9 @@ Sun Oct 22 15:35:53 CEST 2000
 Wed Oct 25 08:53:07 CEST 2000
 
    - Added some more C constructs to the parser.
+
+Wed Oct 25 21:22:17 CEST 2000
+
+   - Synced gram.y and preproc.y.
    - Set ecpg version to 2.8.0. 
    - Set library version to 3.2.0.
index 895b1b2cfe84e0016f5a509a50c76b874f99aa83..9b32dd546d0c54ecc85b7a92d90ecf0761cd0c9b 100644 (file)
@@ -286,7 +286,7 @@ make_name(void)
 %type     CreateAsElement OptCreateAs CreateAsList CreateAsStmt
 %type     OptUnder key_reference comment_text ConstraintDeferrabilitySpec
 %type      key_match ColLabel SpecialRuleRelation ColId columnDef
-%type      ColConstraint ColConstraintElem
+%type      ColConstraint ColConstraintElem drop_type
 %type      OptTableElementList OptTableElement TableConstraint
 %type      ConstraintElem key_actions ColQualList TokenId DropSchemaStmt
 %type      target_list target_el update_target_list alias_clause
@@ -321,7 +321,7 @@ make_name(void)
 %type     RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
 %type      RuleStmt opt_column opt_name oper_argtypes sysid_clause
 %type      MathOp RemoveFuncStmt aggr_argtype for_update_clause
-%type      RemoveAggrStmt remove_type RemoveStmt ExtendStmt
+%type      RemoveAggrStmt ExtendStmt
 %type      RemoveOperStmt RenameStmt all_Op user_valid_clause
 %type      VariableSetStmt var_value zone_value VariableShowStmt
 %type      VariableResetStmt AlterTableStmt DropUserStmt from_list
@@ -434,7 +434,6 @@ stmt:  AlterSchemaStmt          { output_statement($1, 0, NULL, connection); }
        | RemoveAggrStmt    { output_statement($1, 0, NULL, connection); }
        | RemoveOperStmt    { output_statement($1, 0, NULL, connection); }
        | RemoveFuncStmt    { output_statement($1, 0, NULL, connection); }
-       | RemoveStmt        { output_statement($1, 0, NULL, connection); }
        | RenameStmt        { output_statement($1, 0, NULL, connection); }
        | RevokeStmt        { output_statement($1, 0, NULL, connection); }
                 | OptimizableStmt  {
@@ -1553,20 +1552,25 @@ def_arg:  func_return       {  $$ = $1; }
 /*****************************************************************************
  *
  *     QUERY:
- *             drop  [,  ..  ]
+ *
+ *             DROP itemtype itemname [, itemname ...]       
  *
  *****************************************************************************/
 
-DropStmt:  DROP TABLE relation_name_list
-               {
-                   $$ = cat2_str(make_str("drop table"), $3);
-               }
-       | DROP SEQUENCE relation_name_list
+DropStmt:  DROP drop_type relation_name_list
                {
-                   $$ = cat2_str(make_str("drop sequence"), $3);
+                   $$ = cat_str(3, make_str("drop"), $2, $3);
                }
        ;
 
+drop_type: TABLE       { $$ = make_str("table"); }
+   |   SEQUENCE    { $$ = make_str("sequence"); }
+   |   VIEW        { $$ = make_str("view"); }
+   |   INDEX       { $$ = make_str("index"); }
+   |   RULE        { $$ = make_str("rule"); }
+   |   TYPE_P      { $$ = make_str("type"); }
+   ;
+
 /*****************************************************************************
  *
  *             QUERY:
@@ -1985,32 +1989,18 @@ func_return:  Typename
  *
  *     QUERY:
  *
- *     remove function 
- *             (REMOVE FUNCTION "funcname" (arg1, arg2, ...))
- *     remove aggregate 
- *             (REMOVE AGGREGATE "aggname" "aggtype")
- *     remove operator 
- *             (REMOVE OPERATOR "opname" (leftoperand_typ rightoperand_typ))
- *     remove type 
- *             (REMOVE TYPE "typename")
- *     remove rule 
- *             (REMOVE RULE "rulename")
+ *             DROP FUNCTION funcname (arg1, arg2, ...)
+ *             DROP AGGREGATE aggname aggtype
+ *             DROP OPERATOR opname (leftoperand_typ rightoperand_typ) 
  *
  *****************************************************************************/
 
-RemoveStmt:  DROP remove_type name
+RemoveFuncStmt:  DROP FUNCTION func_name func_args   
                {
-                   $$ = cat_str(3, make_str("drop"), $2, $3);
+                   $$ = cat_str(3, make_str("drop function"), $3, $4);
                }
        ;
 
-remove_type:  TYPE_P       {  $$ = make_str("type"); }
-       | INDEX     {  $$ = make_str("index"); }
-       | RULE      {  $$ = make_str("rule"); }
-       | VIEW      {  $$ = make_str("view"); }
-       ;
-
-
 RemoveAggrStmt:  DROP AGGREGATE name aggr_argtype
                {
                        $$ = cat_str(3, make_str("drop aggregate"), $3, $4);
@@ -2022,13 +2012,6 @@ aggr_argtype:  Typename          { $$ = $1; }
        ;
 
 
-RemoveFuncStmt:  DROP FUNCTION func_name func_args
-               {
-                       $$ = cat_str(3, make_str("drop function"), $3, $4);
-               }
-       ;
-
-
 RemoveOperStmt:  DROP OPERATOR all_Op '(' oper_argtypes ')'
                {
                    $$ = cat_str(5, make_str("drop operator"), $3, make_str("("), $5, make_str(")"));