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

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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 2, 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, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     IDENT = 258,
     FCONST = 259,
     SCONST = 260,
     BCONST = 261,
     XCONST = 262,
     Op = 263,
     ICONST = 264,
     PARAM = 265,
     TYPECAST = 266,
     DOT_DOT = 267,
     COLON_EQUALS = 268,
     T_WORD = 269,
     T_CWORD = 270,
     T_DATUM = 271,
     LESS_LESS = 272,
     GREATER_GREATER = 273,
     K_ABSOLUTE = 274,
     K_ALIAS = 275,
     K_ALL = 276,
     K_ARRAY = 277,
     K_BACKWARD = 278,
     K_BEGIN = 279,
     K_BY = 280,
     K_CASE = 281,
     K_CLOSE = 282,
     K_COLLATE = 283,
     K_CONSTANT = 284,
     K_CONTINUE = 285,
     K_CURSOR = 286,
     K_DEBUG = 287,
     K_DECLARE = 288,
     K_DEFAULT = 289,
     K_DETAIL = 290,
     K_DIAGNOSTICS = 291,
     K_DUMP = 292,
     K_ELSE = 293,
     K_ELSIF = 294,
     K_END = 295,
     K_ERRCODE = 296,
     K_ERROR = 297,
     K_EXCEPTION = 298,
     K_EXECUTE = 299,
     K_EXIT = 300,
     K_FETCH = 301,
     K_FIRST = 302,
     K_FOR = 303,
     K_FOREACH = 304,
     K_FORWARD = 305,
     K_FROM = 306,
     K_GET = 307,
     K_HINT = 308,
     K_IF = 309,
     K_IN = 310,
     K_INFO = 311,
     K_INSERT = 312,
     K_INTO = 313,
     K_IS = 314,
     K_LAST = 315,
     K_LOG = 316,
     K_LOOP = 317,
     K_MESSAGE = 318,
     K_MOVE = 319,
     K_NEXT = 320,
     K_NO = 321,
     K_NOT = 322,
     K_NOTICE = 323,
     K_NULL = 324,
     K_OPEN = 325,
     K_OPTION = 326,
     K_OR = 327,
     K_PERFORM = 328,
     K_PRIOR = 329,
     K_QUERY = 330,
     K_RAISE = 331,
     K_RELATIVE = 332,
     K_RESULT_OID = 333,
     K_RETURN = 334,
     K_REVERSE = 335,
     K_ROWTYPE = 336,
     K_ROW_COUNT = 337,
     K_SCROLL = 338,
     K_SLICE = 339,
     K_SQLSTATE = 340,
     K_STRICT = 341,
     K_THEN = 342,
     K_TO = 343,
     K_TYPE = 344,
     K_USE_COLUMN = 345,
     K_USE_VARIABLE = 346,
     K_USING = 347,
     K_VARIABLE_CONFLICT = 348,
     K_WARNING = 349,
     K_WHEN = 350,
     K_WHILE = 351
   };
#endif
#define IDENT 258
#define FCONST 259
#define SCONST 260
#define BCONST 261
#define XCONST 262
#define Op 263
#define ICONST 264
#define PARAM 265
#define TYPECAST 266
#define DOT_DOT 267
#define COLON_EQUALS 268
#define T_WORD 269
#define T_CWORD 270
#define T_DATUM 271
#define LESS_LESS 272
#define GREATER_GREATER 273
#define K_ABSOLUTE 274
#define K_ALIAS 275
#define K_ALL 276
#define K_ARRAY 277
#define K_BACKWARD 278
#define K_BEGIN 279
#define K_BY 280
#define K_CASE 281
#define K_CLOSE 282
#define K_COLLATE 283
#define K_CONSTANT 284
#define K_CONTINUE 285
#define K_CURSOR 286
#define K_DEBUG 287
#define K_DECLARE 288
#define K_DEFAULT 289
#define K_DETAIL 290
#define K_DIAGNOSTICS 291
#define K_DUMP 292
#define K_ELSE 293
#define K_ELSIF 294
#define K_END 295
#define K_ERRCODE 296
#define K_ERROR 297
#define K_EXCEPTION 298
#define K_EXECUTE 299
#define K_EXIT 300
#define K_FETCH 301
#define K_FIRST 302
#define K_FOR 303
#define K_FOREACH 304
#define K_FORWARD 305
#define K_FROM 306
#define K_GET 307
#define K_HINT 308
#define K_IF 309
#define K_IN 310
#define K_INFO 311
#define K_INSERT 312
#define K_INTO 313
#define K_IS 314
#define K_LAST 315
#define K_LOG 316
#define K_LOOP 317
#define K_MESSAGE 318
#define K_MOVE 319
#define K_NEXT 320
#define K_NO 321
#define K_NOT 322
#define K_NOTICE 323
#define K_NULL 324
#define K_OPEN 325
#define K_OPTION 326
#define K_OR 327
#define K_PERFORM 328
#define K_PRIOR 329
#define K_QUERY 330
#define K_RAISE 331
#define K_RELATIVE 332
#define K_RESULT_OID 333
#define K_RETURN 334
#define K_REVERSE 335
#define K_ROWTYPE 336
#define K_ROW_COUNT 337
#define K_SCROLL 338
#define K_SLICE 339
#define K_SQLSTATE 340
#define K_STRICT 341
#define K_THEN 342
#define K_TO 343
#define K_TYPE 344
#define K_USE_COLUMN 345
#define K_USE_VARIABLE 346
#define K_USING 347
#define K_VARIABLE_CONFLICT 348
#define K_WARNING 349
#define K_WHEN 350
#define K_WHILE 351




#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 115 "gram.y"
typedef union YYSTYPE {
		core_YYSTYPE			core_yystype;
		/* these fields must match core_YYSTYPE: */
		int						ival;
		char					*str;
		const char				*keyword;

		PLword					word;
		PLcword					cword;
		PLwdatum				wdatum;
		bool					boolean;
		Oid						oid;
		struct
		{
			char *name;
			int  lineno;
		}						varname;
		struct
		{
			char *name;
			int  lineno;
			PLpgSQL_datum   *scalar;
			PLpgSQL_rec     *rec;
			PLpgSQL_row     *row;
		}						forvariable;
		struct
		{
			char *label;
			int  n_initvars;
			int  *initvarnos;
		}						declhdr;
		struct
		{
			List *stmts;
			char *end_label;
			int   end_label_location;
		}						loop_body;
		List					*list;
		PLpgSQL_type			*dtype;
		PLpgSQL_datum			*datum;
		PLpgSQL_var				*var;
		PLpgSQL_expr			*expr;
		PLpgSQL_stmt			*stmt;
		PLpgSQL_condition		*condition;
		PLpgSQL_exception		*exception;
		PLpgSQL_exception_block	*exception_block;
		PLpgSQL_nsitem			*nsitem;
		PLpgSQL_diag_item		*diagitem;
		PLpgSQL_stmt_fetch		*fetch;
		PLpgSQL_case_when		*casewhen;
} YYSTYPE;
/* Line 1204 of yacc.c.  */
#line 280 "pl_gram.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif

extern YYSTYPE plpgsql_yylval;

#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
typedef struct YYLTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
} YYLTYPE;
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif

extern YYLTYPE plpgsql_yylloc;


