1 /* A Bison parser, made by GNU Bison 3.8.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
48 /* Identify Bison output, and Bison version. */
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
55 #define YYSKELETON_NAME "yacc.c"
69 /* First part of user prologue. */
81 # define YY_CAST(Type, Val) static_cast<Type> (Val)
82 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
84 # define YY_CAST(Type, Val) ((Type) (Val))
85 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
89 # if defined __cplusplus
90 # if 201103L <= __cplusplus
91 # define YY_NULLPTR nullptr
96 # define YY_NULLPTR ((void*)0)
104 YYSYMBOL_YYEMPTY
= -2,
105 YYSYMBOL_YYEOF
= 0, /* "end of input" */
106 YYSYMBOL_YYerror
= 1, /* error */
107 YYSYMBOL_YYUNDEF
= 2, /* "invalid token" */
108 YYSYMBOL_STRING
= 3, /* "string" */
109 YYSYMBOL_NAME
= 4, /* "name" */
110 YYSYMBOL_VALUE
= 5, /* "value" */
111 YYSYMBOL_6_
= 6, /* ':' */
112 YYSYMBOL_7_
= 7, /* '{' */
113 YYSYMBOL_8_
= 8, /* '}' */
114 YYSYMBOL_9_
= 9, /* '[' */
115 YYSYMBOL_10_
= 10, /* ']' */
116 YYSYMBOL_11_
= 11, /* '@' */
117 YYSYMBOL_ARROW
= 12, /* "->" */
118 YYSYMBOL_CATENATE
= 13, /* "+=" */
119 YYSYMBOL_DESCRIPTION
= 14, /* "'description' keyword" */
120 YYSYMBOL_RULE
= 15, /* "'rule' keyword" */
121 YYSYMBOL_TARGET
= 16, /* "'target' keyword" */
122 YYSYMBOL_VARIABLE
= 17, /* "'variable' keyword" */
123 YYSYMBOL_VIRTUAL
= 18, /* "'virtual' keyword" */
124 YYSYMBOL_19_
= 19, /* '=' */
125 YYSYMBOL_YYACCEPT
= 20, /* $accept */
126 YYSYMBOL_program
= 21, /* program */
127 YYSYMBOL_name
= 22, /* name */
128 YYSYMBOL_string
= 23, /* string */
129 YYSYMBOL_strings_or_nothing
= 24, /* strings_or_nothing */
130 YYSYMBOL_variable
= 25, /* variable */
131 YYSYMBOL_description
= 26, /* description */
132 YYSYMBOL_rule
= 27, /* rule */
133 YYSYMBOL_out
= 28, /* out */
134 YYSYMBOL_in
= 29, /* in */
135 YYSYMBOL_apply_rule
= 30, /* apply_rule */
136 YYSYMBOL_value
= 31, /* value */
137 YYSYMBOL_strings
= 32, /* strings */
138 YYSYMBOL_apply_rules
= 33, /* apply_rules */
139 YYSYMBOL_apply_rules_or_nothing
= 34, /* apply_rules_or_nothing */
140 YYSYMBOL_dependencies
= 35, /* dependencies */
141 YYSYMBOL_files
= 36, /* files */
142 YYSYMBOL_target_name
= 37, /* target_name */
143 YYSYMBOL_virtual_target_name
= 38, /* virtual_target_name */
144 YYSYMBOL_virtual_target
= 39, /* virtual_target */
145 YYSYMBOL_target
= 40 /* target */
147 typedef enum yysymbol_kind_t yysymbol_kind_t
;
151 /* Unqualified %code blocks. */
159 #include "diagnostic.h"
160 #include "libquote/quote.h"
163 #define ARRAY_DUPLICATE(a0, a1) \
166 (a0).count = (a1).count; \
167 (a0).array = malloc ((a0).count * sizeof (*(a0).array)); \
169 if (UNLIKELY ((a0).array == NULL)) \
172 memcpy ((a0).array, (a1).array, \
173 (a0).count * sizeof (*(a0).array)); \
177 #define ARRAY_INITIALIZE_EMPTY(a0) \
185 #define ARRAY_INITIALIZE(a0, a1) \
189 (a0).array = malloc (sizeof (*(a0).array)); \
191 if (UNLIKELY ((a0).array == NULL)) \
194 (a0).array[(a0).count++] = (a1); \
198 #define ARRAY_EXPAND(a0, a1) \
203 t = realloc ((a0).array, \
204 ((a0).count + 1) * sizeof (*(a0).array)); \
206 if (UNLIKELY (t == NULL)) \
213 (a0).array[(a0).count++] = (a1); \
217 #define ARRAY_CATENATE(a0, a1) \
222 t = realloc ((a0).array, \
223 ((a0).count + (a1).count) * sizeof (*(a0).array)); \
225 if (UNLIKELY (t == NULL)) \
232 memcpy ((a0).array + (a0).count, (a1).array, \
233 (a1).count * sizeof (*(a0).array)); \
234 (a0).count += (a1).count; \
238 #define VARIABLE_FIND(variable, name) \
241 variable = HashFind (&context->variables, \
242 name, uniqstr_len (name)); \
244 if (UNLIKELY (variable == NULL)) \
246 warning_at (yylocation, \
247 _("variable is not declared: %s"), \
248 quote (yyget_extra (yyscanner)->qs, name)); \
254 #define VARIABLE_INSERT(variable) \
257 if (UNLIKELY (HashInsert (&context->variables, \
259 uniqstr_len (variable.name), \
260 &variable) == NULL)) \
265 #define VARIABLE_REMOVE(variable) \
268 if (LIKELY (variable.name != NULL)) \
270 HashRemove (&context->variables, \
272 uniqstr_len (variable.name)); \
274 /* Do not 'free (variable.value.array);' \
275 since this array used by target_create(). */ \
277 memset (&variable, '\0', sizeof (variable)); \
282 #define VARIABLE_TEMPORARY_DEFINE(variable, string, val) \
285 variable.name = uniqstr_new_from_literal_string (string); \
286 variable.value = val; \
287 VARIABLE_INSERT (variable); \
297 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
298 <limits.h> and (if available) <stdint.h> are included
299 so that the code can choose integer types of a good width. */
301 #ifndef __PTRDIFF_MAX__
302 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
303 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
304 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
309 /* Narrow types that promote to a signed type and that can represent a
310 signed or unsigned integer of at least N bits. In tables they can
311 save space and decrease cache pressure. Promoting to a signed type
312 helps avoid bugs in integer arithmetic. */
314 #ifdef __INT_LEAST8_MAX__
315 typedef __INT_LEAST8_TYPE__ yytype_int8
;
316 #elif defined YY_STDINT_H
317 typedef int_least8_t yytype_int8
;
319 typedef signed char yytype_int8
;
322 #ifdef __INT_LEAST16_MAX__
323 typedef __INT_LEAST16_TYPE__ yytype_int16
;
324 #elif defined YY_STDINT_H
325 typedef int_least16_t yytype_int16
;
327 typedef short yytype_int16
;
330 /* Work around bug in HP-UX 11.23, which defines these macros
331 incorrectly for preprocessor constants. This workaround can likely
332 be removed in 2023, as HPE has promised support for HP-UX 11.23
333 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
334 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
336 # undef UINT_LEAST8_MAX
337 # undef UINT_LEAST16_MAX
338 # define UINT_LEAST8_MAX 255
339 # define UINT_LEAST16_MAX 65535
342 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
343 typedef __UINT_LEAST8_TYPE__ yytype_uint8
;
344 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
345 && UINT_LEAST8_MAX <= INT_MAX)
346 typedef uint_least8_t yytype_uint8
;
347 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
348 typedef unsigned char yytype_uint8
;
350 typedef short yytype_uint8
;
353 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
354 typedef __UINT_LEAST16_TYPE__ yytype_uint16
;
355 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
356 && UINT_LEAST16_MAX <= INT_MAX)
357 typedef uint_least16_t yytype_uint16
;
358 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
359 typedef unsigned short yytype_uint16
;
361 typedef int yytype_uint16
;
365 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
366 # define YYPTRDIFF_T __PTRDIFF_TYPE__
367 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
368 # elif defined PTRDIFF_MAX
370 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
372 # define YYPTRDIFF_T ptrdiff_t
373 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
375 # define YYPTRDIFF_T long
376 # define YYPTRDIFF_MAXIMUM LONG_MAX
381 # ifdef __SIZE_TYPE__
382 # define YYSIZE_T __SIZE_TYPE__
383 # elif defined size_t
384 # define YYSIZE_T size_t
385 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
386 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
387 # define YYSIZE_T size_t
389 # define YYSIZE_T unsigned
393 #define YYSIZE_MAXIMUM \
394 YY_CAST (YYPTRDIFF_T, \
395 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
396 ? YYPTRDIFF_MAXIMUM \
397 : YY_CAST (YYSIZE_T, -1)))
399 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
402 /* Stored state numbers (used for stacks). */
403 typedef yytype_int8 yy_state_t
;
405 /* State numbers in computations. */
406 typedef int yy_state_fast_t
;
409 # if defined YYENABLE_NLS && YYENABLE_NLS
411 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
412 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
416 # define YY_(Msgid) Msgid
421 # define N_(Msgid) Msgid
425 #ifndef YY_ATTRIBUTE_PURE
426 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
427 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
429 # define YY_ATTRIBUTE_PURE
433 #ifndef YY_ATTRIBUTE_UNUSED
434 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
435 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
437 # define YY_ATTRIBUTE_UNUSED
441 /* Suppress unused-variable warnings by "using" E. */
442 #if ! defined lint || defined __GNUC__
443 # define YY_USE(E) ((void) (E))
445 # define YY_USE(E) /* empty */
448 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
449 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
450 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
451 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
452 _Pragma ("GCC diagnostic push") \
453 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
455 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
456 _Pragma ("GCC diagnostic push") \
457 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
458 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
460 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
461 _Pragma ("GCC diagnostic pop")
463 # define YY_INITIAL_VALUE(Value) Value
465 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
466 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
467 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
469 #ifndef YY_INITIAL_VALUE
470 # define YY_INITIAL_VALUE(Value) /* Nothing. */
473 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
474 # define YY_IGNORE_USELESS_CAST_BEGIN \
475 _Pragma ("GCC diagnostic push") \
476 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
477 # define YY_IGNORE_USELESS_CAST_END \
478 _Pragma ("GCC diagnostic pop")
480 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
481 # define YY_IGNORE_USELESS_CAST_BEGIN
482 # define YY_IGNORE_USELESS_CAST_END
486 #define YY_ASSERT(E) ((void) (0 && (E)))
490 /* The parser invokes alloca or malloc; define the necessary symbols. */
492 # ifdef YYSTACK_ALLOC
493 /* Pacify GCC's 'empty if-body' warning. */
494 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
495 # ifndef YYSTACK_ALLOC_MAXIMUM
496 /* The OS might guarantee only one guard page at the bottom of the stack,
497 and a page size can be as small as 4096 bytes. So we cannot safely
498 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
499 to allow for a few compiler-allocated temporary stack slots. */
500 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
503 # define YYSTACK_ALLOC YYMALLOC
504 # define YYSTACK_FREE YYFREE
505 # ifndef YYSTACK_ALLOC_MAXIMUM
506 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
508 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
509 && ! ((defined YYMALLOC || defined malloc) \
510 && (defined YYFREE || defined free)))
511 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
512 # ifndef EXIT_SUCCESS
513 # define EXIT_SUCCESS 0
517 # define YYMALLOC malloc
518 # if ! defined malloc && ! defined EXIT_SUCCESS
519 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
524 # if ! defined free && ! defined EXIT_SUCCESS
525 void free (void *); /* INFRINGES ON USER NAME SPACE */
529 # define YYCOPY_NEEDED 1
532 #if (! defined yyoverflow \
533 && (! defined __cplusplus \
534 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
536 /* A type that is properly aligned for any stack member. */
539 yy_state_t yyss_alloc
;
543 /* The size of the maximum gap between one aligned stack and the next. */
544 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
546 /* The size of an array large to enough to hold all stacks, each with
548 # define YYSTACK_BYTES(N) \
549 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
550 + YYSTACK_GAP_MAXIMUM)
552 # define YYCOPY_NEEDED 1
554 /* Relocate STACK from its old location to the new one. The
555 local variables YYSIZE and YYSTACKSIZE give the old and new number of
556 elements in the stack, and YYPTR gives the new location of the
557 stack. Advance YYPTR to a properly aligned location for the next
559 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
562 YYPTRDIFF_T yynewbytes; \
563 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
564 Stack = &yyptr->Stack_alloc; \
565 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
566 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
572 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
573 /* Copy COUNT objects from SRC to DST. The source and destination do
576 # if defined __GNUC__ && 1 < __GNUC__
577 # define YYCOPY(Dst, Src, Count) \
578 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
580 # define YYCOPY(Dst, Src, Count) \
584 for (yyi = 0; yyi < (Count); yyi++) \
585 (Dst)[yyi] = (Src)[yyi]; \
590 #endif /* !YYCOPY_NEEDED */
592 /* YYFINAL -- State number of the termination state. */
594 /* YYLAST -- Last index in YYTABLE. */
597 /* YYNTOKENS -- Number of terminals. */
599 /* YYNNTS -- Number of nonterminals. */
601 /* YYNRULES -- Number of rules. */
603 /* YYNSTATES -- Number of states. */
606 /* YYMAXUTOK -- Last valid token kind. */
607 #define YYMAXUTOK 267
610 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
611 as returned by yylex, with out-of-bounds checking. */
612 #define YYTRANSLATE(YYX) \
613 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
614 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
617 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
618 as returned by yylex. */
619 static const yytype_int8 yytranslate
[] =
621 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 6, 2,
627 2, 19, 2, 2, 11, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 9, 2, 10, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 7, 2, 8, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
647 5, 12, 13, 14, 15, 16, 17, 18
651 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
652 static const yytype_int16 yyrline
[] =
654 0, 317, 317, 318, 319, 320, 321, 322, 325, 331,
655 335, 348, 352, 358, 364, 372, 382, 386, 392, 403,
656 407, 413, 417, 423, 431, 440, 444, 448, 452, 458,
657 462, 469, 473, 479, 484, 492, 497, 505, 517, 544,
662 /** Accessing symbol of state STATE. */
663 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
666 /* The user-facing name of the symbol whose (internal) number is
667 YYSYMBOL. No bounds checking. */
668 static const char *yysymbol_name (yysymbol_kind_t yysymbol
) YY_ATTRIBUTE_UNUSED
;
671 yysymbol_name (yysymbol_kind_t yysymbol
)
673 static const char *const yy_sname
[] =
675 N_("end of input"), N_("error"), N_("invalid token"), N_("string"),
676 N_("name"), N_("value"), "':'", "'{'", "'}'", "'['", "']'", "'@'", "->",
677 "+=", N_("'description' keyword"), N_("'rule' keyword"),
678 N_("'target' keyword"), N_("'variable' keyword"),
679 N_("'virtual' keyword"), "'='", "$accept", "program", "name", "string",
680 "strings_or_nothing", "variable", "description", "rule", "out", "in",
681 "apply_rule", "value", "strings", "apply_rules",
682 "apply_rules_or_nothing", "dependencies", "files", "target_name",
683 "virtual_target_name", "virtual_target", "target", YY_NULLPTR
685 /* YYTRANSLATABLE[SYMBOL-NUM] -- Whether YY_SNAME[SYMBOL-NUM] is
686 internationalizable. */
687 static yytype_int8 yytranslatable
[] =
689 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
690 0, 0, 0, 0, 1, 1, 1, 1, 1, 0
692 return (yysymbol
< YYNTOKENS
&& yytranslatable
[yysymbol
]
693 ? _(yy_sname
[yysymbol
])
694 : yy_sname
[yysymbol
]);
698 #define YYPACT_NINF (-26)
700 #define yypact_value_is_default(Yyn) \
701 ((Yyn) == YYPACT_NINF)
703 #define YYTABLE_NINF (-17)
705 #define yytable_value_is_error(Yyn) \
708 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
710 static const yytype_int8 yypact
[] =
712 -26, 25, -26, -26, -26, -2, 19, 13, 12, -9,
713 -26, 16, -26, -26, -26, 24, -26, -26, -26, -26,
714 29, 26, 19, 42, 45, 13, 19, 33, 39, 46,
715 -26, 29, 33, 33, 47, 48, -26, -26, 43, 33,
716 49, 33, 39, 3, 52, 43, 33, -26, -26, -26,
717 43, 13, -26, 53, 49, -26, -26, 10, 33, -26,
718 15, -26, -26, -26, 51, 43, -26, -26, 19, -26,
722 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
723 Performed when YYTABLE does not specify something else to do. Zero
724 means the default is an error. */
725 static const yytype_int8 yydefact
[] =
727 2, 0, 1, 7, 8, 0, 0, 0, 0, 0,
728 6, 0, 3, 5, 4, 0, 9, 24, 37, 10,
729 33, 0, 0, 0, 0, 0, 0, 0, 35, 0,
730 38, 33, 0, 11, 0, 0, 25, 26, 34, 0,
731 31, 11, 35, 0, 0, 12, 0, 17, 27, 28,
732 36, 0, 40, 0, 31, 15, 14, 0, 21, 29,
733 0, 13, 39, 18, 19, 22, 32, 30, 0, 23,
737 /* YYPGOTO[NTERM-NUM]. */
738 static const yytype_int8 yypgoto
[] =
740 -26, -26, 2, -21, 14, -26, -26, -26, -26, -26,
741 -3, -6, -25, -26, 11, 35, 22, -26, -26, -26,
745 /* YYDEFGOTO[NTERM-NUM]. */
746 static const yytype_int8 yydefgoto
[] =
748 0, 1, 58, 18, 44, 10, 11, 12, 69, 64,
749 59, 37, 45, 60, 52, 28, 40, 20, 31, 13,
753 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
754 positive, shift that token. If negative, reduce the rule whose
755 number is the opposite. If YYTABLE_NINF, syntax error. */
756 static const yytype_int8 yytable
[] =
758 19, 30, 38, 9, 23, 35, 48, 43, 17, 21,
759 24, 55, 15, 48, 50, 17, 19, 4, 63, 4,
760 19, 57, 16, 66, 17, 2, 3, 34, 22, 4,
761 26, 25, 49, 65, 5, 27, 36, 49, 17, 49,
762 -16, 6, 7, 8, 49, 29, 48, 70, 17, 32,
763 39, 49, 33, 41, 46, 53, 51, 67, 47, 49,
764 56, 61, 19, 68, 54, 62, 42
767 static const yytype_int8 yycheck
[] =
769 6, 22, 27, 1, 13, 26, 3, 32, 5, 7,
770 19, 8, 14, 3, 39, 5, 22, 4, 8, 4,
771 26, 46, 3, 8, 5, 0, 1, 25, 16, 4,
772 6, 15, 38, 58, 9, 6, 3, 43, 5, 45,
773 15, 16, 17, 18, 50, 19, 3, 68, 5, 7,
774 11, 57, 7, 7, 7, 41, 7, 60, 10, 65,
775 8, 8, 68, 12, 42, 54, 31
778 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
780 static const yytype_int8 yystos
[] =
782 0, 21, 0, 1, 4, 9, 16, 17, 18, 22,
783 25, 26, 27, 39, 40, 14, 3, 5, 23, 31,
784 37, 22, 16, 13, 19, 15, 6, 6, 35, 19,
785 23, 38, 7, 7, 22, 23, 3, 31, 32, 11,
786 36, 7, 35, 32, 24, 32, 7, 10, 3, 31,
787 32, 7, 34, 24, 36, 8, 8, 32, 22, 30,
788 33, 8, 34, 8, 29, 32, 8, 30, 12, 28,
792 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
793 static const yytype_int8 yyr1
[] =
795 0, 20, 21, 21, 21, 21, 21, 21, 22, 23,
796 23, 24, 24, 25, 25, 25, 26, 26, 27, 28,
797 28, 29, 29, 30, 31, 32, 32, 32, 32, 33,
798 33, 34, 34, 35, 35, 36, 36, 37, 38, 39,
802 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
803 static const yytype_int8 yyr2
[] =
805 0, 2, 0, 2, 2, 2, 2, 2, 1, 1,
806 1, 0, 1, 6, 5, 5, 0, 5, 6, 0,
807 2, 0, 1, 3, 1, 1, 1, 2, 2, 1,
808 2, 0, 3, 0, 2, 0, 2, 1, 1, 6,
813 enum { YYENOMEM
= -2 };
815 #define yyerrok (yyerrstatus = 0)
816 #define yyclearin (yychar = YYTOKEN_YYEMPTY)
818 #define YYACCEPT goto yyacceptlab
819 #define YYABORT goto yyabortlab
820 #define YYERROR goto yyerrorlab
821 #define YYNOMEM goto yyexhaustedlab
824 #define YYRECOVERING() (!!yyerrstatus)
826 #define YYBACKUP(Token, Value) \
828 if (yychar == YYTOKEN_YYEMPTY) \
832 YYPOPSTACK (yylen); \
834 YY_LAC_DISCARD ("YYBACKUP"); \
839 yyerror (yylocation, yyscanner, context, YY_("syntax error: cannot back up")); \
844 /* Backward compatibility with an undocumented macro.
845 Use YYTOKEN_YYerror or YYTOKEN_YYUNDEF. */
846 #define YYERRCODE YYTOKEN_YYUNDEF
849 /* Enable debugging if requested. */
853 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
854 # define YYFPRINTF fprintf
857 # define YYDPRINTF(Args) \
866 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
870 YYFPRINTF (stderr, "%s ", Title); \
871 yy_symbol_print (stderr, \
872 Kind, Value, yylocation, yyscanner, context); \
873 YYFPRINTF (stderr, "\n"); \
878 /*-----------------------------------.
879 | Print this symbol's value on YYO. |
880 `-----------------------------------*/
883 yy_symbol_value_print (FILE *yyo
,
884 yysymbol_kind_t yykind
, YYSTYPE
const * const yyvaluep
, YYLTYPE
*yylocation
, yyscan_t yyscanner
, struct build_context
*context
)
886 FILE *yyoutput
= yyo
;
893 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
895 YY_IGNORE_MAYBE_UNINITIALIZED_END
899 /*---------------------------.
900 | Print this symbol on YYO. |
901 `---------------------------*/
904 yy_symbol_print (FILE *yyo
,
905 yysymbol_kind_t yykind
, YYSTYPE
const * const yyvaluep
, YYLTYPE
*yylocation
, yyscan_t yyscanner
, struct build_context
*context
)
907 YYFPRINTF (yyo
, "%s %s (",
908 yykind
< YYNTOKENS
? "token" : "nterm", yysymbol_name (yykind
));
910 yy_symbol_value_print (yyo
, yykind
, yyvaluep
, yylocation
, yyscanner
, context
);
911 YYFPRINTF (yyo
, ")");
914 /*------------------------------------------------------------------.
915 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
917 `------------------------------------------------------------------*/
920 yy_stack_print (yy_state_t
*yybottom
, yy_state_t
*yytop
)
922 YYFPRINTF (stderr
, "Stack now");
923 for (; yybottom
<= yytop
; yybottom
++)
925 int yybot
= *yybottom
;
926 YYFPRINTF (stderr
, " %d", yybot
);
928 YYFPRINTF (stderr
, "\n");
931 # define YY_STACK_PRINT(Bottom, Top) \
934 yy_stack_print ((Bottom), (Top)); \
938 /*------------------------------------------------.
939 | Report that the YYRULE is going to be reduced. |
940 `------------------------------------------------*/
943 yy_reduce_print (yy_state_t
*yyssp
, YYSTYPE
*yyvsp
,
944 int yyrule
, YYLTYPE
*yylocation
, yyscan_t yyscanner
, struct build_context
*context
)
946 int yylno
= yyrline
[yyrule
];
947 int yynrhs
= yyr2
[yyrule
];
949 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %d):\n",
951 /* The symbols being reduced. */
952 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
954 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
955 yy_symbol_print (stderr
,
956 YY_ACCESSING_SYMBOL (+yyssp
[yyi
+ 1 - yynrhs
]),
957 &yyvsp
[(yyi
+ 1) - (yynrhs
)], yylocation
, yyscanner
, context
);
958 YYFPRINTF (stderr
, "\n");
962 # define YY_REDUCE_PRINT(Rule) \
965 yy_reduce_print (yyssp, yyvsp, Rule, yylocation, yyscanner, context); \
968 /* Nonzero means print parse trace. It is left uninitialized so that
969 multiple parsers can coexist. */
972 # define YYDPRINTF(Args) ((void) 0)
973 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
974 # define YY_STACK_PRINT(Bottom, Top)
975 # define YY_REDUCE_PRINT(Rule)
976 #endif /* !YYDEBUG */
979 /* YYINITDEPTH -- initial size of the parser's stacks. */
981 # define YYINITDEPTH 200
984 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
985 if the built-in stack extension method is used).
987 Do not make this value too large; the results are undefined if
988 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
989 evaluated with infinite-precision integer arithmetic. */
992 # define YYMAXDEPTH 10000
996 /* Given a state stack such that *YYBOTTOM is its bottom, such that
997 *YYTOP is either its top or is YYTOP_EMPTY to indicate an empty
998 stack, and such that *YYCAPACITY is the maximum number of elements it
999 can hold without a reallocation, make sure there is enough room to
1000 store YYADD more elements. If not, allocate a new stack using
1001 YYSTACK_ALLOC, copy the existing elements, and adjust *YYBOTTOM,
1002 *YYTOP, and *YYCAPACITY to reflect the new capacity and memory
1003 location. If *YYBOTTOM != YYBOTTOM_NO_FREE, then free the old stack
1004 using YYSTACK_FREE. Return 0 if successful or if no reallocation is
1005 required. Return YYENOMEM if memory is exhausted. */
1007 yy_lac_stack_realloc (YYPTRDIFF_T
*yycapacity
, YYPTRDIFF_T yyadd
,
1009 char const *yydebug_prefix
,
1010 char const *yydebug_suffix
,
1012 yy_state_t
**yybottom
,
1013 yy_state_t
*yybottom_no_free
,
1014 yy_state_t
**yytop
, yy_state_t
*yytop_empty
)
1016 YYPTRDIFF_T yysize_old
=
1017 *yytop
== yytop_empty
? 0 : *yytop
- *yybottom
+ 1;
1018 YYPTRDIFF_T yysize_new
= yysize_old
+ yyadd
;
1019 if (*yycapacity
< yysize_new
)
1021 YYPTRDIFF_T yyalloc
= 2 * yysize_new
;
1022 yy_state_t
*yybottom_new
;
1023 /* Use YYMAXDEPTH for maximum stack size given that the stack
1024 should never need to grow larger than the main state stack
1025 needs to grow without LAC. */
1026 if (YYMAXDEPTH
< yysize_new
)
1028 YYDPRINTF ((stderr
, "%smax size exceeded%s", yydebug_prefix
,
1032 if (YYMAXDEPTH
< yyalloc
)
1033 yyalloc
= YYMAXDEPTH
;
1035 YY_CAST (yy_state_t
*,
1036 YYSTACK_ALLOC (YY_CAST (YYSIZE_T
,
1037 yyalloc
* YYSIZEOF (*yybottom_new
))));
1040 YYDPRINTF ((stderr
, "%srealloc failed%s", yydebug_prefix
,
1044 if (*yytop
!= yytop_empty
)
1046 YYCOPY (yybottom_new
, *yybottom
, yysize_old
);
1047 *yytop
= yybottom_new
+ (yysize_old
- 1);
1049 if (*yybottom
!= yybottom_no_free
)
1050 YYSTACK_FREE (*yybottom
);
1051 *yybottom
= yybottom_new
;
1052 *yycapacity
= yyalloc
;
1057 /* Establish the initial context for the current lookahead if no initial
1058 context is currently established.
1060 We define a context as a snapshot of the parser stacks. We define
1061 the initial context for a lookahead as the context in which the
1062 parser initially examines that lookahead in order to select a
1063 syntactic action. Thus, if the lookahead eventually proves
1064 syntactically unacceptable (possibly in a later context reached via a
1065 series of reductions), the initial context can be used to determine
1066 the exact set of tokens that would be syntactically acceptable in the
1067 lookahead's place. Moreover, it is the context after which any
1068 further semantic actions would be erroneous because they would be
1069 determined by a syntactically unacceptable token.
1071 YY_LAC_ESTABLISH should be invoked when a reduction is about to be
1072 performed in an inconsistent state (which, for the purposes of LAC,
1073 includes consistent states that don't know they're consistent because
1074 their default reductions have been disabled). Iff there is a
1075 lookahead token, it should also be invoked before reporting a syntax
1076 error. This latter case is for the sake of the debugging output.
1078 For parse.lac=full, the implementation of YY_LAC_ESTABLISH is as
1079 follows. If no initial context is currently established for the
1080 current lookahead, then check if that lookahead can eventually be
1081 shifted if syntactic actions continue from the current context.
1082 Report a syntax error if it cannot. */
1083 #define YY_LAC_ESTABLISH \
1085 if (!yy_lac_established) \
1087 YYDPRINTF ((stderr, \
1088 "LAC: initial context established for %s\n", \
1089 yysymbol_name (yytoken))); \
1090 yy_lac_established = 1; \
1091 switch (yy_lac (yyesa, &yyes, &yyes_capacity, yyssp, yytoken)) \
1101 /* Discard any previous initial lookahead context because of Event,
1102 which may be a lookahead change or an invalidation of the currently
1103 established initial context for the current lookahead.
1105 The most common example of a lookahead change is a shift. An example
1106 of both cases is syntax error recovery. That is, a syntax error
1107 occurs when the lookahead is syntactically erroneous for the
1108 currently established initial context, so error recovery manipulates
1109 the parser stacks to try to find a new initial context in which the
1110 current lookahead is syntactically acceptable. If it fails to find
1111 such a context, it discards the lookahead. */
1113 # define YY_LAC_DISCARD(Event) \
1115 if (yy_lac_established) \
1117 YYDPRINTF ((stderr, "LAC: initial context discarded due to " \
1119 yy_lac_established = 0; \
1123 # define YY_LAC_DISCARD(Event) yy_lac_established = 0
1126 /* Given the stack whose top is *YYSSP, return 0 iff YYTOKEN can
1127 eventually (after perhaps some reductions) be shifted, return 1 if
1128 not, or return YYENOMEM if memory is exhausted. As preconditions and
1129 postconditions: *YYES_CAPACITY is the allocated size of the array to
1130 which *YYES points, and either *YYES = YYESA or *YYES points to an
1131 array allocated with YYSTACK_ALLOC. yy_lac may overwrite the
1132 contents of either array, alter *YYES and *YYES_CAPACITY, and free
1133 any old *YYES other than YYESA. */
1135 yy_lac (yy_state_t
*yyesa
, yy_state_t
**yyes
,
1136 YYPTRDIFF_T
*yyes_capacity
, yy_state_t
*yyssp
, yysymbol_kind_t yytoken
)
1138 yy_state_t
*yyes_prev
= yyssp
;
1139 yy_state_t
*yyesp
= yyes_prev
;
1140 /* Reduce until we encounter a shift and thereby accept the token. */
1141 YYDPRINTF ((stderr
, "LAC: checking lookahead %s:", yysymbol_name (yytoken
)));
1142 if (yytoken
== YYSYMBOL_YYUNDEF
)
1144 YYDPRINTF ((stderr
, " Always Err\n"));
1149 int yyrule
= yypact
[+*yyesp
];
1150 if (yypact_value_is_default (yyrule
)
1151 || (yyrule
+= yytoken
) < 0 || YYLAST
< yyrule
1152 || yycheck
[yyrule
] != yytoken
)
1154 /* Use the default action. */
1155 yyrule
= yydefact
[+*yyesp
];
1158 YYDPRINTF ((stderr
, " Err\n"));
1164 /* Use the action from yytable. */
1165 yyrule
= yytable
[yyrule
];
1166 if (yytable_value_is_error (yyrule
))
1168 YYDPRINTF ((stderr
, " Err\n"));
1173 YYDPRINTF ((stderr
, " S%d\n", yyrule
));
1178 /* By now we know we have to simulate a reduce. */
1179 YYDPRINTF ((stderr
, " R%d", yyrule
- 1));
1181 /* Pop the corresponding number of values from the stack. */
1182 YYPTRDIFF_T yylen
= yyr2
[yyrule
];
1183 /* First pop from the LAC stack as many tokens as possible. */
1184 if (yyesp
!= yyes_prev
)
1186 YYPTRDIFF_T yysize
= yyesp
- *yyes
+ 1;
1198 /* Only afterwards look at the main stack. */
1200 yyesp
= yyes_prev
-= yylen
;
1202 /* Push the resulting state of the reduction. */
1204 yy_state_fast_t yystate
;
1206 const int yylhs
= yyr1
[yyrule
] - YYNTOKENS
;
1207 const int yyi
= yypgoto
[yylhs
] + *yyesp
;
1208 yystate
= (0 <= yyi
&& yyi
<= YYLAST
&& yycheck
[yyi
] == *yyesp
1210 : yydefgoto
[yylhs
]);
1212 if (yyesp
== yyes_prev
)
1215 YY_IGNORE_USELESS_CAST_BEGIN
1216 *yyesp
= YY_CAST (yy_state_t
, yystate
);
1217 YY_IGNORE_USELESS_CAST_END
1221 if (yy_lac_stack_realloc (yyes_capacity
, 1,
1225 yyes
, yyesa
, &yyesp
, yyes_prev
))
1227 YYDPRINTF ((stderr
, "\n"));
1230 YY_IGNORE_USELESS_CAST_BEGIN
1231 *++yyesp
= YY_CAST (yy_state_t
, yystate
);
1232 YY_IGNORE_USELESS_CAST_END
1234 YYDPRINTF ((stderr
, " G%d", yystate
));
1239 /* Context of a parse error. */
1245 YYPTRDIFF_T
*yyes_capacity
;
1246 yysymbol_kind_t yytoken
;
1249 /* Put in YYARG at most YYARGN of the expected tokens given the
1250 current YYCTX, and return the number of tokens stored in YYARG. If
1251 YYARG is null, return the number of expected tokens (guaranteed to
1252 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1253 Return 0 if there are more than YYARGN expected tokens, yet fill
1254 YYARG up to YYARGN. */
1256 yypcontext_expected_tokens (const yypcontext_t
*yyctx
,
1257 yysymbol_kind_t yyarg
[], int yyargn
)
1259 /* Actual size of YYARG. */
1263 for (yyx
= 0; yyx
< YYNTOKENS
; ++yyx
)
1265 yysymbol_kind_t yysym
= YY_CAST (yysymbol_kind_t
, yyx
);
1266 if (yysym
!= YYSYMBOL_YYerror
&& yysym
!= YYSYMBOL_YYUNDEF
)
1267 switch (yy_lac (yyctx
->yyesa
, yyctx
->yyes
, yyctx
->yyes_capacity
, yyctx
->yyssp
, yysym
))
1276 else if (yycount
== yyargn
)
1279 yyarg
[yycount
++] = yysym
;
1282 if (yyarg
&& yycount
== 0 && 0 < yyargn
)
1283 yyarg
[0] = YYSYMBOL_YYEMPTY
;
1290 /* The kind of the lookahead of this context. */
1291 static yysymbol_kind_t
1292 yypcontext_token (const yypcontext_t
*yyctx
) YY_ATTRIBUTE_UNUSED
;
1294 static yysymbol_kind_t
1295 yypcontext_token (const yypcontext_t
*yyctx
)
1297 return yyctx
->yytoken
;
1302 /* User defined function to report a syntax error. */
1304 yyreport_syntax_error (const yypcontext_t
*yyctx
, YYLTYPE
*yylocation
, yyscan_t yyscanner
, struct build_context
*context
);
1306 /*-----------------------------------------------.
1307 | Release the memory associated to this symbol. |
1308 `-----------------------------------------------*/
1311 yydestruct (const char *yymsg
,
1312 yysymbol_kind_t yykind
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocation
, yyscan_t yyscanner
, struct build_context
*context
)
1315 YY_USE (yylocation
);
1320 YY_SYMBOL_PRINT (yymsg
, yykind
, yyvaluep
, yylocationp
);
1322 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1324 YY_IGNORE_MAYBE_UNINITIALIZED_END
1337 yyparse (YYLTYPE
*yylocation
, yyscan_t yyscanner
, struct build_context
*context
)
1339 /* Lookahead token kind. */
1343 /* The semantic value of the lookahead symbol. */
1344 /* Default value used for initialization, for pacifying older GCCs
1345 or non-GCC compilers. */
1346 YY_INITIAL_VALUE (static YYSTYPE yyval_default
;)
1347 YYSTYPE yylval
YY_INITIAL_VALUE (= yyval_default
);
1349 /* Number of syntax errors so far. */
1352 yy_state_fast_t yystate
= 0;
1353 /* Number of tokens to shift before error messages enabled. */
1354 int yyerrstatus
= 0;
1356 /* Refer to the stacks through separate pointers, to allow yyoverflow
1357 to reallocate them elsewhere. */
1360 YYPTRDIFF_T yystacksize
= YYINITDEPTH
;
1362 /* The state stack: array, bottom, top. */
1363 yy_state_t yyssa
[YYINITDEPTH
];
1364 yy_state_t
*yyss
= yyssa
;
1365 yy_state_t
*yyssp
= yyss
;
1367 /* The semantic value stack: array, bottom, top. */
1368 YYSTYPE yyvsa
[YYINITDEPTH
];
1369 YYSTYPE
*yyvs
= yyvsa
;
1370 YYSTYPE
*yyvsp
= yyvs
;
1372 yy_state_t yyesa
[20];
1373 yy_state_t
*yyes
= yyesa
;
1374 YYPTRDIFF_T yyes_capacity
= 20 < YYMAXDEPTH
? 20 : YYMAXDEPTH
;
1376 /* Whether LAC context is established. A Boolean. */
1377 int yy_lac_established
= 0;
1379 /* The return value of yyparse. */
1381 /* Lookahead symbol kind. */
1382 yysymbol_kind_t yytoken
= YYSYMBOL_YYEMPTY
;
1383 /* The variables used to return semantic value and location from the
1389 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1391 /* The number of symbols on the RHS of the reduced rule.
1392 Keep to zero when no symbol should be popped. */
1395 YYDPRINTF ((stderr
, "Starting parse\n"));
1397 yychar
= YYTOKEN_YYEMPTY
; /* Cause a token to be read. */
1402 /*------------------------------------------------------------.
1403 | yynewstate -- push a new state, which is found in yystate. |
1404 `------------------------------------------------------------*/
1406 /* In all cases, when you get here, the value and location stacks
1407 have just been pushed. So pushing a state here evens the stacks. */
1411 /*--------------------------------------------------------------------.
1412 | yysetstate -- set current state (the top of the stack) to yystate. |
1413 `--------------------------------------------------------------------*/
1415 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1416 YY_ASSERT (0 <= yystate
&& yystate
< YYNSTATES
);
1417 YY_IGNORE_USELESS_CAST_BEGIN
1418 *yyssp
= YY_CAST (yy_state_t
, yystate
);
1419 YY_IGNORE_USELESS_CAST_END
1420 YY_STACK_PRINT (yyss
, yyssp
);
1422 if (yyss
+ yystacksize
- 1 <= yyssp
)
1423 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1427 /* Get the current used size of the three stacks, in elements. */
1428 YYPTRDIFF_T yysize
= yyssp
- yyss
+ 1;
1430 # if defined yyoverflow
1432 /* Give user a chance to reallocate the stack. Use copies of
1433 these so that the &'s don't force the real ones into
1435 yy_state_t
*yyss1
= yyss
;
1436 YYSTYPE
*yyvs1
= yyvs
;
1438 /* Each stack pointer address is followed by the size of the
1439 data in use in that stack, in bytes. This used to be a
1440 conditional around just the two extra args, but that might
1441 be undefined if yyoverflow is a macro. */
1442 yyoverflow (YY_("memory exhausted"),
1443 &yyss1
, yysize
* YYSIZEOF (*yyssp
),
1444 &yyvs1
, yysize
* YYSIZEOF (*yyvsp
),
1449 # else /* defined YYSTACK_RELOCATE */
1450 /* Extend the stack our own way. */
1451 if (YYMAXDEPTH
<= yystacksize
)
1454 if (YYMAXDEPTH
< yystacksize
)
1455 yystacksize
= YYMAXDEPTH
;
1458 yy_state_t
*yyss1
= yyss
;
1459 union yyalloc
*yyptr
=
1460 YY_CAST (union yyalloc
*,
1461 YYSTACK_ALLOC (YY_CAST (YYSIZE_T
, YYSTACK_BYTES (yystacksize
))));
1464 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1465 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1466 # undef YYSTACK_RELOCATE
1468 YYSTACK_FREE (yyss1
);
1472 yyssp
= yyss
+ yysize
- 1;
1473 yyvsp
= yyvs
+ yysize
- 1;
1475 YY_IGNORE_USELESS_CAST_BEGIN
1476 YYDPRINTF ((stderr
, "Stack size increased to %ld\n",
1477 YY_CAST (long, yystacksize
)));
1478 YY_IGNORE_USELESS_CAST_END
1480 if (yyss
+ yystacksize
- 1 <= yyssp
)
1483 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1486 if (yystate
== YYFINAL
)
1496 /* Do appropriate processing given the current state. Read a
1497 lookahead token if we need one and don't already have one. */
1499 /* First try to decide what to do without reference to lookahead token. */
1500 yyn
= yypact
[yystate
];
1501 if (yypact_value_is_default (yyn
))
1504 /* Not known => get a lookahead token if don't already have one. */
1506 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1507 if (yychar
== YYTOKEN_YYEMPTY
)
1509 YYDPRINTF ((stderr
, "Reading a token\n"));
1510 yychar
= yylex (&yylval
, yylocation
, yyscanner
);
1513 if (yychar
<= YYTOKEN_END
)
1515 yychar
= YYTOKEN_END
;
1516 yytoken
= YYSYMBOL_YYEOF
;
1517 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1519 else if (yychar
== YYTOKEN_YYerror
)
1521 /* The scanner already issued an error message, process directly
1522 to error recovery. But do not keep the error token as
1523 lookahead, it is too special and may lead us to an endless
1524 loop in error recovery. */
1525 yychar
= YYTOKEN_YYUNDEF
;
1526 yytoken
= YYSYMBOL_YYerror
;
1531 yytoken
= YYTRANSLATE (yychar
);
1532 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1535 /* If the proper action on seeing token YYTOKEN is to reduce or to
1536 detect an error, take that action. */
1538 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1546 if (yytable_value_is_error (yyn
))
1553 /* Count tokens shifted since error; after three, turn off error
1558 /* Shift the lookahead token. */
1559 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1561 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1563 YY_IGNORE_MAYBE_UNINITIALIZED_END
1565 /* Discard the shifted token. */
1566 yychar
= YYTOKEN_YYEMPTY
;
1567 YY_LAC_DISCARD ("shift");
1571 /*-----------------------------------------------------------.
1572 | yydefault -- do the default action for the current state. |
1573 `-----------------------------------------------------------*/
1575 yyn
= yydefact
[yystate
];
1581 /*-----------------------------.
1582 | yyreduce -- do a reduction. |
1583 `-----------------------------*/
1585 /* yyn is the number of a rule to reduce with. */
1588 /* If YYLEN is nonzero, implement the default value of the action:
1591 Otherwise, the following line sets YYVAL to garbage.
1592 This behavior is undocumented and Bison
1593 users should not rely upon it. Assigning to YYVAL
1594 unconditionally makes the parser a bit smaller, and it avoids a
1595 GCC warning that YYVAL may be used uninitialized. */
1596 yyval
= yyvsp
[1-yylen
];
1599 YY_REDUCE_PRINT (yyn
);
1601 int yychar_backup
= yychar
;
1604 case 7: /* program: program error */
1607 #line 1608 "parse.c"
1610 case 8: /* name: "name" */
1613 (yyval
.string
) = (yyvsp
[0].string
);
1615 #line 1616 "parse.c"
1618 case 9: /* string: "string" */
1621 (yyval
.string
) = (yyvsp
[0].string
);
1623 #line 1624 "parse.c"
1626 case 10: /* string: value */
1629 if (UNLIKELY ((yyvsp
[0].strings
).count
!= 1))
1631 warning_at (yylocation
, _("unexpected string array, expecting string"));
1635 (yyval
.string
) = (yyvsp
[0].strings
).array
[0];
1637 #line 1638 "parse.c"
1640 case 11: /* strings_or_nothing: %empty */
1643 ARRAY_INITIALIZE_EMPTY ((yyval
.strings
));
1645 #line 1646 "parse.c"
1648 case 12: /* strings_or_nothing: strings */
1651 (yyval
.strings
) = (yyvsp
[0].strings
);
1653 #line 1654 "parse.c"
1656 case 13: /* variable: "'variable' keyword" name '=' '{' strings_or_nothing '}' */
1659 if (UNLIKELY (!variable_create (&context
->variables
, (yyvsp
[-4].string
),
1660 &(yyvsp
[-1].strings
))))
1663 #line 1664 "parse.c"
1666 case 14: /* variable: name '=' '{' strings_or_nothing '}' */
1669 struct variable
*variable
;
1671 VARIABLE_FIND (variable
, (yyvsp
[-4].string
));
1672 free (variable
->value
.array
);
1673 variable
->value
= (yyvsp
[-1].strings
);
1675 #line 1676 "parse.c"
1678 case 15: /* variable: name "+=" '{' strings '}' */
1681 struct variable
*variable
;
1683 VARIABLE_FIND (variable
, (yyvsp
[-4].string
));
1684 ARRAY_CATENATE (variable
->value
, (yyvsp
[-1].strings
));
1685 free ((yyvsp
[-1].strings
).array
);
1687 #line 1688 "parse.c"
1690 case 16: /* description: %empty */
1693 (yyval
.string
) = NULL
;
1695 #line 1696 "parse.c"
1698 case 17: /* description: '[' "'description' keyword" ':' string ']' */
1701 (yyval
.string
) = (yyvsp
[-1].string
);
1703 #line 1704 "parse.c"
1706 case 18: /* rule: description "'rule' keyword" name '{' strings '}' */
1709 if (UNLIKELY (!rule_create (&context
->rules
,
1712 &(yyvsp
[-1].strings
),
1713 &context
->variables
)))
1716 #line 1717 "parse.c"
1719 case 19: /* out: %empty */
1722 (yyval
.string
) = NULL
;
1724 #line 1725 "parse.c"
1727 case 20: /* out: "->" string */
1730 (yyval
.string
) = (yyvsp
[0].string
);
1732 #line 1733 "parse.c"
1735 case 21: /* in: %empty */
1738 ARRAY_INITIALIZE_EMPTY ((yyval
.strings
));
1740 #line 1741 "parse.c"
1743 case 22: /* in: strings */
1746 (yyval
.strings
) = (yyvsp
[0].strings
);
1748 #line 1749 "parse.c"
1751 case 23: /* apply_rule: name in out */
1754 (yyval
.apply_rule
).name
= (yyvsp
[-2].string
);
1755 (yyval
.apply_rule
).in
= (yyvsp
[-1].strings
);
1756 (yyval
.apply_rule
).out
= (yyvsp
[0].string
);
1758 #line 1759 "parse.c"
1761 case 24: /* value: "value" */
1764 struct variable
*variable
;
1766 VARIABLE_FIND (variable
, (yyvsp
[0].string
));
1767 (yyval
.strings
) = variable
->value
;
1769 #line 1770 "parse.c"
1772 case 25: /* strings: "string" */
1775 ARRAY_INITIALIZE ((yyval
.strings
), (yyvsp
[0].string
));
1777 #line 1778 "parse.c"
1780 case 26: /* strings: value */
1783 ARRAY_DUPLICATE ((yyval
.strings
), (yyvsp
[0].strings
));
1785 #line 1786 "parse.c"
1788 case 27: /* strings: strings "string" */
1791 ARRAY_EXPAND ((yyval
.strings
), (yyvsp
[0].string
));
1793 #line 1794 "parse.c"
1796 case 28: /* strings: strings value */
1799 ARRAY_CATENATE ((yyval
.strings
), (yyvsp
[0].strings
));
1801 #line 1802 "parse.c"
1804 case 29: /* apply_rules: apply_rule */
1807 ARRAY_INITIALIZE ((yyval
.apply_rules
), (yyvsp
[0].apply_rule
));
1809 #line 1810 "parse.c"
1812 case 30: /* apply_rules: apply_rules apply_rule */
1815 ARRAY_EXPAND ((yyval
.apply_rules
), (yyvsp
[0].apply_rule
));
1817 #line 1818 "parse.c"
1820 case 31: /* apply_rules_or_nothing: %empty */
1823 ARRAY_INITIALIZE_EMPTY ((yyval
.apply_rules
));
1825 #line 1826 "parse.c"
1828 case 32: /* apply_rules_or_nothing: '{' apply_rules '}' */
1831 (yyval
.apply_rules
) = (yyvsp
[-1].apply_rules
);
1833 #line 1834 "parse.c"
1836 case 33: /* dependencies: %empty */
1839 ARRAY_INITIALIZE_EMPTY ((yyval
.strings
));
1840 memset (&context
->dependencies
, '\0', sizeof (context
->dependencies
));
1842 #line 1843 "parse.c"
1845 case 34: /* dependencies: ':' strings */
1848 VARIABLE_TEMPORARY_DEFINE (context
->dependencies
,
1849 "dependencies", (yyvsp
[0].strings
));
1850 (yyval
.strings
) = (yyvsp
[0].strings
);
1852 #line 1853 "parse.c"
1855 case 35: /* files: %empty */
1858 ARRAY_INITIALIZE_EMPTY ((yyval
.strings
));
1859 memset (&context
->files
, '\0', sizeof (context
->files
));
1861 #line 1862 "parse.c"
1864 case 36: /* files: '@' strings */
1867 VARIABLE_TEMPORARY_DEFINE (context
->files
,
1868 "files", (yyvsp
[0].strings
));
1869 (yyval
.strings
) = (yyvsp
[0].strings
);
1871 #line 1872 "parse.c"
1874 case 37: /* target_name: string */
1877 VARIABLE_TEMPORARY_DEFINE (context
->target
,
1879 ((struct uniqstr_array
) {
1881 .array
= &(yyvsp
[0].string
) }));
1882 (yyval
.string
) = (yyvsp
[0].string
);
1884 #line 1885 "parse.c"
1887 case 38: /* virtual_target_name: string */
1890 void *p
= uniqstr_chr ((yyvsp
[0].string
), '%');
1892 if (UNLIKELY (p
== NULL
))
1894 warning_at (yylocation
,
1895 _("%s: '%%' character expected"),
1896 quote (yyget_extra (yyscanner
)->qs
,
1897 (yyvsp
[0].string
)));
1900 else if (UNLIKELY (memchr ((char *) p
+ 1, '%', uniqstr_len ((yyvsp
[0].string
)) - (size_t) (((char *) p
+ 1 - (yyvsp
[0].string
)))) != NULL
))
1902 warning_at (yylocation
, _("%s: found two or more '%%' characters, but only one allowed"), quote (yyget_extra (yyscanner
)->qs
, (yyvsp
[0].string
)));
1906 VARIABLE_TEMPORARY_DEFINE (context
->target
,
1908 ((struct uniqstr_array
) {
1910 .array
= &(yyvsp
[0].string
) }));
1911 (yyval
.string
) = (yyvsp
[0].string
);
1913 #line 1914 "parse.c"
1916 case 39: /* virtual_target: "'virtual' keyword" "'target' keyword" virtual_target_name dependencies files apply_rules_or_nothing */
1919 if (UNLIKELY (!target_create (NULL
,
1920 &context
->virtual_targets
,
1922 &(yyvsp
[-2].strings
),
1923 &(yyvsp
[-1].strings
),
1924 &(yyvsp
[0].apply_rules
))))
1927 /* Target name is never NULL. */
1928 HashRemove (&context
->variables
,
1929 context
->target
.name
,
1930 uniqstr_len (context
->target
.name
));
1931 VARIABLE_REMOVE (context
->files
);
1932 VARIABLE_REMOVE (context
->dependencies
);
1934 #line 1935 "parse.c"
1937 case 40: /* target: "'target' keyword" target_name dependencies files apply_rules_or_nothing */
1940 if (UNLIKELY (!target_create (NULL
,
1943 &(yyvsp
[-2].strings
),
1944 &(yyvsp
[-1].strings
),
1945 &(yyvsp
[0].apply_rules
))))
1948 /* Target name is never NULL. */
1949 HashRemove (&context
->variables
,
1950 context
->target
.name
,
1951 uniqstr_len (context
->target
.name
));
1953 VARIABLE_REMOVE (context
->files
);
1954 VARIABLE_REMOVE (context
->dependencies
);
1956 #line 1957 "parse.c"
1960 #line 1961 "parse.c"
1964 if (yychar_backup
!= yychar
)
1965 YY_LAC_DISCARD ("yychar change");
1967 /* User semantic actions sometimes alter yychar, and that requires
1968 that yytoken be updated with the new translation. We take the
1969 approach of translating immediately before every use of yytoken.
1970 One alternative is translating here after every semantic action,
1971 but that translation would be missed if the semantic action invokes
1972 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1973 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1974 incorrect destructor might then be invoked immediately. In the
1975 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1976 to an incorrect destructor call or verbose syntax error message
1977 before the lookahead is translated. */
1978 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t
, yyr1
[yyn
]), &yyval
, &yyloc
);
1985 /* Now 'shift' the result of the reduction. Determine what state
1986 that goes to, based on the state we popped back to and the rule
1987 number reduced by. */
1989 const int yylhs
= yyr1
[yyn
] - YYNTOKENS
;
1990 const int yyi
= yypgoto
[yylhs
] + *yyssp
;
1991 yystate
= (0 <= yyi
&& yyi
<= YYLAST
&& yycheck
[yyi
] == *yyssp
1993 : yydefgoto
[yylhs
]);
1999 /*--------------------------------------.
2000 | yyerrlab -- here on detecting error. |
2001 `--------------------------------------*/
2003 /* Make sure we have latest lookahead translation. See comments at
2004 user semantic actions for why this is necessary. */
2005 yytoken
= yychar
== YYTOKEN_YYEMPTY
? YYSYMBOL_YYEMPTY
: YYTRANSLATE (yychar
);
2006 /* If not already recovering from an error, report this error. */
2012 = {yyssp
, yyesa
, &yyes
, &yyes_capacity
, yytoken
};
2013 if (yychar
!= YYTOKEN_YYEMPTY
)
2015 if (yyreport_syntax_error (&yyctx
, yylocation
, yyscanner
, context
) == 2)
2020 if (yyerrstatus
== 3)
2022 /* If just tried and failed to reuse lookahead token after an
2023 error, discard it. */
2025 if (yychar
<= YYTOKEN_END
)
2027 /* Return failure if at end of input. */
2028 if (yychar
== YYTOKEN_END
)
2033 yydestruct ("Error: discarding",
2034 yytoken
, &yylval
, yylocation
, yyscanner
, context
);
2035 yychar
= YYTOKEN_YYEMPTY
;
2039 /* Else will try to reuse lookahead token after shifting the error
2044 /*---------------------------------------------------.
2045 | yyerrorlab -- error raised explicitly by YYERROR. |
2046 `---------------------------------------------------*/
2048 /* Pacify compilers when the user code never invokes YYERROR and the
2049 label yyerrorlab therefore never appears in user code. */
2054 /* Do not reclaim the symbols of the rule whose action triggered
2058 YY_STACK_PRINT (yyss
, yyssp
);
2063 /*-------------------------------------------------------------.
2064 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2065 `-------------------------------------------------------------*/
2067 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2069 /* Pop stack until we find a state that shifts the error token. */
2072 yyn
= yypact
[yystate
];
2073 if (!yypact_value_is_default (yyn
))
2075 yyn
+= YYSYMBOL_YYerror
;
2076 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYSYMBOL_YYerror
)
2084 /* Pop the current state because it cannot handle the error token. */
2089 yydestruct ("Error: popping",
2090 YY_ACCESSING_SYMBOL (yystate
), yyvsp
, yylocation
, yyscanner
, context
);
2093 YY_STACK_PRINT (yyss
, yyssp
);
2096 /* If the stack popping above didn't lose the initial context for the
2097 current lookahead token, the shift below will for sure. */
2098 YY_LAC_DISCARD ("error recovery");
2100 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2102 YY_IGNORE_MAYBE_UNINITIALIZED_END
2105 /* Shift the error token. */
2106 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn
), yyvsp
, yylsp
);
2112 /*-------------------------------------.
2113 | yyacceptlab -- YYACCEPT comes here. |
2114 `-------------------------------------*/
2120 /*-----------------------------------.
2121 | yyabortlab -- YYABORT comes here. |
2122 `-----------------------------------*/
2128 /*-----------------------------------------------------------.
2129 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2130 `-----------------------------------------------------------*/
2132 yyerror (yylocation
, yyscanner
, context
, YY_("memory exhausted"));
2137 /*----------------------------------------------------------.
2138 | yyreturnlab -- parsing is finished, clean up and return. |
2139 `----------------------------------------------------------*/
2141 if (yychar
!= YYTOKEN_YYEMPTY
)
2143 /* Make sure we have latest lookahead translation. See comments at
2144 user semantic actions for why this is necessary. */
2145 yytoken
= YYTRANSLATE (yychar
);
2146 yydestruct ("Cleanup: discarding lookahead",
2147 yytoken
, &yylval
, yylocation
, yyscanner
, context
);
2149 /* Do not reclaim the symbols of the rule whose action triggered
2150 this YYABORT or YYACCEPT. */
2152 YY_STACK_PRINT (yyss
, yyssp
);
2153 while (yyssp
!= yyss
)
2155 yydestruct ("Cleanup: popping",
2156 YY_ACCESSING_SYMBOL (+*yyssp
), yyvsp
, yylocation
, yyscanner
, context
);
2161 YYSTACK_FREE (yyss
);
2164 YYSTACK_FREE (yyes
);
2172 static inline const char *
2173 error_format_string (int argc
)
2177 default: /* Avoid compiler warnings. */
2178 case 0: return _("%@: syntax error");
2179 case 1: return _("%@: syntax error: unexpected %u");
2180 /* TRANSLATORS: '%@' is a location in a file, '%u' is an
2181 "unexpected token", and '%0e', '%1e'... are expected tokens
2184 For instance on the expression "1 + * 2", you would get
2186 '1.5: syntax error: expected - or ( or number or function
2187 or variable before *'. */
2188 case 2: return _("%@: syntax error: expected %0e before %u");
2189 case 3: return _("%@: syntax error: expected %0e or %1e before %u");
2190 case 4: return _("%@: syntax error: expected %0e or %1e or %2e before %u");
2191 case 5: return _("%@: syntax error: expected %0e or %1e or %2e or %3e before %u");
2192 case 6: return _("%@: syntax error: expected %0e or %1e or %2e or %3e or %4e before %u");
2193 case 7: return _("%@: syntax error: expected %0e or %1e or %2e or %3e or %4e or %5e before %u");
2194 case 8: return _("%@: syntax error: expected %0e or %1e or %2e or %3e or %4e or %5e etc., before %u");
2198 /* Get line with number "number".
2199 line_offset (if not equal -1) is an
2200 offset of '\n' character before line we need. */
2201 static inline char *
2202 getlinebynumber (FILE *in
, int number
, off_t line_offset
)
2204 off_t old_offset
= ftello (in
);
2209 if (UNLIKELY (old_offset
< 0))
2212 if (UNLIKELY (fseeko (in
, line_offset
>= 0 ? line_offset
: 0, SEEK_SET
) < 0))
2215 if (UNLIKELY (line_offset
< 0))
2217 /* Find required line by ourselves. */
2220 while (current
!= number
&& (c
= getc (in
)) != EOF
)
2224 if (UNLIKELY (c
== EOF
))
2228 if (UNLIKELY (getline (&line
, &size
, in
) < 0))
2231 if (UNLIKELY (fseeko (in
, old_offset
, SEEK_SET
) < 0))
2240 /* Return the number of digits of 'x'
2241 when converted to string in radix 10. */
2242 static inline NODISCARD
int CONST
2247 if (x
< 10) return 1;
2248 if (x
< 100) return 2;
2249 if (x
< 1000) return 3;
2250 if (x
< 10000) return 4;
2251 if (x
< 100000) return 5;
2252 if (x
< 1000000) return 6;
2253 if (x
< 10000000) return 7;
2254 if (x
< 100000000) return 8;
2255 if (x
< 1000000000) return 9;
2256 static_assert (1000000000 < INT_MAX
&& INT_MAX
< 10000000000,
2257 "int is not 32-bit");
2262 yyreport_syntax_error (const yypcontext_t
*yyctx
,
2263 YYLTYPE
*yylocation
,
2265 UNUSED
struct build_context
*context
)
2267 enum { ARGS_MAX
= 6 };
2268 yysymbol_kind_t arg
[ARGS_MAX
];
2269 int argsize
= yypcontext_expected_tokens (yyctx
, arg
, ARGS_MAX
);
2271 bool too_many_expected_tokens
;
2273 if (UNLIKELY (argsize
< 0))
2276 too_many_expected_tokens
= argsize
== 0 && arg
[0] != YYSYMBOL_YYEMPTY
;
2278 if (UNLIKELY (too_many_expected_tokens
))
2281 const char *format
= error_format_string (1 + argsize
+ (too_many_expected_tokens
? 1 : 0));
2282 const char *p
= format
;
2283 const char *s
= format
;
2284 size_t n
= strlen (format
);
2285 const char *const end
= format
+ n
;
2287 while ((s
= memchr (s
, '%', n
)) != NULL
)
2289 if (LIKELY (s
!= p
))
2290 fwrite (p
, sizeof (char), (size_t) (s
- p
), stderr
);
2295 { /* %@: location. */
2296 yylocation_print (stderr
, yylocation
);
2299 else if (s
[0] == 'u')
2300 { /* %u: unexpected token. */
2301 fputs (yysymbol_name (yypcontext_token (yyctx
)), stderr
);
2304 else if (s
[0] >= '0' && s
[0] <= '9' && s
[1] == 'e' && ((s
[0] - '0') < argsize
))
2305 { /* %0e, %1e...: expected token. */
2306 fputs (yysymbol_name (arg
[s
[0] - '0']), stderr
);
2310 n
-= (size_t) (s
- p
);
2315 fwrite (p
, sizeof (char), (size_t) (end
- p
), stderr
);
2317 fputc ('\n', stderr
);
2319 /* Quote the source line. */
2320 line
= getlinebynumber (yyget_in (yyscanner
), yylocation
->first_line
,
2321 yylocation
->newline_offset
);
2323 if (LIKELY (line
!= NULL
))
2325 const int width
= int_width (yylocation
->first_line
);
2326 const int offset
= yylocation
->first_column
;
2328 fprintf (stderr
, " %*d | %s", width
, yylocation
->first_line
, line
);
2329 fprintf (stderr
, " %*s | %*s", width
, "", offset
, "^");
2332 for (int i
= yylocation
->last_column
- offset
- 1; i
> 0; i
--)
2333 fputc ('~', stderr
);
2335 fputc ('\n', stderr
);