1 /* A Bison parser, made by GNU Bison 3.3.2.  */
2 
3 /* Bison interface for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
6    Inc.
7 
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation, either version 3 of the License, or
11    (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20 
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30 
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33 
34 /* Undocumented macros, especially those whose name start with YY_,
35    are private implementation details.  Do not rely on them.  */
36 
37 #ifndef YY_PLPGSQL_YY_PL_GRAM_H_INCLUDED
38 # define YY_PLPGSQL_YY_PL_GRAM_H_INCLUDED
39 /* Debug traces.  */
40 #ifndef YYDEBUG
41 # define YYDEBUG 0
42 #endif
43 #if YYDEBUG
44 extern int plpgsql_yydebug;
45 #endif
46 
47 /* Token type.  */
48 #ifndef YYTOKENTYPE
49 # define YYTOKENTYPE
50   enum yytokentype
51   {
52     IDENT = 258,
53     FCONST = 259,
54     SCONST = 260,
55     BCONST = 261,
56     XCONST = 262,
57     Op = 263,
58     ICONST = 264,
59     PARAM = 265,
60     TYPECAST = 266,
61     DOT_DOT = 267,
62     COLON_EQUALS = 268,
63     EQUALS_GREATER = 269,
64     LESS_EQUALS = 270,
65     GREATER_EQUALS = 271,
66     NOT_EQUALS = 272,
67     T_WORD = 273,
68     T_CWORD = 274,
69     T_DATUM = 275,
70     LESS_LESS = 276,
71     GREATER_GREATER = 277,
72     K_ABSOLUTE = 278,
73     K_ALIAS = 279,
74     K_ALL = 280,
75     K_ARRAY = 281,
76     K_ASSERT = 282,
77     K_BACKWARD = 283,
78     K_BEGIN = 284,
79     K_BY = 285,
80     K_CALL = 286,
81     K_CASE = 287,
82     K_CLOSE = 288,
83     K_COLLATE = 289,
84     K_COLUMN = 290,
85     K_COLUMN_NAME = 291,
86     K_COMMIT = 292,
87     K_CONSTANT = 293,
88     K_CONSTRAINT = 294,
89     K_CONSTRAINT_NAME = 295,
90     K_CONTINUE = 296,
91     K_CURRENT = 297,
92     K_CURSOR = 298,
93     K_DATATYPE = 299,
94     K_DEBUG = 300,
95     K_DECLARE = 301,
96     K_DEFAULT = 302,
97     K_DETAIL = 303,
98     K_DIAGNOSTICS = 304,
99     K_DO = 305,
100     K_DUMP = 306,
101     K_ELSE = 307,
102     K_ELSIF = 308,
103     K_END = 309,
104     K_ERRCODE = 310,
105     K_ERROR = 311,
106     K_EXCEPTION = 312,
107     K_EXECUTE = 313,
108     K_EXIT = 314,
109     K_FETCH = 315,
110     K_FIRST = 316,
111     K_FOR = 317,
112     K_FOREACH = 318,
113     K_FORWARD = 319,
114     K_FROM = 320,
115     K_GET = 321,
116     K_HINT = 322,
117     K_IF = 323,
118     K_IMPORT = 324,
119     K_IN = 325,
120     K_INFO = 326,
121     K_INSERT = 327,
122     K_INTO = 328,
123     K_IS = 329,
124     K_LAST = 330,
125     K_LOG = 331,
126     K_LOOP = 332,
127     K_MESSAGE = 333,
128     K_MESSAGE_TEXT = 334,
129     K_MOVE = 335,
130     K_NEXT = 336,
131     K_NO = 337,
132     K_NOT = 338,
133     K_NOTICE = 339,
134     K_NULL = 340,
135     K_OPEN = 341,
136     K_OPTION = 342,
137     K_OR = 343,
138     K_PERFORM = 344,
139     K_PG_CONTEXT = 345,
140     K_PG_DATATYPE_NAME = 346,
141     K_PG_EXCEPTION_CONTEXT = 347,
142     K_PG_EXCEPTION_DETAIL = 348,
143     K_PG_EXCEPTION_HINT = 349,
144     K_PRINT_STRICT_PARAMS = 350,
145     K_PRIOR = 351,
146     K_QUERY = 352,
147     K_RAISE = 353,
148     K_RELATIVE = 354,
149     K_RESET = 355,
150     K_RESULT_OID = 356,
151     K_RETURN = 357,
152     K_RETURNED_SQLSTATE = 358,
153     K_REVERSE = 359,
154     K_ROLLBACK = 360,
155     K_ROW_COUNT = 361,
156     K_ROWTYPE = 362,
157     K_SCHEMA = 363,
158     K_SCHEMA_NAME = 364,
159     K_SCROLL = 365,
160     K_SET = 366,
161     K_SLICE = 367,
162     K_SQLSTATE = 368,
163     K_STACKED = 369,
164     K_STRICT = 370,
165     K_TABLE = 371,
166     K_TABLE_NAME = 372,
167     K_THEN = 373,
168     K_TO = 374,
169     K_TYPE = 375,
170     K_USE_COLUMN = 376,
171     K_USE_VARIABLE = 377,
172     K_USING = 378,
173     K_VARIABLE_CONFLICT = 379,
174     K_WARNING = 380,
175     K_WHEN = 381,
176     K_WHILE = 382
177   };
178 #endif
179 
180 /* Value type.  */
181 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
182 
183 union YYSTYPE
184 {
185 #line 120 "pl_gram.y" /* yacc.c:1921  */
186 
187 		core_YYSTYPE			core_yystype;
188 		/* these fields must match core_YYSTYPE: */
189 		int						ival;
190 		char					*str;
191 		const char				*keyword;
192 
193 		PLword					word;
194 		PLcword					cword;
195 		PLwdatum				wdatum;
196 		bool					boolean;
197 		Oid						oid;
198 		struct
199 		{
200 			char *name;
201 			int  lineno;
202 		}						varname;
203 		struct
204 		{
205 			char *name;
206 			int  lineno;
207 			PLpgSQL_datum   *scalar;
208 			PLpgSQL_datum   *row;
209 		}						forvariable;
210 		struct
211 		{
212 			char *label;
213 			int  n_initvars;
214 			int  *initvarnos;
215 		}						declhdr;
216 		struct
217 		{
218 			List *stmts;
219 			char *end_label;
220 			int   end_label_location;
221 		}						loop_body;
222 		List					*list;
223 		PLpgSQL_type			*dtype;
224 		PLpgSQL_datum			*datum;
225 		PLpgSQL_var				*var;
226 		PLpgSQL_expr			*expr;
227 		PLpgSQL_stmt			*stmt;
228 		PLpgSQL_condition		*condition;
229 		PLpgSQL_exception		*exception;
230 		PLpgSQL_exception_block	*exception_block;
231 		PLpgSQL_nsitem			*nsitem;
232 		PLpgSQL_diag_item		*diagitem;
233 		PLpgSQL_stmt_fetch		*fetch;
234 		PLpgSQL_case_when		*casewhen;
235 
236 #line 237 "pl_gram.h" /* yacc.c:1921  */
237 };
238 
239 typedef union YYSTYPE YYSTYPE;
240 # define YYSTYPE_IS_TRIVIAL 1
241 # define YYSTYPE_IS_DECLARED 1
242 #endif
243 
244 /* Location type.  */
245 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
246 typedef struct YYLTYPE YYLTYPE;
247 struct YYLTYPE
248 {
249   int first_line;
250   int first_column;
251   int last_line;
252   int last_column;
253 };
254 # define YYLTYPE_IS_DECLARED 1
255 # define YYLTYPE_IS_TRIVIAL 1
256 #endif
257 
258 
259 extern YYSTYPE plpgsql_yylval;
260 extern YYLTYPE plpgsql_yylloc;
261 int plpgsql_yyparse (void);
262 
263 #endif /* !YY_PLPGSQL_YY_PL_GRAM_H_INCLUDED  */
264