1/* A Bison parser, made by GNU Bison 2.7. */
2
3/* Skeleton implementation for Bison GLR parsers in C
4
5 Copyright (C) 2002-2012 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33/* C GLR parser skeleton written by Paul Hilfinger. */
34
35/* Identify Bison output. */
36#define YYBISON 1
37
38/* Bison version. */
39#define YYBISON_VERSION "2.7"
40
41/* Skeleton name. */
42#define YYSKELETON_NAME "glr.c"
43
44/* Pure parsers. */
45#define YYPURE 1
46
47
48
49
50
51
52/* Copy the first part of user declarations. */
53
54
55#include "BsParserFX.h"
56#include "BsLexerFX.h"
57#define inline
58
59void yyerror(YYLTYPE *locp, ParseState* parse_state, yyscan_t scanner, const char *msg);
60
61
62
63# ifndef YY_NULL
64# if defined __cplusplus && 201103L <= __cplusplus
65# define YY_NULL nullptr
66# else
67# define YY_NULL 0
68# endif
69# endif
70
71#include "BsParserFX.h"
72
73/* Enabling verbose error messages. */
74#ifdef YYERROR_VERBOSE
75# undef YYERROR_VERBOSE
76# define YYERROR_VERBOSE 1
77#else
78# define YYERROR_VERBOSE 0
79#endif
80
81/* Default (constant) value used for initialization for null
82 right-hand sides. Unlike the standard yacc.c template, here we set
83 the default value of $$ to a zeroed-out value. Since the default
84 value is undefined, this behavior is technically correct. */
85static YYSTYPE yyval_default;
86static YYLTYPE yyloc_default
87# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
88 = { 1, 1, 1, 1 }
89# endif
90;
91
92/* Copy the second part of user declarations. */
93
94
95
96#include <stdio.h>
97#include <stdlib.h>
98#include <string.h>
99
100#ifndef YY_
101# if defined YYENABLE_NLS && YYENABLE_NLS
102# if ENABLE_NLS
103# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
104# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
105# endif
106# endif
107# ifndef YY_
108# define YY_(Msgid) Msgid
109# endif
110#endif
111
112/* Suppress unused-variable warnings by "using" E. */
113#if ! defined lint || defined __GNUC__
114# define YYUSE(E) ((void) (E))
115#else
116# define YYUSE(E) /* empty */
117#endif
118
119/* Identity function, used to suppress warnings about constant conditions. */
120#ifndef lint
121# define YYID(N) (N)
122#else
123#if (defined __STDC__ || defined __C99__FUNC__ \
124 || defined __cplusplus || defined _MSC_VER)
125static int
126YYID (int i)
127#else
128static int
129YYID (i)
130 int i;
131#endif
132{
133 return i;
134}
135#endif
136
137#ifndef YYFREE
138# define YYFREE free
139#endif
140#ifndef YYMALLOC
141# define YYMALLOC malloc
142#endif
143#ifndef YYREALLOC
144# define YYREALLOC realloc
145#endif
146
147#define YYSIZEMAX ((size_t) -1)
148
149#ifdef __cplusplus
150 typedef bool yybool;
151#else
152 typedef unsigned char yybool;
153#endif
154#define yytrue 1
155#define yyfalse 0
156
157#ifndef YYSETJMP
158# include <setjmp.h>
159# define YYJMP_BUF jmp_buf
160# define YYSETJMP(Env) setjmp (Env)
161/* Pacify clang. */
162# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
163#endif
164
165/*-----------------.
166| GCC extensions. |
167`-----------------*/
168
169#ifndef __attribute__
170/* This feature is available in gcc versions 2.5 and later. */
171# if (! defined __GNUC__ || __GNUC__ < 2 \
172 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
173# define __attribute__(Spec) /* empty */
174# endif
175#endif
176
177#ifndef YYASSERT
178# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
179#endif
180
181/* YYFINAL -- State number of the termination state. */
182#define YYFINAL 16
183/* YYLAST -- Last index in YYTABLE. */
184#define YYLAST 371
185
186/* YYNTOKENS -- Number of terminals. */
187#define YYNTOKENS 72
188/* YYNNTS -- Number of nonterminals. */
189#define YYNNTS 68
190/* YYNRULES -- Number of rules. */
191#define YYNRULES 136
192/* YYNRULES -- Number of states. */
193#define YYNSTATES 347
194/* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */
195#define YYMAXRHS 8
196/* YYMAXLEFT -- Maximum number of symbols to the left of a handle
197 accessed by $0, $-1, etc., in any rule. */
198#define YYMAXLEFT 0
199
200/* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */
201#define YYUNDEFTOK 2
202#define YYMAXUTOK 317
203
204#define YYTRANSLATE(YYX) \
205 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
206
207/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
208static const unsigned char yytranslate[] =
209{
210 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
211 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
212 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
213 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
214 70, 71, 2, 2, 67, 2, 2, 2, 2, 2,
215 2, 2, 2, 2, 2, 2, 2, 2, 2, 65,
216 2, 66, 2, 2, 2, 2, 2, 2, 2, 2,
217 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
218 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
219 2, 69, 2, 68, 2, 2, 2, 2, 2, 2,
220 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
221 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
222 2, 2, 2, 63, 2, 64, 2, 2, 2, 2,
223 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
224 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
225 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
226 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
227 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
228 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
229 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
231 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
234 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
235 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
236 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
237 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
238 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
239 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
240 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
241 55, 56, 57, 58, 59, 60, 61, 62
242};
243
244#if YYDEBUG
245/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
246 YYRHS. */
247static const unsigned short int yyprhs[] =
248{
249 0, 0, 3, 4, 7, 9, 11, 13, 19, 21,
250 22, 25, 30, 35, 40, 45, 50, 56, 59, 62,
251 63, 66, 68, 70, 72, 74, 79, 83, 85, 87,
252 93, 96, 97, 99, 103, 112, 115, 121, 123, 124,
253 127, 129, 131, 133, 135, 137, 139, 145, 147, 148,
254 151, 157, 159, 162, 165, 166, 168, 172, 174, 177,
255 179, 181, 183, 189, 191, 192, 195, 200, 205, 210,
256 215, 220, 225, 230, 235, 241, 243, 244, 247, 252,
257 257, 262, 268, 270, 271, 274, 279, 284, 289, 295,
258 301, 307, 313, 318, 324, 326, 327, 330, 335, 340,
259 342, 351, 353, 356, 359, 367, 368, 371, 376, 381,
260 386, 391, 397, 399, 400, 403, 408, 413, 419, 425,
261 431, 437, 442, 445, 448, 449, 452, 458, 463, 468,
262 473, 477, 479, 480, 482, 486, 491
263};
264
265/* YYRHS -- A `-1'-separated list of the rules' RHS. */
266static const short int yyrhs[] =
267{
268 73, 0, -1, -1, 74, 73, -1, 75, -1, 79,
269 -1, 87, -1, 76, 63, 77, 64, 65, -1, 14,
270 -1, -1, 78, 77, -1, 18, 66, 5, 65, -1,
271 19, 66, 9, 65, -1, 20, 66, 3, 65, -1,
272 21, 66, 5, 65, -1, 22, 66, 5, 65, -1,
273 80, 63, 81, 64, 65, -1, 15, 7, -1, 17,
274 7, -1, -1, 82, 81, -1, 83, -1, 89, -1,
275 93, -1, 120, -1, 23, 66, 7, 65, -1, 17,
276 7, 65, -1, 84, -1, 94, -1, 85, 63, 86,
277 64, 65, -1, 25, 66, -1, -1, 6, -1, 6,
278 67, 86, -1, 88, 63, 55, 66, 3, 65, 64,
279 65, -1, 16, 7, -1, 90, 63, 91, 64, 65,
280 -1, 24, -1, -1, 92, 91, -1, 93, -1, 120,
281 -1, 104, -1, 108, -1, 112, -1, 116, -1, 95,
282 63, 96, 64, 65, -1, 26, -1, -1, 97, 96,
283 -1, 98, 63, 100, 64, 65, -1, 99, -1, 136,
284 99, -1, 7, 66, -1, -1, 101, -1, 101, 67,
285 100, -1, 102, -1, 136, 102, -1, 103, -1, 5,
286 -1, 3, -1, 105, 63, 106, 64, 65, -1, 29,
287 -1, -1, 107, 106, -1, 33, 66, 8, 65, -1,
288 34, 66, 9, 65, -1, 38, 66, 5, 65, -1,
289 39, 66, 5, 65, -1, 40, 66, 5, 65, -1,
290 35, 66, 4, 65, -1, 36, 66, 4, 65, -1,
291 37, 66, 5, 65, -1, 109, 63, 110, 64, 65,
292 -1, 30, -1, -1, 111, 110, -1, 41, 66, 5,
293 65, -1, 42, 66, 5, 65, -1, 43, 66, 10,
294 65, -1, 113, 63, 114, 64, 65, -1, 31, -1,
295 -1, 115, 114, -1, 45, 66, 5, 65, -1, 46,
296 66, 3, 65, -1, 47, 66, 3, 65, -1, 122,
297 63, 125, 64, 65, -1, 123, 63, 125, 64, 65,
298 -1, 122, 63, 124, 64, 65, -1, 123, 63, 124,
299 64, 65, -1, 44, 66, 3, 65, -1, 117, 63,
300 118, 64, 65, -1, 28, -1, -1, 119, 118, -1,
301 52, 66, 5, 65, -1, 53, 66, 5, 65, -1,
302 127, -1, 121, 63, 55, 66, 3, 65, 64, 65,
303 -1, 27, -1, 48, 66, -1, 49, 66, -1, 11,
304 67, 11, 67, 11, 67, 10, -1, -1, 126, 125,
305 -1, 50, 66, 11, 65, -1, 51, 66, 11, 65,
306 -1, 24, 66, 11, 65, -1, 43, 66, 10, 65,
307 -1, 128, 63, 129, 64, 65, -1, 54, -1, -1,
308 130, 129, -1, 55, 66, 3, 65, -1, 45, 66,
309 5, 65, -1, 131, 63, 133, 64, 65, -1, 132,
310 63, 133, 64, 65, -1, 131, 63, 134, 64, 65,
311 -1, 132, 63, 134, 64, 65, -1, 47, 66, 13,
312 65, -1, 56, 66, -1, 57, 66, -1, -1, 135,
313 133, -1, 11, 67, 11, 67, 12, -1, 58, 66,
314 11, 65, -1, 59, 66, 11, 65, -1, 60, 66,
315 12, 65, -1, 137, 138, 68, -1, 69, -1, -1,
316 139, -1, 139, 67, 138, -1, 61, 70, 6, 71,
317 -1, 62, -1
318};
319
320/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
321static const unsigned short int yyrline[] =
322{
323 0, 188, 188, 189, 193, 194, 195, 200, 204, 211,
324 213, 217, 218, 219, 220, 221, 227, 231, 239, 249,
325 251, 255, 256, 257, 258, 262, 263, 264, 265, 270,
326 274, 281, 283, 288, 298, 312, 325, 329, 336, 338,
327 342, 343, 347, 348, 349, 350, 356, 360, 367, 369,
328 373, 377, 378, 388, 398, 400, 405, 413, 418, 429,
329 439, 440, 445, 449, 456, 458, 462, 463, 464, 465,
330 466, 467, 468, 469, 474, 478, 485, 487, 491, 492,
331 493, 498, 502, 509, 511, 515, 516, 517, 518, 519,
332 520, 521, 522, 527, 531, 538, 540, 544, 545, 546,
333 552, 566, 576, 584, 592, 606, 608, 612, 613, 614,
334 615, 620, 624, 631, 633, 637, 638, 639, 640, 641,
335 642, 643, 648, 656, 663, 665, 669, 682, 683, 684,
336 689, 693, 700, 702, 703, 707, 708
337};
338#endif
339
340#if YYDEBUG || YYERROR_VERBOSE || 0
341/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
342 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
343static const char *const yytname[] =
344{
345 "$end", "error", "$undefined", "TOKEN_INTEGER", "TOKEN_FLOAT",
346 "TOKEN_BOOLEAN", "TOKEN_STRING", "TOKEN_IDENTIFIER",
347 "TOKEN_FILLMODEVALUE", "TOKEN_CULLANDQUEUEVALUE", "TOKEN_COMPFUNCVALUE",
348 "TOKEN_OPVALUE", "TOKEN_BLENDOPVALUE", "TOKEN_COLORMASK",
349 "TOKEN_OPTIONS", "TOKEN_SHADER", "TOKEN_SUBSHADER", "TOKEN_MIXIN",
350 "TOKEN_SEPARABLE", "TOKEN_SORT", "TOKEN_PRIORITY", "TOKEN_TRANSPARENT",
351 "TOKEN_FORWARD", "TOKEN_FEATURESET", "TOKEN_PASS", "TOKEN_TAGS",
352 "TOKEN_VARIATIONS", "TOKEN_CODE", "TOKEN_BLEND", "TOKEN_RASTER",
353 "TOKEN_DEPTH", "TOKEN_STENCIL", "TOKEN_VARIATION", "TOKEN_FILLMODE",
354 "TOKEN_CULLMODE", "TOKEN_DEPTHBIAS", "TOKEN_SDEPTHBIAS",
355 "TOKEN_DEPTHCLIP", "TOKEN_SCISSOR", "TOKEN_MULTISAMPLE", "TOKEN_AALINE",
356 "TOKEN_DEPTHREAD", "TOKEN_DEPTHWRITE", "TOKEN_COMPAREFUNC",
357 "TOKEN_STENCILREF", "TOKEN_ENABLED", "TOKEN_READMASK", "TOKEN_WRITEMASK",
358 "TOKEN_STENCILOPFRONT", "TOKEN_STENCILOPBACK", "TOKEN_FAIL",
359 "TOKEN_ZFAIL", "TOKEN_ALPHATOCOVERAGE", "TOKEN_INDEPENDANTBLEND",
360 "TOKEN_TARGET", "TOKEN_INDEX", "TOKEN_COLOR", "TOKEN_ALPHA",
361 "TOKEN_SOURCE", "TOKEN_DEST", "TOKEN_OP", "TOKEN_NAME", "TOKEN_SHOW",
362 "'{'", "'}'", "';'", "'='", "','", "']'", "'['", "'('", "')'", "$accept",
363 "root", "root_statement", "options", "options_header", "options_body",
364 "options_option", "shader", "shader_header", "shader_body",
365 "shader_statement", "shader_option", "tags", "tags_header", "tags_body",
366 "subshader", "subshader_header", "pass", "pass_header", "pass_body",
367 "pass_statement", "pass_option", "variations", "variations_header",
368 "variations_body", "variation", "variation_header_with_attr",
369 "variation_header", "variation_body", "variation_option_with_attr",
370 "variation_option", "variation_option_value", "raster", "raster_header",
371 "raster_body", "raster_option", "depth", "depth_header", "depth_body",
372 "depth_option", "stencil", "stencil_header", "stencil_body",
373 "stencil_option", "blend", "blend_header", "blend_body", "blend_option",
374 "code", "code_header", "stencil_op_front_header",
375 "stencil_op_back_header", "stencil_op_body_init", "stencil_op_body",
376 "stencil_op_option", "target", "target_header", "target_body",
377 "target_option", "blend_color_header", "blend_alpha_header",
378 "blenddef_body", "blenddef_body_init", "blenddef_option", "attributes",
379 "attributes_header", "attributes_body", "attribute", YY_NULL
380};
381#endif
382
383/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
384static const unsigned char yyr1[] =
385{
386 0, 72, 73, 73, 74, 74, 74, 75, 76, 77,
387 77, 78, 78, 78, 78, 78, 79, 80, 80, 81,
388 81, 82, 82, 82, 82, 83, 83, 83, 83, 84,
389 85, 86, 86, 86, 87, 88, 89, 90, 91, 91,
390 92, 92, 93, 93, 93, 93, 94, 95, 96, 96,
391 97, 98, 98, 99, 100, 100, 100, 101, 101, 102,
392 103, 103, 104, 105, 106, 106, 107, 107, 107, 107,
393 107, 107, 107, 107, 108, 109, 110, 110, 111, 111,
394 111, 112, 113, 114, 114, 115, 115, 115, 115, 115,
395 115, 115, 115, 116, 117, 118, 118, 119, 119, 119,
396 120, 121, 122, 123, 124, 125, 125, 126, 126, 126,
397 126, 127, 128, 129, 129, 130, 130, 130, 130, 130,
398 130, 130, 131, 132, 133, 133, 134, 135, 135, 135,
399 136, 137, 138, 138, 138, 139, 139
400};
401
402/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
403static const unsigned char yyr2[] =
404{
405 0, 2, 0, 2, 1, 1, 1, 5, 1, 0,
406 2, 4, 4, 4, 4, 4, 5, 2, 2, 0,
407 2, 1, 1, 1, 1, 4, 3, 1, 1, 5,
408 2, 0, 1, 3, 8, 2, 5, 1, 0, 2,
409 1, 1, 1, 1, 1, 1, 5, 1, 0, 2,
410 5, 1, 2, 2, 0, 1, 3, 1, 2, 1,
411 1, 1, 5, 1, 0, 2, 4, 4, 4, 4,
412 4, 4, 4, 4, 5, 1, 0, 2, 4, 4,
413 4, 5, 1, 0, 2, 4, 4, 4, 5, 5,
414 5, 5, 4, 5, 1, 0, 2, 4, 4, 1,
415 8, 1, 2, 2, 7, 0, 2, 4, 4, 4,
416 4, 5, 1, 0, 2, 4, 4, 5, 5, 5,
417 5, 4, 2, 2, 0, 2, 5, 4, 4, 4,
418 3, 1, 0, 1, 3, 4, 1
419};
420
421/* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */
422static const unsigned char yydprec[] =
423{
424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
427 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
429 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
430 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
432 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
434 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
436 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
437 0, 0, 0, 0, 0, 0, 0
438};
439
440/* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */
441static const unsigned char yymerger[] =
442{
443 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
444 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
448 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
449 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
450 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
454 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
455 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
456 0, 0, 0, 0, 0, 0, 0
457};
458
459/* YYDEFACT[S] -- default reduction number in state S. Performed when
460 YYTABLE doesn't specify something else to do. Zero means the default
461 is an error. */
462static const unsigned char yydefact[] =
463{
464 2, 8, 0, 0, 0, 0, 2, 4, 0, 5,
465 0, 6, 0, 17, 35, 18, 1, 3, 9, 19,
466 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
467 37, 0, 47, 101, 94, 63, 75, 82, 0, 19,
468 21, 27, 0, 22, 0, 23, 28, 0, 42, 0,
469 43, 0, 44, 0, 45, 0, 24, 0, 0, 0,
470 0, 0, 0, 0, 0, 10, 0, 0, 30, 0,
471 20, 31, 38, 48, 64, 76, 83, 95, 0, 0,
472 0, 0, 0, 0, 0, 7, 26, 0, 16, 32,
473 0, 0, 38, 40, 41, 0, 131, 0, 48, 0,
474 51, 0, 132, 0, 0, 0, 0, 0, 0, 0,
475 0, 0, 64, 0, 0, 0, 0, 76, 0, 0,
476 0, 0, 0, 0, 0, 83, 0, 0, 0, 0,
477 112, 0, 95, 99, 0, 0, 0, 11, 12, 13,
478 14, 15, 25, 31, 0, 0, 39, 53, 0, 49,
479 54, 52, 0, 136, 0, 133, 0, 0, 0, 0,
480 0, 0, 0, 0, 0, 65, 0, 0, 0, 0,
481 77, 0, 0, 0, 0, 102, 103, 0, 84, 105,
482 105, 0, 0, 0, 96, 113, 0, 0, 33, 29,
483 36, 46, 61, 60, 0, 55, 57, 59, 0, 0,
484 130, 132, 0, 0, 0, 0, 0, 0, 0, 0,
485 62, 0, 0, 0, 74, 0, 0, 0, 0, 81,
486 0, 0, 0, 0, 0, 0, 0, 105, 0, 0,
487 0, 0, 93, 0, 0, 0, 0, 0, 0, 113,
488 0, 0, 0, 0, 0, 54, 58, 0, 134, 66,
489 67, 71, 72, 73, 68, 69, 70, 78, 79, 80,
490 92, 85, 86, 87, 0, 0, 0, 0, 0, 0,
491 0, 106, 0, 0, 97, 98, 0, 0, 0, 122,
492 123, 0, 114, 124, 124, 0, 34, 50, 56, 135,
493 0, 0, 0, 0, 0, 90, 88, 91, 89, 0,
494 0, 0, 111, 0, 0, 0, 0, 0, 0, 124,
495 0, 0, 0, 0, 109, 110, 107, 108, 116, 121,
496 115, 0, 0, 0, 0, 0, 0, 125, 0, 0,
497 100, 0, 0, 0, 0, 0, 117, 119, 118, 120,
498 0, 0, 127, 128, 129, 104, 126
499};
500
501/* YYPDEFGOTO[NTERM-NUM]. */
502static const short int yydefgoto[] =
503{
504 -1, 5, 6, 7, 8, 26, 27, 9, 10, 38,
505 39, 40, 41, 42, 90, 11, 12, 43, 44, 91,
506 92, 45, 46, 47, 97, 98, 99, 100, 194, 195,
507 196, 197, 48, 49, 111, 112, 50, 51, 116, 117,
508 52, 53, 124, 125, 54, 55, 131, 132, 56, 57,
509 126, 127, 225, 226, 227, 133, 134, 238, 239, 240,
510 241, 307, 308, 309, 101, 102, 154, 155
511};
512
513/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
514 STATE-NUM. */
515#define YYPACT_NINF -276
516static const short int yypact[] =
517{
518 0, -276, 22, 24, 28, 12, 0, -276, -36, -276,
519 -27, -276, -20, -276, -276, -276, -276, -276, 20, 32,
520 10, -16, 25, 30, 31, 37, 2, 20, 69, 38,
521 -276, 39, -276, -276, -276, -276, -276, -276, 42, 32,
522 -276, -276, 44, -276, 45, -276, -276, 46, -276, 47,
523 -276, 48, -276, 49, -276, 50, -276, 51, 52, 93,
524 90, 97, 96, 110, 54, -276, 55, 95, -276, 57,
525 -276, 111, 56, -5, 35, 5, 33, 36, 61, 118,
526 58, 59, 60, 62, 63, -276, -276, 64, -276, 65,
527 66, 67, 56, -276, -276, 68, -276, 71, -5, 70,
528 -276, 119, -42, 72, 73, 74, 75, 76, 77, 78,
529 79, 82, 35, 81, 83, 84, 87, 5, 86, 88,
530 89, 91, 92, 94, 98, 33, 85, 100, 99, 101,
531 -276, 102, 36, -276, 105, 103, 106, -276, -276, -276,
532 -276, -276, -276, 111, 107, 108, -276, -276, 109, -276,
533 -2, -276, 112, -276, 113, 116, 128, 144, 133, 152,
534 154, 156, 159, 165, 114, -276, 170, 171, 167, 115,
535 -276, 175, 179, 182, 183, -276, -276, 122, -276, -6,
536 -6, 184, 185, 123, -276, -34, 188, 129, -276, -276,
537 -276, -276, -276, -276, 130, 125, -276, -276, 21, 189,
538 -276, -42, 131, 132, 134, 135, 136, 137, 138, 139,
539 -276, 140, 141, 142, -276, 143, 145, 146, 147, -276,
540 148, 150, 151, 153, 155, 149, 158, -18, 160, 161,
541 162, 163, -276, 157, 164, 166, 168, 169, 172, -34,
542 174, 176, 173, 177, 178, -2, -276, 127, -276, -276,
543 -276, -276, -276, -276, -276, -276, -276, -276, -276, -276,
544 -276, -276, -276, -276, 198, 203, 208, 209, 215, 180,
545 181, -276, 186, 187, -276, -276, 224, 218, 230, -276,
546 -276, 190, -276, -7, -7, 192, -276, -276, -276, -276,
547 191, 194, 195, 196, 197, -276, -276, -276, -276, 199,
548 200, 201, -276, 202, 204, 205, 206, 193, 210, 34,
549 211, 212, 213, 229, -276, -276, -276, -276, -276, -276,
550 -276, 233, 236, 237, 238, 214, 216, -276, 217, 219,
551 -276, 220, 221, 225, 226, 227, -276, -276, -276, -276,
552 231, 241, -276, -276, -276, -276, -276
553};
554
555/* YYPGOTO[NTERM-NUM]. */
556static const short int yypgoto[] =
557{
558 -276, 243, -276, -276, -276, 240, -276, -276, -276, 234,
559 -276, -276, -276, -276, 120, -276, -276, -276, -276, 207,
560 -276, -64, -276, -276, 222, -276, -276, 223, 9, -276,
561 104, -276, -276, -276, 228, -276, -276, -276, 232, -276,
562 -276, -276, 235, -276, -276, -276, 239, -276, -62, -276,
563 -276, -276, 117, -173, -276, -276, -276, 29, -276, -276,
564 -276, -275, -4, -276, -150, -276, 121, -276
565};
566
567/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
568 positive, shift that token. If negative, reduce the rule which
569 number is the opposite. If YYTABLE_NINF, syntax error. */
570#define YYTABLE_NINF -1
571static const unsigned short int yytable[] =
572{
573 198, 192, 95, 193, 303, 220, 221, 229, 93, 310,
574 94, 233, 16, 234, 1, 2, 3, 4, 221, 152,
575 153, 235, 236, 237, 192, 222, 193, 18, 93, 13,
576 94, 14, 223, 224, 327, 15, 19, 222, 21, 22,
577 23, 24, 25, 20, 223, 224, 113, 114, 115, 28,
578 59, 304, 305, 306, 271, 29, 30, 31, 32, 33,
579 34, 35, 36, 37, 96, 58, 64, 96, 103, 104,
580 105, 106, 107, 108, 109, 110, 66, 118, 119, 120,
581 121, 122, 123, 33, 34, 35, 36, 37, 128, 129,
582 130, 60, 304, 305, 306, 198, 61, 62, 80, 81,
583 82, 83, 87, 63, 67, 68, 69, 71, 72, 73,
584 74, 75, 76, 77, 78, 84, 135, 89, 79, 85,
585 86, 136, 88, 137, 138, 139, 95, 140, 141, 142,
586 144, 145, 143, 150, 147, 148, 202, 204, 156, 157,
587 158, 159, 160, 161, 162, 163, 164, 166, 179, 167,
588 168, 169, 171, 203, 172, 173, 205, 174, 175, 206,
589 176, 207, 177, 180, 208, 181, 183, 182, 185, 186,
590 209, 187, 189, 190, 191, 211, 212, 213, 215, 210,
591 214, 200, 199, 201, 216, 217, 218, 219, 232, 230,
592 231, 242, 245, 243, 244, 247, 249, 250, 289, 251,
593 252, 253, 254, 255, 256, 257, 258, 259, 260, 290,
594 261, 262, 263, 269, 291, 264, 265, 266, 292, 267,
595 293, 268, 270, 276, 272, 273, 294, 274, 275, 299,
596 277, 300, 278, 301, 279, 280, 281, 283, 285, 284,
597 331, 345, 286, 287, 332, 295, 296, 333, 334, 17,
598 335, 297, 298, 346, 288, 302, 312, 325, 313, 314,
599 315, 316, 317, 188, 318, 319, 320, 65, 282, 321,
600 322, 323, 324, 70, 326, 328, 329, 0, 330, 336,
601 311, 337, 338, 0, 339, 0, 0, 340, 341, 0,
602 342, 343, 344, 0, 0, 0, 0, 228, 0, 146,
603 0, 0, 246, 0, 0, 0, 0, 0, 0, 0,
604 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
605 149, 0, 248, 0, 151, 0, 0, 0, 0, 0,
606 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
607 165, 0, 0, 0, 0, 0, 0, 0, 0, 170,
608 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
609 178, 0, 0, 0, 0, 0, 0, 0, 0, 0,
610 0, 184
611};
612
613/* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of
614 list of conflicting reductions corresponding to action entry for
615 state STATE-NUM in yytable. 0 means no conflicts. The list in
616 yyconfl is terminated by a rule number of 0. */
617static const unsigned char yyconflp[] =
618{
619 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
620 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
621 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
622 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
623 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
624 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
626 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
627 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
628 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
629 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
630 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
635 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
637 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
638 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
640 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
644 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
645 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
646 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
647 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
648 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
651 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
652 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
653 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
654 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
655 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
656 0, 0
657};
658
659/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
660 0, pointed into by YYCONFLP. */
661static const short int yyconfl[] =
662{
663 0
664};
665
666static const short int yycheck[] =
667{
668 150, 3, 7, 5, 11, 11, 24, 180, 72, 284,
669 72, 45, 0, 47, 14, 15, 16, 17, 24, 61,
670 62, 55, 56, 57, 3, 43, 5, 63, 92, 7,
671 92, 7, 50, 51, 309, 7, 63, 43, 18, 19,
672 20, 21, 22, 63, 50, 51, 41, 42, 43, 17,
673 66, 58, 59, 60, 227, 23, 24, 25, 26, 27,
674 28, 29, 30, 31, 69, 55, 64, 69, 33, 34,
675 35, 36, 37, 38, 39, 40, 7, 44, 45, 46,
676 47, 48, 49, 27, 28, 29, 30, 31, 52, 53,
677 54, 66, 58, 59, 60, 245, 66, 66, 5, 9,
678 3, 5, 7, 66, 66, 66, 64, 63, 63, 63,
679 63, 63, 63, 63, 63, 5, 55, 6, 66, 65,
680 65, 3, 65, 65, 65, 65, 7, 65, 65, 65,
681 64, 64, 67, 63, 66, 64, 8, 4, 66, 66,
682 66, 66, 66, 66, 66, 66, 64, 66, 63, 66,
683 66, 64, 66, 9, 66, 66, 4, 66, 66, 5,
684 66, 5, 64, 63, 5, 66, 64, 66, 63, 66,
685 5, 65, 65, 65, 65, 5, 5, 10, 3, 65,
686 65, 68, 70, 67, 5, 3, 3, 65, 65, 5,
687 5, 3, 67, 64, 64, 6, 65, 65, 71, 65,
688 65, 65, 65, 65, 65, 65, 65, 65, 65, 11,
689 65, 65, 65, 64, 11, 67, 66, 66, 10, 66,
690 11, 66, 64, 66, 64, 64, 11, 65, 65, 5,
691 66, 13, 66, 3, 66, 66, 64, 63, 65, 63,
692 11, 10, 65, 65, 11, 65, 65, 11, 11, 6,
693 12, 65, 65, 12, 245, 65, 64, 64, 67, 65,
694 65, 65, 65, 143, 65, 65, 65, 27, 239, 67,
695 66, 66, 66, 39, 64, 64, 64, -1, 65, 65,
696 284, 65, 65, -1, 65, -1, -1, 67, 67, -1,
697 65, 65, 65, -1, -1, -1, -1, 180, -1, 92,
698 -1, -1, 198, -1, -1, -1, -1, -1, -1, -1,
699 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
700 98, -1, 201, -1, 101, -1, -1, -1, -1, -1,
701 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
702 112, -1, -1, -1, -1, -1, -1, -1, -1, 117,
703 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
704 125, -1, -1, -1, -1, -1, -1, -1, -1, -1,
705 -1, 132
706};
707
708/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
709 symbol of state STATE-NUM. */
710static const unsigned char yystos[] =
711{
712 0, 14, 15, 16, 17, 73, 74, 75, 76, 79,
713 80, 87, 88, 7, 7, 7, 0, 73, 63, 63,
714 63, 18, 19, 20, 21, 22, 77, 78, 17, 23,
715 24, 25, 26, 27, 28, 29, 30, 31, 81, 82,
716 83, 84, 85, 89, 90, 93, 94, 95, 104, 105,
717 108, 109, 112, 113, 116, 117, 120, 121, 55, 66,
718 66, 66, 66, 66, 64, 77, 7, 66, 66, 64,
719 81, 63, 63, 63, 63, 63, 63, 63, 63, 66,
720 5, 9, 3, 5, 5, 65, 65, 7, 65, 6,
721 86, 91, 92, 93, 120, 7, 69, 96, 97, 98,
722 99, 136, 137, 33, 34, 35, 36, 37, 38, 39,
723 40, 106, 107, 41, 42, 43, 110, 111, 44, 45,
724 46, 47, 48, 49, 114, 115, 122, 123, 52, 53,
725 54, 118, 119, 127, 128, 55, 3, 65, 65, 65,
726 65, 65, 65, 67, 64, 64, 91, 66, 64, 96,
727 63, 99, 61, 62, 138, 139, 66, 66, 66, 66,
728 66, 66, 66, 66, 64, 106, 66, 66, 66, 64,
729 110, 66, 66, 66, 66, 66, 66, 64, 114, 63,
730 63, 66, 66, 64, 118, 63, 66, 65, 86, 65,
731 65, 65, 3, 5, 100, 101, 102, 103, 136, 70,
732 68, 67, 8, 9, 4, 4, 5, 5, 5, 5,
733 65, 5, 5, 10, 65, 3, 5, 3, 3, 65,
734 11, 24, 43, 50, 51, 124, 125, 126, 124, 125,
735 5, 5, 65, 45, 47, 55, 56, 57, 129, 130,
736 131, 132, 3, 64, 64, 67, 102, 6, 138, 65,
737 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
738 65, 65, 65, 65, 67, 66, 66, 66, 66, 64,
739 64, 125, 64, 64, 65, 65, 66, 66, 66, 66,
740 66, 64, 129, 63, 63, 65, 65, 65, 100, 71,
741 11, 11, 10, 11, 11, 65, 65, 65, 65, 5,
742 13, 3, 65, 11, 58, 59, 60, 133, 134, 135,
743 133, 134, 64, 67, 65, 65, 65, 65, 65, 65,
744 65, 67, 66, 66, 66, 64, 64, 133, 64, 64,
745 65, 11, 11, 11, 11, 12, 65, 65, 65, 65,
746 67, 67, 65, 65, 65, 10, 12
747};
748
749/* Error token number */
750#define YYTERROR 1
751
752
753/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
754 If N is 0, then set CURRENT to the empty location which ends
755 the previous symbol: RHS[0] (always defined). */
756
757#ifndef YYLLOC_DEFAULT
758# define YYLLOC_DEFAULT(Current, Rhs, N) \
759 do \
760 if (YYID (N)) \
761 { \
762 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
763 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
764 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
765 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
766 } \
767 else \
768 { \
769 (Current).first_line = (Current).last_line = \
770 YYRHSLOC (Rhs, 0).last_line; \
771 (Current).first_column = (Current).last_column = \
772 YYRHSLOC (Rhs, 0).last_column; \
773 } \
774 while (YYID (0))
775#endif
776
777# define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
778
779
780/* YY_LOCATION_PRINT -- Print the location on the stream.
781 This macro was not mandated originally: define only if we know
782 we won't break user code: when these are the locations we know. */
783
784#ifndef __attribute__
785/* This feature is available in gcc versions 2.5 and later. */
786# if (! defined __GNUC__ || __GNUC__ < 2 \
787 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
788# define __attribute__(Spec) /* empty */
789# endif
790#endif
791
792#ifndef YY_LOCATION_PRINT
793# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
794
795/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
796
797__attribute__((__unused__))
798#if (defined __STDC__ || defined __C99__FUNC__ \
799 || defined __cplusplus || defined _MSC_VER)
800static unsigned
801yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
802#else
803static unsigned
804yy_location_print_ (yyo, yylocp)
805 FILE *yyo;
806 YYLTYPE const * const yylocp;
807#endif
808{
809 unsigned res = 0;
810 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
811 if (0 <= yylocp->first_line)
812 {
813 res += fprintf (yyo, "%d", yylocp->first_line);
814 if (0 <= yylocp->first_column)
815 res += fprintf (yyo, ".%d", yylocp->first_column);
816 }
817 if (0 <= yylocp->last_line)
818 {
819 if (yylocp->first_line < yylocp->last_line)
820 {
821 res += fprintf (yyo, "-%d", yylocp->last_line);
822 if (0 <= end_col)
823 res += fprintf (yyo, ".%d", end_col);
824 }
825 else if (0 <= end_col && yylocp->first_column < end_col)
826 res += fprintf (yyo, "-%d", end_col);
827 }
828 return res;
829 }
830
831# define YY_LOCATION_PRINT(File, Loc) \
832 yy_location_print_ (File, &(Loc))
833
834# else
835# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
836# endif
837#endif
838
839
840/* YYLEX -- calling `yylex' with the right arguments. */
841#define YYLEX yylex (&yylval, &yylloc, scanner)
842
843
844#undef yynerrs
845#define yynerrs (yystackp->yyerrcnt)
846#undef yychar
847#define yychar (yystackp->yyrawchar)
848#undef yylval
849#define yylval (yystackp->yyval)
850#undef yylloc
851#define yylloc (yystackp->yyloc)
852
853
854static const int YYEOF = 0;
855static const int YYEMPTY = -2;
856
857typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
858
859#define YYCHK(YYE) \
860 do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \
861 while (YYID (0))
862
863#if YYDEBUG
864
865# ifndef YYFPRINTF
866# define YYFPRINTF fprintf
867# endif
868
869# define YYDPRINTF(Args) \
870do { \
871 if (yydebug) \
872 YYFPRINTF Args; \
873} while (YYID (0))
874
875
876/*--------------------------------.
877| Print this symbol on YYOUTPUT. |
878`--------------------------------*/
879
880/*ARGSUSED*/
881static void
882yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, ParseState* parse_state, yyscan_t scanner)
883{
884 FILE *yyo = yyoutput;
885 YYUSE (yyo);
886 if (!yyvaluep)
887 return;
888 YYUSE (yylocationp);
889 YYUSE (parse_state);
890 YYUSE (scanner);
891# ifdef YYPRINT
892 if (yytype < YYNTOKENS)
893 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
894# else
895 YYUSE (yyoutput);
896# endif
897 switch (yytype)
898 {
899 default:
900 break;
901 }
902}
903
904
905/*--------------------------------.
906| Print this symbol on YYOUTPUT. |
907`--------------------------------*/
908
909static void
910yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, ParseState* parse_state, yyscan_t scanner)
911{
912 if (yytype < YYNTOKENS)
913 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
914 else
915 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
916
917 YY_LOCATION_PRINT (yyoutput, *yylocationp);
918 YYFPRINTF (yyoutput, ": ");
919 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parse_state, scanner);
920 YYFPRINTF (yyoutput, ")");
921}
922
923# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
924do { \
925 if (yydebug) \
926 { \
927 YYFPRINTF (stderr, "%s ", Title); \
928 yy_symbol_print (stderr, Type, Value, Location, parse_state, scanner); \
929 YYFPRINTF (stderr, "\n"); \
930 } \
931} while (YYID (0))
932
933/* Nonzero means print parse trace. It is left uninitialized so that
934 multiple parsers can coexist. */
935int yydebug;
936
937#else /* !YYDEBUG */
938
939# define YYDPRINTF(Args)
940# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
941
942#endif /* !YYDEBUG */
943
944/* YYINITDEPTH -- initial size of the parser's stacks. */
945#ifndef YYINITDEPTH
946# define YYINITDEPTH 200
947#endif
948
949/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
950 if the built-in stack extension method is used).
951
952 Do not make this value too large; the results are undefined if
953 SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem)
954 evaluated with infinite-precision integer arithmetic. */
955
956#ifndef YYMAXDEPTH
957# define YYMAXDEPTH 10000
958#endif
959
960/* Minimum number of free items on the stack allowed after an
961 allocation. This is to allow allocation and initialization
962 to be completed by functions that call yyexpandGLRStack before the
963 stack is expanded, thus insuring that all necessary pointers get
964 properly redirected to new data. */
965#define YYHEADROOM 2
966
967#ifndef YYSTACKEXPANDABLE
968# if (! defined __cplusplus \
969 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
970 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))
971# define YYSTACKEXPANDABLE 1
972# else
973# define YYSTACKEXPANDABLE 0
974# endif
975#endif
976
977#if YYSTACKEXPANDABLE
978# define YY_RESERVE_GLRSTACK(Yystack) \
979 do { \
980 if (Yystack->yyspaceLeft < YYHEADROOM) \
981 yyexpandGLRStack (Yystack); \
982 } while (YYID (0))
983#else
984# define YY_RESERVE_GLRSTACK(Yystack) \
985 do { \
986 if (Yystack->yyspaceLeft < YYHEADROOM) \
987 yyMemoryExhausted (Yystack); \
988 } while (YYID (0))
989#endif
990
991
992#if YYERROR_VERBOSE
993
994# ifndef yystpcpy
995# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
996# define yystpcpy stpcpy
997# else
998/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
999 YYDEST. */
1000static char *
1001yystpcpy (char *yydest, const char *yysrc)
1002{
1003 char *yyd = yydest;
1004 const char *yys = yysrc;
1005
1006 while ((*yyd++ = *yys++) != '\0')
1007 continue;
1008
1009 return yyd - 1;
1010}
1011# endif
1012# endif
1013
1014# ifndef yytnamerr
1015/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1016 quotes and backslashes, so that it's suitable for yyerror. The
1017 heuristic is that double-quoting is unnecessary unless the string
1018 contains an apostrophe, a comma, or backslash (other than
1019 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1020 null, do not copy; instead, return the length of what the result
1021 would have been. */
1022static size_t
1023yytnamerr (char *yyres, const char *yystr)
1024{
1025 if (*yystr == '"')
1026 {
1027 size_t yyn = 0;
1028 char const *yyp = yystr;
1029
1030 for (;;)
1031 switch (*++yyp)
1032 {
1033 case '\'':
1034 case ',':
1035 goto do_not_strip_quotes;
1036
1037 case '\\':
1038 if (*++yyp != '\\')
1039 goto do_not_strip_quotes;
1040 /* Fall through. */
1041 default:
1042 if (yyres)
1043 yyres[yyn] = *yyp;
1044 yyn++;
1045 break;
1046
1047 case '"':
1048 if (yyres)
1049 yyres[yyn] = '\0';
1050 return yyn;
1051 }
1052 do_not_strip_quotes: ;
1053 }
1054
1055 if (! yyres)
1056 return strlen (yystr);
1057
1058 return yystpcpy (yyres, yystr) - yyres;
1059}
1060# endif
1061
1062#endif /* !YYERROR_VERBOSE */
1063
1064/** State numbers, as in LALR(1) machine */
1065typedef int yyStateNum;
1066
1067/** Rule numbers, as in LALR(1) machine */
1068typedef int yyRuleNum;
1069
1070/** Grammar symbol */
1071typedef short int yySymbol;
1072
1073/** Item references, as in LALR(1) machine */
1074typedef short int yyItemNum;
1075
1076typedef struct yyGLRState yyGLRState;
1077typedef struct yyGLRStateSet yyGLRStateSet;
1078typedef struct yySemanticOption yySemanticOption;
1079typedef union yyGLRStackItem yyGLRStackItem;
1080typedef struct yyGLRStack yyGLRStack;
1081
1082struct yyGLRState {
1083 /** Type tag: always true. */
1084 yybool yyisState;
1085 /** Type tag for yysemantics. If true, yysval applies, otherwise
1086 * yyfirstVal applies. */
1087 yybool yyresolved;
1088 /** Number of corresponding LALR(1) machine state. */
1089 yyStateNum yylrState;
1090 /** Preceding state in this stack */
1091 yyGLRState* yypred;
1092 /** Source position of the first token produced by my symbol */
1093 size_t yyposn;
1094 union {
1095 /** First in a chain of alternative reductions producing the
1096 * non-terminal corresponding to this state, threaded through
1097 * yynext. */
1098 yySemanticOption* yyfirstVal;
1099 /** Semantic value for this state. */
1100 YYSTYPE yysval;
1101 } yysemantics;
1102 /** Source location for this state. */
1103 YYLTYPE yyloc;
1104};
1105
1106struct yyGLRStateSet {
1107 yyGLRState** yystates;
1108 /** During nondeterministic operation, yylookaheadNeeds tracks which
1109 * stacks have actually needed the current lookahead. During deterministic
1110 * operation, yylookaheadNeeds[0] is not maintained since it would merely
1111 * duplicate yychar != YYEMPTY. */
1112 yybool* yylookaheadNeeds;
1113 size_t yysize, yycapacity;
1114};
1115
1116struct yySemanticOption {
1117 /** Type tag: always false. */
1118 yybool yyisState;
1119 /** Rule number for this reduction */
1120 yyRuleNum yyrule;
1121 /** The last RHS state in the list of states to be reduced. */
1122 yyGLRState* yystate;
1123 /** The lookahead for this reduction. */
1124 int yyrawchar;
1125 YYSTYPE yyval;
1126 YYLTYPE yyloc;
1127 /** Next sibling in chain of options. To facilitate merging,
1128 * options are chained in decreasing order by address. */
1129 yySemanticOption* yynext;
1130};
1131
1132/** Type of the items in the GLR stack. The yyisState field
1133 * indicates which item of the union is valid. */
1134union yyGLRStackItem {
1135 yyGLRState yystate;
1136 yySemanticOption yyoption;
1137};
1138
1139struct yyGLRStack {
1140 int yyerrState;
1141 /* To compute the location of the error token. */
1142 yyGLRStackItem yyerror_range[3];
1143
1144 int yyerrcnt;
1145 int yyrawchar;
1146 YYSTYPE yyval;
1147 YYLTYPE yyloc;
1148
1149 YYJMP_BUF yyexception_buffer;
1150 yyGLRStackItem* yyitems;
1151 yyGLRStackItem* yynextFree;
1152 size_t yyspaceLeft;
1153 yyGLRState* yysplitPoint;
1154 yyGLRState* yylastDeleted;
1155 yyGLRStateSet yytops;
1156};
1157
1158#if YYSTACKEXPANDABLE
1159static void yyexpandGLRStack (yyGLRStack* yystackp);
1160#endif
1161
1162static void yyFail (yyGLRStack* yystackp, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner, const char* yymsg)
1163 __attribute__ ((__noreturn__));
1164static void
1165yyFail (yyGLRStack* yystackp, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner, const char* yymsg)
1166{
1167 if (yymsg != YY_NULL)
1168 yyerror (yylocp, parse_state, scanner, yymsg);
1169 YYLONGJMP (yystackp->yyexception_buffer, 1);
1170}
1171
1172static void yyMemoryExhausted (yyGLRStack* yystackp)
1173 __attribute__ ((__noreturn__));
1174static void
1175yyMemoryExhausted (yyGLRStack* yystackp)
1176{
1177 YYLONGJMP (yystackp->yyexception_buffer, 2);
1178}
1179
1180#if YYDEBUG || YYERROR_VERBOSE
1181/** A printable representation of TOKEN. */
1182static inline const char*
1183yytokenName (yySymbol yytoken)
1184{
1185 if (yytoken == YYEMPTY)
1186 return "";
1187
1188 return yytname[yytoken];
1189}
1190#endif
1191
1192/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
1193 * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
1194 * containing the pointer to the next state in the chain. */
1195static void yyfillin (yyGLRStackItem *, int, int) __attribute__ ((__unused__));
1196static void
1197yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
1198{
1199 int i;
1200 yyGLRState *s = yyvsp[yylow0].yystate.yypred;
1201 for (i = yylow0-1; i >= yylow1; i -= 1)
1202 {
1203 YYASSERT (s->yyresolved);
1204 yyvsp[i].yystate.yyresolved = yytrue;
1205 yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
1206 yyvsp[i].yystate.yyloc = s->yyloc;
1207 s = yyvsp[i].yystate.yypred = s->yypred;
1208 }
1209}
1210
1211/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
1212 * YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
1213 * For convenience, always return YYLOW1. */
1214static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
1215 __attribute__ ((__unused__));
1216static inline int
1217yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
1218{
1219 if (!yynormal && yylow1 < *yylow)
1220 {
1221 yyfillin (yyvsp, *yylow, yylow1);
1222 *yylow = yylow1;
1223 }
1224 return yylow1;
1225}
1226
1227/** Perform user action for rule number YYN, with RHS length YYRHSLEN,
1228 * and top stack item YYVSP. YYLVALP points to place to put semantic
1229 * value ($$), and yylocp points to place for location information
1230 * (@$). Returns yyok for normal return, yyaccept for YYACCEPT,
1231 * yyerr for YYERROR, yyabort for YYABORT. */
1232/*ARGSUSED*/ static YYRESULTTAG
1233yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
1234 yyGLRStack* yystackp,
1235 YYSTYPE* yyvalp, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner)
1236{
1237 yybool yynormal __attribute__ ((__unused__)) =
1238 (yystackp->yysplitPoint == YY_NULL);
1239 int yylow;
1240 YYUSE (parse_state);
1241 YYUSE (scanner);
1242# undef yyerrok
1243# define yyerrok (yystackp->yyerrState = 0)
1244# undef YYACCEPT
1245# define YYACCEPT return yyaccept
1246# undef YYABORT
1247# define YYABORT return yyabort
1248# undef YYERROR
1249# define YYERROR return yyerrok, yyerr
1250# undef YYRECOVERING
1251# define YYRECOVERING() (yystackp->yyerrState != 0)
1252# undef yyclearin
1253# define yyclearin (yychar = YYEMPTY)
1254# undef YYFILL
1255# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
1256# undef YYBACKUP
1257# define YYBACKUP(Token, Value) \
1258 return yyerror (yylocp, parse_state, scanner, YY_("syntax error: cannot back up")), \
1259 yyerrok, yyerr
1260
1261 yylow = 1;
1262 if (yyrhslen == 0)
1263 *yyvalp = yyval_default;
1264 else
1265 *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
1266 YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen);
1267 yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
1268
1269 switch (yyn)
1270 {
1271 case 2:
1272
1273 { }
1274 break;
1275
1276 case 3:
1277
1278 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1279 break;
1280
1281 case 4:
1282
1283 { ((*yyvalp).nodeOption).type = OT_Options; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1284 break;
1285
1286 case 5:
1287
1288 { ((*yyvalp).nodeOption).type = OT_Shader; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1289 break;
1290
1291 case 6:
1292
1293 { ((*yyvalp).nodeOption).type = OT_SubShader; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1294 break;
1295
1296 case 7:
1297
1298 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1299 break;
1300
1301 case 8:
1302
1303 {
1304 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Options);
1305 nodePush(parse_state, ((*yyvalp).nodePtr));
1306 }
1307 break;
1308
1309 case 10:
1310
1311 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1312 break;
1313
1314 case 11:
1315
1316 { ((*yyvalp).nodeOption).type = OT_Separable; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1317 break;
1318
1319 case 12:
1320
1321 { ((*yyvalp).nodeOption).type = OT_Sort; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1322 break;
1323
1324 case 13:
1325
1326 { ((*yyvalp).nodeOption).type = OT_Priority; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1327 break;
1328
1329 case 14:
1330
1331 { ((*yyvalp).nodeOption).type = OT_Transparent; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1332 break;
1333
1334 case 15:
1335
1336 { ((*yyvalp).nodeOption).type = OT_Forward; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1337 break;
1338
1339 case 16:
1340
1341 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1342 break;
1343
1344 case 17:
1345
1346 {
1347 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Shader);
1348 nodePush(parse_state, ((*yyvalp).nodePtr));
1349
1350 NodeOption entry; entry.type = OT_Identifier; entry.value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((2) - (2))].yystate.yysemantics.yysval.strValue);
1351 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1352 }
1353 break;
1354
1355 case 18:
1356
1357 {
1358 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Mixin);
1359 nodePush(parse_state, ((*yyvalp).nodePtr));
1360
1361 NodeOption entry; entry.type = OT_Identifier; entry.value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((2) - (2))].yystate.yysemantics.yysval.strValue);
1362 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1363 }
1364 break;
1365
1366 case 20:
1367
1368 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1369 break;
1370
1371 case 22:
1372
1373 { ((*yyvalp).nodeOption).type = OT_Pass; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1374 break;
1375
1376 case 24:
1377
1378 { ((*yyvalp).nodeOption).type = OT_Code; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1379 break;
1380
1381 case 25:
1382
1383 { ((*yyvalp).nodeOption).type = OT_FeatureSet; ((*yyvalp).nodeOption).value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.strValue); }
1384 break;
1385
1386 case 26:
1387
1388 { ((*yyvalp).nodeOption).type = OT_Mixin; ((*yyvalp).nodeOption).value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((2) - (3))].yystate.yysemantics.yysval.strValue); }
1389 break;
1390
1391 case 27:
1392
1393 { ((*yyvalp).nodeOption).type = OT_Tags; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1394 break;
1395
1396 case 28:
1397
1398 { ((*yyvalp).nodeOption).type = OT_Variations; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1399 break;
1400
1401 case 29:
1402
1403 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1404 break;
1405
1406 case 30:
1407
1408 {
1409 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Tags);
1410 nodePush(parse_state, ((*yyvalp).nodePtr));
1411 }
1412 break;
1413
1414 case 32:
1415
1416 {
1417 NodeOption entry; entry.type = OT_TagValue; entry.value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.strValue);
1418 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1419 }
1420 break;
1421
1422 case 33:
1423
1424 {
1425 NodeOption entry; entry.type = OT_TagValue; entry.value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (3))].yystate.yysemantics.yysval.strValue);
1426 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1427 }
1428 break;
1429
1430 case 34:
1431
1432 {
1433 NodeOption index;
1434 index.type = OT_Index;
1435 index.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((5) - (8))].yystate.yysemantics.yysval.intValue);
1436
1437 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &index);
1438
1439 nodePop(parse_state);
1440 ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (8))].yystate.yysemantics.yysval.nodePtr);
1441 }
1442 break;
1443
1444 case 35:
1445
1446 {
1447 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_SubShader);
1448 nodePush(parse_state, ((*yyvalp).nodePtr));
1449
1450 NodeOption entry; entry.type = OT_Identifier; entry.value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((2) - (2))].yystate.yysemantics.yysval.strValue);
1451 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1452 }
1453 break;
1454
1455 case 36:
1456
1457 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1458 break;
1459
1460 case 37:
1461
1462 {
1463 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Pass);
1464 nodePush(parse_state, ((*yyvalp).nodePtr));
1465 }
1466 break;
1467
1468 case 39:
1469
1470 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1471 break;
1472
1473 case 41:
1474
1475 { ((*yyvalp).nodeOption).type = OT_Code; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1476 break;
1477
1478 case 42:
1479
1480 { ((*yyvalp).nodeOption).type = OT_Raster; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1481 break;
1482
1483 case 43:
1484
1485 { ((*yyvalp).nodeOption).type = OT_Depth; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1486 break;
1487
1488 case 44:
1489
1490 { ((*yyvalp).nodeOption).type = OT_Stencil; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1491 break;
1492
1493 case 45:
1494
1495 { ((*yyvalp).nodeOption).type = OT_Blend; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1496 break;
1497
1498 case 46:
1499
1500 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1501 break;
1502
1503 case 47:
1504
1505 {
1506 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Variations);
1507 nodePush(parse_state, ((*yyvalp).nodePtr));
1508 }
1509 break;
1510
1511 case 49:
1512
1513 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1514 break;
1515
1516 case 50:
1517
1518 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_Variation; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1519 break;
1520
1521 case 51:
1522
1523 { ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1524 break;
1525
1526 case 52:
1527
1528 {
1529 NodeOption attrEntry; attrEntry.type = OT_Attributes; attrEntry.value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodePtr);
1530 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &attrEntry);
1531
1532 ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((2) - (2))].yystate.yysemantics.yysval.nodePtr);
1533 }
1534 break;
1535
1536 case 53:
1537
1538 {
1539 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Variation);
1540 nodePush(parse_state, ((*yyvalp).nodePtr));
1541
1542 NodeOption entry; entry.type = OT_Identifier; entry.value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.strValue);
1543 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1544 }
1545 break;
1546
1547 case 55:
1548
1549 {
1550 NodeOption entry; entry.type = OT_VariationOption; entry.value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr);
1551 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1552 }
1553 break;
1554
1555 case 56:
1556
1557 {
1558 NodeOption entry; entry.type = OT_VariationOption; entry.value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (3))].yystate.yysemantics.yysval.nodePtr);
1559 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &entry);
1560 }
1561 break;
1562
1563 case 57:
1564
1565 {
1566 ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr);
1567 nodePop(parse_state);
1568 }
1569 break;
1570
1571 case 58:
1572
1573 {
1574 NodeOption attrEntry; attrEntry.type = OT_Attributes; attrEntry.value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodePtr);
1575 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &attrEntry);
1576
1577 ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((2) - (2))].yystate.yysemantics.yysval.nodePtr);
1578 nodePop(parse_state);
1579 }
1580 break;
1581
1582 case 59:
1583
1584 {
1585 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_VariationOption);
1586 nodePush(parse_state, ((*yyvalp).nodePtr));
1587
1588 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodeOption));
1589 }
1590 break;
1591
1592 case 60:
1593
1594 { ((*yyvalp).nodeOption).type = OT_VariationValue; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.intValue); }
1595 break;
1596
1597 case 61:
1598
1599 { ((*yyvalp).nodeOption).type = OT_VariationValue; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.intValue); }
1600 break;
1601
1602 case 62:
1603
1604 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1605 break;
1606
1607 case 63:
1608
1609 {
1610 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Raster);
1611 nodePush(parse_state, ((*yyvalp).nodePtr));
1612 }
1613 break;
1614
1615 case 65:
1616
1617 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1618 break;
1619
1620 case 66:
1621
1622 { ((*yyvalp).nodeOption).type = OT_FillMode; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1623 break;
1624
1625 case 67:
1626
1627 { ((*yyvalp).nodeOption).type = OT_CullMode; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1628 break;
1629
1630 case 68:
1631
1632 { ((*yyvalp).nodeOption).type = OT_Scissor; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1633 break;
1634
1635 case 69:
1636
1637 { ((*yyvalp).nodeOption).type = OT_Multisample; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1638 break;
1639
1640 case 70:
1641
1642 { ((*yyvalp).nodeOption).type = OT_AALine; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1643 break;
1644
1645 case 71:
1646
1647 { ((*yyvalp).nodeOption).type = OT_DepthBias; ((*yyvalp).nodeOption).value.floatValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.floatValue); }
1648 break;
1649
1650 case 72:
1651
1652 { ((*yyvalp).nodeOption).type = OT_SDepthBias; ((*yyvalp).nodeOption).value.floatValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.floatValue); }
1653 break;
1654
1655 case 73:
1656
1657 { ((*yyvalp).nodeOption).type = OT_DepthClip; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1658 break;
1659
1660 case 74:
1661
1662 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1663 break;
1664
1665 case 75:
1666
1667 {
1668 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Depth);
1669 nodePush(parse_state, ((*yyvalp).nodePtr));
1670 }
1671 break;
1672
1673 case 77:
1674
1675 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1676 break;
1677
1678 case 78:
1679
1680 { ((*yyvalp).nodeOption).type = OT_DepthRead; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1681 break;
1682
1683 case 79:
1684
1685 { ((*yyvalp).nodeOption).type = OT_DepthWrite; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1686 break;
1687
1688 case 80:
1689
1690 { ((*yyvalp).nodeOption).type = OT_CompareFunc; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1691 break;
1692
1693 case 81:
1694
1695 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1696 break;
1697
1698 case 82:
1699
1700 {
1701 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Stencil);
1702 nodePush(parse_state, ((*yyvalp).nodePtr));
1703 }
1704 break;
1705
1706 case 84:
1707
1708 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1709 break;
1710
1711 case 85:
1712
1713 { ((*yyvalp).nodeOption).type = OT_Enabled; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1714 break;
1715
1716 case 86:
1717
1718 { ((*yyvalp).nodeOption).type = OT_StencilReadMask; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1719 break;
1720
1721 case 87:
1722
1723 { ((*yyvalp).nodeOption).type = OT_StencilWriteMask; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1724 break;
1725
1726 case 88:
1727
1728 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_StencilOpFront; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1729 break;
1730
1731 case 89:
1732
1733 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_StencilOpBack; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1734 break;
1735
1736 case 90:
1737
1738 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_StencilOpFront; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1739 break;
1740
1741 case 91:
1742
1743 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_StencilOpBack; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1744 break;
1745
1746 case 92:
1747
1748 { ((*yyvalp).nodeOption).type = OT_StencilRef; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1749 break;
1750
1751 case 93:
1752
1753 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1754 break;
1755
1756 case 94:
1757
1758 {
1759 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Blend);
1760 nodePush(parse_state, ((*yyvalp).nodePtr));
1761 }
1762 break;
1763
1764 case 96:
1765
1766 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1767 break;
1768
1769 case 97:
1770
1771 { ((*yyvalp).nodeOption).type = OT_AlphaToCoverage; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1772 break;
1773
1774 case 98:
1775
1776 { ((*yyvalp).nodeOption).type = OT_IndependantBlend; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1777 break;
1778
1779 case 99:
1780
1781 { ((*yyvalp).nodeOption).type = OT_Target; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodePtr); }
1782 break;
1783
1784 case 100:
1785
1786 {
1787 NodeOption index;
1788 index.type = OT_Index;
1789 index.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((5) - (8))].yystate.yysemantics.yysval.intValue);
1790
1791 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &index);
1792
1793 nodePop(parse_state);
1794 ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (8))].yystate.yysemantics.yysval.nodePtr);
1795 }
1796 break;
1797
1798 case 101:
1799
1800 {
1801 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Code);
1802 nodePush(parse_state, ((*yyvalp).nodePtr));
1803 }
1804 break;
1805
1806 case 102:
1807
1808 {
1809 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_StencilOp);
1810 nodePush(parse_state, ((*yyvalp).nodePtr));
1811 }
1812 break;
1813
1814 case 103:
1815
1816 {
1817 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_StencilOp);
1818 nodePush(parse_state, ((*yyvalp).nodePtr));
1819 }
1820 break;
1821
1822 case 104:
1823
1824 {
1825 NodeOption fail; fail.type = OT_Fail; fail.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (7))].yystate.yysemantics.yysval.intValue);
1826 NodeOption zfail; zfail.type = OT_ZFail; zfail.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (7))].yystate.yysemantics.yysval.intValue);
1827 NodeOption pass; pass.type = OT_PassOp; pass.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((5) - (7))].yystate.yysemantics.yysval.intValue);
1828 NodeOption cmp; cmp.type = OT_CompareFunc; cmp.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((7) - (7))].yystate.yysemantics.yysval.intValue);
1829
1830 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &fail);
1831 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &zfail);
1832 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &pass);
1833 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &cmp);
1834 }
1835 break;
1836
1837 case 106:
1838
1839 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1840 break;
1841
1842 case 107:
1843
1844 { ((*yyvalp).nodeOption).type = OT_Fail; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1845 break;
1846
1847 case 108:
1848
1849 { ((*yyvalp).nodeOption).type = OT_ZFail; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1850 break;
1851
1852 case 109:
1853
1854 { ((*yyvalp).nodeOption).type = OT_PassOp; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1855 break;
1856
1857 case 110:
1858
1859 { ((*yyvalp).nodeOption).type = OT_CompareFunc; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1860 break;
1861
1862 case 111:
1863
1864 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1865 break;
1866
1867 case 112:
1868
1869 {
1870 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Target);
1871 nodePush(parse_state, ((*yyvalp).nodePtr));
1872 }
1873 break;
1874
1875 case 114:
1876
1877 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1878 break;
1879
1880 case 115:
1881
1882 { ((*yyvalp).nodeOption).type = OT_Index; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1883 break;
1884
1885 case 116:
1886
1887 { ((*yyvalp).nodeOption).type = OT_Enabled; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1888 break;
1889
1890 case 117:
1891
1892 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_Color; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1893 break;
1894
1895 case 118:
1896
1897 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_Alpha; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1898 break;
1899
1900 case 119:
1901
1902 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_Color; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1903 break;
1904
1905 case 120:
1906
1907 { nodePop(parse_state); ((*yyvalp).nodeOption).type = OT_Alpha; ((*yyvalp).nodeOption).value.nodePtr = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.nodePtr); }
1908 break;
1909
1910 case 121:
1911
1912 { ((*yyvalp).nodeOption).type = OT_WriteMask; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1913 break;
1914
1915 case 122:
1916
1917 {
1918 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_BlendDef);
1919 nodePush(parse_state, ((*yyvalp).nodePtr));
1920 }
1921 break;
1922
1923 case 123:
1924
1925 {
1926 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_BlendDef);
1927 nodePush(parse_state, ((*yyvalp).nodePtr));
1928 }
1929 break;
1930
1931 case 125:
1932
1933 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (2))].yystate.yysemantics.yysval.nodeOption)); }
1934 break;
1935
1936 case 126:
1937
1938 {
1939 NodeOption src; src.type = OT_Source; src.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (5))].yystate.yysemantics.yysval.intValue);
1940 NodeOption dst; dst.type = OT_Dest; dst.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (5))].yystate.yysemantics.yysval.intValue);
1941 NodeOption op; op.type = OT_Op; op.value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((5) - (5))].yystate.yysemantics.yysval.intValue);
1942
1943 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &src);
1944 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &dst);
1945 nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &op);
1946 }
1947 break;
1948
1949 case 127:
1950
1951 { ((*yyvalp).nodeOption).type = OT_Source; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1952 break;
1953
1954 case 128:
1955
1956 { ((*yyvalp).nodeOption).type = OT_Dest; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1957 break;
1958
1959 case 129:
1960
1961 { ((*yyvalp).nodeOption).type = OT_Op; ((*yyvalp).nodeOption).value.intValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.intValue); }
1962 break;
1963
1964 case 130:
1965
1966 { nodePop(parse_state); ((*yyvalp).nodePtr) = (((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (3))].yystate.yysemantics.yysval.nodePtr); }
1967 break;
1968
1969 case 131:
1970
1971 {
1972 ((*yyvalp).nodePtr) = nodeCreate(parse_state->memContext, NT_Attributes);
1973 nodePush(parse_state, ((*yyvalp).nodePtr));
1974 }
1975 break;
1976
1977 case 133:
1978
1979 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (1))].yystate.yysemantics.yysval.nodeOption)); }
1980 break;
1981
1982 case 134:
1983
1984 { nodeOptionsAdd(parse_state->memContext, parse_state->topNode->options, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((1) - (3))].yystate.yysemantics.yysval.nodeOption)); }
1985 break;
1986
1987 case 135:
1988
1989 { ((*yyvalp).nodeOption).type = OT_AttrName; ((*yyvalp).nodeOption).value.strValue = (((yyGLRStackItem const *)yyvsp)[YYFILL ((3) - (4))].yystate.yysemantics.yysval.strValue); }
1990 break;
1991
1992 case 136:
1993
1994 { ((*yyvalp).nodeOption).type = OT_AttrShow; ((*yyvalp).nodeOption).value.intValue = 0; }
1995 break;
1996
1997
1998
1999 default: break;
2000 }
2001
2002 return yyok;
2003# undef yyerrok
2004# undef YYABORT
2005# undef YYACCEPT
2006# undef YYERROR
2007# undef YYBACKUP
2008# undef yyclearin
2009# undef YYRECOVERING
2010}
2011
2012
2013/*ARGSUSED*/ static void
2014yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
2015{
2016 YYUSE (yy0);
2017 YYUSE (yy1);
2018
2019 switch (yyn)
2020 {
2021
2022 default: break;
2023 }
2024}
2025
2026 /* Bison grammar-table manipulation. */
2027
2028/*-----------------------------------------------.
2029| Release the memory associated to this symbol. |
2030`-----------------------------------------------*/
2031
2032/*ARGSUSED*/
2033static void
2034yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, ParseState* parse_state, yyscan_t scanner)
2035{
2036 YYUSE (yyvaluep);
2037 YYUSE (yylocationp);
2038 YYUSE (parse_state);
2039 YYUSE (scanner);
2040
2041 if (!yymsg)
2042 yymsg = "Deleting";
2043 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2044
2045 switch (yytype)
2046 {
2047
2048 default:
2049 break;
2050 }
2051}
2052
2053/** Number of symbols composing the right hand side of rule #RULE. */
2054static inline int
2055yyrhsLength (yyRuleNum yyrule)
2056{
2057 return yyr2[yyrule];
2058}
2059
2060static void
2061yydestroyGLRState (char const *yymsg, yyGLRState *yys, ParseState* parse_state, yyscan_t scanner)
2062{
2063 if (yys->yyresolved)
2064 yydestruct (yymsg, yystos[yys->yylrState],
2065 &yys->yysemantics.yysval, &yys->yyloc, parse_state, scanner);
2066 else
2067 {
2068#if YYDEBUG
2069 if (yydebug)
2070 {
2071 if (yys->yysemantics.yyfirstVal)
2072 YYFPRINTF (stderr, "%s unresolved ", yymsg);
2073 else
2074 YYFPRINTF (stderr, "%s incomplete ", yymsg);
2075 yy_symbol_print (stderr, yystos[yys->yylrState],
2076 YY_NULL, &yys->yyloc, parse_state, scanner);
2077 YYFPRINTF (stderr, "\n");
2078 }
2079#endif
2080
2081 if (yys->yysemantics.yyfirstVal)
2082 {
2083 yySemanticOption *yyoption = yys->yysemantics.yyfirstVal;
2084 yyGLRState *yyrh;
2085 int yyn;
2086 for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule);
2087 yyn > 0;
2088 yyrh = yyrh->yypred, yyn -= 1)
2089 yydestroyGLRState (yymsg, yyrh, parse_state, scanner);
2090 }
2091 }
2092}
2093
2094/** Left-hand-side symbol for rule #RULE. */
2095static inline yySymbol
2096yylhsNonterm (yyRuleNum yyrule)
2097{
2098 return yyr1[yyrule];
2099}
2100
2101#define yypact_value_is_default(Yystate) \
2102 (!!((Yystate) == (-276)))
2103
2104/** True iff LR state STATE has only a default reduction (regardless
2105 * of token). */
2106static inline yybool
2107yyisDefaultedState (yyStateNum yystate)
2108{
2109 return yypact_value_is_default (yypact[yystate]);
2110}
2111
2112/** The default reduction for STATE, assuming it has one. */
2113static inline yyRuleNum
2114yydefaultAction (yyStateNum yystate)
2115{
2116 return yydefact[yystate];
2117}
2118
2119#define yytable_value_is_error(Yytable_value) \
2120 YYID (0)
2121
2122/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
2123 * Result R means
2124 * R < 0: Reduce on rule -R.
2125 * R = 0: Error.
2126 * R > 0: Shift to state R.
2127 * Set *CONFLICTS to a pointer into yyconfl to 0-terminated list of
2128 * conflicting reductions.
2129 */
2130static inline void
2131yygetLRActions (yyStateNum yystate, int yytoken,
2132 int* yyaction, const short int** yyconflicts)
2133{
2134 int yyindex = yypact[yystate] + yytoken;
2135 if (yypact_value_is_default (yypact[yystate])
2136 || yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
2137 {
2138 *yyaction = -yydefact[yystate];
2139 *yyconflicts = yyconfl;
2140 }
2141 else if (! yytable_value_is_error (yytable[yyindex]))
2142 {
2143 *yyaction = yytable[yyindex];
2144 *yyconflicts = yyconfl + yyconflp[yyindex];
2145 }
2146 else
2147 {
2148 *yyaction = 0;
2149 *yyconflicts = yyconfl + yyconflp[yyindex];
2150 }
2151}
2152
2153static inline yyStateNum
2154yyLRgotoState (yyStateNum yystate, yySymbol yylhs)
2155{
2156 int yyr;
2157 yyr = yypgoto[yylhs - YYNTOKENS] + yystate;
2158 if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
2159 return yytable[yyr];
2160 else
2161 return yydefgoto[yylhs - YYNTOKENS];
2162}
2163
2164static inline yybool
2165yyisShiftAction (int yyaction)
2166{
2167 return 0 < yyaction;
2168}
2169
2170static inline yybool
2171yyisErrorAction (int yyaction)
2172{
2173 return yyaction == 0;
2174}
2175
2176 /* GLRStates */
2177
2178/** Return a fresh GLRStackItem. Callers should call
2179 * YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient
2180 * headroom. */
2181
2182static inline yyGLRStackItem*
2183yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState)
2184{
2185 yyGLRStackItem* yynewItem = yystackp->yynextFree;
2186 yystackp->yyspaceLeft -= 1;
2187 yystackp->yynextFree += 1;
2188 yynewItem->yystate.yyisState = yyisState;
2189 return yynewItem;
2190}
2191
2192/** Add a new semantic action that will execute the action for rule
2193 * RULENUM on the semantic values in RHS to the list of
2194 * alternative actions for STATE. Assumes that RHS comes from
2195 * stack #K of *STACKP. */
2196static void
2197yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
2198 yyGLRState* rhs, yyRuleNum yyrule)
2199{
2200 yySemanticOption* yynewOption =
2201 &yynewGLRStackItem (yystackp, yyfalse)->yyoption;
2202 yynewOption->yystate = rhs;
2203 yynewOption->yyrule = yyrule;
2204 if (yystackp->yytops.yylookaheadNeeds[yyk])
2205 {
2206 yynewOption->yyrawchar = yychar;
2207 yynewOption->yyval = yylval;
2208 yynewOption->yyloc = yylloc;
2209 }
2210 else
2211 yynewOption->yyrawchar = YYEMPTY;
2212 yynewOption->yynext = yystate->yysemantics.yyfirstVal;
2213 yystate->yysemantics.yyfirstVal = yynewOption;
2214
2215 YY_RESERVE_GLRSTACK (yystackp);
2216}
2217
2218 /* GLRStacks */
2219
2220/** Initialize SET to a singleton set containing an empty stack. */
2221static yybool
2222yyinitStateSet (yyGLRStateSet* yyset)
2223{
2224 yyset->yysize = 1;
2225 yyset->yycapacity = 16;
2226 yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
2227 if (! yyset->yystates)
2228 return yyfalse;
2229 yyset->yystates[0] = YY_NULL;
2230 yyset->yylookaheadNeeds =
2231 (yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
2232 if (! yyset->yylookaheadNeeds)
2233 {
2234 YYFREE (yyset->yystates);
2235 return yyfalse;
2236 }
2237 return yytrue;
2238}
2239
2240static void yyfreeStateSet (yyGLRStateSet* yyset)
2241{
2242 YYFREE (yyset->yystates);
2243 YYFREE (yyset->yylookaheadNeeds);
2244}
2245
2246/** Initialize STACK to a single empty stack, with total maximum
2247 * capacity for all stacks of SIZE. */
2248static yybool
2249yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
2250{
2251 yystackp->yyerrState = 0;
2252 yynerrs = 0;
2253 yystackp->yyspaceLeft = yysize;
2254 yystackp->yyitems =
2255 (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystackp->yynextFree[0]);
2256 if (!yystackp->yyitems)
2257 return yyfalse;
2258 yystackp->yynextFree = yystackp->yyitems;
2259 yystackp->yysplitPoint = YY_NULL;
2260 yystackp->yylastDeleted = YY_NULL;
2261 return yyinitStateSet (&yystackp->yytops);
2262}
2263
2264
2265#if YYSTACKEXPANDABLE
2266# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \
2267 &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE
2268
2269/** If STACK is expandable, extend it. WARNING: Pointers into the
2270 stack from outside should be considered invalid after this call.
2271 We always expand when there are 1 or fewer items left AFTER an
2272 allocation, so that we can avoid having external pointers exist
2273 across an allocation. */
2274static void
2275yyexpandGLRStack (yyGLRStack* yystackp)
2276{
2277 yyGLRStackItem* yynewItems;
2278 yyGLRStackItem* yyp0, *yyp1;
2279 size_t yynewSize;
2280 size_t yyn;
2281 size_t yysize = yystackp->yynextFree - yystackp->yyitems;
2282 if (YYMAXDEPTH - YYHEADROOM < yysize)
2283 yyMemoryExhausted (yystackp);
2284 yynewSize = 2*yysize;
2285 if (YYMAXDEPTH < yynewSize)
2286 yynewSize = YYMAXDEPTH;
2287 yynewItems = (yyGLRStackItem*) YYMALLOC (yynewSize * sizeof yynewItems[0]);
2288 if (! yynewItems)
2289 yyMemoryExhausted (yystackp);
2290 for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize;
2291 0 < yyn;
2292 yyn -= 1, yyp0 += 1, yyp1 += 1)
2293 {
2294 *yyp1 = *yyp0;
2295 if (*(yybool *) yyp0)
2296 {
2297 yyGLRState* yys0 = &yyp0->yystate;
2298 yyGLRState* yys1 = &yyp1->yystate;
2299 if (yys0->yypred != YY_NULL)
2300 yys1->yypred =
2301 YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
2302 if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULL)
2303 yys1->yysemantics.yyfirstVal =
2304 YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
2305 }
2306 else
2307 {
2308 yySemanticOption* yyv0 = &yyp0->yyoption;
2309 yySemanticOption* yyv1 = &yyp1->yyoption;
2310 if (yyv0->yystate != YY_NULL)
2311 yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
2312 if (yyv0->yynext != YY_NULL)
2313 yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
2314 }
2315 }
2316 if (yystackp->yysplitPoint != YY_NULL)
2317 yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
2318 yystackp->yysplitPoint, yystate);
2319
2320 for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
2321 if (yystackp->yytops.yystates[yyn] != YY_NULL)
2322 yystackp->yytops.yystates[yyn] =
2323 YYRELOC (yystackp->yyitems, yynewItems,
2324 yystackp->yytops.yystates[yyn], yystate);
2325 YYFREE (yystackp->yyitems);
2326 yystackp->yyitems = yynewItems;
2327 yystackp->yynextFree = yynewItems + yysize;
2328 yystackp->yyspaceLeft = yynewSize - yysize;
2329}
2330#endif
2331
2332static void
2333yyfreeGLRStack (yyGLRStack* yystackp)
2334{
2335 YYFREE (yystackp->yyitems);
2336 yyfreeStateSet (&yystackp->yytops);
2337}
2338
2339/** Assuming that S is a GLRState somewhere on STACK, update the
2340 * splitpoint of STACK, if needed, so that it is at least as deep as
2341 * S. */
2342static inline void
2343yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
2344{
2345 if (yystackp->yysplitPoint != YY_NULL && yystackp->yysplitPoint > yys)
2346 yystackp->yysplitPoint = yys;
2347}
2348
2349/** Invalidate stack #K in STACK. */
2350static inline void
2351yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
2352{
2353 if (yystackp->yytops.yystates[yyk] != YY_NULL)
2354 yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
2355 yystackp->yytops.yystates[yyk] = YY_NULL;
2356}
2357
2358/** Undelete the last stack that was marked as deleted. Can only be
2359 done once after a deletion, and only when all other stacks have
2360 been deleted. */
2361static void
2362yyundeleteLastStack (yyGLRStack* yystackp)
2363{
2364 if (yystackp->yylastDeleted == YY_NULL || yystackp->yytops.yysize != 0)
2365 return;
2366 yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
2367 yystackp->yytops.yysize = 1;
2368 YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
2369 yystackp->yylastDeleted = YY_NULL;
2370}
2371
2372static inline void
2373yyremoveDeletes (yyGLRStack* yystackp)
2374{
2375 size_t yyi, yyj;
2376 yyi = yyj = 0;
2377 while (yyj < yystackp->yytops.yysize)
2378 {
2379 if (yystackp->yytops.yystates[yyi] == YY_NULL)
2380 {
2381 if (yyi == yyj)
2382 {
2383 YYDPRINTF ((stderr, "Removing dead stacks.\n"));
2384 }
2385 yystackp->yytops.yysize -= 1;
2386 }
2387 else
2388 {
2389 yystackp->yytops.yystates[yyj] = yystackp->yytops.yystates[yyi];
2390 /* In the current implementation, it's unnecessary to copy
2391 yystackp->yytops.yylookaheadNeeds[yyi] since, after
2392 yyremoveDeletes returns, the parser immediately either enters
2393 deterministic operation or shifts a token. However, it doesn't
2394 hurt, and the code might evolve to need it. */
2395 yystackp->yytops.yylookaheadNeeds[yyj] =
2396 yystackp->yytops.yylookaheadNeeds[yyi];
2397 if (yyj != yyi)
2398 {
2399 YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
2400 (unsigned long int) yyi, (unsigned long int) yyj));
2401 }
2402 yyj += 1;
2403 }
2404 yyi += 1;
2405 }
2406}
2407
2408/** Shift to a new state on stack #K of STACK, corresponding to LR state
2409 * LRSTATE, at input position POSN, with (resolved) semantic value SVAL. */
2410static inline void
2411yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
2412 size_t yyposn,
2413 YYSTYPE* yyvalp, YYLTYPE* yylocp)
2414{
2415 yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
2416
2417 yynewState->yylrState = yylrState;
2418 yynewState->yyposn = yyposn;
2419 yynewState->yyresolved = yytrue;
2420 yynewState->yypred = yystackp->yytops.yystates[yyk];
2421 yynewState->yysemantics.yysval = *yyvalp;
2422 yynewState->yyloc = *yylocp;
2423 yystackp->yytops.yystates[yyk] = yynewState;
2424
2425 YY_RESERVE_GLRSTACK (yystackp);
2426}
2427
2428/** Shift stack #K of YYSTACK, to a new state corresponding to LR
2429 * state YYLRSTATE, at input position YYPOSN, with the (unresolved)
2430 * semantic value of YYRHS under the action for YYRULE. */
2431static inline void
2432yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
2433 size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule)
2434{
2435 yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
2436
2437 yynewState->yylrState = yylrState;
2438 yynewState->yyposn = yyposn;
2439 yynewState->yyresolved = yyfalse;
2440 yynewState->yypred = yystackp->yytops.yystates[yyk];
2441 yynewState->yysemantics.yyfirstVal = YY_NULL;
2442 yystackp->yytops.yystates[yyk] = yynewState;
2443
2444 /* Invokes YY_RESERVE_GLRSTACK. */
2445 yyaddDeferredAction (yystackp, yyk, yynewState, rhs, yyrule);
2446}
2447
2448/** Pop the symbols consumed by reduction #RULE from the top of stack
2449 * #K of STACK, and perform the appropriate semantic action on their
2450 * semantic values. Assumes that all ambiguities in semantic values
2451 * have been previously resolved. Set *VALP to the resulting value,
2452 * and *LOCP to the computed location (if any). Return value is as
2453 * for userAction. */
2454static inline YYRESULTTAG
2455yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
2456 YYSTYPE* yyvalp, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner)
2457{
2458 int yynrhs = yyrhsLength (yyrule);
2459
2460 if (yystackp->yysplitPoint == YY_NULL)
2461 {
2462 /* Standard special case: single stack. */
2463 yyGLRStackItem* rhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
2464 YYASSERT (yyk == 0);
2465 yystackp->yynextFree -= yynrhs;
2466 yystackp->yyspaceLeft += yynrhs;
2467 yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate;
2468 return yyuserAction (yyrule, yynrhs, rhs, yystackp,
2469 yyvalp, yylocp, parse_state, scanner);
2470 }
2471 else
2472 {
2473 /* At present, doAction is never called in nondeterministic
2474 * mode, so this branch is never taken. It is here in
2475 * anticipation of a future feature that will allow immediate
2476 * evaluation of selected actions in nondeterministic mode. */
2477 int yyi;
2478 yyGLRState* yys;
2479 yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
2480 yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
2481 = yystackp->yytops.yystates[yyk];
2482 if (yynrhs == 0)
2483 /* Set default location. */
2484 yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yys->yyloc;
2485 for (yyi = 0; yyi < yynrhs; yyi += 1)
2486 {
2487 yys = yys->yypred;
2488 YYASSERT (yys);
2489 }
2490 yyupdateSplit (yystackp, yys);
2491 yystackp->yytops.yystates[yyk] = yys;
2492 return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
2493 yystackp, yyvalp, yylocp, parse_state, scanner);
2494 }
2495}
2496
2497#if !YYDEBUG
2498# define YY_REDUCE_PRINT(Args)
2499#else
2500# define YY_REDUCE_PRINT(Args) \
2501do { \
2502 if (yydebug) \
2503 yy_reduce_print Args; \
2504} while (YYID (0))
2505
2506/*----------------------------------------------------------.
2507| Report that the RULE is going to be reduced on stack #K. |
2508`----------------------------------------------------------*/
2509
2510/*ARGSUSED*/ static inline void
2511yy_reduce_print (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
2512 YYSTYPE* yyvalp, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner)
2513{
2514 int yynrhs = yyrhsLength (yyrule);
2515 yybool yynormal __attribute__ ((__unused__)) =
2516 (yystackp->yysplitPoint == YY_NULL);
2517 yyGLRStackItem* yyvsp = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
2518 int yylow = 1;
2519 int yyi;
2520 YYUSE (yyvalp);
2521 YYUSE (yylocp);
2522 YYUSE (parse_state);
2523 YYUSE (scanner);
2524 YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
2525 (unsigned long int) yyk, yyrule - 1,
2526 (unsigned long int) yyrline[yyrule]);
2527 /* The symbols being reduced. */
2528 for (yyi = 0; yyi < yynrhs; yyi++)
2529 {
2530 YYFPRINTF (stderr, " $%d = ", yyi + 1);
2531 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2532 &(((yyGLRStackItem const *)yyvsp)[YYFILL ((yyi + 1) - (yynrhs))].yystate.yysemantics.yysval)
2533 , &(((yyGLRStackItem const *)yyvsp)[YYFILL ((yyi + 1) - (yynrhs))].yystate.yyloc) , parse_state, scanner);
2534 YYFPRINTF (stderr, "\n");
2535 }
2536}
2537#endif
2538
2539/** Pop items off stack #K of STACK according to grammar rule RULE,
2540 * and push back on the resulting nonterminal symbol. Perform the
2541 * semantic action associated with RULE and store its value with the
2542 * newly pushed state, if FORCEEVAL or if STACK is currently
2543 * unambiguous. Otherwise, store the deferred semantic action with
2544 * the new state. If the new state would have an identical input
2545 * position, LR state, and predecessor to an existing state on the stack,
2546 * it is identified with that existing state, eliminating stack #K from
2547 * the STACK. In this case, the (necessarily deferred) semantic value is
2548 * added to the options for the existing state's semantic value.
2549 */
2550static inline YYRESULTTAG
2551yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
2552 yybool yyforceEval, ParseState* parse_state, yyscan_t scanner)
2553{
2554 size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
2555
2556 if (yyforceEval || yystackp->yysplitPoint == YY_NULL)
2557 {
2558 YYSTYPE yysval;
2559 YYLTYPE yyloc;
2560
2561 YY_REDUCE_PRINT ((yystackp, yyk, yyrule, &yysval, &yyloc, parse_state, scanner));
2562 YYCHK (yydoAction (yystackp, yyk, yyrule, &yysval, &yyloc, parse_state, scanner));
2563 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
2564 yyglrShift (yystackp, yyk,
2565 yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState,
2566 yylhsNonterm (yyrule)),
2567 yyposn, &yysval, &yyloc);
2568 }
2569 else
2570 {
2571 size_t yyi;
2572 int yyn;
2573 yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk];
2574 yyStateNum yynewLRState;
2575
2576 for (yys = yystackp->yytops.yystates[yyk], yyn = yyrhsLength (yyrule);
2577 0 < yyn; yyn -= 1)
2578 {
2579 yys = yys->yypred;
2580 YYASSERT (yys);
2581 }
2582 yyupdateSplit (yystackp, yys);
2583 yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
2584 YYDPRINTF ((stderr,
2585 "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n",
2586 (unsigned long int) yyk, yyrule - 1, yynewLRState));
2587 for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
2588 if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULL)
2589 {
2590 yyGLRState *yysplit = yystackp->yysplitPoint;
2591 yyGLRState *yyp = yystackp->yytops.yystates[yyi];
2592 while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn)
2593 {
2594 if (yyp->yylrState == yynewLRState && yyp->yypred == yys)
2595 {
2596 yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule);
2597 yymarkStackDeleted (yystackp, yyk);
2598 YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
2599 (unsigned long int) yyk,
2600 (unsigned long int) yyi));
2601 return yyok;
2602 }
2603 yyp = yyp->yypred;
2604 }
2605 }
2606 yystackp->yytops.yystates[yyk] = yys;
2607 yyglrShiftDefer (yystackp, yyk, yynewLRState, yyposn, yys0, yyrule);
2608 }
2609 return yyok;
2610}
2611
2612static size_t
2613yysplitStack (yyGLRStack* yystackp, size_t yyk)
2614{
2615 if (yystackp->yysplitPoint == YY_NULL)
2616 {
2617 YYASSERT (yyk == 0);
2618 yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
2619 }
2620 if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity)
2621 {
2622 yyGLRState** yynewStates;
2623 yybool* yynewLookaheadNeeds;
2624
2625 yynewStates = YY_NULL;
2626
2627 if (yystackp->yytops.yycapacity
2628 > (YYSIZEMAX / (2 * sizeof yynewStates[0])))
2629 yyMemoryExhausted (yystackp);
2630 yystackp->yytops.yycapacity *= 2;
2631
2632 yynewStates =
2633 (yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
2634 (yystackp->yytops.yycapacity
2635 * sizeof yynewStates[0]));
2636 if (yynewStates == YY_NULL)
2637 yyMemoryExhausted (yystackp);
2638 yystackp->yytops.yystates = yynewStates;
2639
2640 yynewLookaheadNeeds =
2641 (yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
2642 (yystackp->yytops.yycapacity
2643 * sizeof yynewLookaheadNeeds[0]));
2644 if (yynewLookaheadNeeds == YY_NULL)
2645 yyMemoryExhausted (yystackp);
2646 yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
2647 }
2648 yystackp->yytops.yystates[yystackp->yytops.yysize]
2649 = yystackp->yytops.yystates[yyk];
2650 yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize]
2651 = yystackp->yytops.yylookaheadNeeds[yyk];
2652 yystackp->yytops.yysize += 1;
2653 return yystackp->yytops.yysize-1;
2654}
2655
2656/** True iff Y0 and Y1 represent identical options at the top level.
2657 * That is, they represent the same rule applied to RHS symbols
2658 * that produce the same terminal symbols. */
2659static yybool
2660yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1)
2661{
2662 if (yyy0->yyrule == yyy1->yyrule)
2663 {
2664 yyGLRState *yys0, *yys1;
2665 int yyn;
2666 for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
2667 yyn = yyrhsLength (yyy0->yyrule);
2668 yyn > 0;
2669 yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
2670 if (yys0->yyposn != yys1->yyposn)
2671 return yyfalse;
2672 return yytrue;
2673 }
2674 else
2675 return yyfalse;
2676}
2677
2678/** Assuming identicalOptions (Y0,Y1), destructively merge the
2679 * alternative semantic values for the RHS-symbols of Y1 and Y0. */
2680static void
2681yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
2682{
2683 yyGLRState *yys0, *yys1;
2684 int yyn;
2685 for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
2686 yyn = yyrhsLength (yyy0->yyrule);
2687 yyn > 0;
2688 yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
2689 {
2690 if (yys0 == yys1)
2691 break;
2692 else if (yys0->yyresolved)
2693 {
2694 yys1->yyresolved = yytrue;
2695 yys1->yysemantics.yysval = yys0->yysemantics.yysval;
2696 }
2697 else if (yys1->yyresolved)
2698 {
2699 yys0->yyresolved = yytrue;
2700 yys0->yysemantics.yysval = yys1->yysemantics.yysval;
2701 }
2702 else
2703 {
2704 yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal;
2705 yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
2706 while (YYID (yytrue))
2707 {
2708 if (yyz1 == *yyz0p || yyz1 == YY_NULL)
2709 break;
2710 else if (*yyz0p == YY_NULL)
2711 {
2712 *yyz0p = yyz1;
2713 break;
2714 }
2715 else if (*yyz0p < yyz1)
2716 {
2717 yySemanticOption* yyz = *yyz0p;
2718 *yyz0p = yyz1;
2719 yyz1 = yyz1->yynext;
2720 (*yyz0p)->yynext = yyz;
2721 }
2722 yyz0p = &(*yyz0p)->yynext;
2723 }
2724 yys1->yysemantics.yyfirstVal = yys0->yysemantics.yyfirstVal;
2725 }
2726 }
2727}
2728
2729/** Y0 and Y1 represent two possible actions to take in a given
2730 * parsing state; return 0 if no combination is possible,
2731 * 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */
2732static int
2733yypreference (yySemanticOption* y0, yySemanticOption* y1)
2734{
2735 yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule;
2736 int p0 = yydprec[r0], p1 = yydprec[r1];
2737
2738 if (p0 == p1)
2739 {
2740 if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1])
2741 return 0;
2742 else
2743 return 1;
2744 }
2745 if (p0 == 0 || p1 == 0)
2746 return 0;
2747 if (p0 < p1)
2748 return 3;
2749 if (p1 < p0)
2750 return 2;
2751 return 0;
2752}
2753
2754static YYRESULTTAG yyresolveValue (yyGLRState* yys,
2755 yyGLRStack* yystackp, ParseState* parse_state, yyscan_t scanner);
2756
2757
2758/** Resolve the previous N states starting at and including state S. If result
2759 * != yyok, some states may have been left unresolved possibly with empty
2760 * semantic option chains. Regardless of whether result = yyok, each state
2761 * has been left with consistent data so that yydestroyGLRState can be invoked
2762 * if necessary. */
2763static YYRESULTTAG
2764yyresolveStates (yyGLRState* yys, int yyn,
2765 yyGLRStack* yystackp, ParseState* parse_state, yyscan_t scanner)
2766{
2767 if (0 < yyn)
2768 {
2769 YYASSERT (yys->yypred);
2770 YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp, parse_state, scanner));
2771 if (! yys->yyresolved)
2772 YYCHK (yyresolveValue (yys, yystackp, parse_state, scanner));
2773 }
2774 return yyok;
2775}
2776
2777/** Resolve the states for the RHS of OPT, perform its user action, and return
2778 * the semantic value and location. Regardless of whether result = yyok, all
2779 * RHS states have been destroyed (assuming the user action destroys all RHS
2780 * semantic values if invoked). */
2781static YYRESULTTAG
2782yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp,
2783 YYSTYPE* yyvalp, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner)
2784{
2785 yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
2786 int yynrhs = yyrhsLength (yyopt->yyrule);
2787 YYRESULTTAG yyflag =
2788 yyresolveStates (yyopt->yystate, yynrhs, yystackp, parse_state, scanner);
2789 if (yyflag != yyok)
2790 {
2791 yyGLRState *yys;
2792 for (yys = yyopt->yystate; yynrhs > 0; yys = yys->yypred, yynrhs -= 1)
2793 yydestroyGLRState ("Cleanup: popping", yys, parse_state, scanner);
2794 return yyflag;
2795 }
2796
2797 yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;
2798 if (yynrhs == 0)
2799 /* Set default location. */
2800 yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yyopt->yystate->yyloc;
2801 {
2802 int yychar_current = yychar;
2803 YYSTYPE yylval_current = yylval;
2804 YYLTYPE yylloc_current = yylloc;
2805 yychar = yyopt->yyrawchar;
2806 yylval = yyopt->yyval;
2807 yylloc = yyopt->yyloc;
2808 yyflag = yyuserAction (yyopt->yyrule, yynrhs,
2809 yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
2810 yystackp, yyvalp, yylocp, parse_state, scanner);
2811 yychar = yychar_current;
2812 yylval = yylval_current;
2813 yylloc = yylloc_current;
2814 }
2815 return yyflag;
2816}
2817
2818#if YYDEBUG
2819static void
2820yyreportTree (yySemanticOption* yyx, int yyindent)
2821{
2822 int yynrhs = yyrhsLength (yyx->yyrule);
2823 int yyi;
2824 yyGLRState* yys;
2825 yyGLRState* yystates[1 + YYMAXRHS];
2826 yyGLRState yyleftmost_state;
2827
2828 for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
2829 yystates[yyi] = yys;
2830 if (yys == YY_NULL)
2831 {
2832 yyleftmost_state.yyposn = 0;
2833 yystates[0] = &yyleftmost_state;
2834 }
2835 else
2836 yystates[0] = yys;
2837
2838 if (yyx->yystate->yyposn < yys->yyposn + 1)
2839 YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
2840 yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
2841 yyx->yyrule - 1);
2842 else
2843 YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
2844 yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
2845 yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1),
2846 (unsigned long int) yyx->yystate->yyposn);
2847 for (yyi = 1; yyi <= yynrhs; yyi += 1)
2848 {
2849 if (yystates[yyi]->yyresolved)
2850 {
2851 if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
2852 YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
2853 yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]));
2854 else
2855 YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
2856 yytokenName (yyrhs[yyprhs[yyx->yyrule]+yyi-1]),
2857 (unsigned long int) (yystates[yyi - 1]->yyposn + 1),
2858 (unsigned long int) yystates[yyi]->yyposn);
2859 }
2860 else
2861 yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
2862 }
2863}
2864#endif
2865
2866/*ARGSUSED*/ static YYRESULTTAG
2867yyreportAmbiguity (yySemanticOption* yyx0,
2868 yySemanticOption* yyx1, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner)
2869{
2870 YYUSE (yyx0);
2871 YYUSE (yyx1);
2872
2873#if YYDEBUG
2874 YYFPRINTF (stderr, "Ambiguity detected.\n");
2875 YYFPRINTF (stderr, "Option 1,\n");
2876 yyreportTree (yyx0, 2);
2877 YYFPRINTF (stderr, "\nOption 2,\n");
2878 yyreportTree (yyx1, 2);
2879 YYFPRINTF (stderr, "\n");
2880#endif
2881
2882 yyerror (yylocp, parse_state, scanner, YY_("syntax is ambiguous"));
2883 return yyabort;
2884}
2885
2886/** Starting at and including state S1, resolve the location for each of the
2887 * previous N1 states that is unresolved. The first semantic option of a state
2888 * is always chosen. */
2889static void
2890yyresolveLocations (yyGLRState* yys1, int yyn1,
2891 yyGLRStack *yystackp, ParseState* parse_state, yyscan_t scanner)
2892{
2893 if (0 < yyn1)
2894 {
2895 yyresolveLocations (yys1->yypred, yyn1 - 1, yystackp, parse_state, scanner);
2896 if (!yys1->yyresolved)
2897 {
2898 yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
2899 int yynrhs;
2900 yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
2901 YYASSERT (yyoption != YY_NULL);
2902 yynrhs = yyrhsLength (yyoption->yyrule);
2903 if (yynrhs > 0)
2904 {
2905 yyGLRState *yys;
2906 int yyn;
2907 yyresolveLocations (yyoption->yystate, yynrhs,
2908 yystackp, parse_state, scanner);
2909 for (yys = yyoption->yystate, yyn = yynrhs;
2910 yyn > 0;
2911 yys = yys->yypred, yyn -= 1)
2912 yyrhsloc[yyn].yystate.yyloc = yys->yyloc;
2913 }
2914 else
2915 {
2916 /* Both yyresolveAction and yyresolveLocations traverse the GSS
2917 in reverse rightmost order. It is only necessary to invoke
2918 yyresolveLocations on a subforest for which yyresolveAction
2919 would have been invoked next had an ambiguity not been
2920 detected. Thus the location of the previous state (but not
2921 necessarily the previous state itself) is guaranteed to be
2922 resolved already. */
2923 yyGLRState *yyprevious = yyoption->yystate;
2924 yyrhsloc[0].yystate.yyloc = yyprevious->yyloc;
2925 }
2926 {
2927 int yychar_current = yychar;
2928 YYSTYPE yylval_current = yylval;
2929 YYLTYPE yylloc_current = yylloc;
2930 yychar = yyoption->yyrawchar;
2931 yylval = yyoption->yyval;
2932 yylloc = yyoption->yyloc;
2933 YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
2934 yychar = yychar_current;
2935 yylval = yylval_current;
2936 yylloc = yylloc_current;
2937 }
2938 }
2939 }
2940}
2941
2942/** Resolve the ambiguity represented in state S, perform the indicated
2943 * actions, and set the semantic value of S. If result != yyok, the chain of
2944 * semantic options in S has been cleared instead or it has been left
2945 * unmodified except that redundant options may have been removed. Regardless
2946 * of whether result = yyok, S has been left with consistent data so that
2947 * yydestroyGLRState can be invoked if necessary. */
2948static YYRESULTTAG
2949yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp, ParseState* parse_state, yyscan_t scanner)
2950{
2951 yySemanticOption* yyoptionList = yys->yysemantics.yyfirstVal;
2952 yySemanticOption* yybest = yyoptionList;
2953 yySemanticOption** yypp;
2954 yybool yymerge = yyfalse;
2955 YYSTYPE yysval;
2956 YYRESULTTAG yyflag;
2957 YYLTYPE *yylocp = &yys->yyloc;
2958
2959 for (yypp = &yyoptionList->yynext; *yypp != YY_NULL; )
2960 {
2961 yySemanticOption* yyp = *yypp;
2962
2963 if (yyidenticalOptions (yybest, yyp))
2964 {
2965 yymergeOptionSets (yybest, yyp);
2966 *yypp = yyp->yynext;
2967 }
2968 else
2969 {
2970 switch (yypreference (yybest, yyp))
2971 {
2972 case 0:
2973 yyresolveLocations (yys, 1, yystackp, parse_state, scanner);
2974 return yyreportAmbiguity (yybest, yyp, yylocp, parse_state, scanner);
2975 break;
2976 case 1:
2977 yymerge = yytrue;
2978 break;
2979 case 2:
2980 break;
2981 case 3:
2982 yybest = yyp;
2983 yymerge = yyfalse;
2984 break;
2985 default:
2986 /* This cannot happen so it is not worth a YYASSERT (yyfalse),
2987 but some compilers complain if the default case is
2988 omitted. */
2989 break;
2990 }
2991 yypp = &yyp->yynext;
2992 }
2993 }
2994
2995 if (yymerge)
2996 {
2997 yySemanticOption* yyp;
2998 int yyprec = yydprec[yybest->yyrule];
2999 yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp, parse_state, scanner);
3000 if (yyflag == yyok)
3001 for (yyp = yybest->yynext; yyp != YY_NULL; yyp = yyp->yynext)
3002 {
3003 if (yyprec == yydprec[yyp->yyrule])
3004 {
3005 YYSTYPE yysval_other;
3006 YYLTYPE yydummy;
3007 yyflag = yyresolveAction (yyp, yystackp, &yysval_other, &yydummy, parse_state, scanner);
3008 if (yyflag != yyok)
3009 {
3010 yydestruct ("Cleanup: discarding incompletely merged value for",
3011 yystos[yys->yylrState],
3012 &yysval, yylocp, parse_state, scanner);
3013 break;
3014 }
3015 yyuserMerge (yymerger[yyp->yyrule], &yysval, &yysval_other);
3016 }
3017 }
3018 }
3019 else
3020 yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp, parse_state, scanner);
3021
3022 if (yyflag == yyok)
3023 {
3024 yys->yyresolved = yytrue;
3025 yys->yysemantics.yysval = yysval;
3026 }
3027 else
3028 yys->yysemantics.yyfirstVal = YY_NULL;
3029 return yyflag;
3030}
3031
3032static YYRESULTTAG
3033yyresolveStack (yyGLRStack* yystackp, ParseState* parse_state, yyscan_t scanner)
3034{
3035 if (yystackp->yysplitPoint != YY_NULL)
3036 {
3037 yyGLRState* yys;
3038 int yyn;
3039
3040 for (yyn = 0, yys = yystackp->yytops.yystates[0];
3041 yys != yystackp->yysplitPoint;
3042 yys = yys->yypred, yyn += 1)
3043 continue;
3044 YYCHK (yyresolveStates (yystackp->yytops.yystates[0], yyn, yystackp
3045 , parse_state, scanner));
3046 }
3047 return yyok;
3048}
3049
3050static void
3051yycompressStack (yyGLRStack* yystackp)
3052{
3053 yyGLRState* yyp, *yyq, *yyr;
3054
3055 if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULL)
3056 return;
3057
3058 for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULL;
3059 yyp != yystackp->yysplitPoint;
3060 yyr = yyp, yyp = yyq, yyq = yyp->yypred)
3061 yyp->yypred = yyr;
3062
3063 yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
3064 yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
3065 yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
3066 yystackp->yysplitPoint = YY_NULL;
3067 yystackp->yylastDeleted = YY_NULL;
3068
3069 while (yyr != YY_NULL)
3070 {
3071 yystackp->yynextFree->yystate = *yyr;
3072 yyr = yyr->yypred;
3073 yystackp->yynextFree->yystate.yypred = &yystackp->yynextFree[-1].yystate;
3074 yystackp->yytops.yystates[0] = &yystackp->yynextFree->yystate;
3075 yystackp->yynextFree += 1;
3076 yystackp->yyspaceLeft -= 1;
3077 }
3078}
3079
3080static YYRESULTTAG
3081yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
3082 size_t yyposn, YYLTYPE *yylocp, ParseState* parse_state, yyscan_t scanner)
3083{
3084 int yyaction;
3085 const short int* yyconflicts;
3086 yyRuleNum yyrule;
3087
3088 while (yystackp->yytops.yystates[yyk] != YY_NULL)
3089 {
3090 yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
3091 YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
3092 (unsigned long int) yyk, yystate));
3093
3094 YYASSERT (yystate != YYFINAL);
3095
3096 if (yyisDefaultedState (yystate))
3097 {
3098 yyrule = yydefaultAction (yystate);
3099 if (yyrule == 0)
3100 {
3101 YYDPRINTF ((stderr, "Stack %lu dies.\n",
3102 (unsigned long int) yyk));
3103 yymarkStackDeleted (yystackp, yyk);
3104 return yyok;
3105 }
3106 YYCHK (yyglrReduce (yystackp, yyk, yyrule, yyfalse, parse_state, scanner));
3107 }
3108 else
3109 {
3110 yySymbol yytoken;
3111 yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
3112 if (yychar == YYEMPTY)
3113 {
3114 YYDPRINTF ((stderr, "Reading a token: "));
3115 yychar = YYLEX;
3116 }
3117
3118 if (yychar <= YYEOF)
3119 {
3120 yychar = yytoken = YYEOF;
3121 YYDPRINTF ((stderr, "Now at end of input.\n"));
3122 }
3123 else
3124 {
3125 yytoken = YYTRANSLATE (yychar);
3126 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3127 }
3128
3129 yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
3130
3131 while (*yyconflicts != 0)
3132 {
3133 size_t yynewStack = yysplitStack (yystackp, yyk);
3134 YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n",
3135 (unsigned long int) yynewStack,
3136 (unsigned long int) yyk));
3137 YYCHK (yyglrReduce (yystackp, yynewStack,
3138 *yyconflicts, yyfalse, parse_state, scanner));
3139 YYCHK (yyprocessOneStack (yystackp, yynewStack,
3140 yyposn, yylocp, parse_state, scanner));
3141 yyconflicts += 1;
3142 }
3143
3144 if (yyisShiftAction (yyaction))
3145 break;
3146 else if (yyisErrorAction (yyaction))
3147 {
3148 YYDPRINTF ((stderr, "Stack %lu dies.\n",
3149 (unsigned long int) yyk));
3150 yymarkStackDeleted (yystackp, yyk);
3151 break;
3152 }
3153 else
3154 YYCHK (yyglrReduce (yystackp, yyk, -yyaction,
3155 yyfalse, parse_state, scanner));
3156 }
3157 }
3158 return yyok;
3159}
3160
3161/*ARGSUSED*/ static void
3162yyreportSyntaxError (yyGLRStack* yystackp, ParseState* parse_state, yyscan_t scanner)
3163{
3164 if (yystackp->yyerrState != 0)
3165 return;
3166#if ! YYERROR_VERBOSE
3167 yyerror (&yylloc, parse_state, scanner, YY_("syntax error"));
3168#else
3169 {
3170 yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3171 size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
3172 size_t yysize = yysize0;
3173 yybool yysize_overflow = yyfalse;
3174 char* yymsg = YY_NULL;
3175 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3176 /* Internationalized format string. */
3177 const char *yyformat = YY_NULL;
3178 /* Arguments of yyformat. */
3179 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3180 /* Number of reported tokens (one for the "unexpected", one per
3181 "expected"). */
3182 int yycount = 0;
3183
3184 /* There are many possibilities here to consider:
3185 - If this state is a consistent state with a default action, then
3186 the only way this function was invoked is if the default action
3187 is an error action. In that case, don't check for expected
3188 tokens because there are none.
3189 - The only way there can be no lookahead present (in yychar) is if
3190 this state is a consistent state with a default action. Thus,
3191 detecting the absence of a lookahead is sufficient to determine
3192 that there is no unexpected or expected token to report. In that
3193 case, just report a simple "syntax error".
3194 - Don't assume there isn't a lookahead just because this state is a
3195 consistent state with a default action. There might have been a
3196 previous inconsistent state, consistent state with a non-default
3197 action, or user semantic action that manipulated yychar.
3198 - Of course, the expected token list depends on states to have
3199 correct lookahead information, and it depends on the parser not
3200 to perform extra reductions after fetching a lookahead from the
3201 scanner and before detecting a syntax error. Thus, state merging
3202 (from LALR or IELR) and default reductions corrupt the expected
3203 token list. However, the list is correct for canonical LR with
3204 one exception: it will still contain any token that will not be
3205 accepted due to an error action in a later state.
3206 */
3207 if (yytoken != YYEMPTY)
3208 {
3209 int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
3210 yyarg[yycount++] = yytokenName (yytoken);
3211 if (!yypact_value_is_default (yyn))
3212 {
3213 /* Start YYX at -YYN if negative to avoid negative indexes in
3214 YYCHECK. In other words, skip the first -YYN actions for this
3215 state because they are default actions. */
3216 int yyxbegin = yyn < 0 ? -yyn : 0;
3217 /* Stay within bounds of both yycheck and yytname. */
3218 int yychecklim = YYLAST - yyn + 1;
3219 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3220 int yyx;
3221 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3222 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
3223 && !yytable_value_is_error (yytable[yyx + yyn]))
3224 {
3225 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3226 {
3227 yycount = 1;
3228 yysize = yysize0;
3229 break;
3230 }
3231 yyarg[yycount++] = yytokenName (yyx);
3232 {
3233 size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
3234 yysize_overflow |= yysz < yysize;
3235 yysize = yysz;
3236 }
3237 }
3238 }
3239 }
3240
3241 switch (yycount)
3242 {
3243#define YYCASE_(N, S) \
3244 case N: \
3245 yyformat = S; \
3246 break
3247 YYCASE_(0, YY_("syntax error"));
3248 YYCASE_(1, YY_("syntax error, unexpected %s"));
3249 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
3250 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
3251 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
3252 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
3253#undef YYCASE_
3254 }
3255
3256 {
3257 size_t yysz = yysize + strlen (yyformat);
3258 yysize_overflow |= yysz < yysize;
3259 yysize = yysz;
3260 }
3261
3262 if (!yysize_overflow)
3263 yymsg = (char *) YYMALLOC (yysize);
3264
3265 if (yymsg)
3266 {
3267 char *yyp = yymsg;
3268 int yyi = 0;
3269 while ((*yyp = *yyformat))
3270 {
3271 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
3272 {
3273 yyp += yytnamerr (yyp, yyarg[yyi++]);
3274 yyformat += 2;
3275 }
3276 else
3277 {
3278 yyp++;
3279 yyformat++;
3280 }
3281 }
3282 yyerror (&yylloc, parse_state, scanner, yymsg);
3283 YYFREE (yymsg);
3284 }
3285 else
3286 {
3287 yyerror (&yylloc, parse_state, scanner, YY_("syntax error"));
3288 yyMemoryExhausted (yystackp);
3289 }
3290 }
3291#endif /* YYERROR_VERBOSE */
3292 yynerrs += 1;
3293}
3294
3295/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
3296 yylval, and yylloc are the syntactic category, semantic value, and location
3297 of the lookahead. */
3298/*ARGSUSED*/ static void
3299yyrecoverSyntaxError (yyGLRStack* yystackp, ParseState* parse_state, yyscan_t scanner)
3300{
3301 size_t yyk;
3302 int yyj;
3303
3304 if (yystackp->yyerrState == 3)
3305 /* We just shifted the error token and (perhaps) took some
3306 reductions. Skip tokens until we can proceed. */
3307 while (YYID (yytrue))
3308 {
3309 yySymbol yytoken;
3310 if (yychar == YYEOF)
3311 yyFail (yystackp, &yylloc, parse_state, scanner, YY_NULL);
3312 if (yychar != YYEMPTY)
3313 {
3314 /* We throw away the lookahead, but the error range
3315 of the shifted error token must take it into account. */
3316 yyGLRState *yys = yystackp->yytops.yystates[0];
3317 yyGLRStackItem yyerror_range[3];
3318 yyerror_range[1].yystate.yyloc = yys->yyloc;
3319 yyerror_range[2].yystate.yyloc = yylloc;
3320 YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);
3321 yytoken = YYTRANSLATE (yychar);
3322 yydestruct ("Error: discarding",
3323 yytoken, &yylval, &yylloc, parse_state, scanner);
3324 }
3325 YYDPRINTF ((stderr, "Reading a token: "));
3326 yychar = YYLEX;
3327 if (yychar <= YYEOF)
3328 {
3329 yychar = yytoken = YYEOF;
3330 YYDPRINTF ((stderr, "Now at end of input.\n"));
3331 }
3332 else
3333 {
3334 yytoken = YYTRANSLATE (yychar);
3335 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3336 }
3337 yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
3338 if (yypact_value_is_default (yyj))
3339 return;
3340 yyj += yytoken;
3341 if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
3342 {
3343 if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
3344 return;
3345 }
3346 else if (! yytable_value_is_error (yytable[yyj]))
3347 return;
3348 }
3349
3350 /* Reduce to one stack. */
3351 for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
3352 if (yystackp->yytops.yystates[yyk] != YY_NULL)
3353 break;
3354 if (yyk >= yystackp->yytops.yysize)
3355 yyFail (yystackp, &yylloc, parse_state, scanner, YY_NULL);
3356 for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
3357 yymarkStackDeleted (yystackp, yyk);
3358 yyremoveDeletes (yystackp);
3359 yycompressStack (yystackp);
3360
3361 /* Now pop stack until we find a state that shifts the error token. */
3362 yystackp->yyerrState = 3;
3363 while (yystackp->yytops.yystates[0] != YY_NULL)
3364 {
3365 yyGLRState *yys = yystackp->yytops.yystates[0];
3366 yyj = yypact[yys->yylrState];
3367 if (! yypact_value_is_default (yyj))
3368 {
3369 yyj += YYTERROR;
3370 if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
3371 && yyisShiftAction (yytable[yyj]))
3372 {
3373 /* Shift the error token. */
3374 /* First adjust its location.*/
3375 YYLTYPE yyerrloc;
3376 yystackp->yyerror_range[2].yystate.yyloc = yylloc;
3377 YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);
3378 YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
3379 &yylval, &yyerrloc);
3380 yyglrShift (yystackp, 0, yytable[yyj],
3381 yys->yyposn, &yylval, &yyerrloc);
3382 yys = yystackp->yytops.yystates[0];
3383 break;
3384 }
3385 }
3386 yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;
3387 if (yys->yypred != YY_NULL)
3388 yydestroyGLRState ("Error: popping", yys, parse_state, scanner);
3389 yystackp->yytops.yystates[0] = yys->yypred;
3390 yystackp->yynextFree -= 1;
3391 yystackp->yyspaceLeft += 1;
3392 }
3393 if (yystackp->yytops.yystates[0] == YY_NULL)
3394 yyFail (yystackp, &yylloc, parse_state, scanner, YY_NULL);
3395}
3396
3397#define YYCHK1(YYE) \
3398 do { \
3399 switch (YYE) { \
3400 case yyok: \
3401 break; \
3402 case yyabort: \
3403 goto yyabortlab; \
3404 case yyaccept: \
3405 goto yyacceptlab; \
3406 case yyerr: \
3407 goto yyuser_error; \
3408 default: \
3409 goto yybuglab; \
3410 } \
3411 } while (YYID (0))
3412
3413
3414/*----------.
3415| yyparse. |
3416`----------*/
3417
3418int
3419yyparse (ParseState* parse_state, yyscan_t scanner)
3420{
3421 int yyresult;
3422 yyGLRStack yystack;
3423 yyGLRStack* const yystackp = &yystack;
3424 size_t yyposn;
3425
3426 YYDPRINTF ((stderr, "Starting parse\n"));
3427
3428 yychar = YYEMPTY;
3429 yylval = yyval_default;
3430 yylloc = yyloc_default;
3431
3432 if (! yyinitGLRStack (yystackp, YYINITDEPTH))
3433 goto yyexhaustedlab;
3434 switch (YYSETJMP (yystack.yyexception_buffer))
3435 {
3436 case 0: break;
3437 case 1: goto yyabortlab;
3438 case 2: goto yyexhaustedlab;
3439 default: goto yybuglab;
3440 }
3441 yyglrShift (&yystack, 0, 0, 0, &yylval, &yylloc);
3442 yyposn = 0;
3443
3444 while (YYID (yytrue))
3445 {
3446 /* For efficiency, we have two loops, the first of which is
3447 specialized to deterministic operation (single stack, no
3448 potential ambiguity). */
3449 /* Standard mode */
3450 while (YYID (yytrue))
3451 {
3452 yyRuleNum yyrule;
3453 int yyaction;
3454 const short int* yyconflicts;
3455
3456 yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
3457 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3458 if (yystate == YYFINAL)
3459 goto yyacceptlab;
3460 if (yyisDefaultedState (yystate))
3461 {
3462 yyrule = yydefaultAction (yystate);
3463 if (yyrule == 0)
3464 {
3465 yystack.yyerror_range[1].yystate.yyloc = yylloc;
3466 yyreportSyntaxError (&yystack, parse_state, scanner);
3467 goto yyuser_error;
3468 }
3469 YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue, parse_state, scanner));
3470 }
3471 else
3472 {
3473 yySymbol yytoken;
3474 if (yychar == YYEMPTY)
3475 {
3476 YYDPRINTF ((stderr, "Reading a token: "));
3477 yychar = YYLEX;
3478 }
3479
3480 if (yychar <= YYEOF)
3481 {
3482 yychar = yytoken = YYEOF;
3483 YYDPRINTF ((stderr, "Now at end of input.\n"));
3484 }
3485 else
3486 {
3487 yytoken = YYTRANSLATE (yychar);
3488 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3489 }
3490
3491 yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
3492 if (*yyconflicts != 0)
3493 break;
3494 if (yyisShiftAction (yyaction))
3495 {
3496 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3497 yychar = YYEMPTY;
3498 yyposn += 1;
3499 yyglrShift (&yystack, 0, yyaction, yyposn, &yylval, &yylloc);
3500 if (0 < yystack.yyerrState)
3501 yystack.yyerrState -= 1;
3502 }
3503 else if (yyisErrorAction (yyaction))
3504 {
3505 yystack.yyerror_range[1].yystate.yyloc = yylloc;
3506 yyreportSyntaxError (&yystack, parse_state, scanner);
3507 goto yyuser_error;
3508 }
3509 else
3510 YYCHK1 (yyglrReduce (&yystack, 0, -yyaction, yytrue, parse_state, scanner));
3511 }
3512 }
3513
3514 while (YYID (yytrue))
3515 {
3516 yySymbol yytoken_to_shift;
3517 size_t yys;
3518
3519 for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
3520 yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY;
3521
3522 /* yyprocessOneStack returns one of three things:
3523
3524 - An error flag. If the caller is yyprocessOneStack, it
3525 immediately returns as well. When the caller is finally
3526 yyparse, it jumps to an error label via YYCHK1.
3527
3528 - yyok, but yyprocessOneStack has invoked yymarkStackDeleted
3529 (&yystack, yys), which sets the top state of yys to NULL. Thus,
3530 yyparse's following invocation of yyremoveDeletes will remove
3531 the stack.
3532
3533 - yyok, when ready to shift a token.
3534
3535 Except in the first case, yyparse will invoke yyremoveDeletes and
3536 then shift the next token onto all remaining stacks. This
3537 synchronization of the shift (that is, after all preceding
3538 reductions on all stacks) helps prevent double destructor calls
3539 on yylval in the event of memory exhaustion. */
3540
3541 for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
3542 YYCHK1 (yyprocessOneStack (&yystack, yys, yyposn, &yylloc, parse_state, scanner));
3543 yyremoveDeletes (&yystack);
3544 if (yystack.yytops.yysize == 0)
3545 {
3546 yyundeleteLastStack (&yystack);
3547 if (yystack.yytops.yysize == 0)
3548 yyFail (&yystack, &yylloc, parse_state, scanner, YY_("syntax error"));
3549 YYCHK1 (yyresolveStack (&yystack, parse_state, scanner));
3550 YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
3551 yystack.yyerror_range[1].yystate.yyloc = yylloc;
3552 yyreportSyntaxError (&yystack, parse_state, scanner);
3553 goto yyuser_error;
3554 }
3555
3556 /* If any yyglrShift call fails, it will fail after shifting. Thus,
3557 a copy of yylval will already be on stack 0 in the event of a
3558 failure in the following loop. Thus, yychar is set to YYEMPTY
3559 before the loop to make sure the user destructor for yylval isn't
3560 called twice. */
3561 yytoken_to_shift = YYTRANSLATE (yychar);
3562 yychar = YYEMPTY;
3563 yyposn += 1;
3564 for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
3565 {
3566 int yyaction;
3567 const short int* yyconflicts;
3568 yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState;
3569 yygetLRActions (yystate, yytoken_to_shift, &yyaction,
3570 &yyconflicts);
3571 /* Note that yyconflicts were handled by yyprocessOneStack. */
3572 YYDPRINTF ((stderr, "On stack %lu, ", (unsigned long int) yys));
3573 YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc);
3574 yyglrShift (&yystack, yys, yyaction, yyposn,
3575 &yylval, &yylloc);
3576 YYDPRINTF ((stderr, "Stack %lu now in state #%d\n",
3577 (unsigned long int) yys,
3578 yystack.yytops.yystates[yys]->yylrState));
3579 }
3580
3581 if (yystack.yytops.yysize == 1)
3582 {
3583 YYCHK1 (yyresolveStack (&yystack, parse_state, scanner));
3584 YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
3585 yycompressStack (&yystack);
3586 break;
3587 }
3588 }
3589 continue;
3590 yyuser_error:
3591 yyrecoverSyntaxError (&yystack, parse_state, scanner);
3592 yyposn = yystack.yytops.yystates[0]->yyposn;
3593 }
3594
3595 yyacceptlab:
3596 yyresult = 0;
3597 goto yyreturn;
3598
3599 yybuglab:
3600 YYASSERT (yyfalse);
3601 goto yyabortlab;
3602
3603 yyabortlab:
3604 yyresult = 1;
3605 goto yyreturn;
3606
3607 yyexhaustedlab:
3608 yyerror (&yylloc, parse_state, scanner, YY_("memory exhausted"));
3609 yyresult = 2;
3610 goto yyreturn;
3611
3612 yyreturn:
3613 if (yychar != YYEMPTY)
3614 yydestruct ("Cleanup: discarding lookahead",
3615 YYTRANSLATE (yychar), &yylval, &yylloc, parse_state, scanner);
3616
3617 /* If the stack is well-formed, pop the stack until it is empty,
3618 destroying its entries as we go. But free the stack regardless
3619 of whether it is well-formed. */
3620 if (yystack.yyitems)
3621 {
3622 yyGLRState** yystates = yystack.yytops.yystates;
3623 if (yystates)
3624 {
3625 size_t yysize = yystack.yytops.yysize;
3626 size_t yyk;
3627 for (yyk = 0; yyk < yysize; yyk += 1)
3628 if (yystates[yyk])
3629 {
3630 while (yystates[yyk])
3631 {
3632 yyGLRState *yys = yystates[yyk];
3633 yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;
3634 if (yys->yypred != YY_NULL)
3635 yydestroyGLRState ("Cleanup: popping", yys, parse_state, scanner);
3636 yystates[yyk] = yys->yypred;
3637 yystack.yynextFree -= 1;
3638 yystack.yyspaceLeft += 1;
3639 }
3640 break;
3641 }
3642 }
3643 yyfreeGLRStack (&yystack);
3644 }
3645
3646 /* Make sure YYID is used. */
3647 return YYID (yyresult);
3648}
3649
3650/* DEBUGGING ONLY */
3651#if YYDEBUG
3652static void yypstack (yyGLRStack* yystackp, size_t yyk)
3653 __attribute__ ((__unused__));
3654static void yypdumpstack (yyGLRStack* yystackp) __attribute__ ((__unused__));
3655
3656static void
3657yy_yypstack (yyGLRState* yys)
3658{
3659 if (yys->yypred)
3660 {
3661 yy_yypstack (yys->yypred);
3662 YYFPRINTF (stderr, " -> ");
3663 }
3664 YYFPRINTF (stderr, "%d@%lu", yys->yylrState,
3665 (unsigned long int) yys->yyposn);
3666}
3667
3668static void
3669yypstates (yyGLRState* yyst)
3670{
3671 if (yyst == YY_NULL)
3672 YYFPRINTF (stderr, "<null>");
3673 else
3674 yy_yypstack (yyst);
3675 YYFPRINTF (stderr, "\n");
3676}
3677
3678static void
3679yypstack (yyGLRStack* yystackp, size_t yyk)
3680{
3681 yypstates (yystackp->yytops.yystates[yyk]);
3682}
3683
3684#define YYINDEX(YYX) \
3685 ((YYX) == YY_NULL ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
3686
3687
3688static void
3689yypdumpstack (yyGLRStack* yystackp)
3690{
3691 yyGLRStackItem* yyp;
3692 size_t yyi;
3693 for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
3694 {
3695 YYFPRINTF (stderr, "%3lu. ",
3696 (unsigned long int) (yyp - yystackp->yyitems));
3697 if (*(yybool *) yyp)
3698 {
3699 YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
3700 yyp->yystate.yyresolved, yyp->yystate.yylrState,
3701 (unsigned long int) yyp->yystate.yyposn,
3702 (long int) YYINDEX (yyp->yystate.yypred));
3703 if (! yyp->yystate.yyresolved)
3704 YYFPRINTF (stderr, ", firstVal: %ld",
3705 (long int) YYINDEX (yyp->yystate
3706 .yysemantics.yyfirstVal));
3707 }
3708 else
3709 {
3710 YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
3711 yyp->yyoption.yyrule - 1,
3712 (long int) YYINDEX (yyp->yyoption.yystate),
3713 (long int) YYINDEX (yyp->yyoption.yynext));
3714 }
3715 YYFPRINTF (stderr, "\n");
3716 }
3717 YYFPRINTF (stderr, "Tops:");
3718 for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
3719 YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi,
3720 (long int) YYINDEX (yystackp->yytops.yystates[yyi]));
3721 YYFPRINTF (stderr, "\n");
3722}
3723#endif
3724
3725
3726
3727void yyerror(YYLTYPE *locp, ParseState* parse_state, yyscan_t scanner, const char *msg)
3728{
3729 parse_state->hasError = 1;
3730 parse_state->errorLine = locp->first_line;
3731 parse_state->errorColumn = locp->first_column;
3732 parse_state->errorMessage = mmalloc_strdup(parse_state->memContext, msg);
3733 parse_state->errorFile = locp->filename;
3734}