66c8dd9a66373be056616095e146faa2797999b7
[reactos.git] / dll / win32 / msxml3 / xslpattern.tab.c
1 /* A Bison parser, made by GNU Bison 3.0.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2013 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 LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.2"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 1
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse xslpattern_parse
64 #define yylex xslpattern_lex
65 #define yyerror xslpattern_error
66 #define yydebug xslpattern_debug
67 #define yynerrs xslpattern_nerrs
68
69
70 /* Copy the first part of user declarations. */
71 #line 21 "xslpattern.y" /* yacc.c:339 */
72
73 #include "precomp.h"
74
75 #include <wine/port.h>
76
77 #ifdef HAVE_LIBXML2
78 #include "xslpattern.h"
79 #include <libxml/xpathInternals.h>
80
81 static const xmlChar NameTest_mod_pre[] = "*[name()='";
82 static const xmlChar NameTest_mod_post[] = "']";
83
84 #define U(str) BAD_CAST str
85
86 static inline BOOL is_literal(xmlChar const* tok)
87 {
88 return (tok && tok[0] && tok[1] &&
89 tok[0]== tok[xmlStrlen(tok)-1] &&
90 (tok[0] == '\'' || tok[0] == '"'));
91 }
92
93 static void xslpattern_error(parser_param* param, void const* scanner, char const* msg)
94 {
95 FIXME("%s:\n"
96 " param {\n"
97 " yyscanner=%p\n"
98 " ctx=%p\n"
99 " in=\"%s\"\n"
100 " pos=%i\n"
101 " len=%i\n"
102 " out=\"%s\"\n"
103 " err=%i\n"
104 " }\n"
105 " scanner=%p\n",
106 msg, param->yyscanner, param->ctx, param->in, param->pos,
107 param->len, param->out, ++param->err, scanner);
108 }
109
110
111 #line 115 "xslpattern.tab.c" /* yacc.c:339 */
112
113 # ifndef YY_NULLPTR
114 # if defined __cplusplus && 201103L <= __cplusplus
115 # define YY_NULLPTR nullptr
116 # else
117 # define YY_NULLPTR 0
118 # endif
119 # endif
120
121 /* Enabling verbose error messages. */
122 #ifdef YYERROR_VERBOSE
123 # undef YYERROR_VERBOSE
124 # define YYERROR_VERBOSE 1
125 #else
126 # define YYERROR_VERBOSE 0
127 #endif
128
129
130 /* Debug traces. */
131 #ifndef YYDEBUG
132 # define YYDEBUG 0
133 #endif
134 #if YYDEBUG
135 extern int xslpattern_debug;
136 #endif
137
138 /* Token type. */
139 #ifndef YYTOKENTYPE
140 # define YYTOKENTYPE
141 enum yytokentype
142 {
143 TOK_Parent = 258,
144 TOK_Self = 259,
145 TOK_DblFSlash = 260,
146 TOK_FSlash = 261,
147 TOK_Axis = 262,
148 TOK_Colon = 263,
149 TOK_OpAnd = 264,
150 TOK_OpOr = 265,
151 TOK_OpNot = 266,
152 TOK_OpEq = 267,
153 TOK_OpIEq = 268,
154 TOK_OpNEq = 269,
155 TOK_OpINEq = 270,
156 TOK_OpLt = 271,
157 TOK_OpILt = 272,
158 TOK_OpGt = 273,
159 TOK_OpIGt = 274,
160 TOK_OpLEq = 275,
161 TOK_OpILEq = 276,
162 TOK_OpGEq = 277,
163 TOK_OpIGEq = 278,
164 TOK_OpAll = 279,
165 TOK_OpAny = 280,
166 TOK_NCName = 281,
167 TOK_Literal = 282,
168 TOK_Number = 283
169 };
170 #endif
171
172 /* Value type. */
173 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
174 typedef int YYSTYPE;
175 # define YYSTYPE_IS_TRIVIAL 1
176 # define YYSTYPE_IS_DECLARED 1
177 #endif
178
179
180
181 int xslpattern_parse (parser_param* p, void* scanner);
182
183
184
185 /* Copy the second part of user declarations. */
186
187 #line 191 "xslpattern.tab.c" /* yacc.c:358 */
188
189 #ifdef short
190 # undef short
191 #endif
192
193 #ifdef YYTYPE_UINT8
194 typedef YYTYPE_UINT8 yytype_uint8;
195 #else
196 typedef unsigned char yytype_uint8;
197 #endif
198
199 #ifdef YYTYPE_INT8
200 typedef YYTYPE_INT8 yytype_int8;
201 #else
202 typedef signed char yytype_int8;
203 #endif
204
205 #ifdef YYTYPE_UINT16
206 typedef YYTYPE_UINT16 yytype_uint16;
207 #else
208 typedef unsigned short int yytype_uint16;
209 #endif
210
211 #ifdef YYTYPE_INT16
212 typedef YYTYPE_INT16 yytype_int16;
213 #else
214 typedef short int yytype_int16;
215 #endif
216
217 #ifndef YYSIZE_T
218 # ifdef __SIZE_TYPE__
219 # define YYSIZE_T __SIZE_TYPE__
220 # elif defined size_t
221 # define YYSIZE_T size_t
222 # elif ! defined YYSIZE_T
223 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
224 # define YYSIZE_T size_t
225 # else
226 # define YYSIZE_T unsigned int
227 # endif
228 #endif
229
230 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
231
232 #ifndef YY_
233 # if defined YYENABLE_NLS && YYENABLE_NLS
234 # if ENABLE_NLS
235 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
236 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
237 # endif
238 # endif
239 # ifndef YY_
240 # define YY_(Msgid) Msgid
241 # endif
242 #endif
243
244 #ifndef YY_ATTRIBUTE
245 # if (defined __GNUC__ \
246 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
247 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
248 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
249 # else
250 # define YY_ATTRIBUTE(Spec) /* empty */
251 # endif
252 #endif
253
254 #ifndef YY_ATTRIBUTE_PURE
255 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
256 #endif
257
258 #ifndef YY_ATTRIBUTE_UNUSED
259 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
260 #endif
261
262 #if !defined _Noreturn \
263 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
264 # if defined _MSC_VER && 1200 <= _MSC_VER
265 # define _Noreturn __declspec (noreturn)
266 # else
267 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
268 # endif
269 #endif
270
271 /* Suppress unused-variable warnings by "using" E. */
272 #if ! defined lint || defined __GNUC__
273 # define YYUSE(E) ((void) (E))
274 #else
275 # define YYUSE(E) /* empty */
276 #endif
277
278 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
279 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
280 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
281 _Pragma ("GCC diagnostic push") \
282 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
283 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
284 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
285 _Pragma ("GCC diagnostic pop")
286 #else
287 # define YY_INITIAL_VALUE(Value) Value
288 #endif
289 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
290 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
291 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
292 #endif
293 #ifndef YY_INITIAL_VALUE
294 # define YY_INITIAL_VALUE(Value) /* Nothing. */
295 #endif
296
297
298 #if ! defined yyoverflow || YYERROR_VERBOSE
299
300 /* The parser invokes alloca or malloc; define the necessary symbols. */
301
302 # ifdef YYSTACK_USE_ALLOCA
303 # if YYSTACK_USE_ALLOCA
304 # ifdef __GNUC__
305 # define YYSTACK_ALLOC __builtin_alloca
306 # elif defined __BUILTIN_VA_ARG_INCR
307 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
308 # elif defined _AIX
309 # define YYSTACK_ALLOC __alloca
310 # elif defined _MSC_VER
311 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
312 # define alloca _alloca
313 # else
314 # define YYSTACK_ALLOC alloca
315 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
316 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
317 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
318 # ifndef EXIT_SUCCESS
319 # define EXIT_SUCCESS 0
320 # endif
321 # endif
322 # endif
323 # endif
324 # endif
325
326 # ifdef YYSTACK_ALLOC
327 /* Pacify GCC's 'empty if-body' warning. */
328 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
329 # ifndef YYSTACK_ALLOC_MAXIMUM
330 /* The OS might guarantee only one guard page at the bottom of the stack,
331 and a page size can be as small as 4096 bytes. So we cannot safely
332 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
333 to allow for a few compiler-allocated temporary stack slots. */
334 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
335 # endif
336 # else
337 # define YYSTACK_ALLOC YYMALLOC
338 # define YYSTACK_FREE YYFREE
339 # ifndef YYSTACK_ALLOC_MAXIMUM
340 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
341 # endif
342 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
343 && ! ((defined YYMALLOC || defined malloc) \
344 && (defined YYFREE || defined free)))
345 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
346 # ifndef EXIT_SUCCESS
347 # define EXIT_SUCCESS 0
348 # endif
349 # endif
350 # ifndef YYMALLOC
351 # define YYMALLOC malloc
352 # if ! defined malloc && ! defined EXIT_SUCCESS
353 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
354 # endif
355 # endif
356 # ifndef YYFREE
357 # define YYFREE free
358 # if ! defined free && ! defined EXIT_SUCCESS
359 void free (void *); /* INFRINGES ON USER NAME SPACE */
360 # endif
361 # endif
362 # endif
363 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
364
365
366 #if (! defined yyoverflow \
367 && (! defined __cplusplus \
368 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
369
370 /* A type that is properly aligned for any stack member. */
371 union yyalloc
372 {
373 yytype_int16 yyss_alloc;
374 YYSTYPE yyvs_alloc;
375 };
376
377 /* The size of the maximum gap between one aligned stack and the next. */
378 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
379
380 /* The size of an array large to enough to hold all stacks, each with
381 N elements. */
382 # define YYSTACK_BYTES(N) \
383 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
384 + YYSTACK_GAP_MAXIMUM)
385
386 # define YYCOPY_NEEDED 1
387
388 /* Relocate STACK from its old location to the new one. The
389 local variables YYSIZE and YYSTACKSIZE give the old and new number of
390 elements in the stack, and YYPTR gives the new location of the
391 stack. Advance YYPTR to a properly aligned location for the next
392 stack. */
393 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
394 do \
395 { \
396 YYSIZE_T yynewbytes; \
397 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
398 Stack = &yyptr->Stack_alloc; \
399 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
400 yyptr += yynewbytes / sizeof (*yyptr); \
401 } \
402 while (0)
403
404 #endif
405
406 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
407 /* Copy COUNT objects from SRC to DST. The source and destination do
408 not overlap. */
409 # ifndef YYCOPY
410 # if defined __GNUC__ && 1 < __GNUC__
411 # define YYCOPY(Dst, Src, Count) \
412 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
413 # else
414 # define YYCOPY(Dst, Src, Count) \
415 do \
416 { \
417 YYSIZE_T yyi; \
418 for (yyi = 0; yyi < (Count); yyi++) \
419 (Dst)[yyi] = (Src)[yyi]; \
420 } \
421 while (0)
422 # endif
423 # endif
424 #endif /* !YYCOPY_NEEDED */
425
426 /* YYFINAL -- State number of the termination state. */
427 #define YYFINAL 58
428 /* YYLAST -- Last index in YYTABLE. */
429 #define YYLAST 176
430
431 /* YYNTOKENS -- Number of terminals. */
432 #define YYNTOKENS 38
433 /* YYNNTS -- Number of nonterminals. */
434 #define YYNNTS 39
435 /* YYNRULES -- Number of rules. */
436 #define YYNRULES 104
437 /* YYNSTATES -- Number of states. */
438 #define YYNSTATES 157
439
440 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
441 by yylex, with out-of-bounds checking. */
442 #define YYUNDEFTOK 2
443 #define YYMAXUTOK 283
444
445 #define YYTRANSLATE(YYX) \
446 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
447
448 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
449 as returned by yylex, without out-of-bounds checking. */
450 static const yytype_uint8 yytranslate[] =
451 {
452 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 35, 2, 2, 2, 2, 2, 2,
456 33, 34, 30, 2, 36, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 29, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 31, 2, 32, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 37, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
478 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
479 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
480 25, 26, 27, 28
481 };
482
483 #if YYDEBUG
484 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
485 static const yytype_uint16 yyrline[] =
486 {
487 0, 86, 86, 96, 97, 99, 108, 119, 120, 122,
488 129, 134, 136, 137, 145, 148, 157, 164, 171, 172,
489 173, 175, 182, 189, 197, 198, 200, 205, 211, 230,
490 238, 244, 246, 255, 261, 262, 263, 266, 274, 283,
491 288, 297, 299, 300, 301, 302, 303, 304, 306, 314,
492 322, 323, 326, 385, 416, 423, 425, 428, 429, 438,
493 439, 447, 455, 457, 458, 467, 468, 470, 479, 480,
494 482, 491, 492, 494, 502, 513, 521, 533, 534, 536,
495 544, 555, 563, 574, 582, 593, 601, 615, 616, 618,
496 626, 634, 642, 648, 655, 662, 669, 676, 683, 690,
497 700, 710, 720, 730, 740
498 };
499 #endif
500
501 #if YYDEBUG || YYERROR_VERBOSE || 0
502 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
503 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
504 static const char *const yytname[] =
505 {
506 "$end", "error", "$undefined", "TOK_Parent", "TOK_Self",
507 "TOK_DblFSlash", "TOK_FSlash", "TOK_Axis", "TOK_Colon", "TOK_OpAnd",
508 "TOK_OpOr", "TOK_OpNot", "TOK_OpEq", "TOK_OpIEq", "TOK_OpNEq",
509 "TOK_OpINEq", "TOK_OpLt", "TOK_OpILt", "TOK_OpGt", "TOK_OpIGt",
510 "TOK_OpLEq", "TOK_OpILEq", "TOK_OpGEq", "TOK_OpIGEq", "TOK_OpAll",
511 "TOK_OpAny", "TOK_NCName", "TOK_Literal", "TOK_Number", "'@'", "'*'",
512 "'['", "']'", "'('", "')'", "'!'", "','", "'|'", "$accept", "XSLPattern",
513 "QName", "PrefixedName", "UnprefixedName", "LocationPath",
514 "AbsoluteLocationPath", "RelativeLocationPath", "Step", "AxisSpecifier",
515 "Attribute", "NodeTest", "NameTest", "Predicates", "Predicate",
516 "PredicateExpr", "AbbreviatedAbsoluteLocationPath",
517 "AbbreviatedRelativeLocationPath", "AbbreviatedStep", "Expr", "BoolExpr",
518 "PrimaryExpr", "FunctionCall", "Arguments", "Argument", "UnionExpr",
519 "PathExpr", "FilterExpr", "OrExpr", "BoolOrExpr", "AndExpr",
520 "BoolAndExpr", "EqualityExpr", "BoolEqualityExpr", "RelationalExpr",
521 "BoolRelationalExpr", "UnaryExpr", "BoolUnaryExpr", "AllExpr", YY_NULLPTR
522 };
523 #endif
524
525 # ifdef YYPRINT
526 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
527 (internal) symbol number NUM (which must be that of a token). */
528 static const yytype_uint16 yytoknum[] =
529 {
530 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
531 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
532 275, 276, 277, 278, 279, 280, 281, 282, 283, 64,
533 42, 91, 93, 40, 41, 33, 44, 124
534 };
535 # endif
536
537 #define YYPACT_NINF -34
538
539 #define yypact_value_is_default(Yystate) \
540 (!!((Yystate) == (-34)))
541
542 #define YYTABLE_NINF -67
543
544 #define yytable_value_is_error(Yytable_value) \
545 0
546
547 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
548 STATE-NUM. */
549 static const yytype_int16 yypact[] =
550 {
551 20, -34, -34, 25, 25, 20, 106, 20, 0, -34,
552 -34, -21, -34, 20, 10, -17, -34, -12, -34, -34,
553 52, -34, -8, -34, 28, -34, -34, -34, -34, -34,
554 -34, -34, -10, 27, 35, 55, -34, 21, -34, 58,
555 -34, 136, -34, -34, -34, 52, 52, -34, 128, -34,
556 -34, -34, 26, 59, -34, -34, -34, 40, -34, 9,
557 25, 25, 105, 28, 97, 28, -34, 106, 88, 25,
558 25, -34, 20, 20, 20, 20, 20, 20, 20, 20,
559 20, 20, 20, 20, 20, 20, 106, 106, 106, 106,
560 106, 106, 106, 106, 106, 106, 106, 106, 82, -34,
561 90, -34, -34, -34, 83, 84, -34, -34, 28, 99,
562 86, 87, 96, -34, 129, 55, 119, 130, 132, 133,
563 134, -34, 27, -34, 52, 52, -34, 58, 136, 136,
564 136, 136, -34, -34, -34, -34, -34, -34, -34, -34,
565 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
566 27, 27, -34, -34, 20, -34, -34
567 };
568
569 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
570 Performed when YYTABLE does not specify something else to do. Zero
571 means the default is an error. */
572 static const yytype_uint8 yydefact[] =
573 {
574 0, 39, 40, 0, 10, 0, 92, 0, 6, 50,
575 51, 0, 26, 0, 0, 0, 3, 29, 59, 8,
576 7, 12, 0, 19, 18, 24, 11, 14, 20, 2,
577 63, 25, 87, 57, 62, 41, 66, 65, 69, 68,
578 72, 71, 78, 77, 88, 37, 9, 89, 0, 91,
579 90, 21, 0, 6, 23, 22, 4, 0, 1, 0,
580 0, 0, 6, 17, 0, 16, 31, 0, 0, 0,
581 0, 64, 0, 0, 0, 0, 0, 0, 0, 0,
582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
583 0, 0, 0, 0, 0, 0, 0, 0, 28, 27,
584 0, 48, 53, 56, 0, 55, 38, 13, 15, 6,
585 51, 19, 0, 34, 25, 0, 47, 69, 72, 78,
586 88, 30, 58, 49, 61, 60, 67, 70, 73, 74,
587 75, 76, 79, 80, 81, 82, 83, 84, 85, 86,
588 93, 99, 94, 100, 95, 101, 97, 103, 96, 102,
589 98, 104, 5, 52, 0, 32, 54
590 };
591
592 /* YYPGOTO[NTERM-NUM]. */
593 static const yytype_int16 yypgoto[] =
594 {
595 -34, -34, 126, -34, -5, -34, -34, -1, 44, -34,
596 74, 138, -34, 104, -33, -34, -34, -34, -34, 4,
597 -34, -34, -4, 15, -34, -34, -6, -34, 107, 108,
598 98, 109, 95, 110, 2, 111, 14, 112, -34
599 };
600
601 /* YYDEFGOTO[NTERM-NUM]. */
602 static const yytype_int8 yydefgoto[] =
603 {
604 -1, 14, 15, 16, 17, 18, 19, 20, 21, 22,
605 23, 24, 25, 65, 66, 112, 26, 27, 28, 103,
606 113, 30, 31, 104, 105, 32, 33, 34, 35, 36,
607 37, 38, 39, 40, 41, 42, 43, 44, 49
608 };
609
610 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
611 positive, shift that token. If negative, reduce the rule whose
612 number is the opposite. If YYTABLE_NINF, syntax error. */
613 static const yytype_int16 yytable[] =
614 {
615 48, 71, 45, 46, 29, 53, 56, 51, 52, 54,
616 58, 50, 1, 2, 3, 4, 59, 57, 62, 47,
617 5, -4, 12, 1, 2, 3, 4, 67, 1, 2,
618 73, 5, 121, 6, 7, 8, 9, 10, 11, 12,
619 69, 70, 13, 102, 6, 7, 8, 9, 10, 11,
620 12, 8, 98, 13, 11, 12, 99, 60, 61, 64,
621 114, 122, 68, 56, 123, 72, 64, 100, 124, 125,
622 74, 75, 76, 77, 101, 121, 128, 129, 130, 131,
623 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
624 150, 151, 132, 133, 134, 135, 136, 137, 138, 139,
625 1, 2, 3, 4, 106, 107, 51, 52, 5, 1,
626 2, 3, 4, 52, 53, -5, 152, 153, -33, -35,
627 154, 6, 7, 109, 9, 110, 11, 12, 155, -66,
628 13, -36, 8, 9, 10, 11, 12, 55, 111, 13,
629 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
630 96, 97, 78, 79, 80, 81, 82, 83, 84, 85,
631 63, -42, -46, 68, -45, -44, -43, 108, 127, 156,
632 126, 115, 116, 117, 118, 119, 120
633 };
634
635 static const yytype_uint8 yycheck[] =
636 {
637 6, 34, 3, 4, 0, 26, 11, 7, 8, 30,
638 0, 7, 3, 4, 5, 6, 33, 13, 26, 5,
639 11, 33, 30, 3, 4, 5, 6, 37, 3, 4,
640 9, 11, 65, 24, 25, 26, 27, 28, 29, 30,
641 5, 6, 33, 34, 24, 25, 26, 27, 28, 29,
642 30, 26, 26, 33, 29, 30, 30, 5, 6, 31,
643 64, 67, 35, 68, 68, 10, 31, 8, 69, 70,
644 12, 13, 14, 15, 34, 108, 74, 75, 76, 77,
645 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
646 96, 97, 78, 79, 80, 81, 82, 83, 84, 85,
647 3, 4, 5, 6, 60, 61, 7, 8, 11, 3,
648 4, 5, 6, 8, 26, 33, 26, 34, 32, 32,
649 36, 24, 25, 26, 27, 28, 29, 30, 32, 10,
650 33, 32, 26, 27, 28, 29, 30, 11, 64, 33,
651 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
652 22, 23, 16, 17, 18, 19, 20, 21, 22, 23,
653 22, 32, 32, 35, 32, 32, 32, 63, 73, 154,
654 72, 64, 64, 64, 64, 64, 64
655 };
656
657 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
658 symbol of state STATE-NUM. */
659 static const yytype_uint8 yystos[] =
660 {
661 0, 3, 4, 5, 6, 11, 24, 25, 26, 27,
662 28, 29, 30, 33, 39, 40, 41, 42, 43, 44,
663 45, 46, 47, 48, 49, 50, 54, 55, 56, 57,
664 59, 60, 63, 64, 65, 66, 67, 68, 69, 70,
665 71, 72, 73, 74, 75, 45, 45, 74, 64, 76,
666 57, 7, 8, 26, 30, 40, 42, 57, 0, 33,
667 5, 6, 26, 49, 31, 51, 52, 37, 35, 5,
668 6, 52, 10, 9, 12, 13, 14, 15, 16, 17,
669 18, 19, 20, 21, 22, 23, 12, 13, 14, 15,
670 16, 17, 18, 19, 20, 21, 22, 23, 26, 30,
671 8, 34, 34, 57, 61, 62, 46, 46, 51, 26,
672 28, 48, 53, 58, 60, 66, 67, 69, 71, 73,
673 75, 52, 64, 60, 45, 45, 68, 70, 72, 72,
674 72, 72, 74, 74, 74, 74, 74, 74, 74, 74,
675 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
676 64, 64, 26, 34, 36, 32, 61
677 };
678
679 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
680 static const yytype_uint8 yyr1[] =
681 {
682 0, 38, 39, 40, 40, 41, 42, 43, 43, 44,
683 44, 44, 45, 45, 45, 46, 46, 46, 46, 46,
684 46, 47, 48, 48, 49, 49, 50, 50, 50, 50,
685 51, 51, 52, 53, 53, 53, 53, 54, 55, 56,
686 56, 57, 58, 58, 58, 58, 58, 58, 59, 59,
687 59, 59, 60, 60, 61, 61, 62, 63, 63, 64,
688 64, 64, 64, 65, 65, 66, 66, 67, 68, 68,
689 69, 70, 70, 71, 71, 71, 71, 72, 72, 73,
690 73, 73, 73, 73, 73, 73, 73, 74, 74, 75,
691 75, 75, 75, 76, 76, 76, 76, 76, 76, 76,
692 76, 76, 76, 76, 76
693 };
694
695 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
696 static const yytype_uint8 yyr2[] =
697 {
698 0, 2, 1, 1, 1, 3, 1, 1, 1, 2,
699 1, 1, 1, 3, 1, 3, 2, 2, 1, 1,
700 1, 2, 2, 2, 1, 1, 1, 3, 3, 1,
701 2, 1, 3, 1, 1, 1, 1, 2, 3, 1,
702 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
703 1, 1, 4, 3, 3, 1, 1, 1, 3, 1,
704 3, 3, 1, 1, 2, 1, 1, 3, 1, 1,
705 3, 1, 1, 3, 3, 3, 3, 1, 1, 3,
706 3, 3, 3, 3, 3, 3, 3, 1, 1, 2,
707 2, 2, 1, 3, 3, 3, 3, 3, 3, 3,
708 3, 3, 3, 3, 3
709 };
710
711
712 #define yyerrok (yyerrstatus = 0)
713 #define yyclearin (yychar = YYEMPTY)
714 #define YYEMPTY (-2)
715 #define YYEOF 0
716
717 #define YYACCEPT goto yyacceptlab
718 #define YYABORT goto yyabortlab
719 #define YYERROR goto yyerrorlab
720
721
722 #define YYRECOVERING() (!!yyerrstatus)
723
724 #define YYBACKUP(Token, Value) \
725 do \
726 if (yychar == YYEMPTY) \
727 { \
728 yychar = (Token); \
729 yylval = (Value); \
730 YYPOPSTACK (yylen); \
731 yystate = *yyssp; \
732 goto yybackup; \
733 } \
734 else \
735 { \
736 yyerror (p, scanner, YY_("syntax error: cannot back up")); \
737 YYERROR; \
738 } \
739 while (0)
740
741 /* Error token number */
742 #define YYTERROR 1
743 #define YYERRCODE 256
744
745
746
747 /* Enable debugging if requested. */
748 #if YYDEBUG
749
750 # ifndef YYFPRINTF
751 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
752 # define YYFPRINTF fprintf
753 # endif
754
755 # define YYDPRINTF(Args) \
756 do { \
757 if (yydebug) \
758 YYFPRINTF Args; \
759 } while (0)
760
761 /* This macro is provided for backward compatibility. */
762 #ifndef YY_LOCATION_PRINT
763 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
764 #endif
765
766
767 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
768 do { \
769 if (yydebug) \
770 { \
771 YYFPRINTF (stderr, "%s ", Title); \
772 yy_symbol_print (stderr, \
773 Type, Value, p, scanner); \
774 YYFPRINTF (stderr, "\n"); \
775 } \
776 } while (0)
777
778
779 /*----------------------------------------.
780 | Print this symbol's value on YYOUTPUT. |
781 `----------------------------------------*/
782
783 static void
784 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_param* p, void* scanner)
785 {
786 FILE *yyo = yyoutput;
787 YYUSE (yyo);
788 YYUSE (p);
789 YYUSE (scanner);
790 if (!yyvaluep)
791 return;
792 # ifdef YYPRINT
793 if (yytype < YYNTOKENS)
794 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
795 # endif
796 YYUSE (yytype);
797 }
798
799
800 /*--------------------------------.
801 | Print this symbol on YYOUTPUT. |
802 `--------------------------------*/
803
804 static void
805 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_param* p, void* scanner)
806 {
807 YYFPRINTF (yyoutput, "%s %s (",
808 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
809
810 yy_symbol_value_print (yyoutput, yytype, yyvaluep, p, scanner);
811 YYFPRINTF (yyoutput, ")");
812 }
813
814 /*------------------------------------------------------------------.
815 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
816 | TOP (included). |
817 `------------------------------------------------------------------*/
818
819 static void
820 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
821 {
822 YYFPRINTF (stderr, "Stack now");
823 for (; yybottom <= yytop; yybottom++)
824 {
825 int yybot = *yybottom;
826 YYFPRINTF (stderr, " %d", yybot);
827 }
828 YYFPRINTF (stderr, "\n");
829 }
830
831 # define YY_STACK_PRINT(Bottom, Top) \
832 do { \
833 if (yydebug) \
834 yy_stack_print ((Bottom), (Top)); \
835 } while (0)
836
837
838 /*------------------------------------------------.
839 | Report that the YYRULE is going to be reduced. |
840 `------------------------------------------------*/
841
842 static void
843 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_param* p, void* scanner)
844 {
845 unsigned long int yylno = yyrline[yyrule];
846 int yynrhs = yyr2[yyrule];
847 int yyi;
848 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
849 yyrule - 1, yylno);
850 /* The symbols being reduced. */
851 for (yyi = 0; yyi < yynrhs; yyi++)
852 {
853 YYFPRINTF (stderr, " $%d = ", yyi + 1);
854 yy_symbol_print (stderr,
855 yystos[yyssp[yyi + 1 - yynrhs]],
856 &(yyvsp[(yyi + 1) - (yynrhs)])
857 , p, scanner);
858 YYFPRINTF (stderr, "\n");
859 }
860 }
861
862 # define YY_REDUCE_PRINT(Rule) \
863 do { \
864 if (yydebug) \
865 yy_reduce_print (yyssp, yyvsp, Rule, p, scanner); \
866 } while (0)
867
868 /* Nonzero means print parse trace. It is left uninitialized so that
869 multiple parsers can coexist. */
870 int yydebug;
871 #else /* !YYDEBUG */
872 # define YYDPRINTF(Args)
873 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
874 # define YY_STACK_PRINT(Bottom, Top)
875 # define YY_REDUCE_PRINT(Rule)
876 #endif /* !YYDEBUG */
877
878
879 /* YYINITDEPTH -- initial size of the parser's stacks. */
880 #ifndef YYINITDEPTH
881 # define YYINITDEPTH 200
882 #endif
883
884 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
885 if the built-in stack extension method is used).
886
887 Do not make this value too large; the results are undefined if
888 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
889 evaluated with infinite-precision integer arithmetic. */
890
891 #ifndef YYMAXDEPTH
892 # define YYMAXDEPTH 10000
893 #endif
894
895
896 #if YYERROR_VERBOSE
897
898 # ifndef yystrlen
899 # if defined __GLIBC__ && defined _STRING_H
900 # define yystrlen strlen
901 # else
902 /* Return the length of YYSTR. */
903 static YYSIZE_T
904 yystrlen (const char *yystr)
905 {
906 YYSIZE_T yylen;
907 for (yylen = 0; yystr[yylen]; yylen++)
908 continue;
909 return yylen;
910 }
911 # endif
912 # endif
913
914 # ifndef yystpcpy
915 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
916 # define yystpcpy stpcpy
917 # else
918 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
919 YYDEST. */
920 static char *
921 yystpcpy (char *yydest, const char *yysrc)
922 {
923 char *yyd = yydest;
924 const char *yys = yysrc;
925
926 while ((*yyd++ = *yys++) != '\0')
927 continue;
928
929 return yyd - 1;
930 }
931 # endif
932 # endif
933
934 # ifndef yytnamerr
935 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
936 quotes and backslashes, so that it's suitable for yyerror. The
937 heuristic is that double-quoting is unnecessary unless the string
938 contains an apostrophe, a comma, or backslash (other than
939 backslash-backslash). YYSTR is taken from yytname. If YYRES is
940 null, do not copy; instead, return the length of what the result
941 would have been. */
942 static YYSIZE_T
943 yytnamerr (char *yyres, const char *yystr)
944 {
945 if (*yystr == '"')
946 {
947 YYSIZE_T yyn = 0;
948 char const *yyp = yystr;
949
950 for (;;)
951 switch (*++yyp)
952 {
953 case '\'':
954 case ',':
955 goto do_not_strip_quotes;
956
957 case '\\':
958 if (*++yyp != '\\')
959 goto do_not_strip_quotes;
960 /* Fall through. */
961 default:
962 if (yyres)
963 yyres[yyn] = *yyp;
964 yyn++;
965 break;
966
967 case '"':
968 if (yyres)
969 yyres[yyn] = '\0';
970 return yyn;
971 }
972 do_not_strip_quotes: ;
973 }
974
975 if (! yyres)
976 return yystrlen (yystr);
977
978 return yystpcpy (yyres, yystr) - yyres;
979 }
980 # endif
981
982 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
983 about the unexpected token YYTOKEN for the state stack whose top is
984 YYSSP.
985
986 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
987 not large enough to hold the message. In that case, also set
988 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
989 required number of bytes is too large to store. */
990 static int
991 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
992 yytype_int16 *yyssp, int yytoken)
993 {
994 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
995 YYSIZE_T yysize = yysize0;
996 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
997 /* Internationalized format string. */
998 const char *yyformat = YY_NULLPTR;
999 /* Arguments of yyformat. */
1000 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1001 /* Number of reported tokens (one for the "unexpected", one per
1002 "expected"). */
1003 int yycount = 0;
1004
1005 /* There are many possibilities here to consider:
1006 - If this state is a consistent state with a default action, then
1007 the only way this function was invoked is if the default action
1008 is an error action. In that case, don't check for expected
1009 tokens because there are none.
1010 - The only way there can be no lookahead present (in yychar) is if
1011 this state is a consistent state with a default action. Thus,
1012 detecting the absence of a lookahead is sufficient to determine
1013 that there is no unexpected or expected token to report. In that
1014 case, just report a simple "syntax error".
1015 - Don't assume there isn't a lookahead just because this state is a
1016 consistent state with a default action. There might have been a
1017 previous inconsistent state, consistent state with a non-default
1018 action, or user semantic action that manipulated yychar.
1019 - Of course, the expected token list depends on states to have
1020 correct lookahead information, and it depends on the parser not
1021 to perform extra reductions after fetching a lookahead from the
1022 scanner and before detecting a syntax error. Thus, state merging
1023 (from LALR or IELR) and default reductions corrupt the expected
1024 token list. However, the list is correct for canonical LR with
1025 one exception: it will still contain any token that will not be
1026 accepted due to an error action in a later state.
1027 */
1028 if (yytoken != YYEMPTY)
1029 {
1030 int yyn = yypact[*yyssp];
1031 yyarg[yycount++] = yytname[yytoken];
1032 if (!yypact_value_is_default (yyn))
1033 {
1034 /* Start YYX at -YYN if negative to avoid negative indexes in
1035 YYCHECK. In other words, skip the first -YYN actions for
1036 this state because they are default actions. */
1037 int yyxbegin = yyn < 0 ? -yyn : 0;
1038 /* Stay within bounds of both yycheck and yytname. */
1039 int yychecklim = YYLAST - yyn + 1;
1040 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1041 int yyx;
1042
1043 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1044 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1045 && !yytable_value_is_error (yytable[yyx + yyn]))
1046 {
1047 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1048 {
1049 yycount = 1;
1050 yysize = yysize0;
1051 break;
1052 }
1053 yyarg[yycount++] = yytname[yyx];
1054 {
1055 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1056 if (! (yysize <= yysize1
1057 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1058 return 2;
1059 yysize = yysize1;
1060 }
1061 }
1062 }
1063 }
1064
1065 switch (yycount)
1066 {
1067 # define YYCASE_(N, S) \
1068 case N: \
1069 yyformat = S; \
1070 break
1071 YYCASE_(0, YY_("syntax error"));
1072 YYCASE_(1, YY_("syntax error, unexpected %s"));
1073 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1074 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1075 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1076 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1077 # undef YYCASE_
1078 }
1079
1080 {
1081 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1082 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1083 return 2;
1084 yysize = yysize1;
1085 }
1086
1087 if (*yymsg_alloc < yysize)
1088 {
1089 *yymsg_alloc = 2 * yysize;
1090 if (! (yysize <= *yymsg_alloc
1091 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1092 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1093 return 1;
1094 }
1095
1096 /* Avoid sprintf, as that infringes on the user's name space.
1097 Don't have undefined behavior even if the translation
1098 produced a string with the wrong number of "%s"s. */
1099 {
1100 char *yyp = *yymsg;
1101 int yyi = 0;
1102 while ((*yyp = *yyformat) != '\0')
1103 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1104 {
1105 yyp += yytnamerr (yyp, yyarg[yyi++]);
1106 yyformat += 2;
1107 }
1108 else
1109 {
1110 yyp++;
1111 yyformat++;
1112 }
1113 }
1114 return 0;
1115 }
1116 #endif /* YYERROR_VERBOSE */
1117
1118 /*-----------------------------------------------.
1119 | Release the memory associated to this symbol. |
1120 `-----------------------------------------------*/
1121
1122 static void
1123 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_param* p, void* scanner)
1124 {
1125 YYUSE (yyvaluep);
1126 YYUSE (p);
1127 YYUSE (scanner);
1128 if (!yymsg)
1129 yymsg = "Deleting";
1130 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1131
1132 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1133 YYUSE (yytype);
1134 YY_IGNORE_MAYBE_UNINITIALIZED_END
1135 }
1136
1137
1138
1139
1140 /*----------.
1141 | yyparse. |
1142 `----------*/
1143
1144 int
1145 yyparse (parser_param* p, void* scanner)
1146 {
1147 /* The lookahead symbol. */
1148 int yychar;
1149
1150
1151 /* The semantic value of the lookahead symbol. */
1152 /* Default value used for initialization, for pacifying older GCCs
1153 or non-GCC compilers. */
1154 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1155 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1156
1157 /* Number of syntax errors so far. */
1158 int yynerrs;
1159
1160 int yystate;
1161 /* Number of tokens to shift before error messages enabled. */
1162 int yyerrstatus;
1163
1164 /* The stacks and their tools:
1165 'yyss': related to states.
1166 'yyvs': related to semantic values.
1167
1168 Refer to the stacks through separate pointers, to allow yyoverflow
1169 to reallocate them elsewhere. */
1170
1171 /* The state stack. */
1172 yytype_int16 yyssa[YYINITDEPTH];
1173 yytype_int16 *yyss;
1174 yytype_int16 *yyssp;
1175
1176 /* The semantic value stack. */
1177 YYSTYPE yyvsa[YYINITDEPTH];
1178 YYSTYPE *yyvs;
1179 YYSTYPE *yyvsp;
1180
1181 YYSIZE_T yystacksize;
1182
1183 int yyn;
1184 int yyresult;
1185 /* Lookahead token as an internal (translated) token number. */
1186 int yytoken = 0;
1187 /* The variables used to return semantic value and location from the
1188 action routines. */
1189 YYSTYPE yyval;
1190
1191 #if YYERROR_VERBOSE
1192 /* Buffer for error messages, and its allocated size. */
1193 char yymsgbuf[128];
1194 char *yymsg = yymsgbuf;
1195 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1196 #endif
1197
1198 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1199
1200 /* The number of symbols on the RHS of the reduced rule.
1201 Keep to zero when no symbol should be popped. */
1202 int yylen = 0;
1203
1204 yyssp = yyss = yyssa;
1205 yyvsp = yyvs = yyvsa;
1206 yystacksize = YYINITDEPTH;
1207
1208 YYDPRINTF ((stderr, "Starting parse\n"));
1209
1210 yystate = 0;
1211 yyerrstatus = 0;
1212 yynerrs = 0;
1213 yychar = YYEMPTY; /* Cause a token to be read. */
1214 goto yysetstate;
1215
1216 /*------------------------------------------------------------.
1217 | yynewstate -- Push a new state, which is found in yystate. |
1218 `------------------------------------------------------------*/
1219 yynewstate:
1220 /* In all cases, when you get here, the value and location stacks
1221 have just been pushed. So pushing a state here evens the stacks. */
1222 yyssp++;
1223
1224 yysetstate:
1225 *yyssp = yystate;
1226
1227 if (yyss + yystacksize - 1 <= yyssp)
1228 {
1229 /* Get the current used size of the three stacks, in elements. */
1230 YYSIZE_T yysize = yyssp - yyss + 1;
1231
1232 #ifdef yyoverflow
1233 {
1234 /* Give user a chance to reallocate the stack. Use copies of
1235 these so that the &'s don't force the real ones into
1236 memory. */
1237 YYSTYPE *yyvs1 = yyvs;
1238 yytype_int16 *yyss1 = yyss;
1239
1240 /* Each stack pointer address is followed by the size of the
1241 data in use in that stack, in bytes. This used to be a
1242 conditional around just the two extra args, but that might
1243 be undefined if yyoverflow is a macro. */
1244 yyoverflow (YY_("memory exhausted"),
1245 &yyss1, yysize * sizeof (*yyssp),
1246 &yyvs1, yysize * sizeof (*yyvsp),
1247 &yystacksize);
1248
1249 yyss = yyss1;
1250 yyvs = yyvs1;
1251 }
1252 #else /* no yyoverflow */
1253 # ifndef YYSTACK_RELOCATE
1254 goto yyexhaustedlab;
1255 # else
1256 /* Extend the stack our own way. */
1257 if (YYMAXDEPTH <= yystacksize)
1258 goto yyexhaustedlab;
1259 yystacksize *= 2;
1260 if (YYMAXDEPTH < yystacksize)
1261 yystacksize = YYMAXDEPTH;
1262
1263 {
1264 yytype_int16 *yyss1 = yyss;
1265 union yyalloc *yyptr =
1266 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1267 if (! yyptr)
1268 goto yyexhaustedlab;
1269 YYSTACK_RELOCATE (yyss_alloc, yyss);
1270 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1271 # undef YYSTACK_RELOCATE
1272 if (yyss1 != yyssa)
1273 YYSTACK_FREE (yyss1);
1274 }
1275 # endif
1276 #endif /* no yyoverflow */
1277
1278 yyssp = yyss + yysize - 1;
1279 yyvsp = yyvs + yysize - 1;
1280
1281 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1282 (unsigned long int) yystacksize));
1283
1284 if (yyss + yystacksize - 1 <= yyssp)
1285 YYABORT;
1286 }
1287
1288 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1289
1290 if (yystate == YYFINAL)
1291 YYACCEPT;
1292
1293 goto yybackup;
1294
1295 /*-----------.
1296 | yybackup. |
1297 `-----------*/
1298 yybackup:
1299
1300 /* Do appropriate processing given the current state. Read a
1301 lookahead token if we need one and don't already have one. */
1302
1303 /* First try to decide what to do without reference to lookahead token. */
1304 yyn = yypact[yystate];
1305 if (yypact_value_is_default (yyn))
1306 goto yydefault;
1307
1308 /* Not known => get a lookahead token if don't already have one. */
1309
1310 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1311 if (yychar == YYEMPTY)
1312 {
1313 YYDPRINTF ((stderr, "Reading a token: "));
1314 yychar = yylex (&yylval, scanner);
1315 }
1316
1317 if (yychar <= YYEOF)
1318 {
1319 yychar = yytoken = YYEOF;
1320 YYDPRINTF ((stderr, "Now at end of input.\n"));
1321 }
1322 else
1323 {
1324 yytoken = YYTRANSLATE (yychar);
1325 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1326 }
1327
1328 /* If the proper action on seeing token YYTOKEN is to reduce or to
1329 detect an error, take that action. */
1330 yyn += yytoken;
1331 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1332 goto yydefault;
1333 yyn = yytable[yyn];
1334 if (yyn <= 0)
1335 {
1336 if (yytable_value_is_error (yyn))
1337 goto yyerrlab;
1338 yyn = -yyn;
1339 goto yyreduce;
1340 }
1341
1342 /* Count tokens shifted since error; after three, turn off error
1343 status. */
1344 if (yyerrstatus)
1345 yyerrstatus--;
1346
1347 /* Shift the lookahead token. */
1348 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1349
1350 /* Discard the shifted token. */
1351 yychar = YYEMPTY;
1352
1353 yystate = yyn;
1354 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1355 *++yyvsp = yylval;
1356 YY_IGNORE_MAYBE_UNINITIALIZED_END
1357
1358 goto yynewstate;
1359
1360
1361 /*-----------------------------------------------------------.
1362 | yydefault -- do the default action for the current state. |
1363 `-----------------------------------------------------------*/
1364 yydefault:
1365 yyn = yydefact[yystate];
1366 if (yyn == 0)
1367 goto yyerrlab;
1368 goto yyreduce;
1369
1370
1371 /*-----------------------------.
1372 | yyreduce -- Do a reduction. |
1373 `-----------------------------*/
1374 yyreduce:
1375 /* yyn is the number of a rule to reduce with. */
1376 yylen = yyr2[yyn];
1377
1378 /* If YYLEN is nonzero, implement the default value of the action:
1379 '$$ = $1'.
1380
1381 Otherwise, the following line sets YYVAL to garbage.
1382 This behavior is undocumented and Bison
1383 users should not rely upon it. Assigning to YYVAL
1384 unconditionally makes the parser a bit smaller, and it avoids a
1385 GCC warning that YYVAL may be used uninitialized. */
1386 yyval = yyvsp[1-yylen];
1387
1388
1389 YY_REDUCE_PRINT (yyn);
1390 switch (yyn)
1391 {
1392 case 2:
1393 #line 87 "xslpattern.y" /* yacc.c:1646 */
1394 {
1395 p->out = (yyvsp[0]);
1396 }
1397 #line 1401 "xslpattern.tab.c" /* yacc.c:1646 */
1398 break;
1399
1400 case 5:
1401 #line 100 "xslpattern.y" /* yacc.c:1646 */
1402 {
1403 TRACE("Got PrefixedName: \"%s:%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1404 (yyval)=(yyvsp[-2]);
1405 (yyval)=xmlStrcat((yyval),U(":"));
1406 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1407 xmlFree((yyvsp[0]));
1408 }
1409 #line 1413 "xslpattern.tab.c" /* yacc.c:1646 */
1410 break;
1411
1412 case 6:
1413 #line 109 "xslpattern.y" /* yacc.c:1646 */
1414 {
1415 TRACE("Got UnprefixedName: \"%s\"\n", (yyvsp[0]));
1416 (yyval)=(yyvsp[0]);
1417 }
1418 #line 1422 "xslpattern.tab.c" /* yacc.c:1646 */
1419 break;
1420
1421 case 9:
1422 #line 123 "xslpattern.y" /* yacc.c:1646 */
1423 {
1424 TRACE("Got AbsoluteLocationPath: \"/%s\"\n", (yyvsp[0]));
1425 (yyval)=xmlStrdup(U("/"));
1426 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1427 xmlFree((yyvsp[0]));
1428 }
1429 #line 1433 "xslpattern.tab.c" /* yacc.c:1646 */
1430 break;
1431
1432 case 10:
1433 #line 130 "xslpattern.y" /* yacc.c:1646 */
1434 {
1435 TRACE("Got AbsoluteLocationPath: \"/\"\n");
1436 (yyval)=xmlStrdup(U("/"));
1437 }
1438 #line 1442 "xslpattern.tab.c" /* yacc.c:1646 */
1439 break;
1440
1441 case 13:
1442 #line 138 "xslpattern.y" /* yacc.c:1646 */
1443 {
1444 TRACE("Got RelativeLocationPath: \"%s/%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1445 (yyval)=(yyvsp[-2]);
1446 (yyval)=xmlStrcat((yyval),U("/"));
1447 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1448 xmlFree((yyvsp[0]));
1449 }
1450 #line 1454 "xslpattern.tab.c" /* yacc.c:1646 */
1451 break;
1452
1453 case 15:
1454 #line 149 "xslpattern.y" /* yacc.c:1646 */
1455 {
1456 TRACE("Got Step: \"%s%s%s\"\n", (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]));
1457 (yyval)=(yyvsp[-2]);
1458 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1459 xmlFree((yyvsp[-1]));
1460 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1461 xmlFree((yyvsp[0]));
1462 }
1463 #line 1467 "xslpattern.tab.c" /* yacc.c:1646 */
1464 break;
1465
1466 case 16:
1467 #line 158 "xslpattern.y" /* yacc.c:1646 */
1468 {
1469 TRACE("Got Step: \"%s%s\"\n", (yyvsp[-1]), (yyvsp[0]));
1470 (yyval)=(yyvsp[-1]);
1471 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1472 xmlFree((yyvsp[0]));
1473 }
1474 #line 1478 "xslpattern.tab.c" /* yacc.c:1646 */
1475 break;
1476
1477 case 17:
1478 #line 165 "xslpattern.y" /* yacc.c:1646 */
1479 {
1480 TRACE("Got Step: \"%s%s\"\n", (yyvsp[-1]), (yyvsp[0]));
1481 (yyval)=(yyvsp[-1]);
1482 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1483 xmlFree((yyvsp[0]));
1484 }
1485 #line 1489 "xslpattern.tab.c" /* yacc.c:1646 */
1486 break;
1487
1488 case 21:
1489 #line 176 "xslpattern.y" /* yacc.c:1646 */
1490 {
1491 TRACE("Got AxisSpecifier: \"%s::\"\n", (yyvsp[-1]));
1492 (yyval)=(yyvsp[-1]);
1493 (yyval)=xmlStrcat((yyval),U("::"));
1494 }
1495 #line 1499 "xslpattern.tab.c" /* yacc.c:1646 */
1496 break;
1497
1498 case 22:
1499 #line 183 "xslpattern.y" /* yacc.c:1646 */
1500 {
1501 TRACE("Got Attribute: \"@%s\"\n", (yyvsp[0]));
1502 (yyval)=xmlStrdup(U("@"));
1503 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1504 xmlFree((yyvsp[0]));
1505 }
1506 #line 1510 "xslpattern.tab.c" /* yacc.c:1646 */
1507 break;
1508
1509 case 23:
1510 #line 190 "xslpattern.y" /* yacc.c:1646 */
1511 {
1512 TRACE("Got All attributes pattern: \"@*\"\n");
1513 (yyval)=xmlStrdup(U("@*"));
1514 }
1515 #line 1519 "xslpattern.tab.c" /* yacc.c:1646 */
1516 break;
1517
1518 case 26:
1519 #line 201 "xslpattern.y" /* yacc.c:1646 */
1520 {
1521 TRACE("Got NameTest: \"*\"\n");
1522 (yyval)=xmlStrdup(U("*"));
1523 }
1524 #line 1528 "xslpattern.tab.c" /* yacc.c:1646 */
1525 break;
1526
1527 case 27:
1528 #line 206 "xslpattern.y" /* yacc.c:1646 */
1529 {
1530 TRACE("Got NameTest: \"%s:*\"\n", (yyvsp[-2]));
1531 (yyval)=(yyvsp[-2]);
1532 (yyval)=xmlStrcat((yyval),U(":*"));
1533 }
1534 #line 1538 "xslpattern.tab.c" /* yacc.c:1646 */
1535 break;
1536
1537 case 28:
1538 #line 212 "xslpattern.y" /* yacc.c:1646 */
1539 { /* PrefixedName */
1540 xmlChar const* registeredNsURI = xmlXPathNsLookup(p->ctx, (yyvsp[-2]));
1541 TRACE("Got PrefixedName: \"%s:%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1542
1543 if (registeredNsURI)
1544 (yyval)=xmlStrdup(U(""));
1545 else
1546 (yyval)=xmlStrdup(NameTest_mod_pre);
1547
1548 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
1549 xmlFree((yyvsp[-2]));
1550 (yyval)=xmlStrcat((yyval),U(":"));
1551 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1552 xmlFree((yyvsp[0]));
1553
1554 if (!registeredNsURI)
1555 (yyval)=xmlStrcat((yyval),NameTest_mod_post);
1556 }
1557 #line 1561 "xslpattern.tab.c" /* yacc.c:1646 */
1558 break;
1559
1560 case 29:
1561 #line 231 "xslpattern.y" /* yacc.c:1646 */
1562 {
1563 (yyval)=xmlStrdup(NameTest_mod_pre);
1564 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1565 xmlFree((yyvsp[0]));
1566 (yyval)=xmlStrcat((yyval),NameTest_mod_post);
1567 }
1568 #line 1572 "xslpattern.tab.c" /* yacc.c:1646 */
1569 break;
1570
1571 case 30:
1572 #line 239 "xslpattern.y" /* yacc.c:1646 */
1573 {
1574 (yyval)=(yyvsp[-1]);
1575 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1576 xmlFree((yyvsp[0]));
1577 }
1578 #line 1582 "xslpattern.tab.c" /* yacc.c:1646 */
1579 break;
1580
1581 case 32:
1582 #line 247 "xslpattern.y" /* yacc.c:1646 */
1583 {
1584 TRACE("Got Predicate: \"[%s]\"\n", (yyvsp[-1]));
1585 (yyval)=xmlStrdup(U("["));
1586 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1587 xmlFree((yyvsp[-1]));
1588 (yyval)=xmlStrcat((yyval),U("]"));
1589 }
1590 #line 1594 "xslpattern.tab.c" /* yacc.c:1646 */
1591 break;
1592
1593 case 33:
1594 #line 256 "xslpattern.y" /* yacc.c:1646 */
1595 {
1596 (yyval)=xmlStrdup(U("index()="));
1597 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1598 xmlFree((yyvsp[0]));
1599 }
1600 #line 1604 "xslpattern.tab.c" /* yacc.c:1646 */
1601 break;
1602
1603 case 37:
1604 #line 267 "xslpattern.y" /* yacc.c:1646 */
1605 {
1606 TRACE("Got AbbreviatedAbsoluteLocationPath: \"//%s\"\n", (yyvsp[0]));
1607 (yyval)=xmlStrdup(U("//"));
1608 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1609 xmlFree((yyvsp[0]));
1610 }
1611 #line 1615 "xslpattern.tab.c" /* yacc.c:1646 */
1612 break;
1613
1614 case 38:
1615 #line 275 "xslpattern.y" /* yacc.c:1646 */
1616 {
1617 TRACE("Got AbbreviatedRelativeLocationPath: \"%s//%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1618 (yyval)=(yyvsp[-2]);
1619 (yyval)=xmlStrcat((yyval),U("//"));
1620 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1621 xmlFree((yyvsp[0]));
1622 }
1623 #line 1627 "xslpattern.tab.c" /* yacc.c:1646 */
1624 break;
1625
1626 case 39:
1627 #line 284 "xslpattern.y" /* yacc.c:1646 */
1628 {
1629 TRACE("Got AbbreviatedStep: \"..\"\n");
1630 (yyval)=xmlStrdup(U(".."));
1631 }
1632 #line 1636 "xslpattern.tab.c" /* yacc.c:1646 */
1633 break;
1634
1635 case 40:
1636 #line 289 "xslpattern.y" /* yacc.c:1646 */
1637 {
1638 TRACE("Got AbbreviatedStep: \".\"\n");
1639 (yyval)=xmlStrdup(U("."));
1640 }
1641 #line 1645 "xslpattern.tab.c" /* yacc.c:1646 */
1642 break;
1643
1644 case 48:
1645 #line 307 "xslpattern.y" /* yacc.c:1646 */
1646 {
1647 TRACE("Got PrimaryExpr: \"(%s)\"\n", (yyvsp[-2]));
1648 (yyval)=xmlStrdup(U("("));
1649 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1650 xmlFree((yyvsp[-1]));
1651 (yyval)=xmlStrcat((yyval),U(")"));
1652 }
1653 #line 1657 "xslpattern.tab.c" /* yacc.c:1646 */
1654 break;
1655
1656 case 49:
1657 #line 315 "xslpattern.y" /* yacc.c:1646 */
1658 {
1659 TRACE("Got PrimaryExpr: \"%s!%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1660 (yyval)=(yyvsp[-2]);
1661 (yyval)=xmlStrcat((yyval),U("/"));
1662 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1663 xmlFree((yyvsp[0]));
1664 }
1665 #line 1669 "xslpattern.tab.c" /* yacc.c:1646 */
1666 break;
1667
1668 case 52:
1669 #line 327 "xslpattern.y" /* yacc.c:1646 */
1670 {
1671 TRACE("Got FunctionCall: \"%s(%s)\"\n", (yyvsp[-3]), (yyvsp[-1]));
1672 if (xmlStrEqual((yyvsp[-3]),U("ancestor")))
1673 {
1674 (yyval)=(yyvsp[-3]);
1675 (yyval)=xmlStrcat((yyval),U("::"));
1676 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1677 xmlFree((yyvsp[-1]));
1678 }
1679 else if (xmlStrEqual((yyvsp[-3]),U("attribute")))
1680 {
1681 if (is_literal((yyvsp[-1])))
1682 {
1683 (yyval)=xmlStrdup(U("@*[name()="));
1684 xmlFree((yyvsp[-3]));
1685 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1686 xmlFree((yyvsp[-1]));
1687 (yyval)=xmlStrcat((yyval),U("]"));
1688 }
1689 else
1690 {
1691 /* XML_XPATH_INVALID_TYPE */
1692 (yyval)=xmlStrdup(U("error(1211, 'Error: attribute("));
1693 xmlFree((yyvsp[-3]));
1694 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1695 xmlFree((yyvsp[-1]));
1696 (yyval)=xmlStrcat((yyval),U("): invalid argument')"));
1697 }
1698 }
1699 else if (xmlStrEqual((yyvsp[-3]),U("element")))
1700 {
1701 if (is_literal((yyvsp[-1])))
1702 {
1703 (yyval)=xmlStrdup(U("node()[nodeType()=1][name()="));
1704 xmlFree((yyvsp[-3]));
1705 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1706 xmlFree((yyvsp[-1]));
1707 (yyval)=xmlStrcat((yyval),U("]"));
1708 }
1709 else
1710 {
1711 /* XML_XPATH_INVALID_TYPE */
1712 (yyval)=xmlStrdup(U("error(1211, 'Error: element("));
1713 xmlFree((yyvsp[-3]));
1714 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1715 xmlFree((yyvsp[-1]));
1716 (yyval)=xmlStrcat((yyval),U("): invalid argument')"));
1717 }
1718 }
1719 else
1720 {
1721 (yyval)=(yyvsp[-3]);
1722 (yyval)=xmlStrcat((yyval),U("("));
1723 (yyval)=xmlStrcat((yyval),(yyvsp[-1]));
1724 xmlFree((yyvsp[-1]));
1725 (yyval)=xmlStrcat((yyval),U(")"));
1726 }
1727 }
1728 #line 1732 "xslpattern.tab.c" /* yacc.c:1646 */
1729 break;
1730
1731 case 53:
1732 #line 386 "xslpattern.y" /* yacc.c:1646 */
1733 {
1734 TRACE("Got FunctionCall: \"%s()\"\n", (yyvsp[-2]));
1735 /* comment() & node() work the same in XPath */
1736 if (xmlStrEqual((yyvsp[-2]),U("attribute")))
1737 {
1738 (yyval)=xmlStrdup(U("@*"));
1739 xmlFree((yyvsp[-2]));
1740 }
1741 else if (xmlStrEqual((yyvsp[-2]),U("element")))
1742 {
1743 (yyval)=xmlStrdup(U("node()[nodeType()=1]"));
1744 xmlFree((yyvsp[-2]));
1745 }
1746 else if (xmlStrEqual((yyvsp[-2]),U("pi")))
1747 {
1748 (yyval)=xmlStrdup(U("processing-instruction()"));
1749 xmlFree((yyvsp[-2]));
1750 }
1751 else if (xmlStrEqual((yyvsp[-2]),U("textnode")))
1752 {
1753 (yyval)=xmlStrdup(U("text()"));
1754 xmlFree((yyvsp[-2]));
1755 }
1756 else
1757 {
1758 (yyval)=(yyvsp[-2]);
1759 (yyval)=xmlStrcat((yyval),U("()"));
1760 }
1761 }
1762 #line 1766 "xslpattern.tab.c" /* yacc.c:1646 */
1763 break;
1764
1765 case 54:
1766 #line 417 "xslpattern.y" /* yacc.c:1646 */
1767 {
1768 (yyval)=(yyvsp[-2]);
1769 (yyval)=xmlStrcat((yyval),U(","));
1770 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1771 xmlFree((yyvsp[0]));
1772 }
1773 #line 1777 "xslpattern.tab.c" /* yacc.c:1646 */
1774 break;
1775
1776 case 58:
1777 #line 430 "xslpattern.y" /* yacc.c:1646 */
1778 {
1779 TRACE("Got UnionExpr: \"%s|%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1780 (yyval)=(yyvsp[-2]);
1781 (yyval)=xmlStrcat((yyval),U("|"));
1782 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1783 xmlFree((yyvsp[0]));
1784 }
1785 #line 1789 "xslpattern.tab.c" /* yacc.c:1646 */
1786 break;
1787
1788 case 60:
1789 #line 440 "xslpattern.y" /* yacc.c:1646 */
1790 {
1791 TRACE("Got PathExpr: \"%s/%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1792 (yyval)=(yyvsp[-2]);
1793 (yyval)=xmlStrcat((yyval),U("/"));
1794 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1795 xmlFree((yyvsp[0]));
1796 }
1797 #line 1801 "xslpattern.tab.c" /* yacc.c:1646 */
1798 break;
1799
1800 case 61:
1801 #line 448 "xslpattern.y" /* yacc.c:1646 */
1802 {
1803 TRACE("Got PathExpr: \"%s//%s\"\n", (yyvsp[-2]), (yyvsp[0]));
1804 (yyval)=(yyvsp[-2]);
1805 (yyval)=xmlStrcat((yyval),U("//"));
1806 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1807 xmlFree((yyvsp[0]));
1808 }
1809 #line 1813 "xslpattern.tab.c" /* yacc.c:1646 */
1810 break;
1811
1812 case 64:
1813 #line 459 "xslpattern.y" /* yacc.c:1646 */
1814 {
1815 TRACE("Got FilterExpr: \"%s%s\"\n", (yyvsp[-1]), (yyvsp[0]));
1816 (yyval)=(yyvsp[-1]);
1817 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1818 xmlFree((yyvsp[0]));
1819 }
1820 #line 1824 "xslpattern.tab.c" /* yacc.c:1646 */
1821 break;
1822
1823 case 67:
1824 #line 471 "xslpattern.y" /* yacc.c:1646 */
1825 {
1826 TRACE("Got OrExpr: \"%s $or$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1827 (yyval)=(yyvsp[-2]);
1828 (yyval)=xmlStrcat((yyval),U(" or "));
1829 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1830 xmlFree((yyvsp[0]));
1831 }
1832 #line 1836 "xslpattern.tab.c" /* yacc.c:1646 */
1833 break;
1834
1835 case 70:
1836 #line 483 "xslpattern.y" /* yacc.c:1646 */
1837 {
1838 TRACE("Got AndExpr: \"%s $and$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1839 (yyval)=(yyvsp[-2]);
1840 (yyval)=xmlStrcat((yyval),U(" and "));
1841 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1842 xmlFree((yyvsp[0]));
1843 }
1844 #line 1848 "xslpattern.tab.c" /* yacc.c:1646 */
1845 break;
1846
1847 case 73:
1848 #line 495 "xslpattern.y" /* yacc.c:1646 */
1849 {
1850 TRACE("Got EqualityExpr: \"%s $eq$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1851 (yyval)=(yyvsp[-2]);
1852 (yyval)=xmlStrcat((yyval),U("="));
1853 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1854 xmlFree((yyvsp[0]));
1855 }
1856 #line 1860 "xslpattern.tab.c" /* yacc.c:1646 */
1857 break;
1858
1859 case 74:
1860 #line 503 "xslpattern.y" /* yacc.c:1646 */
1861 {
1862 TRACE("Got EqualityExpr: \"%s $ieq$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1863 (yyval)=xmlStrdup(U("OP_IEq("));
1864 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
1865 xmlFree((yyvsp[-2]));
1866 (yyval)=xmlStrcat((yyval),U(","));
1867 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1868 xmlFree((yyvsp[0]));
1869 (yyval)=xmlStrcat((yyval),U(")"));
1870 }
1871 #line 1875 "xslpattern.tab.c" /* yacc.c:1646 */
1872 break;
1873
1874 case 75:
1875 #line 514 "xslpattern.y" /* yacc.c:1646 */
1876 {
1877 TRACE("Got EqualityExpr: \"%s $ne$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1878 (yyval)=(yyvsp[-2]);
1879 (yyval)=xmlStrcat((yyval),U("!="));
1880 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1881 xmlFree((yyvsp[0]));
1882 }
1883 #line 1887 "xslpattern.tab.c" /* yacc.c:1646 */
1884 break;
1885
1886 case 76:
1887 #line 522 "xslpattern.y" /* yacc.c:1646 */
1888 {
1889 TRACE("Got EqualityExpr: \"%s $ine$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1890 (yyval)=xmlStrdup(U("OP_INEq("));
1891 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
1892 xmlFree((yyvsp[-2]));
1893 (yyval)=xmlStrcat((yyval),U(","));
1894 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1895 xmlFree((yyvsp[0]));
1896 (yyval)=xmlStrcat((yyval),U(")"));
1897 }
1898 #line 1902 "xslpattern.tab.c" /* yacc.c:1646 */
1899 break;
1900
1901 case 79:
1902 #line 537 "xslpattern.y" /* yacc.c:1646 */
1903 {
1904 TRACE("Got RelationalExpr: \"%s $lt$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1905 (yyval)=(yyvsp[-2]);
1906 (yyval)=xmlStrcat((yyval),U("<"));
1907 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1908 xmlFree((yyvsp[0]));
1909 }
1910 #line 1914 "xslpattern.tab.c" /* yacc.c:1646 */
1911 break;
1912
1913 case 80:
1914 #line 545 "xslpattern.y" /* yacc.c:1646 */
1915 {
1916 TRACE("Got RelationalExpr: \"%s $ilt$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1917 (yyval)=xmlStrdup(U("OP_ILt("));
1918 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
1919 xmlFree((yyvsp[-2]));
1920 (yyval)=xmlStrcat((yyval),U(","));
1921 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1922 xmlFree((yyvsp[0]));
1923 (yyval)=xmlStrcat((yyval),U(")"));
1924 }
1925 #line 1929 "xslpattern.tab.c" /* yacc.c:1646 */
1926 break;
1927
1928 case 81:
1929 #line 556 "xslpattern.y" /* yacc.c:1646 */
1930 {
1931 TRACE("Got RelationalExpr: \"%s $gt$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1932 (yyval)=(yyvsp[-2]);
1933 (yyval)=xmlStrcat((yyval),U(">"));
1934 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1935 xmlFree((yyvsp[0]));
1936 }
1937 #line 1941 "xslpattern.tab.c" /* yacc.c:1646 */
1938 break;
1939
1940 case 82:
1941 #line 564 "xslpattern.y" /* yacc.c:1646 */
1942 {
1943 TRACE("Got RelationalExpr: \"%s $igt$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1944 (yyval)=xmlStrdup(U("OP_IGt("));
1945 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
1946 xmlFree((yyvsp[-2]));
1947 (yyval)=xmlStrcat((yyval),U(","));
1948 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1949 xmlFree((yyvsp[0]));
1950 (yyval)=xmlStrcat((yyval),U(")"));
1951 }
1952 #line 1956 "xslpattern.tab.c" /* yacc.c:1646 */
1953 break;
1954
1955 case 83:
1956 #line 575 "xslpattern.y" /* yacc.c:1646 */
1957 {
1958 TRACE("Got RelationalExpr: \"%s $le$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1959 (yyval)=(yyvsp[-2]);
1960 (yyval)=xmlStrcat((yyval),U("<="));
1961 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1962 xmlFree((yyvsp[0]));
1963 }
1964 #line 1968 "xslpattern.tab.c" /* yacc.c:1646 */
1965 break;
1966
1967 case 84:
1968 #line 583 "xslpattern.y" /* yacc.c:1646 */
1969 {
1970 TRACE("Got RelationalExpr: \"%s $ile$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1971 (yyval)=xmlStrdup(U("OP_ILEq("));
1972 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
1973 xmlFree((yyvsp[-2]));
1974 (yyval)=xmlStrcat((yyval),U(","));
1975 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1976 xmlFree((yyvsp[0]));
1977 (yyval)=xmlStrcat((yyval),U(")"));
1978 }
1979 #line 1983 "xslpattern.tab.c" /* yacc.c:1646 */
1980 break;
1981
1982 case 85:
1983 #line 594 "xslpattern.y" /* yacc.c:1646 */
1984 {
1985 TRACE("Got RelationalExpr: \"%s $ge$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1986 (yyval)=(yyvsp[-2]);
1987 (yyval)=xmlStrcat((yyval),U(">="));
1988 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
1989 xmlFree((yyvsp[0]));
1990 }
1991 #line 1995 "xslpattern.tab.c" /* yacc.c:1646 */
1992 break;
1993
1994 case 86:
1995 #line 602 "xslpattern.y" /* yacc.c:1646 */
1996 {
1997 TRACE("Got RelationalExpr: \"%s $ige$ %s\"\n", (yyvsp[-2]), (yyvsp[0]));
1998 (yyval)=xmlStrdup(U("OP_IGEq("));
1999 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2000 xmlFree((yyvsp[-2]));
2001 (yyval)=xmlStrcat((yyval),U(","));
2002 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2003 xmlFree((yyvsp[0]));
2004 (yyval)=xmlStrcat((yyval),U(")"));
2005 }
2006 #line 2010 "xslpattern.tab.c" /* yacc.c:1646 */
2007 break;
2008
2009 case 89:
2010 #line 619 "xslpattern.y" /* yacc.c:1646 */
2011 {
2012 TRACE("Got UnaryExpr: \"$not$ %s\"\n", (yyvsp[0]));
2013 (yyval)=xmlStrdup(U(" not("));
2014 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2015 xmlFree((yyvsp[0]));
2016 (yyval)=xmlStrcat((yyval),U(")"));
2017 }
2018 #line 2022 "xslpattern.tab.c" /* yacc.c:1646 */
2019 break;
2020
2021 case 90:
2022 #line 627 "xslpattern.y" /* yacc.c:1646 */
2023 {
2024 TRACE("Got UnaryExpr: \"$any$ %s\"\n", (yyvsp[0]));
2025 (yyval)=xmlStrdup(U("boolean("));
2026 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2027 xmlFree((yyvsp[0]));
2028 (yyval)=xmlStrcat((yyval),U(")"));
2029 }
2030 #line 2034 "xslpattern.tab.c" /* yacc.c:1646 */
2031 break;
2032
2033 case 91:
2034 #line 635 "xslpattern.y" /* yacc.c:1646 */
2035 {
2036 TRACE("Got UnaryExpr: \"$all$ %s\"\n", (yyvsp[0]));
2037 (yyval)=xmlStrdup(U("not("));
2038 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2039 xmlFree((yyvsp[0]));
2040 (yyval)=xmlStrcat((yyval),U(")"));
2041 }
2042 #line 2046 "xslpattern.tab.c" /* yacc.c:1646 */
2043 break;
2044
2045 case 92:
2046 #line 643 "xslpattern.y" /* yacc.c:1646 */
2047 {
2048 FIXME("Unrecognized $all$ expression - ignoring\n");
2049 (yyval)=xmlStrdup(U(""));
2050 }
2051 #line 2055 "xslpattern.tab.c" /* yacc.c:1646 */
2052 break;
2053
2054 case 93:
2055 #line 649 "xslpattern.y" /* yacc.c:1646 */
2056 {
2057 (yyval)=(yyvsp[-2]);
2058 (yyval)=xmlStrcat((yyval),U("!="));
2059 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2060 xmlFree((yyvsp[0]));
2061 }
2062 #line 2066 "xslpattern.tab.c" /* yacc.c:1646 */
2063 break;
2064
2065 case 94:
2066 #line 656 "xslpattern.y" /* yacc.c:1646 */
2067 {
2068 (yyval)=(yyvsp[-2]);
2069 (yyval)=xmlStrcat((yyval),U("="));
2070 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2071 xmlFree((yyvsp[0]));
2072 }
2073 #line 2077 "xslpattern.tab.c" /* yacc.c:1646 */
2074 break;
2075
2076 case 95:
2077 #line 663 "xslpattern.y" /* yacc.c:1646 */
2078 {
2079 (yyval)=(yyvsp[-2]);
2080 (yyval)=xmlStrcat((yyval),U(">="));
2081 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2082 xmlFree((yyvsp[0]));
2083 }
2084 #line 2088 "xslpattern.tab.c" /* yacc.c:1646 */
2085 break;
2086
2087 case 96:
2088 #line 670 "xslpattern.y" /* yacc.c:1646 */
2089 {
2090 (yyval)=(yyvsp[-2]);
2091 (yyval)=xmlStrcat((yyval),U(">"));
2092 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2093 xmlFree((yyvsp[0]));
2094 }
2095 #line 2099 "xslpattern.tab.c" /* yacc.c:1646 */
2096 break;
2097
2098 case 97:
2099 #line 677 "xslpattern.y" /* yacc.c:1646 */
2100 {
2101 (yyval)=(yyvsp[-2]);
2102 (yyval)=xmlStrcat((yyval),U("<="));
2103 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2104 xmlFree((yyvsp[0]));
2105 }
2106 #line 2110 "xslpattern.tab.c" /* yacc.c:1646 */
2107 break;
2108
2109 case 98:
2110 #line 684 "xslpattern.y" /* yacc.c:1646 */
2111 {
2112 (yyval)=(yyvsp[-2]);
2113 (yyval)=xmlStrcat((yyval),U("<"));
2114 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2115 xmlFree((yyvsp[0]));
2116 }
2117 #line 2121 "xslpattern.tab.c" /* yacc.c:1646 */
2118 break;
2119
2120 case 99:
2121 #line 691 "xslpattern.y" /* yacc.c:1646 */
2122 {
2123 (yyval)=xmlStrdup(U("OP_INEq("));
2124 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2125 xmlFree((yyvsp[-2]));
2126 (yyval)=xmlStrcat((yyval),U(","));
2127 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2128 xmlFree((yyvsp[0]));
2129 (yyval)=xmlStrcat((yyval),U(")"));
2130 }
2131 #line 2135 "xslpattern.tab.c" /* yacc.c:1646 */
2132 break;
2133
2134 case 100:
2135 #line 701 "xslpattern.y" /* yacc.c:1646 */
2136 {
2137 (yyval)=xmlStrdup(U("OP_IEq("));
2138 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2139 xmlFree((yyvsp[-2]));
2140 (yyval)=xmlStrcat((yyval),U(","));
2141 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2142 xmlFree((yyvsp[0]));
2143 (yyval)=xmlStrcat((yyval),U(")"));
2144 }
2145 #line 2149 "xslpattern.tab.c" /* yacc.c:1646 */
2146 break;
2147
2148 case 101:
2149 #line 711 "xslpattern.y" /* yacc.c:1646 */
2150 {
2151 (yyval)=xmlStrdup(U("OP_IGEq("));
2152 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2153 xmlFree((yyvsp[-2]));
2154 (yyval)=xmlStrcat((yyval),U(","));
2155 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2156 xmlFree((yyvsp[0]));
2157 (yyval)=xmlStrcat((yyval),U(")"));
2158 }
2159 #line 2163 "xslpattern.tab.c" /* yacc.c:1646 */
2160 break;
2161
2162 case 102:
2163 #line 721 "xslpattern.y" /* yacc.c:1646 */
2164 {
2165 (yyval)=xmlStrdup(U("OP_IGt("));
2166 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2167 xmlFree((yyvsp[-2]));
2168 (yyval)=xmlStrcat((yyval),U(","));
2169 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2170 xmlFree((yyvsp[0]));
2171 (yyval)=xmlStrcat((yyval),U(")"));
2172 }
2173 #line 2177 "xslpattern.tab.c" /* yacc.c:1646 */
2174 break;
2175
2176 case 103:
2177 #line 731 "xslpattern.y" /* yacc.c:1646 */
2178 {
2179 (yyval)=xmlStrdup(U("OP_ILEq("));
2180 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2181 xmlFree((yyvsp[-2]));
2182 (yyval)=xmlStrcat((yyval),U(","));
2183 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2184 xmlFree((yyvsp[0]));
2185 (yyval)=xmlStrcat((yyval),U(")"));
2186 }
2187 #line 2191 "xslpattern.tab.c" /* yacc.c:1646 */
2188 break;
2189
2190 case 104:
2191 #line 741 "xslpattern.y" /* yacc.c:1646 */
2192 {
2193 (yyval)=xmlStrdup(U("OP_ILt("));
2194 (yyval)=xmlStrcat((yyval),(yyvsp[-2]));
2195 xmlFree((yyvsp[-2]));
2196 (yyval)=xmlStrcat((yyval),U(","));
2197 (yyval)=xmlStrcat((yyval),(yyvsp[0]));
2198 xmlFree((yyvsp[0]));
2199 (yyval)=xmlStrcat((yyval),U(")"));
2200 }
2201 #line 2205 "xslpattern.tab.c" /* yacc.c:1646 */
2202 break;
2203
2204
2205 #line 2209 "xslpattern.tab.c" /* yacc.c:1646 */
2206 default: break;
2207 }
2208 /* User semantic actions sometimes alter yychar, and that requires
2209 that yytoken be updated with the new translation. We take the
2210 approach of translating immediately before every use of yytoken.
2211 One alternative is translating here after every semantic action,
2212 but that translation would be missed if the semantic action invokes
2213 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2214 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2215 incorrect destructor might then be invoked immediately. In the
2216 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2217 to an incorrect destructor call or verbose syntax error message
2218 before the lookahead is translated. */
2219 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2220
2221 YYPOPSTACK (yylen);
2222 yylen = 0;
2223 YY_STACK_PRINT (yyss, yyssp);
2224
2225 *++yyvsp = yyval;
2226
2227 /* Now 'shift' the result of the reduction. Determine what state
2228 that goes to, based on the state we popped back to and the rule
2229 number reduced by. */
2230
2231 yyn = yyr1[yyn];
2232
2233 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2234 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2235 yystate = yytable[yystate];
2236 else
2237 yystate = yydefgoto[yyn - YYNTOKENS];
2238
2239 goto yynewstate;
2240
2241
2242 /*--------------------------------------.
2243 | yyerrlab -- here on detecting error. |
2244 `--------------------------------------*/
2245 yyerrlab:
2246 /* Make sure we have latest lookahead translation. See comments at
2247 user semantic actions for why this is necessary. */
2248 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2249
2250 /* If not already recovering from an error, report this error. */
2251 if (!yyerrstatus)
2252 {
2253 ++yynerrs;
2254 #if ! YYERROR_VERBOSE
2255 yyerror (p, scanner, YY_("syntax error"));
2256 #else
2257 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2258 yyssp, yytoken)
2259 {
2260 char const *yymsgp = YY_("syntax error");
2261 int yysyntax_error_status;
2262 yysyntax_error_status = YYSYNTAX_ERROR;
2263 if (yysyntax_error_status == 0)
2264 yymsgp = yymsg;
2265 else if (yysyntax_error_status == 1)
2266 {
2267 if (yymsg != yymsgbuf)
2268 YYSTACK_FREE (yymsg);
2269 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2270 if (!yymsg)
2271 {
2272 yymsg = yymsgbuf;
2273 yymsg_alloc = sizeof yymsgbuf;
2274 yysyntax_error_status = 2;
2275 }
2276 else
2277 {
2278 yysyntax_error_status = YYSYNTAX_ERROR;
2279 yymsgp = yymsg;
2280 }
2281 }
2282 yyerror (p, scanner, yymsgp);
2283 if (yysyntax_error_status == 2)
2284 goto yyexhaustedlab;
2285 }
2286 # undef YYSYNTAX_ERROR
2287 #endif
2288 }
2289
2290
2291
2292 if (yyerrstatus == 3)
2293 {
2294 /* If just tried and failed to reuse lookahead token after an
2295 error, discard it. */
2296
2297 if (yychar <= YYEOF)
2298 {
2299 /* Return failure if at end of input. */
2300 if (yychar == YYEOF)
2301 YYABORT;
2302 }
2303 else
2304 {
2305 yydestruct ("Error: discarding",
2306 yytoken, &yylval, p, scanner);
2307 yychar = YYEMPTY;
2308 }
2309 }
2310
2311 /* Else will try to reuse lookahead token after shifting the error
2312 token. */
2313 goto yyerrlab1;
2314
2315
2316 /*---------------------------------------------------.
2317 | yyerrorlab -- error raised explicitly by YYERROR. |
2318 `---------------------------------------------------*/
2319 yyerrorlab:
2320
2321 /* Pacify compilers like GCC when the user code never invokes
2322 YYERROR and the label yyerrorlab therefore never appears in user
2323 code. */
2324 if (/*CONSTCOND*/ 0)
2325 goto yyerrorlab;
2326
2327 /* Do not reclaim the symbols of the rule whose action triggered
2328 this YYERROR. */
2329 YYPOPSTACK (yylen);
2330 yylen = 0;
2331 YY_STACK_PRINT (yyss, yyssp);
2332 yystate = *yyssp;
2333 goto yyerrlab1;
2334
2335
2336 /*-------------------------------------------------------------.
2337 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2338 `-------------------------------------------------------------*/
2339 yyerrlab1:
2340 yyerrstatus = 3; /* Each real token shifted decrements this. */
2341
2342 for (;;)
2343 {
2344 yyn = yypact[yystate];
2345 if (!yypact_value_is_default (yyn))
2346 {
2347 yyn += YYTERROR;
2348 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2349 {
2350 yyn = yytable[yyn];
2351 if (0 < yyn)
2352 break;
2353 }
2354 }
2355
2356 /* Pop the current state because it cannot handle the error token. */
2357 if (yyssp == yyss)
2358 YYABORT;
2359
2360
2361 yydestruct ("Error: popping",
2362 yystos[yystate], yyvsp, p, scanner);
2363 YYPOPSTACK (1);
2364 yystate = *yyssp;
2365 YY_STACK_PRINT (yyss, yyssp);
2366 }
2367
2368 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2369 *++yyvsp = yylval;
2370 YY_IGNORE_MAYBE_UNINITIALIZED_END
2371
2372
2373 /* Shift the error token. */
2374 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2375
2376 yystate = yyn;
2377 goto yynewstate;
2378
2379
2380 /*-------------------------------------.
2381 | yyacceptlab -- YYACCEPT comes here. |
2382 `-------------------------------------*/
2383 yyacceptlab:
2384 yyresult = 0;
2385 goto yyreturn;
2386
2387 /*-----------------------------------.
2388 | yyabortlab -- YYABORT comes here. |
2389 `-----------------------------------*/
2390 yyabortlab:
2391 yyresult = 1;
2392 goto yyreturn;
2393
2394 #if !defined yyoverflow || YYERROR_VERBOSE
2395 /*-------------------------------------------------.
2396 | yyexhaustedlab -- memory exhaustion comes here. |
2397 `-------------------------------------------------*/
2398 yyexhaustedlab:
2399 yyerror (p, scanner, YY_("memory exhausted"));
2400 yyresult = 2;
2401 /* Fall through. */
2402 #endif
2403
2404 yyreturn:
2405 if (yychar != YYEMPTY)
2406 {
2407 /* Make sure we have latest lookahead translation. See comments at
2408 user semantic actions for why this is necessary. */
2409 yytoken = YYTRANSLATE (yychar);
2410 yydestruct ("Cleanup: discarding lookahead",
2411 yytoken, &yylval, p, scanner);
2412 }
2413 /* Do not reclaim the symbols of the rule whose action triggered
2414 this YYABORT or YYACCEPT. */
2415 YYPOPSTACK (yylen);
2416 YY_STACK_PRINT (yyss, yyssp);
2417 while (yyssp != yyss)
2418 {
2419 yydestruct ("Cleanup: popping",
2420 yystos[*yyssp], yyvsp, p, scanner);
2421 YYPOPSTACK (1);
2422 }
2423 #ifndef yyoverflow
2424 if (yyss != yyssa)
2425 YYSTACK_FREE (yyss);
2426 #endif
2427 #if YYERROR_VERBOSE
2428 if (yymsg != yymsgbuf)
2429 YYSTACK_FREE (yymsg);
2430 #endif
2431 return yyresult;
2432 }
2433 #line 752 "xslpattern.y" /* yacc.c:1906 */
2434
2435
2436 #endif /* HAVE_LIBXML2 */