1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
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.
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.
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/>. */
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.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
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. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
64 /* Substitute the variable and function names. */
65 #define yyparse parse_events_parse
66 #define yylex parse_events_lex
67 #define yyerror parse_events_error
68 #define yylval parse_events_lval
69 #define yychar parse_events_char
70 #define yydebug parse_events_debug
71 #define yynerrs parse_events_nerrs
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
77 #line 7 "util/parse-events.y"
82 #include <linux/compiler.h>
83 #include <linux/list.h>
86 #include "parse-events.h"
88 extern int parse_events_lex (void);
90 #define ABORT_ON(val) \
98 /* Line 268 of yacc.c */
99 #line 100 "util/parse-events-bison.c"
101 /* Enabling traces. */
106 /* Enabling verbose error messages. */
107 #ifdef YYERROR_VERBOSE
108 # undef YYERROR_VERBOSE
109 # define YYERROR_VERBOSE 1
111 # define YYERROR_VERBOSE 0
114 /* Enabling the token table. */
115 #ifndef YYTOKEN_TABLE
116 # define YYTOKEN_TABLE 0
123 /* Put the tokens into the symbol table, so that GDB and other debuggers
131 PE_MODIFIER_EVENT = 263,
132 PE_MODIFIER_BP = 264,
133 PE_NAME_CACHE_TYPE = 265,
134 PE_NAME_CACHE_OP_RESULT = 266,
143 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
144 typedef union YYSTYPE
147 /* Line 293 of yacc.c */
148 #line 46 "util/parse-events.y"
152 struct list_head *head;
153 struct parse_events__term *term;
157 /* Line 293 of yacc.c */
158 #line 159 "util/parse-events-bison.c"
160 # define YYSTYPE_IS_TRIVIAL 1
161 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
162 # define YYSTYPE_IS_DECLARED 1
166 /* Copy the second part of user declarations. */
169 /* Line 343 of yacc.c */
170 #line 171 "util/parse-events-bison.c"
177 typedef YYTYPE_UINT8 yytype_uint8;
179 typedef unsigned char yytype_uint8;
183 typedef YYTYPE_INT8 yytype_int8;
184 #elif (defined __STDC__ || defined __C99__FUNC__ \
185 || defined __cplusplus || defined _MSC_VER)
186 typedef signed char yytype_int8;
188 typedef short int yytype_int8;
192 typedef YYTYPE_UINT16 yytype_uint16;
194 typedef unsigned short int yytype_uint16;
198 typedef YYTYPE_INT16 yytype_int16;
200 typedef short int yytype_int16;
204 # ifdef __SIZE_TYPE__
205 # define YYSIZE_T __SIZE_TYPE__
206 # elif defined size_t
207 # define YYSIZE_T size_t
208 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
209 || defined __cplusplus || defined _MSC_VER)
210 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
211 # define YYSIZE_T size_t
213 # define YYSIZE_T unsigned int
217 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
220 # if defined YYENABLE_NLS && YYENABLE_NLS
222 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
223 # define YY_(msgid) dgettext ("bison-runtime", msgid)
227 # define YY_(msgid) msgid
231 /* Suppress unused-variable warnings by "using" E. */
232 #if ! defined lint || defined __GNUC__
233 # define YYUSE(e) ((void) (e))
235 # define YYUSE(e) /* empty */
238 /* Identity function, used to suppress warnings about constant conditions. */
242 #if (defined __STDC__ || defined __C99__FUNC__ \
243 || defined __cplusplus || defined _MSC_VER)
256 #if ! defined yyoverflow || YYERROR_VERBOSE
258 /* The parser invokes alloca or malloc; define the necessary symbols. */
260 # ifdef YYSTACK_USE_ALLOCA
261 # if YYSTACK_USE_ALLOCA
263 # define YYSTACK_ALLOC __builtin_alloca
264 # elif defined __BUILTIN_VA_ARG_INCR
265 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
267 # define YYSTACK_ALLOC __alloca
268 # elif defined _MSC_VER
269 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
270 # define alloca _alloca
272 # define YYSTACK_ALLOC alloca
273 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
274 || defined __cplusplus || defined _MSC_VER)
275 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
276 # ifndef EXIT_SUCCESS
277 # define EXIT_SUCCESS 0
284 # ifdef YYSTACK_ALLOC
285 /* Pacify GCC's `empty if-body' warning. */
286 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
287 # ifndef YYSTACK_ALLOC_MAXIMUM
288 /* The OS might guarantee only one guard page at the bottom of the stack,
289 and a page size can be as small as 4096 bytes. So we cannot safely
290 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
291 to allow for a few compiler-allocated temporary stack slots. */
292 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
295 # define YYSTACK_ALLOC YYMALLOC
296 # define YYSTACK_FREE YYFREE
297 # ifndef YYSTACK_ALLOC_MAXIMUM
298 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
300 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
301 && ! ((defined YYMALLOC || defined malloc) \
302 && (defined YYFREE || defined free)))
303 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
304 # ifndef EXIT_SUCCESS
305 # define EXIT_SUCCESS 0
309 # define YYMALLOC malloc
310 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
311 || defined __cplusplus || defined _MSC_VER)
312 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
317 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
318 || defined __cplusplus || defined _MSC_VER)
319 void free (void *); /* INFRINGES ON USER NAME SPACE */
323 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
326 #if (! defined yyoverflow \
327 && (! defined __cplusplus \
328 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
330 /* A type that is properly aligned for any stack member. */
333 yytype_int16 yyss_alloc;
337 /* The size of the maximum gap between one aligned stack and the next. */
338 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
340 /* The size of an array large to enough to hold all stacks, each with
342 # define YYSTACK_BYTES(N) \
343 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
344 + YYSTACK_GAP_MAXIMUM)
346 # define YYCOPY_NEEDED 1
348 /* Relocate STACK from its old location to the new one. The
349 local variables YYSIZE and YYSTACKSIZE give the old and new number of
350 elements in the stack, and YYPTR gives the new location of the
351 stack. Advance YYPTR to a properly aligned location for the next
353 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
356 YYSIZE_T yynewbytes; \
357 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
358 Stack = &yyptr->Stack_alloc; \
359 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
360 yyptr += yynewbytes / sizeof (*yyptr); \
366 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
367 /* Copy COUNT objects from FROM to TO. The source and destination do
370 # if defined __GNUC__ && 1 < __GNUC__
371 # define YYCOPY(To, From, Count) \
372 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
374 # define YYCOPY(To, From, Count) \
378 for (yyi = 0; yyi < (Count); yyi++) \
379 (To)[yyi] = (From)[yyi]; \
384 #endif /* !YYCOPY_NEEDED */
386 /* YYFINAL -- State number of the termination state. */
388 /* YYLAST -- Last index in YYTABLE. */
391 /* YYNTOKENS -- Number of terminals. */
393 /* YYNNTS -- Number of nonterminals. */
395 /* YYNRULES -- Number of rules. */
397 /* YYNRULES -- Number of states. */
400 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
402 #define YYMAXUTOK 269
404 #define YYTRANSLATE(YYX) \
405 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
407 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
408 static const yytype_uint8 yytranslate[] =
410 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 15, 17, 2, 16, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 18, 2,
416 2, 19, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
436 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
440 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
442 static const yytype_uint8 yyprhs[] =
444 0, 0, 3, 7, 9, 12, 14, 16, 18, 21,
445 23, 26, 29, 32, 37, 42, 45, 51, 55, 57,
446 63, 67, 71, 75, 77, 81, 83, 87, 91, 93,
447 97, 99, 101, 102, 104, 106
450 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
451 static const yytype_int8 yyrhs[] =
453 21, 0, -1, 21, 15, 22, -1, 22, -1, 23,
454 8, -1, 23, -1, 24, -1, 25, -1, 26, 33,
455 -1, 27, -1, 28, 33, -1, 29, 33, -1, 30,
456 33, -1, 7, 16, 31, 16, -1, 4, 16, 31,
457 16, -1, 4, 34, -1, 10, 17, 11, 17, 11,
458 -1, 10, 17, 11, -1, 10, -1, 12, 3, 18,
459 9, 33, -1, 12, 3, 33, -1, 7, 18, 7,
460 -1, 3, 18, 3, -1, 5, -1, 31, 15, 32,
461 -1, 32, -1, 7, 19, 7, -1, 7, 19, 3,
462 -1, 7, -1, 6, 19, 3, -1, 6, -1, 18,
463 -1, -1, 16, -1, 18, -1, -1
466 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
467 static const yytype_uint8 yyrline[] =
469 0, 55, 55, 55, 58, 69, 74, 75, 76, 77,
470 78, 79, 80, 83, 90, 99, 108, 113, 118, 124,
471 129, 135, 141, 147, 153, 163, 175, 184, 193, 202,
472 210, 218, 218, 220, 220, 220
476 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
477 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
478 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
479 static const char *const yytname[] =
481 "$end", "error", "$undefined", "PE_VALUE", "PE_VALUE_SYM", "PE_RAW",
482 "PE_TERM", "PE_NAME", "PE_MODIFIER_EVENT", "PE_MODIFIER_BP",
483 "PE_NAME_CACHE_TYPE", "PE_NAME_CACHE_OP_RESULT", "PE_PREFIX_MEM",
484 "PE_PREFIX_RAW", "PE_ERROR", "','", "'/'", "'-'", "':'", "'='",
485 "$accept", "events", "event", "event_def", "event_pmu",
486 "event_legacy_symbol", "event_legacy_cache", "event_legacy_mem",
487 "event_legacy_tracepoint", "event_legacy_numeric", "event_legacy_raw",
488 "event_config", "event_term", "sep_dc", "sep_slash_dc", 0
493 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
495 static const yytype_uint16 yytoknum[] =
497 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
498 265, 266, 267, 268, 269, 44, 47, 45, 58, 61
502 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
503 static const yytype_uint8 yyr1[] =
505 0, 20, 21, 21, 22, 22, 23, 23, 23, 23,
506 23, 23, 23, 24, 25, 25, 26, 26, 26, 27,
507 27, 28, 29, 30, 31, 31, 32, 32, 32, 32,
508 32, 33, 33, 34, 34, 34
511 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
512 static const yytype_uint8 yyr2[] =
514 0, 2, 3, 1, 2, 1, 1, 1, 2, 1,
515 2, 2, 2, 4, 4, 2, 5, 3, 1, 5,
516 3, 3, 3, 1, 3, 1, 3, 3, 1, 3,
520 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
521 Performed when YYTABLE doesn't specify something else to do. Zero
522 means the default is an error. */
523 static const yytype_uint8 yydefact[] =
525 0, 0, 35, 23, 0, 18, 0, 0, 3, 5,
526 6, 7, 32, 9, 32, 32, 32, 0, 33, 34,
527 15, 0, 0, 0, 32, 1, 0, 4, 31, 8,
528 10, 11, 12, 22, 30, 28, 0, 25, 0, 21,
529 17, 31, 20, 2, 0, 0, 0, 14, 13, 0,
530 32, 29, 27, 26, 24, 16, 19
533 /* YYDEFGOTO[NTERM-NUM]. */
534 static const yytype_int8 yydefgoto[] =
536 -1, 7, 8, 9, 10, 11, 12, 13, 14, 15,
540 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
542 #define YYPACT_NINF -15
543 static const yytype_int8 yypact[] =
545 1, -4, -9, -15, -1, 10, 22, 3, -15, 18,
546 -15, -15, 11, -15, 11, 11, 11, 25, 13, -15,
547 -15, 13, 23, 20, 14, -15, 1, -15, -15, -15,
548 -15, -15, -15, -15, 15, 16, 6, -15, 8, -15,
549 21, 24, -15, -15, 34, 9, 13, -15, -15, 28,
550 11, -15, -15, -15, -15, -15, -15
553 /* YYPGOTO[NTERM-NUM]. */
554 static const yytype_int8 yypgoto[] =
556 -15, -15, 17, -15, -15, -15, -15, -15, -15, -15,
557 -15, 19, -5, -14, -15
560 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
561 positive, shift that token. If negative, reduce the rule which
562 number is the opposite. If YYTABLE_NINF, syntax error. */
563 #define YYTABLE_NINF -1
564 static const yytype_uint8 yytable[] =
566 30, 31, 32, 25, 1, 2, 3, 18, 4, 19,
567 42, 5, 52, 6, 17, 21, 53, 22, 26, 34,
568 35, 46, 47, 46, 48, 24, 27, 23, 33, 28,
569 39, 40, 41, 50, 44, 45, 56, 51, 49, 55,
573 #define yypact_value_is_default(yystate) \
576 #define yytable_value_is_error(yytable_value) \
579 static const yytype_int8 yycheck[] =
581 14, 15, 16, 0, 3, 4, 5, 16, 7, 18,
582 24, 10, 3, 12, 18, 16, 7, 18, 15, 6,
583 7, 15, 16, 15, 16, 3, 8, 17, 3, 18,
584 7, 11, 18, 9, 19, 19, 50, 3, 17, 11,
588 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
589 symbol of state STATE-NUM. */
590 static const yytype_uint8 yystos[] =
592 0, 3, 4, 5, 7, 10, 12, 21, 22, 23,
593 24, 25, 26, 27, 28, 29, 30, 18, 16, 18,
594 34, 16, 18, 17, 3, 0, 15, 8, 18, 33,
595 33, 33, 33, 3, 6, 7, 31, 32, 31, 7,
596 11, 18, 33, 22, 19, 19, 15, 16, 16, 17,
597 9, 3, 3, 7, 32, 11, 33
600 #define yyerrok (yyerrstatus = 0)
601 #define yyclearin (yychar = YYEMPTY)
605 #define YYACCEPT goto yyacceptlab
606 #define YYABORT goto yyabortlab
607 #define YYERROR goto yyerrorlab
610 /* Like YYERROR except do call yyerror. This remains here temporarily
611 to ease the transition to the new meaning of YYERROR, for GCC.
612 Once GCC version 2 has supplanted version 1, this can go. However,
613 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
614 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
617 #define YYFAIL goto yyerrlab
619 /* This is here to suppress warnings from the GCC cpp's
620 -Wunused-macros. Normally we don't worry about that warning, but
621 some users do, and we want to make it easy for users to remove
622 YYFAIL uses, which will produce warnings from Bison 2.5. */
625 #define YYRECOVERING() (!!yyerrstatus)
627 #define YYBACKUP(Token, Value) \
629 if (yychar == YYEMPTY && yylen == 1) \
638 yyerror (list_all, list_event, idx, YY_("syntax error: cannot back up")); \
645 #define YYERRCODE 256
648 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
649 If N is 0, then set CURRENT to the empty location which ends
650 the previous symbol: RHS[0] (always defined). */
652 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
653 #ifndef YYLLOC_DEFAULT
654 # define YYLLOC_DEFAULT(Current, Rhs, N) \
658 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
659 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
660 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
661 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
665 (Current).first_line = (Current).last_line = \
666 YYRHSLOC (Rhs, 0).last_line; \
667 (Current).first_column = (Current).last_column = \
668 YYRHSLOC (Rhs, 0).last_column; \
674 /* This macro is provided for backward compatibility. */
676 #ifndef YY_LOCATION_PRINT
677 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
681 /* YYLEX -- calling `yylex' with the right arguments. */
684 # define YYLEX yylex (YYLEX_PARAM)
686 # define YYLEX yylex ()
689 /* Enable debugging if requested. */
693 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
694 # define YYFPRINTF fprintf
697 # define YYDPRINTF(Args) \
703 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
707 YYFPRINTF (stderr, "%s ", Title); \
708 yy_symbol_print (stderr, \
709 Type, Value, list_all, list_event, idx); \
710 YYFPRINTF (stderr, "\n"); \
715 /*--------------------------------.
716 | Print this symbol on YYOUTPUT. |
717 `--------------------------------*/
720 #if (defined __STDC__ || defined __C99__FUNC__ \
721 || defined __cplusplus || defined _MSC_VER)
723 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct list_head *list_all, struct list_head *list_event, int *idx)
726 yy_symbol_value_print (yyoutput, yytype, yyvaluep, list_all, list_event, idx)
729 YYSTYPE const * const yyvaluep;
730 struct list_head *list_all;
731 struct list_head *list_event;
741 if (yytype < YYNTOKENS)
742 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
754 /*--------------------------------.
755 | Print this symbol on YYOUTPUT. |
756 `--------------------------------*/
758 #if (defined __STDC__ || defined __C99__FUNC__ \
759 || defined __cplusplus || defined _MSC_VER)
761 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct list_head *list_all, struct list_head *list_event, int *idx)
764 yy_symbol_print (yyoutput, yytype, yyvaluep, list_all, list_event, idx)
767 YYSTYPE const * const yyvaluep;
768 struct list_head *list_all;
769 struct list_head *list_event;
773 if (yytype < YYNTOKENS)
774 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
776 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
778 yy_symbol_value_print (yyoutput, yytype, yyvaluep, list_all, list_event, idx);
779 YYFPRINTF (yyoutput, ")");
782 /*------------------------------------------------------------------.
783 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
785 `------------------------------------------------------------------*/
787 #if (defined __STDC__ || defined __C99__FUNC__ \
788 || defined __cplusplus || defined _MSC_VER)
790 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
793 yy_stack_print (yybottom, yytop)
794 yytype_int16 *yybottom;
798 YYFPRINTF (stderr, "Stack now");
799 for (; yybottom <= yytop; yybottom++)
801 int yybot = *yybottom;
802 YYFPRINTF (stderr, " %d", yybot);
804 YYFPRINTF (stderr, "\n");
807 # define YY_STACK_PRINT(Bottom, Top) \
810 yy_stack_print ((Bottom), (Top)); \
814 /*------------------------------------------------.
815 | Report that the YYRULE is going to be reduced. |
816 `------------------------------------------------*/
818 #if (defined __STDC__ || defined __C99__FUNC__ \
819 || defined __cplusplus || defined _MSC_VER)
821 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, struct list_head *list_all, struct list_head *list_event, int *idx)
824 yy_reduce_print (yyvsp, yyrule, list_all, list_event, idx)
827 struct list_head *list_all;
828 struct list_head *list_event;
832 int yynrhs = yyr2[yyrule];
834 unsigned long int yylno = yyrline[yyrule];
835 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
837 /* The symbols being reduced. */
838 for (yyi = 0; yyi < yynrhs; yyi++)
840 YYFPRINTF (stderr, " $%d = ", yyi + 1);
841 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
842 &(yyvsp[(yyi + 1) - (yynrhs)])
843 , list_all, list_event, idx);
844 YYFPRINTF (stderr, "\n");
848 # define YY_REDUCE_PRINT(Rule) \
851 yy_reduce_print (yyvsp, Rule, list_all, list_event, idx); \
854 /* Nonzero means print parse trace. It is left uninitialized so that
855 multiple parsers can coexist. */
858 # define YYDPRINTF(Args)
859 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
860 # define YY_STACK_PRINT(Bottom, Top)
861 # define YY_REDUCE_PRINT(Rule)
862 #endif /* !YYDEBUG */
865 /* YYINITDEPTH -- initial size of the parser's stacks. */
867 # define YYINITDEPTH 200
870 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
871 if the built-in stack extension method is used).
873 Do not make this value too large; the results are undefined if
874 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
875 evaluated with infinite-precision integer arithmetic. */
878 # define YYMAXDEPTH 10000
885 # if defined __GLIBC__ && defined _STRING_H
886 # define yystrlen strlen
888 /* Return the length of YYSTR. */
889 #if (defined __STDC__ || defined __C99__FUNC__ \
890 || defined __cplusplus || defined _MSC_VER)
892 yystrlen (const char *yystr)
900 for (yylen = 0; yystr[yylen]; yylen++)
908 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
909 # define yystpcpy stpcpy
911 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
913 #if (defined __STDC__ || defined __C99__FUNC__ \
914 || defined __cplusplus || defined _MSC_VER)
916 yystpcpy (char *yydest, const char *yysrc)
919 yystpcpy (yydest, yysrc)
925 const char *yys = yysrc;
927 while ((*yyd++ = *yys++) != '\0')
936 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
937 quotes and backslashes, so that it's suitable for yyerror. The
938 heuristic is that double-quoting is unnecessary unless the string
939 contains an apostrophe, a comma, or backslash (other than
940 backslash-backslash). YYSTR is taken from yytname. If YYRES is
941 null, do not copy; instead, return the length of what the result
944 yytnamerr (char *yyres, const char *yystr)
949 char const *yyp = yystr;
956 goto do_not_strip_quotes;
960 goto do_not_strip_quotes;
973 do_not_strip_quotes: ;
977 return yystrlen (yystr);
979 return yystpcpy (yyres, yystr) - yyres;
983 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
984 about the unexpected token YYTOKEN for the state stack whose top is
987 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
988 not large enough to hold the message. In that case, also set
989 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
990 required number of bytes is too large to store. */
992 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
993 yytype_int16 *yyssp, int yytoken)
995 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
996 YYSIZE_T yysize = yysize0;
998 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
999 /* Internationalized format string. */
1000 const char *yyformat = 0;
1001 /* Arguments of yyformat. */
1002 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1003 /* Number of reported tokens (one for the "unexpected", one per
1007 /* There are many possibilities here to consider:
1008 - Assume YYFAIL is not used. It's too flawed to consider. See
1009 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1010 for details. YYERROR is fine as it does not invoke this
1012 - If this state is a consistent state with a default action, then
1013 the only way this function was invoked is if the default action
1014 is an error action. In that case, don't check for expected
1015 tokens because there are none.
1016 - The only way there can be no lookahead present (in yychar) is if
1017 this state is a consistent state with a default action. Thus,
1018 detecting the absence of a lookahead is sufficient to determine
1019 that there is no unexpected or expected token to report. In that
1020 case, just report a simple "syntax error".
1021 - Don't assume there isn't a lookahead just because this state is a
1022 consistent state with a default action. There might have been a
1023 previous inconsistent state, consistent state with a non-default
1024 action, or user semantic action that manipulated yychar.
1025 - Of course, the expected token list depends on states to have
1026 correct lookahead information, and it depends on the parser not
1027 to perform extra reductions after fetching a lookahead from the
1028 scanner and before detecting a syntax error. Thus, state merging
1029 (from LALR or IELR) and default reductions corrupt the expected
1030 token list. However, the list is correct for canonical LR with
1031 one exception: it will still contain any token that will not be
1032 accepted due to an error action in a later state.
1034 if (yytoken != YYEMPTY)
1036 int yyn = yypact[*yyssp];
1037 yyarg[yycount++] = yytname[yytoken];
1038 if (!yypact_value_is_default (yyn))
1040 /* Start YYX at -YYN if negative to avoid negative indexes in
1041 YYCHECK. In other words, skip the first -YYN actions for
1042 this state because they are default actions. */
1043 int yyxbegin = yyn < 0 ? -yyn : 0;
1044 /* Stay within bounds of both yycheck and yytname. */
1045 int yychecklim = YYLAST - yyn + 1;
1046 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1049 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1050 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1051 && !yytable_value_is_error (yytable[yyx + yyn]))
1053 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1059 yyarg[yycount++] = yytname[yyx];
1060 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1061 if (! (yysize <= yysize1
1062 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1071 # define YYCASE_(N, S) \
1075 YYCASE_(0, YY_("syntax error"));
1076 YYCASE_(1, YY_("syntax error, unexpected %s"));
1077 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1078 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1079 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1080 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1084 yysize1 = yysize + yystrlen (yyformat);
1085 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1089 if (*yymsg_alloc < yysize)
1091 *yymsg_alloc = 2 * yysize;
1092 if (! (yysize <= *yymsg_alloc
1093 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1094 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1098 /* Avoid sprintf, as that infringes on the user's name space.
1099 Don't have undefined behavior even if the translation
1100 produced a string with the wrong number of "%s"s. */
1104 while ((*yyp = *yyformat) != '\0')
1105 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1107 yyp += yytnamerr (yyp, yyarg[yyi++]);
1118 #endif /* YYERROR_VERBOSE */
1120 /*-----------------------------------------------.
1121 | Release the memory associated to this symbol. |
1122 `-----------------------------------------------*/
1125 #if (defined __STDC__ || defined __C99__FUNC__ \
1126 || defined __cplusplus || defined _MSC_VER)
1128 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct list_head *list_all, struct list_head *list_event, int *idx)
1131 yydestruct (yymsg, yytype, yyvaluep, list_all, list_event, idx)
1135 struct list_head *list_all;
1136 struct list_head *list_event;
1147 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1158 /* Prevent warnings from -Wmissing-prototypes. */
1159 #ifdef YYPARSE_PARAM
1160 #if defined __STDC__ || defined __cplusplus
1161 int yyparse (void *YYPARSE_PARAM);
1165 #else /* ! YYPARSE_PARAM */
1166 #if defined __STDC__ || defined __cplusplus
1167 int yyparse (struct list_head *list_all, struct list_head *list_event, int *idx);
1171 #endif /* ! YYPARSE_PARAM */
1174 /* The lookahead symbol. */
1177 /* The semantic value of the lookahead symbol. */
1180 /* Number of syntax errors so far. */
1188 #ifdef YYPARSE_PARAM
1189 #if (defined __STDC__ || defined __C99__FUNC__ \
1190 || defined __cplusplus || defined _MSC_VER)
1192 yyparse (void *YYPARSE_PARAM)
1195 yyparse (YYPARSE_PARAM)
1196 void *YYPARSE_PARAM;
1198 #else /* ! YYPARSE_PARAM */
1199 #if (defined __STDC__ || defined __C99__FUNC__ \
1200 || defined __cplusplus || defined _MSC_VER)
1202 yyparse (struct list_head *list_all, struct list_head *list_event, int *idx)
1205 yyparse (list_all, list_event, idx)
1206 struct list_head *list_all;
1207 struct list_head *list_event;
1213 /* Number of tokens to shift before error messages enabled. */
1216 /* The stacks and their tools:
1217 `yyss': related to states.
1218 `yyvs': related to semantic values.
1220 Refer to the stacks thru separate pointers, to allow yyoverflow
1221 to reallocate them elsewhere. */
1223 /* The state stack. */
1224 yytype_int16 yyssa[YYINITDEPTH];
1226 yytype_int16 *yyssp;
1228 /* The semantic value stack. */
1229 YYSTYPE yyvsa[YYINITDEPTH];
1233 YYSIZE_T yystacksize;
1237 /* Lookahead token as an internal (translated) token number. */
1239 /* The variables used to return semantic value and location from the
1244 /* Buffer for error messages, and its allocated size. */
1246 char *yymsg = yymsgbuf;
1247 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1250 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1252 /* The number of symbols on the RHS of the reduced rule.
1253 Keep to zero when no symbol should be popped. */
1259 yystacksize = YYINITDEPTH;
1261 YYDPRINTF ((stderr, "Starting parse\n"));
1266 yychar = YYEMPTY; /* Cause a token to be read. */
1268 /* Initialize stack pointers.
1269 Waste one element of value and location stack
1270 so that they stay on the same level as the state stack.
1271 The wasted elements are never initialized. */
1277 /*------------------------------------------------------------.
1278 | yynewstate -- Push a new state, which is found in yystate. |
1279 `------------------------------------------------------------*/
1281 /* In all cases, when you get here, the value and location stacks
1282 have just been pushed. So pushing a state here evens the stacks. */
1288 if (yyss + yystacksize - 1 <= yyssp)
1290 /* Get the current used size of the three stacks, in elements. */
1291 YYSIZE_T yysize = yyssp - yyss + 1;
1295 /* Give user a chance to reallocate the stack. Use copies of
1296 these so that the &'s don't force the real ones into
1298 YYSTYPE *yyvs1 = yyvs;
1299 yytype_int16 *yyss1 = yyss;
1301 /* Each stack pointer address is followed by the size of the
1302 data in use in that stack, in bytes. This used to be a
1303 conditional around just the two extra args, but that might
1304 be undefined if yyoverflow is a macro. */
1305 yyoverflow (YY_("memory exhausted"),
1306 &yyss1, yysize * sizeof (*yyssp),
1307 &yyvs1, yysize * sizeof (*yyvsp),
1313 #else /* no yyoverflow */
1314 # ifndef YYSTACK_RELOCATE
1315 goto yyexhaustedlab;
1317 /* Extend the stack our own way. */
1318 if (YYMAXDEPTH <= yystacksize)
1319 goto yyexhaustedlab;
1321 if (YYMAXDEPTH < yystacksize)
1322 yystacksize = YYMAXDEPTH;
1325 yytype_int16 *yyss1 = yyss;
1326 union yyalloc *yyptr =
1327 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1329 goto yyexhaustedlab;
1330 YYSTACK_RELOCATE (yyss_alloc, yyss);
1331 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1332 # undef YYSTACK_RELOCATE
1334 YYSTACK_FREE (yyss1);
1337 #endif /* no yyoverflow */
1339 yyssp = yyss + yysize - 1;
1340 yyvsp = yyvs + yysize - 1;
1342 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1343 (unsigned long int) yystacksize));
1345 if (yyss + yystacksize - 1 <= yyssp)
1349 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1351 if (yystate == YYFINAL)
1361 /* Do appropriate processing given the current state. Read a
1362 lookahead token if we need one and don't already have one. */
1364 /* First try to decide what to do without reference to lookahead token. */
1365 yyn = yypact[yystate];
1366 if (yypact_value_is_default (yyn))
1369 /* Not known => get a lookahead token if don't already have one. */
1371 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1372 if (yychar == YYEMPTY)
1374 YYDPRINTF ((stderr, "Reading a token: "));
1378 if (yychar <= YYEOF)
1380 yychar = yytoken = YYEOF;
1381 YYDPRINTF ((stderr, "Now at end of input.\n"));
1385 yytoken = YYTRANSLATE (yychar);
1386 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1389 /* If the proper action on seeing token YYTOKEN is to reduce or to
1390 detect an error, take that action. */
1392 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1397 if (yytable_value_is_error (yyn))
1403 /* Count tokens shifted since error; after three, turn off error
1408 /* Shift the lookahead token. */
1409 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1411 /* Discard the shifted token. */
1420 /*-----------------------------------------------------------.
1421 | yydefault -- do the default action for the current state. |
1422 `-----------------------------------------------------------*/
1424 yyn = yydefact[yystate];
1430 /*-----------------------------.
1431 | yyreduce -- Do a reduction. |
1432 `-----------------------------*/
1434 /* yyn is the number of a rule to reduce with. */
1437 /* If YYLEN is nonzero, implement the default value of the action:
1440 Otherwise, the following line sets YYVAL to garbage.
1441 This behavior is undocumented and Bison
1442 users should not rely upon it. Assigning to YYVAL
1443 unconditionally makes the parser a bit smaller, and it avoids a
1444 GCC warning that YYVAL may be used uninitialized. */
1445 yyval = yyvsp[1-yylen];
1448 YY_REDUCE_PRINT (yyn);
1453 /* Line 1806 of yacc.c */
1454 #line 59 "util/parse-events.y"
1457 * Apply modifier on all events added by single event definition
1458 * (there could be more events added for multiple tracepoint
1459 * definitions via '*?'.
1461 ABORT_ON(parse_events_modifier(list_event, (yyvsp[(2) - (2)].str)));
1462 parse_events_update_lists(list_event, list_all);
1468 /* Line 1806 of yacc.c */
1469 #line 70 "util/parse-events.y"
1471 parse_events_update_lists(list_event, list_all);
1477 /* Line 1806 of yacc.c */
1478 #line 84 "util/parse-events.y"
1480 ABORT_ON(parse_events_add_pmu(list_event, idx, (yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].head)));
1481 parse_events__free_terms((yyvsp[(3) - (4)].head));
1487 /* Line 1806 of yacc.c */
1488 #line 91 "util/parse-events.y"
1490 int type = (yyvsp[(1) - (4)].num) >> 16;
1491 int config = (yyvsp[(1) - (4)].num) & 255;
1493 ABORT_ON(parse_events_add_numeric(list_event, idx, type, config, (yyvsp[(3) - (4)].head)));
1494 parse_events__free_terms((yyvsp[(3) - (4)].head));
1500 /* Line 1806 of yacc.c */
1501 #line 100 "util/parse-events.y"
1503 int type = (yyvsp[(1) - (2)].num) >> 16;
1504 int config = (yyvsp[(1) - (2)].num) & 255;
1506 ABORT_ON(parse_events_add_numeric(list_event, idx, type, config, NULL));
1512 /* Line 1806 of yacc.c */
1513 #line 109 "util/parse-events.y"
1515 ABORT_ON(parse_events_add_cache(list_event, idx, (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str)));
1521 /* Line 1806 of yacc.c */
1522 #line 114 "util/parse-events.y"
1524 ABORT_ON(parse_events_add_cache(list_event, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), NULL));
1530 /* Line 1806 of yacc.c */
1531 #line 119 "util/parse-events.y"
1533 ABORT_ON(parse_events_add_cache(list_event, idx, (yyvsp[(1) - (1)].str), NULL, NULL));
1539 /* Line 1806 of yacc.c */
1540 #line 125 "util/parse-events.y"
1542 ABORT_ON(parse_events_add_breakpoint(list_event, idx, (void *) (yyvsp[(2) - (5)].num), (yyvsp[(4) - (5)].str)));
1548 /* Line 1806 of yacc.c */
1549 #line 130 "util/parse-events.y"
1551 ABORT_ON(parse_events_add_breakpoint(list_event, idx, (void *) (yyvsp[(2) - (3)].num), NULL));
1557 /* Line 1806 of yacc.c */
1558 #line 136 "util/parse-events.y"
1560 ABORT_ON(parse_events_add_tracepoint(list_event, idx, (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)));
1566 /* Line 1806 of yacc.c */
1567 #line 142 "util/parse-events.y"
1569 ABORT_ON(parse_events_add_numeric(list_event, idx, (yyvsp[(1) - (3)].num), (yyvsp[(3) - (3)].num), NULL));
1575 /* Line 1806 of yacc.c */
1576 #line 148 "util/parse-events.y"
1578 ABORT_ON(parse_events_add_numeric(list_event, idx, PERF_TYPE_RAW, (yyvsp[(1) - (1)].num), NULL));
1584 /* Line 1806 of yacc.c */
1585 #line 154 "util/parse-events.y"
1587 struct list_head *head = (yyvsp[(1) - (3)].head);
1588 struct parse_events__term *term = (yyvsp[(3) - (3)].term);
1591 list_add_tail(&term->list, head);
1592 (yyval.head) = (yyvsp[(1) - (3)].head);
1598 /* Line 1806 of yacc.c */
1599 #line 164 "util/parse-events.y"
1601 struct list_head *head = malloc(sizeof(*head));
1602 struct parse_events__term *term = (yyvsp[(1) - (1)].term);
1605 INIT_LIST_HEAD(head);
1606 list_add_tail(&term->list, head);
1607 (yyval.head) = head;
1613 /* Line 1806 of yacc.c */
1614 #line 176 "util/parse-events.y"
1616 struct parse_events__term *term;
1618 ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_STR,
1619 (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str), 0));
1620 (yyval.term) = term;
1626 /* Line 1806 of yacc.c */
1627 #line 185 "util/parse-events.y"
1629 struct parse_events__term *term;
1631 ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM,
1632 (yyvsp[(1) - (3)].str), NULL, (yyvsp[(3) - (3)].num)));
1633 (yyval.term) = term;
1639 /* Line 1806 of yacc.c */
1640 #line 194 "util/parse-events.y"
1642 struct parse_events__term *term;
1644 ABORT_ON(parse_events__new_term(&term, PARSE_EVENTS__TERM_TYPE_NUM,
1645 (yyvsp[(1) - (1)].str), NULL, 1));
1646 (yyval.term) = term;
1652 /* Line 1806 of yacc.c */
1653 #line 203 "util/parse-events.y"
1655 struct parse_events__term *term;
1657 ABORT_ON(parse_events__new_term(&term, (yyvsp[(1) - (3)].num), NULL, NULL, (yyvsp[(3) - (3)].num)));
1658 (yyval.term) = term;
1664 /* Line 1806 of yacc.c */
1665 #line 211 "util/parse-events.y"
1667 struct parse_events__term *term;
1669 ABORT_ON(parse_events__new_term(&term, (yyvsp[(1) - (1)].num), NULL, NULL, 1));
1670 (yyval.term) = term;
1676 /* Line 1806 of yacc.c */
1677 #line 1678 "util/parse-events-bison.c"
1680 /* User semantic actions sometimes alter yychar, and that requires
1681 that yytoken be updated with the new translation. We take the
1682 approach of translating immediately before every use of yytoken.
1683 One alternative is translating here after every semantic action,
1684 but that translation would be missed if the semantic action invokes
1685 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1686 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1687 incorrect destructor might then be invoked immediately. In the
1688 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1689 to an incorrect destructor call or verbose syntax error message
1690 before the lookahead is translated. */
1691 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1695 YY_STACK_PRINT (yyss, yyssp);
1699 /* Now `shift' the result of the reduction. Determine what state
1700 that goes to, based on the state we popped back to and the rule
1701 number reduced by. */
1705 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1706 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1707 yystate = yytable[yystate];
1709 yystate = yydefgoto[yyn - YYNTOKENS];
1714 /*------------------------------------.
1715 | yyerrlab -- here on detecting error |
1716 `------------------------------------*/
1718 /* Make sure we have latest lookahead translation. See comments at
1719 user semantic actions for why this is necessary. */
1720 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1722 /* If not already recovering from an error, report this error. */
1726 #if ! YYERROR_VERBOSE
1727 yyerror (list_all, list_event, idx, YY_("syntax error"));
1729 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1732 char const *yymsgp = YY_("syntax error");
1733 int yysyntax_error_status;
1734 yysyntax_error_status = YYSYNTAX_ERROR;
1735 if (yysyntax_error_status == 0)
1737 else if (yysyntax_error_status == 1)
1739 if (yymsg != yymsgbuf)
1740 YYSTACK_FREE (yymsg);
1741 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1745 yymsg_alloc = sizeof yymsgbuf;
1746 yysyntax_error_status = 2;
1750 yysyntax_error_status = YYSYNTAX_ERROR;
1754 yyerror (list_all, list_event, idx, yymsgp);
1755 if (yysyntax_error_status == 2)
1756 goto yyexhaustedlab;
1758 # undef YYSYNTAX_ERROR
1764 if (yyerrstatus == 3)
1766 /* If just tried and failed to reuse lookahead token after an
1767 error, discard it. */
1769 if (yychar <= YYEOF)
1771 /* Return failure if at end of input. */
1772 if (yychar == YYEOF)
1777 yydestruct ("Error: discarding",
1778 yytoken, &yylval, list_all, list_event, idx);
1783 /* Else will try to reuse lookahead token after shifting the error
1788 /*---------------------------------------------------.
1789 | yyerrorlab -- error raised explicitly by YYERROR. |
1790 `---------------------------------------------------*/
1793 /* Pacify compilers like GCC when the user code never invokes
1794 YYERROR and the label yyerrorlab therefore never appears in user
1796 if (/*CONSTCOND*/ 0)
1799 /* Do not reclaim the symbols of the rule which action triggered
1803 YY_STACK_PRINT (yyss, yyssp);
1808 /*-------------------------------------------------------------.
1809 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1810 `-------------------------------------------------------------*/
1812 yyerrstatus = 3; /* Each real token shifted decrements this. */
1816 yyn = yypact[yystate];
1817 if (!yypact_value_is_default (yyn))
1820 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1828 /* Pop the current state because it cannot handle the error token. */
1833 yydestruct ("Error: popping",
1834 yystos[yystate], yyvsp, list_all, list_event, idx);
1837 YY_STACK_PRINT (yyss, yyssp);
1843 /* Shift the error token. */
1844 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1850 /*-------------------------------------.
1851 | yyacceptlab -- YYACCEPT comes here. |
1852 `-------------------------------------*/
1857 /*-----------------------------------.
1858 | yyabortlab -- YYABORT comes here. |
1859 `-----------------------------------*/
1864 #if !defined(yyoverflow) || YYERROR_VERBOSE
1865 /*-------------------------------------------------.
1866 | yyexhaustedlab -- memory exhaustion comes here. |
1867 `-------------------------------------------------*/
1869 yyerror (list_all, list_event, idx, YY_("memory exhausted"));
1875 if (yychar != YYEMPTY)
1877 /* Make sure we have latest lookahead translation. See comments at
1878 user semantic actions for why this is necessary. */
1879 yytoken = YYTRANSLATE (yychar);
1880 yydestruct ("Cleanup: discarding lookahead",
1881 yytoken, &yylval, list_all, list_event, idx);
1883 /* Do not reclaim the symbols of the rule which action triggered
1884 this YYABORT or YYACCEPT. */
1886 YY_STACK_PRINT (yyss, yyssp);
1887 while (yyssp != yyss)
1889 yydestruct ("Cleanup: popping",
1890 yystos[*yyssp], yyvsp, list_all, list_event, idx);
1895 YYSTACK_FREE (yyss);
1898 if (yymsg != yymsgbuf)
1899 YYSTACK_FREE (yymsg);
1901 /* Make sure YYID is used. */
1902 return YYID (yyresult);
1907 /* Line 2067 of yacc.c */
1908 #line 222 "util/parse-events.y"
1911 void parse_events_error(struct list_head *list_all __used,
1912 struct list_head *list_event __used,
1914 char const *msg __used)