/* A Bison parser, made by GNU Bison 2.5.  */

/* Bison implementation for Yacc-like parsers in C
   
      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
   
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.
   
   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */

/* C LALR(1) parser skeleton written by Richard Stallman, by
   simplifying the original so-called "semantic" parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
#define YYBISON 1

/* Bison version.  */
#define YYBISON_VERSION "2.5"

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 0

/* Push parsers.  */
#define YYPUSH 0

/* Pull parsers.  */
#define YYPULL 1

/* Using locations.  */
#define YYLSP_NEEDED 0



/* Copy the first part of user declarations.  */

/* Line 268 of yacc.c  */
#line 1 "parser.y"

/*
 *
 *	The slony_logshipper command language grammar
 *
 *	Copyright (c) 2003-2009, PostgreSQL Global Development Group
 *	Author: Jan Wieck, Afilias USA INC.
 *
 *	
 *-------------------------------------------------------------------------
 */

#include "config.h"
#include "../slonik/types.h"
#include "libpq-fe.h"
#include "slony_logshipper.h"
#include "../parsestatements/scanner.h"

#include "scan.h"

extern int STMTS[MAXSTATEMENTS];


/*
 * Global data
 */
char   *current_file = "<stdin>";
#ifdef DEBUG
int yydebug=1;
#endif




/* Line 268 of yacc.c  */
#line 106 "y.tab.c"

/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

/* Enabling the token table.  */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     K_LOGFILE = 258,
     K_MAX = 259,
     K_ARCHIVES = 260,
     K_ANALYZE = 261,
     K_AND = 262,
     K_ARCHIVE = 263,
     K_ARCHIVE_COMMENT = 264,
     K_CASCADE = 265,
     K_CLUSTER = 266,
     K_COMMAND = 267,
     K_COMMIT = 268,
     K_CONF_COMMENT = 269,
     K_COPY = 270,
     K_DATABASE = 271,
     K_DELETE = 272,
     K_DESTINATION = 273,
     K_DIR = 274,
     K_ERROR = 275,
     K_EXEC_DDL = 276,
     K_FROM = 277,
     K_IGNORE = 278,
     K_INSERT = 279,
     K_INTO = 280,
     K_NAME = 281,
     K_NAMESPACE = 282,
     K_NULL = 283,
     K_ONLY = 284,
     K_POST = 285,
     K_PRE = 286,
     K_PROCESSING = 287,
     K_RENAME = 288,
     K_REPLICA = 289,
     K_SELECT = 290,
     K_SESSION_ROLE = 291,
     K_SET = 292,
     K_START = 293,
     K_START_ARCHIVE = 294,
     K_START_CONFIG = 295,
     K_TABLE = 296,
     K_TO = 297,
     K_TRANSACTION = 298,
     K_TRUNCATE = 299,
     K_UPDATE = 300,
     K_VACUUM = 301,
     K_VALUES = 302,
     K_WHERE = 303,
     T_COPYDATA = 304,
     T_COPYDATA_PART = 305,
     T_COPYEND = 306,
     T_IDENT = 307,
     T_LITERAL = 308,
     T_LITERAL_PART = 309,
     T_NUMBER = 310,
     T_TRACKING_FUNCTION = 311,
     T_FINISH_FUNCTION = 312,
     T_SEQSETVAL_FUNCTION = 313,
     T_PGSETVAL_FUNCTION = 314
   };
#endif
/* Tokens.  */
#define K_LOGFILE 258
#define K_MAX 259
#define K_ARCHIVES 260
#define K_ANALYZE 261
#define K_AND 262
#define K_ARCHIVE 263
#define K_ARCHIVE_COMMENT 264
#define K_CASCADE 265
#define K_CLUSTER 266
#define K_COMMAND 267
#define K_COMMIT 268
#define K_CONF_COMMENT 269
#define K_COPY 270
#define K_DATABASE 271
#define K_DELETE 272
#define K_DESTINATION 273
#define K_DIR 274
#define K_ERROR 275
#define K_EXEC_DDL 276
#define K_FROM 277
#define K_IGNORE 278
#define K_INSERT 279
#define K_INTO 280
#define K_NAME 281
#define K_NAMESPACE 282
#define K_NULL 283
#define K_ONLY 284
#define K_POST 285
#define K_PRE 286
#define K_PROCESSING 287
#define K_RENAME 288
#define K_REPLICA 289
#define K_SELECT 290
#define K_SESSION_ROLE 291
#define K_SET 292
#define K_START 293
#define K_START_ARCHIVE 294
#define K_START_CONFIG 295
#define K_TABLE 296
#define K_TO 297
#define K_TRANSACTION 298
#define K_TRUNCATE 299
#define K_UPDATE 300
#define K_VACUUM 301
#define K_VALUES 302
#define K_WHERE 303
#define T_COPYDATA 304
#define T_COPYDATA_PART 305
#define T_COPYEND 306
#define T_IDENT 307
#define T_LITERAL 308
#define T_LITERAL_PART 309
#define T_NUMBER 310
#define T_TRACKING_FUNCTION 311
#define T_FINISH_FUNCTION 312
#define T_SEQSETVAL_FUNCTION 313
#define T_PGSETVAL_FUNCTION 314




#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 293 of yacc.c  */
#line 38 "parser.y"

	int32		ival;
	char	   *str;
	AttElem	   *att_elem;
	AttElemList	*att_elem_list;
	SlonDString *dstring;



/* Line 293 of yacc.c  */
#line 270 "y.tab.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif


/* Copy the second part of user declarations.  */


/* Line 343 of yacc.c  */
#line 282 "y.tab.c"

#ifdef short
# undef short
#endif

#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif

#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#elif (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
typedef signed char yytype_int8;
#else
typedef short int yytype_int8;
#endif

#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short int yytype_uint16;
#endif

#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short int yytype_int16;
#endif

#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#  define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
#  define YYSIZE_T size_t
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# else
#  define YYSIZE_T unsigned int
# endif
#endif

#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)

#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(msgid) msgid
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif

/* Identity function, used to suppress warnings about constant conditions.  */
#ifndef lint
# define YYID(n) (n)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static int
YYID (int yyi)
#else
static int
YYID (yyi)
    int yyi;
#endif
{
  return yyi;
}
#endif

#if ! defined yyoverflow || YYERROR_VERBOSE

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   elif defined __BUILTIN_VA_ARG_INCR
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
#   elif defined _AIX
#    define YYSTACK_ALLOC __alloca
#   elif defined _MSC_VER
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
#    define alloca _alloca
#   else
#    define YYSTACK_ALLOC alloca
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#     ifndef EXIT_SUCCESS
#      define EXIT_SUCCESS 0
#     endif
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning.  */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
#  ifndef YYSTACK_ALLOC_MAXIMUM
    /* The OS might guarantee only one guard page at the bottom of the stack,
       and a page size can be as small as 4096 bytes.  So we cannot safely
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
       to allow for a few compiler-allocated temporary stack slots.  */
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
#  endif
# else
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
#  ifndef YYSTACK_ALLOC_MAXIMUM
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
#  endif
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
       && ! ((defined YYMALLOC || defined malloc) \
	     && (defined YYFREE || defined free)))
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   ifndef EXIT_SUCCESS
#    define EXIT_SUCCESS 0
#   endif
#  endif
#  ifndef YYMALLOC
#   define YYMALLOC malloc
#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
#  ifndef YYFREE
#   define YYFREE free
#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
#   endif
#  endif
# endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */


#if (! defined yyoverflow \
     && (! defined __cplusplus \
	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  yytype_int16 yyss_alloc;
  YYSTYPE yyvs_alloc;
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

# define YYCOPY_NEEDED 1

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
	Stack = &yyptr->Stack_alloc;					\
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (YYID (0))

#endif

#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined __GNUC__ && 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  YYSIZE_T yyi;				\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];		\
	}					\
      while (YYID (0))
#  endif
# endif
#endif /* !YYCOPY_NEEDED */

/* YYFINAL -- State number of the termination state.  */
#define YYFINAL  8
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   250

/* YYNTOKENS -- Number of terminals.  */
#define YYNTOKENS  66
/* YYNNTS -- Number of nonterminals.  */
#define YYNNTS  59
/* YYNRULES -- Number of rules.  */
#define YYNRULES  134
/* YYNRULES -- Number of states.  */
#define YYNSTATES  296

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   314

#define YYTRANSLATE(YYX)						\
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
static const yytype_uint8 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      63,    65,     2,     2,    64,     2,    62,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,    60,
       2,    61,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const yytype_uint16 yyprhs[] =
{
       0,     0,     3,     5,     7,    11,    13,    16,    18,    20,
      22,    24,    26,    28,    30,    32,    34,    36,    38,    44,
      50,    56,    61,    67,    73,    78,    85,    92,   103,   110,
     117,   123,   128,   133,   139,   143,   154,   156,   158,   161,
     163,   165,   167,   169,   171,   173,   175,   177,   179,   181,
     183,   185,   187,   189,   191,   194,   208,   210,   214,   223,
     226,   230,   239,   241,   242,   244,   245,   254,   265,   267,
     270,   272,   275,   277,   279,   281,   283,   287,   290,   294,
     298,   305,   311,   320,   322,   335,   337,   348,   350,   352,
     354,   357,   359,   361,   363,   365,   367,   369,   371,   373,
     375,   377,   379,   381,   383,   385,   387,   389,   391,   393,
     395,   397,   399,   401,   403,   405,   407,   409,   411,   413,
     415,   417,   419,   421,   423,   425,   427,   429,   431,   433,
     436,   438,   440,   443,   445
};

/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
static const yytype_int8 yyrhs[] =
{
      67,     0,    -1,    68,    -1,    81,    -1,    40,    60,    69,
      -1,    70,    -1,    69,    70,    -1,    14,    -1,    71,    -1,
      72,    -1,    73,    -1,    74,    -1,    75,    -1,    76,    -1,
      77,    -1,    78,    -1,    79,    -1,    80,    -1,     8,    19,
      61,   121,    60,    -1,    18,    19,    61,   121,    60,    -1,
      18,    16,    61,   121,    60,    -1,     3,    61,   121,    60,
      -1,     4,     5,    61,   118,    60,    -1,    11,    26,    61,
     121,    60,    -1,    23,    27,   119,    60,    -1,    23,    41,
     119,    62,   119,    60,    -1,    33,    27,   119,    42,   119,
      60,    -1,    33,    41,   119,    62,   119,    42,   119,    62,
     119,    60,    -1,    31,    32,    12,    61,   121,    60,    -1,
      30,    32,    12,    61,   121,    60,    -1,    20,    12,    61,
     121,    60,    -1,    39,    60,    82,    87,    -1,   116,    83,
      84,    85,    -1,    37,    36,    42,    34,    60,    -1,    38,
      43,    60,    -1,    35,   119,    62,    86,    63,   121,    64,
     121,    65,    60,    -1,    56,    -1,    88,    -1,    87,    88,
      -1,   117,    -1,    89,    -1,    90,    -1,    92,    -1,    94,
      -1,    98,    -1,    99,    -1,   103,    -1,   109,    -1,   111,
      -1,   113,    -1,   115,    -1,   107,    -1,   108,    -1,    97,
      -1,    13,    60,    -1,    24,    25,   119,    62,   119,    63,
     104,    65,    47,    63,    91,    65,    60,    -1,   121,    -1,
      91,    64,   121,    -1,    45,    29,   119,    62,   119,    93,
     105,    60,    -1,    37,   106,    -1,    93,    64,   106,    -1,
      17,    22,    95,   119,    62,   119,    96,    60,    -1,    29,
      -1,    -1,   105,    -1,    -1,    44,    41,    29,   119,    62,
     119,    10,    60,    -1,    15,   119,    62,   119,    63,   104,
      65,    22,   119,    60,    -1,   101,    -1,   100,   101,    -1,
     102,    -1,   100,   102,    -1,    49,    -1,    50,    -1,    51,
      -1,   119,    -1,   104,    64,   119,    -1,    48,   106,    -1,
     105,     7,   106,    -1,   119,    61,   121,    -1,    46,     6,
     119,    62,   119,    60,    -1,     6,   119,    62,   119,    60,
      -1,    35,   119,    62,   110,    63,   118,    65,    60,    -1,
      57,    -1,    35,   119,    62,   112,    63,   121,    64,   121,
      64,   121,    65,    60,    -1,    58,    -1,    35,   119,    62,
     114,    63,   121,    64,   121,    65,    60,    -1,    59,    -1,
      21,    -1,   117,    -1,   116,   117,    -1,     9,    -1,    55,
      -1,    52,    -1,   120,    -1,    40,    -1,    39,    -1,     8,
      -1,     5,    -1,    11,    -1,    13,    -1,    15,    -1,    16,
      -1,    17,    -1,    18,    -1,    19,    -1,    20,    -1,    23,
      -1,    24,    -1,     3,    -1,     4,    -1,    26,    -1,    27,
      -1,    30,    -1,    31,    -1,    32,    -1,    33,    -1,    37,
      -1,    38,    -1,    43,    -1,    44,    -1,    45,    -1,    46,
      -1,    47,    -1,    56,    -1,    57,    -1,    58,    -1,    59,
      -1,   124,    -1,   122,   124,    -1,    28,    -1,   123,    -1,
     122,   123,    -1,    54,    -1,    53,    -1
};

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const yytype_uint16 yyrline[] =
{
       0,   138,   138,   139,   142,   146,   147,   150,   151,   152,
     153,   154,   155,   156,   157,   158,   159,   160,   163,   172,
     181,   190,   199,   205,   214,   225,   237,   249,   265,   279,
     293,   313,   318,   324,   332,   339,   373,   385,   386,   389,
     390,   391,   392,   393,   394,   395,   396,   397,   398,   399,
     400,   401,   402,   403,   406,   413,   454,   468,   484,   524,
     534,   542,   576,   581,   586,   591,   596,   606,   637,   647,
     662,   673,   682,   688,   694,   701,   715,   731,   741,   750,
     762,   791,   820,   837,   849,   867,   879,   898,   910,   958,
     959,   962,   980,   986,   996,  1008,  1008,  1009,  1010,  1011,
    1012,  1013,  1014,  1015,  1016,  1017,  1018,  1019,  1020,  1021,
    1022,  1023,  1024,  1025,  1026,  1027,  1028,  1029,  1030,  1031,
    1032,  1033,  1034,  1035,  1036,  1037,  1038,  1039,  1042,  1046,
    1059,  1065,  1075,  1084,  1089
};
#endif

#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "K_LOGFILE", "K_MAX", "K_ARCHIVES",
  "K_ANALYZE", "K_AND", "K_ARCHIVE", "K_ARCHIVE_COMMENT", "K_CASCADE",
  "K_CLUSTER", "K_COMMAND", "K_COMMIT", "K_CONF_COMMENT", "K_COPY",
  "K_DATABASE", "K_DELETE", "K_DESTINATION", "K_DIR", "K_ERROR",
  "K_EXEC_DDL", "K_FROM", "K_IGNORE", "K_INSERT", "K_INTO", "K_NAME",
  "K_NAMESPACE", "K_NULL", "K_ONLY", "K_POST", "K_PRE", "K_PROCESSING",
  "K_RENAME", "K_REPLICA", "K_SELECT", "K_SESSION_ROLE", "K_SET",
  "K_START", "K_START_ARCHIVE", "K_START_CONFIG", "K_TABLE", "K_TO",
  "K_TRANSACTION", "K_TRUNCATE", "K_UPDATE", "K_VACUUM", "K_VALUES",
  "K_WHERE", "T_COPYDATA", "T_COPYDATA_PART", "T_COPYEND", "T_IDENT",
  "T_LITERAL", "T_LITERAL_PART", "T_NUMBER", "T_TRACKING_FUNCTION",
  "T_FINISH_FUNCTION", "T_SEQSETVAL_FUNCTION", "T_PGSETVAL_FUNCTION",
  "';'", "'='", "'.'", "'('", "','", "')'", "$accept", "valid_input",
  "configuration_file", "conf_stmts", "conf_stmt", "conf_archive_dir",
  "conf_dest_dir", "conf_dest_database", "conf_logfile",
  "conf_maxarchives", "conf_clustername", "conf_rename_object",
  "conf_preprocess", "conf_postprocess", "conf_errorcommand",
  "archive_file", "arch_hdr", "arch_session_role", "arch_start_trans",
  "arch_tracking", "arch_tracking_func", "arch_stmts", "arch_stmt",
  "arch_commit", "arch_insert", "arch_ins_vals", "arch_update",
  "arch_upd_set", "arch_delete", "arch_delete_only", "arch_delete_qual",
  "arch_truncate", "arch_copy", "arch_copydata", "arch_copydata_parts",
  "arch_copydata_fin", "arch_copydata_part", "arch_copyend",
  "arch_attr_list", "arch_qualification", "arch_ident_eq_lit",
  "arch_vacuum", "arch_analyze", "arch_finishtable", "arch_finish_func",
  "arch_seqsetval", "arch_seqsetval_func", "arch_pgsetval",
  "arch_pgsetval_func", "arch_exec_ddl", "arch_comments", "arch_comment",
  "num", "ident", "ident_keywords", "literal", "literal_parts",
  "literal_part", "literal_final", 0
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const yytype_uint16 yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
      59,    61,    46,    40,    44,    41
};
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const yytype_uint8 yyr1[] =
{
       0,    66,    67,    67,    68,    69,    69,    70,    70,    70,
      70,    70,    70,    70,    70,    70,    70,    70,    71,    72,
      73,    74,    75,    76,    77,    77,    77,    77,    78,    79,
      80,    81,    82,    83,    84,    85,    86,    87,    87,    88,
      88,    88,    88,    88,    88,    88,    88,    88,    88,    88,
      88,    88,    88,    88,    89,    90,    91,    91,    92,    93,
      93,    94,    95,    95,    96,    96,    97,    98,    99,    99,
     100,   100,   101,   102,   103,   104,   104,   105,   105,   106,
     107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
     116,   117,   118,   119,   119,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   121,   121,
     121,   122,   122,   123,   124
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const yytype_uint8 yyr2[] =
{
       0,     2,     1,     1,     3,     1,     2,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     5,     5,
       5,     4,     5,     5,     4,     6,     6,    10,     6,     6,
       5,     4,     4,     5,     3,    10,     1,     1,     2,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,    13,     1,     3,     8,     2,
       3,     8,     1,     0,     1,     0,     8,    10,     1,     2,
       1,     2,     1,     1,     1,     1,     3,     2,     3,     3,
       6,     5,     8,     1,    12,     1,    10,     1,     1,     1,
       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
       1,     1,     2,     1,     1
};

/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE doesn't specify something else to do.  Zero
   means the default is an error.  */
static const yytype_uint8 yydefact[] =
{
       0,     0,     0,     0,     2,     3,     0,     0,     1,    91,
       0,     0,    89,     0,     0,     0,     0,     7,     0,     0,
       0,     0,     0,     0,     4,     5,     8,     9,    10,    11,
      12,    13,    14,    15,    16,    17,     0,     0,     0,     0,
      88,     0,     0,     0,     0,     0,    72,    73,    74,    31,
      37,    40,    41,    42,    43,    53,    44,    45,     0,    68,
      70,    46,    51,    52,    47,    48,    49,    50,    39,     0,
       0,    90,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     6,   109,   110,    98,    97,
      99,   100,   101,   102,   103,   104,   105,   106,   107,   108,
     111,   112,   113,   114,   115,   116,   117,   118,    96,    95,
     119,   120,   121,   122,   123,    93,   124,   125,   126,   127,
       0,    94,    54,     0,    63,     0,     0,     0,     0,     0,
      38,    69,    71,     0,     0,     0,   130,   134,   133,     0,
       0,   131,   128,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,    62,     0,     0,
       0,     0,     0,     0,     0,     0,     0,    32,    21,   132,
     129,    92,     0,     0,     0,     0,     0,     0,    24,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    83,    85,
      87,     0,     0,     0,     0,     0,     0,     0,    34,     0,
      22,    18,    23,    20,    19,    30,     0,     0,     0,     0,
       0,    81,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    33,     0,    25,    29,    28,    26,     0,     0,    75,
      65,     0,     0,     0,     0,     0,     0,     0,    80,    36,
       0,     0,     0,     0,     0,     0,    64,     0,     0,     0,
       0,     0,    59,     0,     0,     0,     0,     0,    76,     0,
      77,    61,     0,     0,    82,     0,     0,    66,     0,    60,
      58,     0,     0,     0,    78,     0,     0,     0,    79,     0,
      27,    67,     0,     0,    86,     0,     0,    56,     0,     0,
       0,     0,    84,    35,    57,    55
};

/* YYDEFGOTO[NTERM-NUM].  */
static const yytype_int16 yydefgoto[] =
{
      -1,     3,     4,    24,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    34,    35,     5,    10,    70,   135,   167,
     240,    49,    50,    51,    52,   286,    53,   237,    54,   158,
     245,    55,    56,    57,    58,    59,    60,    61,   228,   246,
     252,    62,    63,    64,   191,    65,   192,    66,   193,    67,
      11,    68,   172,   253,   121,   139,   140,   141,   142
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -242
static const yytype_int16 yypact[] =
{
     -23,   -49,   -42,    20,  -242,  -242,    24,    77,  -242,  -242,
      25,    -5,  -242,   -24,    34,    22,    19,  -242,    -4,    41,
     -22,    26,    27,   -19,    77,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,  -242,  -242,  -242,  -242,   170,    -3,   170,    39,
    -242,    42,   170,    38,    37,    62,  -242,  -242,  -242,    25,
    -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,   -25,  -242,
    -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,    46,
      45,  -242,   -18,    23,    29,    33,    35,    40,    43,   170,
     170,    74,    75,   170,   170,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,
      44,  -242,  -242,    47,    73,   170,    49,    76,   170,   170,
    -242,  -242,  -242,    61,    69,    78,  -242,  -242,  -242,    54,
       2,  -242,  -242,    60,   -18,   -18,   -18,   -18,   -18,    56,
      55,    57,    63,    79,    64,   170,   170,  -242,   170,    65,
      -7,   170,    66,    67,    89,    80,   170,  -242,  -242,  -242,
    -242,  -242,    81,    82,    84,    85,    88,    92,  -242,   170,
     -18,   -18,   170,   170,    93,    70,    72,   170,  -242,  -242,
    -242,    86,    91,    94,   100,   170,   170,    95,  -242,   101,
    -242,  -242,  -242,  -242,  -242,  -242,    96,   105,   106,   107,
      97,  -242,   170,   170,   108,    60,   -18,   -18,   170,    98,
     109,  -242,   112,  -242,  -242,  -242,  -242,   170,     0,  -242,
     122,   170,    71,   115,   116,   127,   170,   -41,  -242,  -242,
     121,   130,   170,   176,   170,   139,   197,     8,   145,   -18,
     -18,   151,  -242,   157,   170,    -6,   -18,   170,  -242,   170,
    -242,  -242,   170,   165,  -242,   155,   159,  -242,   -18,  -242,
    -242,   156,   171,   172,  -242,   162,   -18,   173,  -242,   -18,
    -242,  -242,   -18,   169,  -242,   174,    13,  -242,   175,   177,
     -18,   178,  -242,  -242,  -242,  -242
};

/* YYPGOTO[NTERM-NUM].  */
static const yytype_int16 yypgoto[] =
{
    -242,  -242,  -242,  -242,   206,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,   187,  -242,  -242,  -242,  -242,  -242,  -242,  -242,
    -242,  -242,  -242,  -242,  -242,   182,   183,  -242,    11,     6,
    -241,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,  -242,
    -242,     3,    30,   -36,  -242,  -118,  -242,   104,   110
};

/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule which
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
#define YYTABLE_NINF -1
static const yytype_uint16 yytable[] =
{
     120,   262,   123,   260,     9,    79,   126,   244,    83,    12,
     136,     6,    76,   269,    71,    77,     1,     2,     7,    80,
       8,   274,    84,   254,    46,    47,   173,   174,   175,   176,
     177,    36,    69,     9,     9,   137,   138,    72,    37,    73,
      38,    74,    39,   149,   150,    75,    40,   153,   154,    41,
     188,   189,   190,    78,   270,   137,   138,   122,    81,    82,
      42,   124,   207,   208,   242,   243,   128,   125,   129,    43,
      44,    45,   242,   263,    46,    47,    48,   290,   291,   127,
      13,    14,   133,   134,   143,    15,   151,   152,    16,   159,
     144,    17,   162,   163,   145,    18,   146,    19,   233,   234,
      20,   147,   157,   164,   148,   161,   155,    21,    22,   156,
      23,   160,   165,   166,   168,   171,   178,   179,   180,   184,
     185,   182,   186,   197,   181,   194,   183,   187,   195,   196,
     199,   265,   266,   212,   213,   236,   248,   251,   271,   227,
     198,   200,   201,   206,   202,   203,   209,   210,   204,   215,
     278,   214,   205,   211,   216,   221,   223,   217,   283,   219,
     220,   285,   218,   222,   287,   224,   225,   226,   239,   238,
     244,   231,   294,    86,    87,    88,   229,   230,    89,   249,
     250,    90,   235,    91,   256,    92,    93,    94,    95,    96,
      97,   241,   257,    98,    99,   229,   100,   101,   259,   261,
     102,   103,   104,   105,   262,   264,   258,   106,   107,   108,
     109,   267,   275,   110,   111,   112,   113,   114,   268,   276,
     279,   272,   115,   273,   277,   282,   116,   117,   118,   119,
      85,   280,   281,   284,   288,   292,   130,   293,   295,   289,
     131,   132,   247,   255,   169,   232,     0,     0,     0,     0,
     170
};

#define yypact_value_is_default(yystate) \
  ((yystate) == (-242))

#define yytable_value_is_error(yytable_value) \
  YYID (0)

static const yytype_int16 yycheck[] =
{
      36,     7,    38,   244,     9,    27,    42,    48,    27,     6,
      28,    60,    16,   254,    11,    19,    39,    40,    60,    41,
       0,   262,    41,    64,    49,    50,   144,   145,   146,   147,
     148,     6,    37,     9,     9,    53,    54,    61,    13,     5,
      15,    19,    17,    79,    80,    26,    21,    83,    84,    24,
      57,    58,    59,    12,    60,    53,    54,    60,    32,    32,
      35,    22,   180,   181,    64,    65,    29,    25,     6,    44,
      45,    46,    64,    65,    49,    50,    51,    64,    65,    41,
       3,     4,    36,    38,    61,     8,    12,    12,    11,   125,
      61,    14,   128,   129,    61,    18,    61,    20,   216,   217,
      23,    61,    29,    42,    61,    29,    62,    30,    31,    62,
      33,    62,    43,    35,    60,    55,    60,    62,    61,   155,
     156,    42,   158,    34,    61,   161,    62,    62,    62,    62,
     166,   249,   250,    63,    62,    37,    65,    10,   256,    42,
      60,    60,    60,   179,    60,    60,   182,   183,    60,    63,
     268,   187,    60,    60,    63,    60,    60,    63,   276,   195,
     196,   279,    62,    62,   282,    60,    60,    60,    56,    60,
      48,    63,   290,     3,     4,     5,   212,   213,     8,    64,
      64,    11,   218,    13,    63,    15,    16,    17,    18,    19,
      20,   227,    62,    23,    24,   231,    26,    27,    22,    60,
      30,    31,    32,    33,     7,    60,   242,    37,    38,    39,
      40,    60,    47,    43,    44,    45,    46,    47,    61,    64,
      64,   257,    52,   259,    65,    63,    56,    57,    58,    59,
      24,    60,    60,    60,    65,    60,    49,    60,    60,    65,
      58,    58,   231,   237,   140,   215,    -1,    -1,    -1,    -1,
     140
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
static const yytype_uint8 yystos[] =
{
       0,    39,    40,    67,    68,    81,    60,    60,     0,     9,
      82,   116,   117,     3,     4,     8,    11,    14,    18,    20,
      23,    30,    31,    33,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,     6,    13,    15,    17,
      21,    24,    35,    44,    45,    46,    49,    50,    51,    87,
      88,    89,    90,    92,    94,    97,    98,    99,   100,   101,
     102,   103,   107,   108,   109,   111,   113,   115,   117,    37,
      83,   117,    61,     5,    19,    26,    16,    19,    12,    27,
      41,    32,    32,    27,    41,    70,     3,     4,     5,     8,
      11,    13,    15,    16,    17,    18,    19,    20,    23,    24,
      26,    27,    30,    31,    32,    33,    37,    38,    39,    40,
      43,    44,    45,    46,    47,    52,    56,    57,    58,    59,
     119,   120,    60,   119,    22,    25,   119,    41,    29,     6,
      88,   101,   102,    36,    38,    84,    28,    53,    54,   121,
     122,   123,   124,    61,    61,    61,    61,    61,    61,   119,
     119,    12,    12,   119,   119,    62,    62,    29,    95,   119,
      62,    29,   119,   119,    42,    43,    35,    85,    60,   123,
     124,    55,   118,   121,   121,   121,   121,   121,    60,    62,
      61,    61,    42,    62,   119,   119,   119,    62,    57,    58,
      59,   110,   112,   114,   119,    62,    62,    34,    60,   119,
      60,    60,    60,    60,    60,    60,   119,   121,   121,   119,
     119,    60,    63,    62,   119,    63,    63,    63,    62,   119,
     119,    60,    62,    60,    60,    60,    60,    42,   104,   119,
     119,    63,   118,   121,   121,   119,    37,    93,    60,    56,
      86,   119,    64,    65,    48,    96,   105,   104,    65,    64,
      64,    10,   106,   119,    64,   105,    63,    62,   119,    22,
     106,    60,     7,    65,    60,   121,   121,    60,    61,   106,
      60,   121,   119,   119,   106,    47,    64,    65,   121,    64,
      60,    60,    63,   121,    60,   121,    91,   121,    65,    65,
      64,    65,    60,    60,   121,    60
};

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		(-2)
#define YYEOF		0

#define YYACCEPT	goto yyacceptlab
#define YYABORT		goto yyabortlab
#define YYERROR		goto yyerrorlab


/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  However,
   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
   discussed.  */

#define YYFAIL		goto yyerrlab
#if defined YYFAIL
  /* This is here to suppress warnings from the GCC cpp's
     -Wunused-macros.  Normally we don't worry about that warning, but
     some users do, and we want to make it easy for users to remove
     YYFAIL uses, which will produce warnings from Bison 2.5.  */
#endif

#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      YYPOPSTACK (1);						\
      goto yybackup;						\
    }								\
  else								\
    {								\
      yyerror (YY_("syntax error: cannot back up")); \
      YYERROR;							\
    }								\
while (YYID (0))


#define YYTERROR	1
#define YYERRCODE	256


/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */

#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)				\
    do									\
      if (YYID (N))                                                    \
	{								\
	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
	}								\
      else								\
	{								\
	  (Current).first_line   = (Current).last_line   =		\
	    YYRHSLOC (Rhs, 0).last_line;				\
	  (Current).first_column = (Current).last_column =		\
	    YYRHSLOC (Rhs, 0).last_column;				\
	}								\
    while (YYID (0))
#endif


/* This macro is provided for backward compatibility. */

#ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif


/* YYLEX -- calling `yylex' with the right arguments.  */

#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
} while (YYID (0))

# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
do {									  \
  if (yydebug)								  \
    {									  \
      YYFPRINTF (stderr, "%s ", Title);					  \
      yy_symbol_print (stderr,						  \
		  Type, Value); \
      YYFPRINTF (stderr, "\n");						  \
    }									  \
} while (YYID (0))


/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE const * const yyvaluep;
#endif
{
  if (!yyvaluep)
    return;
# ifdef YYPRINT
  if (yytype < YYNTOKENS)
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
  YYUSE (yyoutput);
# endif
  switch (yytype)
    {
      default:
	break;
    }
}


/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE const * const yyvaluep;
#endif
{
  if (yytype < YYNTOKENS)
    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  else
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);

  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  YYFPRINTF (yyoutput, ")");
}

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
yy_stack_print (yybottom, yytop)
    yytype_int16 *yybottom;
    yytype_int16 *yytop;
#endif
{
  YYFPRINTF (stderr, "Stack now");
  for (; yybottom <= yytop; yybottom++)
    {
      int yybot = *yybottom;
      YYFPRINTF (stderr, " %d", yybot);
    }
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)				\
do {								\
  if (yydebug)							\
    yy_stack_print ((Bottom), (Top));				\
} while (YYID (0))


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
yy_reduce_print (yyvsp, yyrule)
    YYSTYPE *yyvsp;
    int yyrule;
#endif
{
  int yynrhs = yyr2[yyrule];
  int yyi;
  unsigned long int yylno = yyrline[yyrule];
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
	     yyrule - 1, yylno);
  /* The symbols being reduced.  */
  for (yyi = 0; yyi < yynrhs; yyi++)
    {
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
		       &(yyvsp[(yyi + 1) - (yynrhs)])
		       		       );
      YYFPRINTF (stderr, "\n");
    }
}

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug)				\
    yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif


#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined __GLIBC__ && defined _STRING_H
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
#else
static YYSIZE_T
yystrlen (yystr)
    const char *yystr;
#endif
{
  YYSIZE_T yylen;
  for (yylen = 0; yystr[yylen]; yylen++)
    continue;
  return yylen;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
#else
static char *
yystpcpy (yydest, yysrc)
    char *yydest;
    const char *yysrc;
#endif
{
  char *yyd = yydest;
  const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
   quotes and backslashes, so that it's suitable for yyerror.  The
   heuristic is that double-quoting is unnecessary unless the string
   contains an apostrophe, a comma, or backslash (other than
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
   null, do not copy; instead, return the length of what the result
   would have been.  */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
  if (*yystr == '"')
    {
      YYSIZE_T yyn = 0;
      char const *yyp = yystr;

      for (;;)
	switch (*++yyp)
	  {
	  case '\'':
	  case ',':
	    goto do_not_strip_quotes;

	  case '\\':
	    if (*++yyp != '\\')
	      goto do_not_strip_quotes;
	    /* Fall through.  */
	  default:
	    if (yyres)
	      yyres[yyn] = *yyp;
	    yyn++;
	    break;

	  case '"':
	    if (yyres)
	      yyres[yyn] = '\0';
	    return yyn;
	  }
    do_not_strip_quotes: ;
    }

  if (! yyres)
    return yystrlen (yystr);

  return yystpcpy (yyres, yystr) - yyres;
}
# endif

/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
   about the unexpected token YYTOKEN for the state stack whose top is
   YYSSP.

   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
   not large enough to hold the message.  In that case, also set
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
   required number of bytes is too large to store.  */
static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                yytype_int16 *yyssp, int yytoken)
{
  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
  YYSIZE_T yysize = yysize0;
  YYSIZE_T yysize1;
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  /* Internationalized format string. */
  const char *yyformat = 0;
  /* Arguments of yyformat. */
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  /* Number of reported tokens (one for the "unexpected", one per
     "expected"). */
  int yycount = 0;

  /* There are many possibilities here to consider:
     - Assume YYFAIL is not used.  It's too flawed to consider.  See
       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
       for details.  YYERROR is fine as it does not invoke this
       function.
     - If this state is a consistent state with a default action, then
       the only way this function was invoked is if the default action
       is an error action.  In that case, don't check for expected
       tokens because there are none.
     - The only way there can be no lookahead present (in yychar) is if
       this state is a consistent state with a default action.  Thus,
       detecting the absence of a lookahead is sufficient to determine
       that there is no unexpected or expected token to report.  In that
       case, just report a simple "syntax error".
     - Don't assume there isn't a lookahead just because this state is a
       consistent state with a default action.  There might have been a
       previous inconsistent state, consistent state with a non-default
       action, or user semantic action that manipulated yychar.
     - Of course, the expected token list depends on states to have
       correct lookahead information, and it depends on the parser not
       to perform extra reductions after fetching a lookahead from the
       scanner and before detecting a syntax error.  Thus, state merging
       (from LALR or IELR) and default reductions corrupt the expected
       token list.  However, the list is correct for canonical LR with
       one exception: it will still contain any token that will not be
       accepted due to an error action in a later state.
  */
  if (yytoken != YYEMPTY)
    {
      int yyn = yypact[*yyssp];
      yyarg[yycount++] = yytname[yytoken];
      if (!yypact_value_is_default (yyn))
        {
          /* Start YYX at -YYN if negative to avoid negative indexes in
             YYCHECK.  In other words, skip the first -YYN actions for
             this state because they are default actions.  */
          int yyxbegin = yyn < 0 ? -yyn : 0;
          /* Stay within bounds of both yycheck and yytname.  */
          int yychecklim = YYLAST - yyn + 1;
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
          int yyx;

          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
                && !yytable_value_is_error (yytable[yyx + yyn]))
              {
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
                  {
                    yycount = 1;
                    yysize = yysize0;
                    break;
                  }
                yyarg[yycount++] = yytname[yyx];
                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
                if (! (yysize <= yysize1
                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
                  return 2;
                yysize = yysize1;
              }
        }
    }

  switch (yycount)
    {
# define YYCASE_(N, S)                      \
      case N:                               \
        yyformat = S;                       \
      break
      YYCASE_(0, YY_("syntax error"));
      YYCASE_(1, YY_("syntax error, unexpected %s"));
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
# undef YYCASE_
    }

  yysize1 = yysize + yystrlen (yyformat);
  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
    return 2;
  yysize = yysize1;

  if (*yymsg_alloc < yysize)
    {
      *yymsg_alloc = 2 * yysize;
      if (! (yysize <= *yymsg_alloc
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
      return 1;
    }

  /* Avoid sprintf, as that infringes on the user's name space.
     Don't have undefined behavior even if the translation
     produced a string with the wrong number of "%s"s.  */
  {
    char *yyp = *yymsg;
    int yyi = 0;
    while ((*yyp = *yyformat) != '\0')
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
        {
          yyp += yytnamerr (yyp, yyarg[yyi++]);
          yyformat += 2;
        }
      else
        {
          yyp++;
          yyformat++;
        }
  }
  return 0;
}
#endif /* YYERROR_VERBOSE */

/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yymsg, yytype, yyvaluep)
    const char *yymsg;
    int yytype;
    YYSTYPE *yyvaluep;
#endif
{
  YYUSE (yyvaluep);

  if (!yymsg)
    yymsg = "Deleting";
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);

  switch (yytype)
    {

      default:
	break;
    }
}


/* Prevent warnings from -Wmissing-prototypes.  */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */


/* The lookahead symbol.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;

/* Number of syntax errors so far.  */
int yynerrs;


/*----------.
| yyparse.  |
`----------*/

#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
int
yyparse (void *YYPARSE_PARAM)
#else
int
yyparse (YYPARSE_PARAM)
    void *YYPARSE_PARAM;
#endif
#else /* ! YYPARSE_PARAM */
#if (defined __STDC__ || defined __C99__FUNC__ \
     || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()

#endif
#endif
{
    int yystate;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus;

    /* The stacks and their tools:
       `yyss': related to states.
       `yyvs': related to semantic values.

       Refer to the stacks thru separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* The state stack.  */
    yytype_int16 yyssa[YYINITDEPTH];
    yytype_int16 *yyss;
    yytype_int16 *yyssp;

    /* The semantic value stack.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs;
    YYSTYPE *yyvsp;

    YYSIZE_T yystacksize;

  int yyn;
  int yyresult;
  /* Lookahead token as an internal (translated) token number.  */
  int yytoken;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;

#if YYERROR_VERBOSE
  /* Buffer for error messages, and its allocated size.  */
  char yymsgbuf[128];
  char *yymsg = yymsgbuf;
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif

#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  yytoken = 0;
  yyss = yyssa;
  yyvs = yyvsa;
  yystacksize = YYINITDEPTH;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY; /* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */
  yyssp = yyss;
  yyvsp = yyvs;

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyss + yystacksize - 1 <= yyssp)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
	/* Give user a chance to reallocate the stack.  Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
	yytype_int16 *yyss1 = yyss;

	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  This used to be a
	   conditional around just the two extra args, but that might
	   be undefined if yyoverflow is a macro.  */
	yyoverflow (YY_("memory exhausted"),
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
		    &yystacksize);

	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyexhaustedlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
	goto yyexhaustedlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
	yystacksize = YYMAXDEPTH;

      {
	yytype_int16 *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyexhaustedlab;
	YYSTACK_RELOCATE (yyss_alloc, yyss);
	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
#  undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;

      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) yystacksize));

      if (yyss + yystacksize - 1 <= yyssp)
	YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yypact_value_is_default (yyn))
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yytable_value_is_error (yyn))
        goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

  /* Discard the shifted token.  */
  yychar = YYEMPTY;

  yystate = yyn;
  *++yyvsp = yylval;

  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
        case 18:

/* Line 1806 of yacc.c  */
#line 164 "parser.y"
    {
						if (archive_dir != NULL)
							parse_error("duplicate archive dir specification");
						else
							archive_dir = strdup((yyvsp[(4) - (5)].str));
					}
    break;

  case 19:

/* Line 1806 of yacc.c  */
#line 173 "parser.y"
    {
						if (destination_dir != NULL)
							parse_error("duplicate destination dir specification");
						else
							destination_dir = strdup((yyvsp[(4) - (5)].str));
					}
    break;

  case 20:

/* Line 1806 of yacc.c  */
#line 182 "parser.y"
    {
						if (destination_conninfo != NULL)
							parse_error("duplicate destination database specification");
						else
							destination_conninfo = strdup((yyvsp[(4) - (5)].str));
					}
    break;

  case 21:

/* Line 1806 of yacc.c  */
#line 191 "parser.y"
    {
						if (logfile_path != NULL)
							parse_error("duplicate logfile path specification");
						else
							logfile_path = strdup((yyvsp[(3) - (4)].str));
					}
    break;

  case 22:

/* Line 1806 of yacc.c  */
#line 200 "parser.y"
    {
						max_archives = (yyvsp[(4) - (5)].ival);
					}
    break;

  case 23:

/* Line 1806 of yacc.c  */
#line 206 "parser.y"
    {
						if (cluster_name != NULL)
							parse_error("duplicate cluster name specification");
						else
							cluster_name = strdup((yyvsp[(4) - (5)].str));
					}
    break;

  case 24:

/* Line 1806 of yacc.c  */
#line 215 "parser.y"
    {
						RenameObject *new;

						new = (RenameObject *)malloc(sizeof(RenameObject));
						memset(new, 0, sizeof(RenameObject));

						new->old_namespace = (yyvsp[(3) - (4)].str);

						config_add_rename(new);
					}
    break;

  case 25:

/* Line 1806 of yacc.c  */
#line 226 "parser.y"
    {
						RenameObject *new;

						new = (RenameObject *)malloc(sizeof(RenameObject));
						memset(new, 0, sizeof(RenameObject));

						new->old_namespace = (yyvsp[(3) - (6)].str);
						new->old_name      = (yyvsp[(5) - (6)].str);

						config_add_rename(new);
					}
    break;

  case 26:

/* Line 1806 of yacc.c  */
#line 238 "parser.y"
    {
						RenameObject *new;

						new = (RenameObject *)malloc(sizeof(RenameObject));
						memset(new, 0, sizeof(RenameObject));

						new->old_namespace = (yyvsp[(3) - (6)].str);
						new->new_namespace = (yyvsp[(5) - (6)].str);

						config_add_rename(new);
					}
    break;

  case 27:

/* Line 1806 of yacc.c  */
#line 250 "parser.y"
    {
						RenameObject *new;

						new = (RenameObject *)malloc(sizeof(RenameObject));
						memset(new, 0, sizeof(RenameObject));

						new->old_namespace = (yyvsp[(3) - (10)].str);
						new->old_name      = (yyvsp[(5) - (10)].str);
						new->new_namespace = (yyvsp[(7) - (10)].str);
						new->new_name      = (yyvsp[(9) - (10)].str);

						config_add_rename(new);
					}
    break;

  case 28:

/* Line 1806 of yacc.c  */
#line 266 "parser.y"
    {
						ProcessingCommand	  **pptr;

						pptr = &pre_processing_commands;
						while (*pptr != NULL)
							pptr = &((*pptr)->next);
						
						*pptr = (ProcessingCommand *)malloc(sizeof(ProcessingCommand));
						(*pptr)->command = (yyvsp[(5) - (6)].str);
						(*pptr)->next = NULL;
					}
    break;

  case 29:

/* Line 1806 of yacc.c  */
#line 280 "parser.y"
    {
						ProcessingCommand	  **pptr;

						pptr = &post_processing_commands;
						while (*pptr != NULL)
							pptr = &((*pptr)->next);
						
						*pptr = (ProcessingCommand *)malloc(sizeof(ProcessingCommand));
						(*pptr)->command = (yyvsp[(5) - (6)].str);
						(*pptr)->next = NULL;
					}
    break;

  case 30:

/* Line 1806 of yacc.c  */
#line 294 "parser.y"
    {
						ProcessingCommand	  **pptr;

						pptr = &error_commands;
						while (*pptr != NULL)
							pptr = &((*pptr)->next);
						
						*pptr = (ProcessingCommand *)malloc(sizeof(ProcessingCommand));
						(*pptr)->command = (yyvsp[(4) - (5)].str);
						(*pptr)->next = NULL;
					}
    break;

  case 33:

/* Line 1806 of yacc.c  */
#line 325 "parser.y"
    {
						if (process_simple_sql(
							"set session_replication_role to replica;") < 0)
							YYABORT;
					}
    break;

  case 34:

/* Line 1806 of yacc.c  */
#line 333 "parser.y"
    {
						if (process_start_transaction("start transaction;") < 0)
							YYABORT;
					}
    break;

  case 35:

/* Line 1806 of yacc.c  */
#line 340 "parser.y"
    {
						SlonDString	ds;
						int			rc;

						dstring_init(&ds);
						slon_mkquery(&ds, "select %s.%s('%s', '%s');",
								(yyvsp[(2) - (10)].str), (yyvsp[(4) - (10)].str), (yyvsp[(6) - (10)].str), (yyvsp[(8) - (10)].str));
						rc = process_check_at_counter((yyvsp[(6) - (10)].str));
						free((yyvsp[(2) - (10)].str));
						free((yyvsp[(4) - (10)].str));
						free((yyvsp[(6) - (10)].str));
						free((yyvsp[(8) - (10)].str));

						if (rc < 0)
						{
							dstring_free(&ds);
							YYABORT;
						}
						if (rc == 1)
						{
							dstring_free(&ds);
							YYACCEPT;
						}
						
						if (process_simple_sql(dstring_data(&ds)) < 0)
						{
							dstring_free(&ds);
							YYABORT;
						}
						else
							dstring_free(&ds);
					}
    break;

  case 36:

/* Line 1806 of yacc.c  */
#line 374 "parser.y"
    {
						char   *ret;
						size_t toklen=yyget_leng();
						ret = malloc(toklen + 1);
						memcpy(ret, yytext, toklen);
						ret[toklen] = '\0';

						(yyval.str) = ret;
					}
    break;

  case 54:

/* Line 1806 of yacc.c  */
#line 407 "parser.y"
    {
						if (process_end_transaction("commit;") < 0)
							YYABORT;
					}
    break;

  case 55:

/* Line 1806 of yacc.c  */
#line 414 "parser.y"
    {
						InsertStmt	stmt;
						AttElem	   *nelem;
						AttElem	   *velem;
						AttElem	   *next;
						int			rc;

						stmt.namespace	= (yyvsp[(3) - (13)].str);
						stmt.tablename	= (yyvsp[(5) - (13)].str);
						stmt.attributes	= (yyvsp[(7) - (13)].att_elem_list);

						for (nelem = (yyvsp[(7) - (13)].att_elem_list)->list_head, velem = (yyvsp[(11) - (13)].att_elem_list)->list_head;
								nelem != NULL && velem != NULL;
								nelem = nelem->next, velem = next)
						{
							nelem->attvalue = velem->attvalue;
							next = velem->next;
							free(velem);
						}
						free((yyvsp[(11) - (13)].att_elem_list));

						rc = process_insert(&stmt);

						for (nelem = (yyvsp[(7) - (13)].att_elem_list)->list_head; nelem != NULL; nelem = next)
						{
							next = nelem->next;
							free(nelem->attname);
							if (nelem->attvalue != NULL)
								free(nelem->attvalue);
							free(nelem);
						}
						free(stmt.namespace);
						free(stmt.tablename);
						free(stmt.attributes);

						if (rc < 0)
							YYABORT;
					}
    break;

  case 56:

/* Line 1806 of yacc.c  */
#line 455 "parser.y"
    {
						AttElemList	   *new;
						new = (AttElemList *)malloc(sizeof(AttElemList));

						new->list_head = (AttElem *)malloc(sizeof(AttElem));
						new->list_tail = new->list_head;

						new->list_head->attname = NULL;
						new->list_head->attvalue = (yyvsp[(1) - (1)].str);
						new->list_head->next = NULL;

						(yyval.att_elem_list) = new;
					}
    break;

  case 57:

/* Line 1806 of yacc.c  */
#line 469 "parser.y"
    {
						AttElem		   *new;
						new = (AttElem *)malloc(sizeof(AttElem));

						new->attname = NULL;
						new->attvalue = (yyvsp[(3) - (3)].str);
						new->next = NULL;

						(yyvsp[(1) - (3)].att_elem_list)->list_tail->next = new;
						(yyvsp[(1) - (3)].att_elem_list)->list_tail = new;

						(yyval.att_elem_list) = (yyvsp[(1) - (3)].att_elem_list);
					}
    break;

  case 58:

/* Line 1806 of yacc.c  */
#line 485 "parser.y"
    {
						UpdateStmt		stmt;
						AttElem		   *elem;
						AttElem		   *next;
						int				rc;

						stmt.namespace		= (yyvsp[(3) - (8)].str);
						stmt.tablename		= (yyvsp[(5) - (8)].str);
						stmt.changes		= (yyvsp[(6) - (8)].att_elem_list);
						stmt.qualification	= (yyvsp[(7) - (8)].att_elem_list);

						rc = process_update(&stmt);

						for (elem = stmt.changes->list_head; elem != NULL; elem = next)
						{
							next = elem->next;
							free(elem->attname);
							if (elem->attvalue != NULL)
								free(elem->attvalue);
							free(elem);
						}
						free(stmt.changes);
						for (elem = stmt.qualification->list_head; elem != NULL; elem = next)
						{
							next = elem->next;
							free(elem->attname);
							if (elem->attvalue != NULL)
								free(elem->attvalue);
							free(elem);
						}
						free(stmt.namespace);
						free(stmt.tablename);
						free(stmt.qualification);

						if (rc < 0)
							YYABORT;
					}
    break;

  case 59:

/* Line 1806 of yacc.c  */
#line 525 "parser.y"
    {
						AttElemList	   *new;
						new = (AttElemList *)malloc(sizeof(AttElemList));

						new->list_head = (yyvsp[(2) - (2)].att_elem);
						new->list_tail = (yyvsp[(2) - (2)].att_elem);

						(yyval.att_elem_list) = new;
					}
    break;

  case 60:

/* Line 1806 of yacc.c  */
#line 535 "parser.y"
    { 
						(yyvsp[(1) - (3)].att_elem_list)->list_tail->next = (yyvsp[(3) - (3)].att_elem);
						(yyvsp[(1) - (3)].att_elem_list)->list_tail = (yyvsp[(3) - (3)].att_elem);

						(yyval.att_elem_list) = (yyvsp[(1) - (3)].att_elem_list);
					}
    break;

  case 61:

/* Line 1806 of yacc.c  */
#line 543 "parser.y"
    {
						DeleteStmt		stmt;
						AttElem		   *elem;
						AttElem		   *next;
						int				rc;

						stmt.namespace		= (yyvsp[(4) - (8)].str);
						stmt.tablename		= (yyvsp[(6) - (8)].str);
						stmt.only			= (yyvsp[(3) - (8)].ival);
						stmt.qualification	= (yyvsp[(7) - (8)].att_elem_list);

						rc = process_delete(&stmt);

						if (stmt.qualification != NULL)
						{
							for (elem = stmt.qualification->list_head; elem != NULL; elem = next)
							{
								next = elem->next;
								free(elem->attname);
								if (elem->attvalue != NULL)
									free(elem->attvalue);
								free(elem);
							}
							free(stmt.qualification);
						}
						free(stmt.namespace);
						free(stmt.tablename);

						if (rc < 0)
							YYABORT;
					}
    break;

  case 62:

/* Line 1806 of yacc.c  */
#line 577 "parser.y"
    {
						(yyval.ival) = 1;
					}
    break;

  case 63:

/* Line 1806 of yacc.c  */
#line 581 "parser.y"
    {
						(yyval.ival) = 0;
					}
    break;

  case 64:

/* Line 1806 of yacc.c  */
#line 587 "parser.y"
    {
						(yyval.att_elem_list) = (yyvsp[(1) - (1)].att_elem_list);
					}
    break;

  case 65:

/* Line 1806 of yacc.c  */
#line 591 "parser.y"
    {
						(yyval.att_elem_list) = NULL;
					}
    break;

  case 66:

/* Line 1806 of yacc.c  */
#line 597 "parser.y"
    {
						
						TruncateStmt stmt;
						stmt.namespace=(yyvsp[(4) - (8)].str);
						stmt.tablename=(yyvsp[(6) - (8)].str);
						process_truncate(&stmt);

					}
    break;

  case 67:

/* Line 1806 of yacc.c  */
#line 607 "parser.y"
    {
						CopyStmt		stmt;
						AttElem		   *elem;
						AttElem		   *next;
						int				rc;

						stmt.namespace		= (yyvsp[(2) - (10)].str);
						stmt.tablename		= (yyvsp[(4) - (10)].str);
						stmt.attributes		= (yyvsp[(6) - (10)].att_elem_list);
						stmt.from			= (yyvsp[(9) - (10)].str);

						rc = process_copy(&stmt);

						for (elem = stmt.attributes->list_head; elem != NULL; elem = next)
						{
							next = elem->next;
							free(elem->attname);
							if (elem->attvalue != NULL)
								free(elem->attvalue);
							free(elem);
						}
						free(stmt.attributes);
						free(stmt.namespace);
						free(stmt.tablename);

						if (rc < 0)
							YYABORT;
					}
    break;

  case 68:

/* Line 1806 of yacc.c  */
#line 638 "parser.y"
    {
						int rc;

						rc = process_copydata((yyvsp[(1) - (1)].str));
						free((yyvsp[(1) - (1)].str));

						if (rc < 0)
							YYABORT;
					}
    break;

  case 69:

/* Line 1806 of yacc.c  */
#line 648 "parser.y"
    {
						int rc;

						dstring_append((yyvsp[(1) - (2)].dstring), (yyvsp[(2) - (2)].str));
						dstring_terminate((yyvsp[(1) - (2)].dstring));
						free((yyvsp[(2) - (2)].str));
						rc = process_copydata(dstring_data((yyvsp[(1) - (2)].dstring)));
						dstring_free((yyvsp[(1) - (2)].dstring));

						if (rc < 0)
							YYABORT;
					}
    break;

  case 70:

/* Line 1806 of yacc.c  */
#line 663 "parser.y"
    {
						SlonDString	*new;

						new = (SlonDString *)malloc(sizeof(SlonDString));
						dstring_init(new);
						dstring_append(new, (yyvsp[(1) - (1)].str));
						free((yyvsp[(1) - (1)].str));

						(yyval.dstring) = new;
					}
    break;

  case 71:

/* Line 1806 of yacc.c  */
#line 674 "parser.y"
    {
						dstring_append((yyvsp[(1) - (2)].dstring), (yyvsp[(2) - (2)].str));
						free((yyvsp[(2) - (2)].str));

						(yyval.dstring) = (yyvsp[(1) - (2)].dstring);
					}
    break;

  case 72:

/* Line 1806 of yacc.c  */
#line 683 "parser.y"
    {
						(yyval.str) = strdup(yychunk);
					}
    break;

  case 73:

/* Line 1806 of yacc.c  */
#line 689 "parser.y"
    {
						(yyval.str) = strdup(yychunk);
					}
    break;

  case 74:

/* Line 1806 of yacc.c  */
#line 695 "parser.y"
    {
						if (process_copyend() < 0)
							YYABORT;
					}
    break;

  case 75:

/* Line 1806 of yacc.c  */
#line 702 "parser.y"
    {
						AttElemList	   *new;
						new = (AttElemList *)malloc(sizeof(AttElemList));

						new->list_head = (AttElem *)malloc(sizeof(AttElem));
						new->list_tail = new->list_head;

						new->list_head->attname = (yyvsp[(1) - (1)].str);
						new->list_head->attvalue = NULL;
						new->list_head->next = NULL;

						(yyval.att_elem_list) = new;
					}
    break;

  case 76:

/* Line 1806 of yacc.c  */
#line 716 "parser.y"
    {
						AttElem		   *new;
						new = (AttElem *)malloc(sizeof(AttElem));

						new->attname = (yyvsp[(3) - (3)].str);
						new->attvalue = NULL;
						new->next = NULL;

						(yyvsp[(1) - (3)].att_elem_list)->list_tail->next = new;
						(yyvsp[(1) - (3)].att_elem_list)->list_tail = new;

						(yyval.att_elem_list) = (yyvsp[(1) - (3)].att_elem_list);
					}
    break;

  case 77:

/* Line 1806 of yacc.c  */
#line 732 "parser.y"
    {
						AttElemList	   *new;
						new = (AttElemList *)malloc(sizeof(AttElemList));

						new->list_head = (yyvsp[(2) - (2)].att_elem);
						new->list_tail = (yyvsp[(2) - (2)].att_elem);

						(yyval.att_elem_list) = new;
					}
    break;

  case 78:

/* Line 1806 of yacc.c  */
#line 742 "parser.y"
    {
						(yyvsp[(1) - (3)].att_elem_list)->list_tail->next = (yyvsp[(3) - (3)].att_elem);
						(yyvsp[(1) - (3)].att_elem_list)->list_tail = (yyvsp[(3) - (3)].att_elem);

						(yyval.att_elem_list) = (yyvsp[(1) - (3)].att_elem_list);
					}
    break;

  case 79:

/* Line 1806 of yacc.c  */
#line 751 "parser.y"
    {
						AttElem	   *new = (AttElem *)malloc(sizeof(AttElem));

						new->attname = (yyvsp[(1) - (3)].str);
						new->attvalue = (yyvsp[(3) - (3)].str);
						new->next = NULL;

						(yyval.att_elem) = new;
					}
    break;

  case 80:

/* Line 1806 of yacc.c  */
#line 763 "parser.y"
    {
						SlonDString	ds;
						char	   *namespace;
						char	   *tablename;

						if (lookup_rename((yyvsp[(3) - (6)].str), (yyvsp[(5) - (6)].str), &namespace, &tablename) == 1)
						{
							dstring_init(&ds);
							slon_mkquery(&ds, "vacuum analyze %s.%s;",
									(yyvsp[(3) - (6)].str), (yyvsp[(5) - (6)].str));
							free((yyvsp[(3) - (6)].str));
							free((yyvsp[(5) - (6)].str));
							if (process_simple_sql(dstring_data(&ds)) < 0)
							{
								dstring_free(&ds);
								YYABORT;
							}
							else
								dstring_free(&ds);
						}
						else
						{
							free((yyvsp[(3) - (6)].str));
							free((yyvsp[(5) - (6)].str));
						}
					}
    break;

  case 81:

/* Line 1806 of yacc.c  */
#line 792 "parser.y"
    {
						SlonDString	ds;
						char	   *namespace;
						char	   *tablename;

						if (lookup_rename((yyvsp[(2) - (5)].str), (yyvsp[(4) - (5)].str), &namespace, &tablename) == 1)
						{
							dstring_init(&ds);
							slon_mkquery(&ds, "analyze %s.%s;",
									namespace, tablename);
							free((yyvsp[(2) - (5)].str));
							free((yyvsp[(4) - (5)].str));
							if (process_simple_sql(dstring_data(&ds)) < 0)
							{
								dstring_free(&ds);
								YYABORT;
							}
							else
								dstring_free(&ds);
						}
						else
						{
							free((yyvsp[(2) - (5)].str));
							free((yyvsp[(4) - (5)].str));
						}
					}
    break;

  case 82:

/* Line 1806 of yacc.c  */
#line 821 "parser.y"
    {
						SlonDString	ds;
						dstring_init(&ds);
						slon_mkquery(&ds, "select %s.%s(%d);",
								(yyvsp[(2) - (8)].str), (yyvsp[(4) - (8)].str), (yyvsp[(6) - (8)].ival));
						free((yyvsp[(2) - (8)].str));
						free((yyvsp[(4) - (8)].str));
						if (process_simple_sql(dstring_data(&ds)) < 0)
						{
							dstring_free(&ds);
							YYABORT;
						}
						else
							dstring_free(&ds);
					}
    break;

  case 83:

/* Line 1806 of yacc.c  */
#line 838 "parser.y"
    {
						char   *ret;
						size_t toklen = yyget_leng();
						ret = malloc(toklen + 1);
						memcpy(ret, yytext, toklen);
						ret[toklen] = '\0';

						(yyval.str) = ret;
					}
    break;

  case 84:

/* Line 1806 of yacc.c  */
#line 850 "parser.y"
    {
						SlonDString	ds;
						dstring_init(&ds);
						slon_mkquery(&ds, "select %s.%s('%s', '%s', '%s');",
									 (yyvsp[(2) - (12)].str), (yyvsp[(4) - (12)].str), (yyvsp[(6) - (12)].str), (yyvsp[(8) - (12)].str),(yyvsp[(10) - (12)].str));
						free((yyvsp[(2) - (12)].str));
						free((yyvsp[(4) - (12)].str));
						free((yyvsp[(8) - (12)].str));
						if (process_simple_sql(dstring_data(&ds)) < 0)
						{
							dstring_free(&ds);
							YYABORT;
						}
						else
							dstring_free(&ds);
					}
    break;

  case 85:

/* Line 1806 of yacc.c  */
#line 868 "parser.y"
    {
						char   *ret;
						size_t toklen= yyget_leng();
						ret = malloc(toklen + 1);
						memcpy(ret, yytext, toklen);
						ret[toklen] = '\0';

						(yyval.str) = ret;
					}
    break;

  case 86:

/* Line 1806 of yacc.c  */
#line 880 "parser.y"
    {
						SlonDString	ds;
						dstring_init(&ds);
						slon_mkquery(&ds, "select %s.%s('%s', '%s');",
									 (yyvsp[(2) - (10)].str), (yyvsp[(4) - (10)].str), (yyvsp[(6) - (10)].str), (yyvsp[(8) - (10)].str));
						free((yyvsp[(2) - (10)].str));
						free((yyvsp[(4) - (10)].str));
						free((yyvsp[(6) - (10)].str));
						free((yyvsp[(8) - (10)].str));
						if (process_simple_sql(dstring_data(&ds)) < 0)
						{
							dstring_free(&ds);
							YYABORT;
						}
						else
							dstring_free(&ds);
					}
    break;

  case 87:

/* Line 1806 of yacc.c  */
#line 899 "parser.y"
    {
						char   *ret;
						size_t toklen = yyget_leng();
						ret = malloc(toklen + 1);
						memcpy(ret, yytext, toklen);
						ret[toklen] = '\0';

						(yyval.str) = ret;
					}
    break;

  case 88:

/* Line 1806 of yacc.c  */
#line 911 "parser.y"
    {
						SlonDString	ds;
						int			c;
						int			nstmts;
						int			i;

						if (process_simple_sql("-- DDL_SCRIPT") < 0)
							YYABORT;

						dstring_init(&ds);
						while ((c = scan_yyinput()) != EOF)
						{
							dstring_addchar(&ds, c);
						}
						dstring_terminate(&ds);

						if ((nstmts = scan_for_statements(dstring_data(&ds))) < 0)
						{
							errlog(LOG_ERROR, "scan_for_statements failed\n");
							dstring_free(&ds);
							YYABORT;
						}

						for (i = 0; i < nstmts; i++)
						{
							int start = (i == 0) ? 0 : STMTS[i - 1] + 1;
							int end = STMTS[i];

							dstring_data(&ds)[end] = '\0';

							if (process_simple_sql(dstring_data(&ds) + start) < 0)
							{
								dstring_free(&ds);
								YYABORT;
							}
						}
						dstring_free(&ds);

						/*
						 * Just in case
						 */
						process_end_transaction("rollback;");

						YYACCEPT;
					}
    break;

  case 91:

/* Line 1806 of yacc.c  */
#line 963 "parser.y"
    {
						char   *str;
						size_t toklen = yyget_leng();
						str = malloc(toklen + 1);
						memcpy(str, yytext, toklen);
						str[toklen] = '\0';

						if (process_simple_sql(str) < 0)
						{
							free(str);
							YYABORT;
						}
						else
							free(str);
					}
    break;

  case 92:

/* Line 1806 of yacc.c  */
#line 981 "parser.y"
    {
						(yyval.ival) = strtol(yytext, NULL, 10);
					}
    break;

  case 93:

/* Line 1806 of yacc.c  */
#line 987 "parser.y"
    {
						char   *ret;
						size_t toklen = yyget_leng();
						ret = malloc(toklen + 1);
						memcpy(ret, yytext, toklen);
						ret[toklen] = '\0';

						(yyval.str) = ret;
					}
    break;

  case 94:

/* Line 1806 of yacc.c  */
#line 997 "parser.y"
    {
						char   *ret;
						size_t toklen = yyget_leng();
						ret = malloc(toklen + 1);
						memcpy(ret, yytext, toklen);
						ret[toklen] = '\0';

						(yyval.str) = ret;
					}
    break;

  case 128:

/* Line 1806 of yacc.c  */
#line 1043 "parser.y"
    {
						(yyval.str) = (yyvsp[(1) - (1)].str);
					}
    break;

  case 129:

/* Line 1806 of yacc.c  */
#line 1047 "parser.y"
    {
						char   *ret;

						dstring_append((yyvsp[(1) - (2)].dstring), (yyvsp[(2) - (2)].str));
						dstring_terminate((yyvsp[(1) - (2)].dstring));
						free((yyvsp[(2) - (2)].str));

						ret = strdup(dstring_data((yyvsp[(1) - (2)].dstring)));
						dstring_free((yyvsp[(1) - (2)].dstring));
						
						(yyval.str) = ret;
					}
    break;

  case 130:

/* Line 1806 of yacc.c  */
#line 1060 "parser.y"
    {
						(yyval.str) = NULL;
					}
    break;

  case 131:

/* Line 1806 of yacc.c  */
#line 1066 "parser.y"
    {
						SlonDString	   *dsp = (SlonDString *)malloc(sizeof(SlonDString));

						dstring_init(dsp);
						dstring_append(dsp, (yyvsp[(1) - (1)].str));
						free((yyvsp[(1) - (1)].str));

						(yyval.dstring) = dsp;
					}
    break;

  case 132:

/* Line 1806 of yacc.c  */
#line 1076 "parser.y"
    {
						dstring_append((yyvsp[(1) - (2)].dstring), (yyvsp[(2) - (2)].str));
						free((yyvsp[(2) - (2)].str));

						(yyval.dstring) = (yyvsp[(1) - (2)].dstring);
					}
    break;

  case 133:

/* Line 1806 of yacc.c  */
#line 1085 "parser.y"
    {
						(yyval.str) = strdup(yychunk);
					}
    break;

  case 134:

/* Line 1806 of yacc.c  */
#line 1090 "parser.y"
    {
						(yyval.str) = strdup(yychunk);
					}
    break;



/* Line 1806 of yacc.c  */
#line 2855 "y.tab.c"
      default: break;
    }
  /* User semantic actions sometimes alter yychar, and that requires
     that yytoken be updated with the new translation.  We take the
     approach of translating immediately before every use of yytoken.
     One alternative is translating here after every semantic action,
     but that translation would be missed if the semantic action invokes
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
     incorrect destructor might then be invoked immediately.  In the
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
     to an incorrect destructor call or verbose syntax error message
     before the lookahead is translated.  */
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;

  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* Make sure we have latest lookahead translation.  See comments at
     user semantic actions for why this is necessary.  */
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);

  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if ! YYERROR_VERBOSE
      yyerror (YY_("syntax error"));
#else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
                                        yyssp, yytoken)
      {
        char const *yymsgp = YY_("syntax error");
        int yysyntax_error_status;
        yysyntax_error_status = YYSYNTAX_ERROR;
        if (yysyntax_error_status == 0)
          yymsgp = yymsg;
        else if (yysyntax_error_status == 1)
          {
            if (yymsg != yymsgbuf)
              YYSTACK_FREE (yymsg);
            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
            if (!yymsg)
              {
                yymsg = yymsgbuf;
                yymsg_alloc = sizeof yymsgbuf;
                yysyntax_error_status = 2;
              }
            else
              {
                yysyntax_error_status = YYSYNTAX_ERROR;
                yymsgp = yymsg;
              }
          }
        yyerror (yymsgp);
        if (yysyntax_error_status == 2)
          goto yyexhaustedlab;
      }
# undef YYSYNTAX_ERROR
#endif
    }



  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      if (yychar <= YYEOF)
	{
	  /* Return failure if at end of input.  */
	  if (yychar == YYEOF)
	    YYABORT;
	}
      else
	{
	  yydestruct ("Error: discarding",
		      yytoken, &yylval);
	  yychar = YYEMPTY;
	}
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (/*CONSTCOND*/ 0)
     goto yyerrorlab;

  /* Do not reclaim the symbols of the rule which action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (!yypact_value_is_default (yyn))
	{
	  yyn += YYTERROR;
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
	    {
	      yyn = yytable[yyn];
	      if (0 < yyn)
		break;
	    }
	}

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
	YYABORT;


      yydestruct ("Error: popping",
		  yystos[yystate], yyvsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  *++yyvsp = yylval;


  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
  if (yychar != YYEMPTY)
    {
      /* Make sure we have latest lookahead translation.  See comments at
         user semantic actions for why this is necessary.  */
      yytoken = YYTRANSLATE (yychar);
      yydestruct ("Cleanup: discarding lookahead",
                  yytoken, &yylval);
    }
  /* Do not reclaim the symbols of the rule which action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
		  yystos[*yyssp], yyvsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
  if (yymsg != yymsgbuf)
    YYSTACK_FREE (yymsg);
#endif
  /* Make sure YYID is used.  */
  return YYID (yyresult);
}



/* Line 2067 of yacc.c  */
#line 1094 "parser.y"



void
yyerror(const char *msg)
{
	errlog(LOG_ERROR, "%s:%d: ERROR %s at or near %s\n", current_file,
				yylineno, msg, yytext);
	parse_errors++;
}
void

parse_error(const char *msg)
{
	errlog(LOG_ERROR, "%s:%d: ERROR %s\n", current_file,
				yylineno, msg);
	parse_errors++;
}




/*
 * Local Variables:
 *  tab-width: 4
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 */

