Tom Lane wrote:
> Rod Taylor <[EMAIL PROTECTED]> writes:
> > Updated to tag REL7_2_4 on FreeBSD 4.7 and cannot compile it.  gram.y
> > errors complaining: invalid character: ','.
> 
> > bash-2.05b$ bison --version
> > bison (GNU Bison) 1.75
> 
> We just had that discussion on pgcore.  The 7.2 grammar was developed
> against bison 1.28; it works with warnings against bison 1.35, but bison
> 1.75 just flat rejects it (not for any significant reason, but just
> because they decided to get anal-retentive about whether they'd allow
> commas in keyword lists).
> 
> We could update the 7.2 grammar and compile it with the latest bison,
> but we were worried about whether we might introduce any subtle problems
> if we did.  The 7.2 branch has received zero testing with bison 1.75.
> 
> ISTM that the eve of what'll probably be our last dot-release for 7.2
> is not the time to drop a new bison into its toolchain.

For what it's worth, I've fixed all the errors in the 7.2.4 gram.y
file that bison 1.75 complained and then re-ran bison 1.35 against it,
then compared that with the output that the same version of bison
generated from the original grammar file.  The only differences were
references to line numbers -- everything else is identical.

So if any problems occur from using bison 1.75, they will be either
due to bugs in that version of bison or due to our dependence on a bug
in earlier versions, or something like that.

I'm attaching a patch for 7.2.4's parser/gram.y that fixes all of
bison 1.75's complaints.  Since the output of bison 1.35 is
essentially identical between the original and this, I don't see any
reason we shouldn't include the fix in the 7.2.4 release, as long as
we include a warning in the release notes that we haven't done any
real testing with a build against bison 1.75 (or later).


-- 
Kevin Brown                                           [EMAIL PROTECTED]
--- gram.y.orig Wed Jan 29 22:39:31 2003
+++ gram.y      Wed Jan 29 22:43:33 2003
@@ -129,33 +129,33 @@
        InsertStmt                      *istmt;
 }
 
-%type <node>   stmt,
-               AlterGroupStmt, AlterSchemaStmt, AlterTableStmt, AlterUserStmt,
-               AnalyzeStmt,
-               ClosePortalStmt, ClusterStmt, CommentStmt, ConstraintsSetStmt,
-               CopyStmt, CreateAsStmt, CreateGroupStmt, CreatePLangStmt,
-               CreateSchemaStmt, CreateSeqStmt, CreateStmt, CreateTrigStmt,
-               CreateUserStmt, CreatedbStmt, CursorStmt, DefineStmt, DeleteStmt,
-               DropGroupStmt, DropPLangStmt, DropSchemaStmt, DropStmt, DropTrigStmt,
-               DropUserStmt, DropdbStmt, ExplainStmt, FetchStmt,
-               GrantStmt, IndexStmt, InsertStmt, ListenStmt, LoadStmt, LockStmt,
-               NotifyStmt, OptimizableStmt, ProcedureStmt, ReindexStmt,
-               RemoveAggrStmt, RemoveFuncStmt, RemoveOperStmt,
-               RenameStmt, RevokeStmt, RuleActionStmt, RuleActionStmtOrEmpty,
-               RuleStmt, SelectStmt, TransactionStmt, TruncateStmt,
-               UnlistenStmt, UpdateStmt, VacuumStmt, VariableResetStmt,
-               VariableSetStmt, VariableShowStmt, ViewStmt, CheckPointStmt
+%type <node>   stmt
+               AlterGroupStmt AlterSchemaStmt AlterTableStmt AlterUserStmt
+               AnalyzeStmt
+               ClosePortalStmt ClusterStmt CommentStmt ConstraintsSetStmt
+               CopyStmt CreateAsStmt CreateGroupStmt CreatePLangStmt
+               CreateSchemaStmt CreateSeqStmt CreateStmt CreateTrigStmt
+               CreateUserStmt CreatedbStmt CursorStmt DefineStmt DeleteStmt
+               DropGroupStmt DropPLangStmt DropSchemaStmt DropStmt DropTrigStmt
+               DropUserStmt DropdbStmt ExplainStmt FetchStmt
+               GrantStmt IndexStmt InsertStmt ListenStmt LoadStmt LockStmt
+               NotifyStmt OptimizableStmt ProcedureStmt ReindexStmt
+               RemoveAggrStmt RemoveFuncStmt RemoveOperStmt
+               RenameStmt RevokeStmt RuleActionStmt RuleActionStmtOrEmpty
+               RuleStmt SelectStmt TransactionStmt TruncateStmt
+               UnlistenStmt UpdateStmt VacuumStmt VariableResetStmt
+               VariableSetStmt VariableShowStmt ViewStmt CheckPointStmt
 
-%type <node>   select_no_parens, select_with_parens, select_clause,
+%type <node>   select_no_parens select_with_parens select_clause
                                simple_select
 
 %type <node>    alter_column_default
 %type <ival>    drop_behavior
 
-%type <list>   createdb_opt_list, createdb_opt_item
+%type <list>   createdb_opt_list createdb_opt_item
 
-%type <ival>   opt_lock, lock_type
-%type <boolean>        opt_force, opt_or_replace
+%type <ival>   opt_lock lock_type
+%type <boolean>        opt_force opt_or_replace
 
 %type <list>   user_list
 
@@ -165,7 +165,7 @@
 %type <list>   OptUserList
 %type <defelt> OptUserElem
 
-%type <boolean>        TriggerActionTime, TriggerForSpec, opt_trusted, opt_procedural
+%type <boolean>        TriggerActionTime TriggerForSpec opt_trusted opt_procedural
 %type <str>            opt_lancompiler
 
 %type <str>            OptConstrFromTable
@@ -173,111 +173,111 @@
 %type <str>            TriggerEvents
 %type <value>  TriggerFuncArg
 
-%type <str>            relation_name, copy_file_name, copy_delimiter, copy_null,
-               database_name, access_method_clause, access_method, attr_name,
-               class, index_name, name, func_name, file_name
+%type <str>            relation_name copy_file_name copy_delimiter copy_null
+               database_name access_method_clause access_method attr_name
+               class index_name name func_name file_name
 
-%type <str>            opt_id,
-               all_Op, MathOp, opt_name,
-               OptUseOp, opt_class, SpecialRuleRelation
+%type <str>            opt_id
+               all_Op MathOp opt_name
+               OptUseOp opt_class SpecialRuleRelation
 
-%type <str>            opt_level, opt_encoding
-%type <str>            privileges, operation_commalist
+%type <str>            opt_level opt_encoding
+%type <str>            privileges operation_commalist
 %type <node>   grantee
 %type <list>   grantee_list
-%type <chr>            operation, TriggerOneEvent
+%type <chr>            operation TriggerOneEvent
 
-%type <list>   stmtblock, stmtmulti,
-               into_clause, OptTempTableName, relation_name_list,
-               OptTableElementList, OptInherit, definition, opt_distinct,
-               opt_with, func_args, func_args_list, func_as,
-               oper_argtypes, RuleActionList, RuleActionMulti,
-               opt_column_list, columnList, opt_name_list,
-               sort_clause, sortby_list, index_params, index_list, name_list,
-               from_clause, from_list, opt_array_bounds,
-               expr_list, attrs, target_list, update_target_list,
-               def_list, opt_indirection, group_clause, TriggerFuncArgs,
-               select_limit, opt_select_limit
+%type <list>   stmtblock stmtmulti
+               into_clause OptTempTableName relation_name_list
+               OptTableElementList OptInherit definition opt_distinct
+               opt_with func_args func_args_list func_as
+               oper_argtypes RuleActionList RuleActionMulti
+               opt_column_list columnList opt_name_list
+               sort_clause sortby_list index_params index_list name_list
+               from_clause from_list opt_array_bounds
+               expr_list attrs target_list update_target_list
+               def_list opt_indirection group_clause TriggerFuncArgs
+               select_limit opt_select_limit
 
-%type <typnam> func_arg, func_return, func_type, aggr_argtype
+%type <typnam> func_arg func_return func_type aggr_argtype
 
-%type <boolean>        opt_arg, TriggerForOpt, TriggerForType, OptTemp, OptWithOids
+%type <boolean>        opt_arg TriggerForOpt TriggerForType OptTemp OptWithOids
 
-%type <list>   for_update_clause, opt_for_update_clause, update_list
+%type <list>   for_update_clause opt_for_update_clause update_list
 %type <boolean>        opt_all
 %type <boolean>        opt_table
-%type <boolean>        opt_chain, opt_trans
+%type <boolean>        opt_chain opt_trans
 
-%type <node>   join_outer, join_qual
+%type <node>   join_outer join_qual
 %type <jtype>  join_type
 
-%type <list>   extract_list, position_list
-%type <list>   substr_list, trim_list
+%type <list>   extract_list position_list
+%type <list>   substr_list trim_list
 %type <ival>   opt_interval
-%type <node>   substr_from, substr_for
+%type <node>   substr_from substr_for
 
-%type <boolean>        opt_binary, opt_using, opt_instead, opt_cursor
-%type <boolean>        opt_with_copy, index_opt_unique, opt_verbose, opt_full
-%type <boolean>        opt_freeze, analyze_keyword
+%type <boolean>        opt_binary opt_using opt_instead opt_cursor
+%type <boolean>        opt_with_copy index_opt_unique opt_verbose opt_full
+%type <boolean>        opt_freeze analyze_keyword
 
-%type <ival>   copy_dirn, direction, reindex_type, drop_type,
-               opt_column, event, comment_type
+%type <ival>   copy_dirn direction reindex_type drop_type
+               opt_column event comment_type
 
 %type <ival>   fetch_how_many
 
-%type <node>   select_limit_value, select_offset_value
+%type <node>   select_limit_value select_offset_value
 
 %type <list>   OptSeqList
 %type <defelt> OptSeqElem
 
 %type <istmt>  insert_rest
 
-%type <node>   OptTableElement, ConstraintElem
+%type <node>   OptTableElement ConstraintElem
 %type <node>   columnDef
 %type <defelt> def_elem
-%type <node>   def_arg, columnElem, where_clause,
-                               a_expr, b_expr, c_expr, AexprConst,
-                               in_expr, having_clause
-%type <list>   row_descriptor, row_list, in_expr_nodes
+%type <node>   def_arg columnElem where_clause
+                               a_expr b_expr c_expr AexprConst
+                               in_expr having_clause
+%type <list>   row_descriptor row_list in_expr_nodes
 %type <node>   row_expr
-%type <node>   case_expr, case_arg, when_clause, case_default
+%type <node>   case_expr case_arg when_clause case_default
 %type <boolean>        opt_empty_parentheses
 %type <list>   when_clause_list
 %type <ival>   sub_type
-%type <list>   OptCreateAs, CreateAsList
+%type <list>   OptCreateAs CreateAsList
 %type <node>   CreateAsElement
-%type <value>  NumericOnly, FloatOnly, IntegerOnly
-%type <attr>   event_object, attr, alias_clause
+%type <value>  NumericOnly FloatOnly IntegerOnly
+%type <attr>   event_object attr alias_clause
 %type <sortgroupby>            sortby
-%type <ielem>  index_elem, func_index
+%type <ielem>  index_elem func_index
 %type <node>   table_ref
 %type <jexpr>  joined_table
 %type <range>  relation_expr
-%type <target> target_el, update_target_el
+%type <target> target_el update_target_el
 %type <paramno> ParamNo
 
-%type <typnam> Typename, SimpleTypename, ConstTypename
-                               GenericType, Numeric, Character, ConstDatetime, 
ConstInterval, Bit
-%type <str>            character, bit
+%type <typnam> Typename SimpleTypename ConstTypename
+                               GenericType Numeric Character ConstDatetime 
+ConstInterval Bit
+%type <str>            character bit
 %type <str>            extract_arg
-%type <str>            opt_charset, opt_collate
+%type <str>            opt_charset opt_collate
 %type <str>            opt_float
-%type <ival>   opt_numeric, opt_decimal
-%type <boolean>        opt_varying, opt_timezone, opt_timezone_x
+%type <ival>   opt_numeric opt_decimal
+%type <boolean>        opt_varying opt_timezone opt_timezone_x
 
 %type <ival>   Iconst
-%type <str>            Sconst, comment_text
-%type <str>            UserId, opt_boolean, var_value, ColId_or_Sconst
-%type <str>            ColId, ColLabel, type_name, func_name_keyword
-%type <str>            col_name_keyword, unreserved_keyword, reserved_keyword
+%type <str>            Sconst comment_text
+%type <str>            UserId opt_boolean var_value ColId_or_Sconst
+%type <str>            ColId ColLabel type_name func_name_keyword
+%type <str>            col_name_keyword unreserved_keyword reserved_keyword
 %type <node>   zone_value
 
 %type <node>   TableConstraint
 %type <list>   ColQualList
-%type <node>   ColConstraint, ColConstraintElem, ConstraintAttr
-%type <ival>   key_actions, key_delete, key_update, key_reference
+%type <node>   ColConstraint ColConstraintElem ConstraintAttr
+%type <ival>   key_actions key_delete key_update key_reference
 %type <str>            key_match
-%type <ival>   ConstraintAttributeSpec, ConstraintDeferrabilitySpec,
+%type <ival>   ConstraintAttributeSpec ConstraintDeferrabilitySpec
                                ConstraintTimeSpec
 
 %type <list>   constraints_set_list
@@ -302,43 +302,43 @@
  */
 
 /* Keywords (in SQL92 reserved words) */
-%token ABSOLUTE, ACTION, ADD, ALL, ALTER, AND, ANY, AS, ASC, AT, AUTHORIZATION,
-               BEGIN_TRANS, BETWEEN, BOTH, BY,
-               CASCADE, CASE, CAST, CHAR, CHARACTER, CHECK, CLOSE, 
-               COALESCE, COLLATE, COLUMN, COMMIT,
-               CONSTRAINT, CONSTRAINTS, CREATE, CROSS, CURRENT_DATE,
-               CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER, CURSOR,
-               DAY_P, DEC, DECIMAL, DECLARE, DEFAULT, DELETE, DESC,
-               DISTINCT, DOUBLE, DROP,
-               ELSE, ENCRYPTED, END_TRANS, ESCAPE, EXCEPT, EXECUTE, EXISTS, EXTRACT,
-               FALSE_P, FETCH, FLOAT, FOR, FOREIGN, FROM, FULL,
-               GLOBAL, GRANT, GROUP, HAVING, HOUR_P,
-               IN, INNER_P, INSENSITIVE, INSERT, INTERSECT, INTERVAL, INTO, IS,
-               ISOLATION, JOIN, KEY, LANGUAGE, LEADING, LEFT, LEVEL, LIKE, LOCAL,
-               MATCH, MINUTE_P, MONTH_P, NAMES,
-               NATIONAL, NATURAL, NCHAR, NEXT, NO, NOT, NULLIF, NULL_P, NUMERIC,
-               OF, OLD, ON, ONLY, OPTION, OR, ORDER, OUTER_P, OVERLAPS,
-               PARTIAL, POSITION, PRECISION, PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, 
PUBLIC,
-               READ, REFERENCES, RELATIVE, REVOKE, RIGHT, ROLLBACK,
-               SCHEMA, SCROLL, SECOND_P, SELECT, SESSION, SESSION_USER, SET, SOME, 
SUBSTRING,
-               TABLE, TEMPORARY, THEN, TIME, TIMESTAMP,
-               TO, TRAILING, TRANSACTION, TRIM, TRUE_P,
-               UNENCRYPTED, UNION, UNIQUE, UNKNOWN, UPDATE, USER, USING,
-               VALUES, VARCHAR, VARYING, VIEW,
-               WHEN, WHERE, WITH, WORK, YEAR_P, ZONE
+%token ABSOLUTE ACTION ADD ALL ALTER AND ANY AS ASC AT AUTHORIZATION
+               BEGIN_TRANS BETWEEN BOTH BY
+               CASCADE CASE CAST CHAR CHARACTER CHECK CLOSE 
+               COALESCE COLLATE COLUMN COMMIT
+               CONSTRAINT CONSTRAINTS CREATE CROSS CURRENT_DATE
+               CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR
+               DAY_P DEC DECIMAL DECLARE DEFAULT DELETE DESC
+               DISTINCT DOUBLE DROP
+               ELSE ENCRYPTED END_TRANS ESCAPE EXCEPT EXECUTE EXISTS EXTRACT
+               FALSE_P FETCH FLOAT FOR FOREIGN FROM FULL
+               GLOBAL GRANT GROUP HAVING HOUR_P
+               IN INNER_P INSENSITIVE INSERT INTERSECT INTERVAL INTO IS
+               ISOLATION JOIN KEY LANGUAGE LEADING LEFT LEVEL LIKE LOCAL
+               MATCH MINUTE_P MONTH_P NAMES
+               NATIONAL NATURAL NCHAR NEXT NO NOT NULLIF NULL_P NUMERIC
+               OF OLD ON ONLY OPTION OR ORDER OUTER_P OVERLAPS
+               PARTIAL POSITION PRECISION PRIMARY PRIOR PRIVILEGES PROCEDURE PUBLIC
+               READ REFERENCES RELATIVE REVOKE RIGHT ROLLBACK
+               SCHEMA SCROLL SECOND_P SELECT SESSION SESSION_USER SET SOME SUBSTRING
+               TABLE TEMPORARY THEN TIME TIMESTAMP
+               TO TRAILING TRANSACTION TRIM TRUE_P
+               UNENCRYPTED UNION UNIQUE UNKNOWN UPDATE USER USING
+               VALUES VARCHAR VARYING VIEW
+               WHEN WHERE WITH WORK YEAR_P ZONE
 
 /* Keywords (in SQL99 reserved words) */
-%token CHAIN, CHARACTERISTICS,
-               DEFERRABLE, DEFERRED,
-               IMMEDIATE, INITIALLY, INOUT,
-               OFF, OUT,
-               PATH_P, PENDANT,
-               REPLACE, RESTRICT,
-        TRIGGER,
+%token CHAIN CHARACTERISTICS
+               DEFERRABLE DEFERRED
+               IMMEDIATE INITIALLY INOUT
+               OFF OUT
+               PATH_P PENDANT
+               REPLACE RESTRICT
+        TRIGGER
                WITHOUT
 
 /* Keywords (in SQL92 non-reserved words) */
-%token COMMITTED, SERIALIZABLE, TYPE_P
+%token COMMITTED SERIALIZABLE TYPE_P
 
 /* Keywords for Postgres support (not in SQL92 reserved words)
  *
@@ -346,22 +346,22 @@
  * when some sort of pg_privileges relation is introduced.
  * - Todd A. Brandys 1998-01-01?
  */
-%token ABORT_TRANS, ACCESS, AFTER, AGGREGATE, ANALYSE, ANALYZE,
-               BACKWARD, BEFORE, BINARY, BIT,
-               CACHE, CHECKPOINT, CLUSTER, COMMENT, COPY, CREATEDB, CREATEUSER, CYCLE,
-               DATABASE, DELIMITERS, DO,
-               EACH, ENCODING, EXCLUSIVE, EXPLAIN,
-               FORCE, FORWARD, FREEZE, FUNCTION, HANDLER,
-               ILIKE, INCREMENT, INDEX, INHERITS, INSTEAD, ISNULL,
-               LANCOMPILER, LIMIT, LISTEN, LOAD, LOCATION, LOCK_P,
-               MAXVALUE, MINVALUE, MODE, MOVE,
-               NEW, NOCREATEDB, NOCREATEUSER, NONE, NOTHING, NOTIFY, NOTNULL,
-               OFFSET, OIDS, OPERATOR, OWNER, PASSWORD, PROCEDURAL,
-               REINDEX, RENAME, RESET, RETURNS, ROW, RULE,
-               SEQUENCE, SETOF, SHARE, SHOW, START, STATEMENT,
-               STATISTICS, STDIN, STDOUT, SYSID,
-               TEMP, TEMPLATE, TOAST, TRUNCATE, TRUSTED, 
-               UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION
+%token ABORT_TRANS ACCESS AFTER AGGREGATE ANALYSE ANALYZE
+               BACKWARD BEFORE BINARY BIT
+               CACHE CHECKPOINT CLUSTER COMMENT COPY CREATEDB CREATEUSER CYCLE
+               DATABASE DELIMITERS DO
+               EACH ENCODING EXCLUSIVE EXPLAIN
+               FORCE FORWARD FREEZE FUNCTION HANDLER
+               ILIKE INCREMENT INDEX INHERITS INSTEAD ISNULL
+               LANCOMPILER LIMIT LISTEN LOAD LOCATION LOCK_P
+               MAXVALUE MINVALUE MODE MOVE
+               NEW NOCREATEDB NOCREATEUSER NONE NOTHING NOTIFY NOTNULL
+               OFFSET OIDS OPERATOR OWNER PASSWORD PROCEDURAL
+               REINDEX RENAME RESET RETURNS ROW RULE
+               SEQUENCE SETOF SHARE SHOW START STATEMENT
+               STATISTICS STDIN STDOUT SYSID
+               TEMP TEMPLATE TOAST TRUNCATE TRUSTED 
+               UNLISTEN UNTIL VACUUM VALID VERBOSE VERSION
 
 /* The grammar thinks these are keywords, but they are not in the keywords.c
  * list and so can never be entered directly.  The filter in parser.c
@@ -370,8 +370,8 @@
 %token                 UNIONJOIN
 
 /* Special keywords, not in the query language - see the "lex" file */
-%token <str>   IDENT, FCONST, SCONST, BITCONST, Op
-%token <ival>  ICONST, PARAM
+%token <str>   IDENT FCONST SCONST BITCONST Op
+%token <ival>  ICONST PARAM
 
 /* these are not real. they are here so that they get generated as #define's*/
 %token                 OP
@@ -748,7 +748,7 @@
                                        n->dbname = $3;
                                        $$ = (Node *)n;
                                }
-
+               ;
 
 /*****************************************************************************
  *
@@ -945,6 +945,7 @@
 
 ColId_or_Sconst: ColId                                         { $$ = $1; }
                | SCONST                                                        { $$ = 
$1; }
+               ;
 
 
 VariableShowStmt:  SHOW ColId
@@ -1242,6 +1243,7 @@
 
 copy_null:      WITH NULL_P AS Sconst                  { $$ = $4; }
                 | /*EMPTY*/                                            { $$ = "\\N"; }
+               ;
 
 /*****************************************************************************
  *
@@ -1716,6 +1718,7 @@
 
 NumericOnly:  FloatOnly                                        { $$ = $1; }
                        | IntegerOnly                           { $$ = $1; }
+               ;
 
 FloatOnly:  FCONST
                                {
@@ -1765,6 +1768,7 @@
 
 opt_lancompiler: LANCOMPILER Sconst { $$ = $2; }
                        | /*EMPTY*/                     { $$ = ""; }
+               ;
 
 DropPLangStmt:  DROP opt_procedural LANGUAGE ColId_or_Sconst
                        {
@@ -2424,6 +2428,7 @@
 
 grantee_list: grantee                                  { $$ = makeList1($1); }
                | grantee_list ',' grantee              { $$ = lappend($1, $3); }
+               ;
 
 
 opt_with_grant:  WITH GRANT OPTION
@@ -4238,6 +4243,7 @@
                                        else type = xlateSqlType("bit");
                                        $$ = type;
                                }
+               ;
 
 
 /*
@@ -5478,6 +5484,7 @@
 
 opt_empty_parentheses: '(' ')' { $$ = TRUE; }
                                        | /*EMPTY*/ { $$ = TRUE; }
+               ;
 
 /*****************************************************************************
  *
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to