Linux Perf
pmu-bison.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse perf_pmu_parse
64 #define yylex perf_pmu_lex
65 #define yyerror perf_pmu_error
66 #define yydebug perf_pmu_debug
67 #define yynerrs perf_pmu_nerrs
68 
69 #define yylval perf_pmu_lval
70 #define yychar perf_pmu_char
71 
72 /* Copy the first part of user declarations. */
73 #line 5 "util/pmu.y" /* yacc.c:339 */
74 
75 
76 #include <linux/compiler.h>
77 #include <linux/list.h>
78 #include <linux/bitmap.h>
79 #include <string.h>
80 #include "pmu.h"
81 
82 extern int perf_pmu_lex (void);
83 
84 #define ABORT_ON(val) \
85 do { \
86  if (val) \
87  YYABORT; \
88 } while (0)
89 
90 
91 #line 92 "util/pmu-bison.c" /* yacc.c:339 */
92 
93 # ifndef YY_NULLPTR
94 # if defined __cplusplus && 201103L <= __cplusplus
95 # define YY_NULLPTR nullptr
96 # else
97 # define YY_NULLPTR 0
98 # endif
99 # endif
100 
101 /* Enabling verbose error messages. */
102 #ifdef YYERROR_VERBOSE
103 # undef YYERROR_VERBOSE
104 # define YYERROR_VERBOSE 1
105 #else
106 # define YYERROR_VERBOSE 0
107 #endif
108 
109 /* In a future release of Bison, this section will be replaced
110  by #include "pmu-bison.h". */
111 #ifndef YY_PERF_PMU_UTIL_PMU_BISON_H_INCLUDED
112 # define YY_PERF_PMU_UTIL_PMU_BISON_H_INCLUDED
113 /* Debug traces. */
114 #ifndef YYDEBUG
115 # define YYDEBUG 0
116 #endif
117 #if YYDEBUG
118 extern int perf_pmu_debug;
119 #endif
120 
121 /* Token type. */
122 #ifndef YYTOKENTYPE
123 # define YYTOKENTYPE
125  {
126  PP_CONFIG = 258,
127  PP_CONFIG1 = 259,
128  PP_CONFIG2 = 260,
129  PP_VALUE = 261,
130  PP_ERROR = 262
131  };
132 #endif
133 
134 /* Value type. */
135 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
136 
137 union YYSTYPE
138 {
139 #line 30 "util/pmu.y" /* yacc.c:355 */
140 
141  unsigned long num;
143 
144 #line 145 "util/pmu-bison.c" /* yacc.c:355 */
145 };
146 
147 typedef union YYSTYPE YYSTYPE;
148 # define YYSTYPE_IS_TRIVIAL 1
149 # define YYSTYPE_IS_DECLARED 1
150 #endif
151 
152 
153 extern YYSTYPE perf_pmu_lval;
154 
155 int perf_pmu_parse (struct list_head *format, char *name);
156 
157 #endif /* !YY_PERF_PMU_UTIL_PMU_BISON_H_INCLUDED */
158 
159 /* Copy the second part of user declarations. */
160 
161 #line 162 "util/pmu-bison.c" /* yacc.c:358 */
162 
163 #ifdef short
164 # undef short
165 #endif
166 
167 #ifdef YYTYPE_UINT8
168 typedef YYTYPE_UINT8 yytype_uint8;
169 #else
170 typedef unsigned char yytype_uint8;
171 #endif
172 
173 #ifdef YYTYPE_INT8
174 typedef YYTYPE_INT8 yytype_int8;
175 #else
176 typedef signed char yytype_int8;
177 #endif
178 
179 #ifdef YYTYPE_UINT16
180 typedef YYTYPE_UINT16 yytype_uint16;
181 #else
182 typedef unsigned short int yytype_uint16;
183 #endif
184 
185 #ifdef YYTYPE_INT16
186 typedef YYTYPE_INT16 yytype_int16;
187 #else
188 typedef short int yytype_int16;
189 #endif
190 
191 #ifndef YYSIZE_T
192 # ifdef __SIZE_TYPE__
193 # define YYSIZE_T __SIZE_TYPE__
194 # elif defined size_t
195 # define YYSIZE_T size_t
196 # elif ! defined YYSIZE_T
197 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
198 # define YYSIZE_T size_t
199 # else
200 # define YYSIZE_T unsigned int
201 # endif
202 #endif
203 
204 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
205 
206 #ifndef YY_
207 # if defined YYENABLE_NLS && YYENABLE_NLS
208 # if ENABLE_NLS
209 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
210 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
211 # endif
212 # endif
213 # ifndef YY_
214 # define YY_(Msgid) Msgid
215 # endif
216 #endif
217 
218 #ifndef YY_ATTRIBUTE
219 # if (defined __GNUC__ \
220  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
221  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
222 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
223 # else
224 # define YY_ATTRIBUTE(Spec) /* empty */
225 # endif
226 #endif
227 
228 #ifndef YY_ATTRIBUTE_PURE
229 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
230 #endif
231 
232 #ifndef YY_ATTRIBUTE_UNUSED
233 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
234 #endif
235 
236 #if !defined _Noreturn \
237  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
238 # if defined _MSC_VER && 1200 <= _MSC_VER
239 # define _Noreturn __declspec (noreturn)
240 # else
241 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
242 # endif
243 #endif
244 
245 /* Suppress unused-variable warnings by "using" E. */
246 #if ! defined lint || defined __GNUC__
247 # define YYUSE(E) ((void) (E))
248 #else
249 # define YYUSE(E) /* empty */
250 #endif
251 
252 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
253 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
254 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
255  _Pragma ("GCC diagnostic push") \
256  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
257  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
258 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
259  _Pragma ("GCC diagnostic pop")
260 #else
261 # define YY_INITIAL_VALUE(Value) Value
262 #endif
263 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
264 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
265 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
266 #endif
267 #ifndef YY_INITIAL_VALUE
268 # define YY_INITIAL_VALUE(Value) /* Nothing. */
269 #endif
270 
271 
272 #if ! defined yyoverflow || YYERROR_VERBOSE
273 
274 /* The parser invokes alloca or malloc; define the necessary symbols. */
275 
276 # ifdef YYSTACK_USE_ALLOCA
277 # if YYSTACK_USE_ALLOCA
278 # ifdef __GNUC__
279 # define YYSTACK_ALLOC __builtin_alloca
280 # elif defined __BUILTIN_VA_ARG_INCR
281 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
282 # elif defined _AIX
283 # define YYSTACK_ALLOC __alloca
284 # elif defined _MSC_VER
285 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
286 # define alloca _alloca
287 # else
288 # define YYSTACK_ALLOC alloca
289 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
290 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
291  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
292 # ifndef EXIT_SUCCESS
293 # define EXIT_SUCCESS 0
294 # endif
295 # endif
296 # endif
297 # endif
298 # endif
299 
300 # ifdef YYSTACK_ALLOC
301  /* Pacify GCC's 'empty if-body' warning. */
302 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
303 # ifndef YYSTACK_ALLOC_MAXIMUM
304  /* The OS might guarantee only one guard page at the bottom of the stack,
305  and a page size can be as small as 4096 bytes. So we cannot safely
306  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
307  to allow for a few compiler-allocated temporary stack slots. */
308 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
309 # endif
310 # else
311 # define YYSTACK_ALLOC YYMALLOC
312 # define YYSTACK_FREE YYFREE
313 # ifndef YYSTACK_ALLOC_MAXIMUM
314 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
315 # endif
316 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
317  && ! ((defined YYMALLOC || defined malloc) \
318  && (defined YYFREE || defined free)))
319 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
320 # ifndef EXIT_SUCCESS
321 # define EXIT_SUCCESS 0
322 # endif
323 # endif
324 # ifndef YYMALLOC
325 # define YYMALLOC malloc
326 # if ! defined malloc && ! defined EXIT_SUCCESS
327 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
328 # endif
329 # endif
330 # ifndef YYFREE
331 # define YYFREE free
332 # if ! defined free && ! defined EXIT_SUCCESS
333 void free (void *); /* INFRINGES ON USER NAME SPACE */
334 # endif
335 # endif
336 # endif
337 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
338 
339 
340 #if (! defined yyoverflow \
341  && (! defined __cplusplus \
342  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
343 
344 /* A type that is properly aligned for any stack member. */
345 union yyalloc
346 {
347  yytype_int16 yyss_alloc;
348  YYSTYPE yyvs_alloc;
349 };
350 
351 /* The size of the maximum gap between one aligned stack and the next. */
352 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
353 
354 /* The size of an array large to enough to hold all stacks, each with
355  N elements. */
356 # define YYSTACK_BYTES(N) \
357  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
358  + YYSTACK_GAP_MAXIMUM)
359 
360 # define YYCOPY_NEEDED 1
361 
362 /* Relocate STACK from its old location to the new one. The
363  local variables YYSIZE and YYSTACKSIZE give the old and new number of
364  elements in the stack, and YYPTR gives the new location of the
365  stack. Advance YYPTR to a properly aligned location for the next
366  stack. */
367 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
368  do \
369  { \
370  YYSIZE_T yynewbytes; \
371  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
372  Stack = &yyptr->Stack_alloc; \
373  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
374  yyptr += yynewbytes / sizeof (*yyptr); \
375  } \
376  while (0)
377 
378 #endif
379 
380 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
381 /* Copy COUNT objects from SRC to DST. The source and destination do
382  not overlap. */
383 # ifndef YYCOPY
384 # if defined __GNUC__ && 1 < __GNUC__
385 # define YYCOPY(Dst, Src, Count) \
386  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
387 # else
388 # define YYCOPY(Dst, Src, Count) \
389  do \
390  { \
391  YYSIZE_T yyi; \
392  for (yyi = 0; yyi < (Count); yyi++) \
393  (Dst)[yyi] = (Src)[yyi]; \
394  } \
395  while (0)
396 # endif
397 # endif
398 #endif /* !YYCOPY_NEEDED */
399 
400 /* YYFINAL -- State number of the termination state. */
401 #define YYFINAL 9
402 /* YYLAST -- Last index in YYTABLE. */
403 #define YYLAST 17
404 
405 /* YYNTOKENS -- Number of terminals. */
406 #define YYNTOKENS 11
407 /* YYNNTS -- Number of nonterminals. */
408 #define YYNNTS 5
409 /* YYNRULES -- Number of rules. */
410 #define YYNRULES 10
411 /* YYNSTATES -- Number of states. */
412 #define YYNSTATES 20
413 
414 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
415  by yylex, with out-of-bounds checking. */
416 #define YYUNDEFTOK 2
417 #define YYMAXUTOK 262
418 
419 #define YYTRANSLATE(YYX) \
420  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
421 
422 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
423  as returned by yylex, without out-of-bounds checking. */
424 static const yytype_uint8 yytranslate[] =
425 {
426  0, 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, 9, 10, 2, 2, 2, 2,
431  2, 2, 2, 2, 2, 2, 2, 2, 8, 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, 2, 2, 2, 2,
436  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
452  5, 6, 7
453 };
454 
455 #if YYDEBUG
456  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
457 static const yytype_uint8 yyrline[] =
458 {
459  0, 38, 38, 40, 43, 50, 57, 65, 70, 76,
460  81
461 };
462 #endif
463 
464 #if YYDEBUG || YYERROR_VERBOSE || 0
465 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
466  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
467 static const char *const yytname[] =
468 {
469  "$end", "error", "$undefined", "PP_CONFIG", "PP_CONFIG1", "PP_CONFIG2",
470  "PP_VALUE", "PP_ERROR", "':'", "','", "'-'", "$accept", "format",
471  "format_term", "bits", "bit_term", YY_NULLPTR
472 };
473 #endif
474 
475 # ifdef YYPRINT
476 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
477  (internal) symbol number NUM (which must be that of a token). */
478 static const yytype_uint16 yytoknum[] =
479 {
480  0, 256, 257, 258, 259, 260, 261, 262, 58, 44,
481  45
482 };
483 # endif
484 
485 #define YYPACT_NINF -7
486 
487 #define yypact_value_is_default(Yystate) \
488  (!!((Yystate) == (-7)))
489 
490 #define YYTABLE_NINF -1
491 
492 #define yytable_value_is_error(Yytable_value) \
493  0
494 
495  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
496  STATE-NUM. */
497 static const yytype_int8 yypact[] =
498 {
499  3, 1, 2, 4, 0, -7, 5, 5, 5, -7,
500  -7, 6, 8, -7, 8, 8, 7, 5, -7, -7
501 };
502 
503  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
504  Performed when YYTABLE does not specify something else to do. Zero
505  means the default is an error. */
506 static const yytype_uint8 yydefact[] =
507 {
508  0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
509  2, 10, 4, 8, 5, 6, 0, 0, 9, 7
510 };
511 
512  /* YYPGOTO[NTERM-NUM]. */
513 static const yytype_int8 yypgoto[] =
514 {
515  -7, -7, 10, -6, -2
516 };
517 
518  /* YYDEFGOTO[NTERM-NUM]. */
519 static const yytype_int8 yydefgoto[] =
520 {
521  -1, 4, 5, 12, 13
522 };
523 
524  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
525  positive, shift that token. If negative, reduce the rule whose
526  number is the opposite. If YYTABLE_NINF, syntax error. */
527 static const yytype_uint8 yytable[] =
528 {
529  9, 14, 15, 1, 2, 3, 1, 2, 3, 6,
530  7, 11, 8, 18, 10, 19, 16, 17
531 };
532 
533 static const yytype_uint8 yycheck[] =
534 {
535  0, 7, 8, 3, 4, 5, 3, 4, 5, 8,
536  8, 6, 8, 6, 4, 17, 10, 9
537 };
538 
539  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
540  symbol of state STATE-NUM. */
541 static const yytype_uint8 yystos[] =
542 {
543  0, 3, 4, 5, 12, 13, 8, 8, 8, 0,
544  13, 6, 14, 15, 14, 14, 10, 9, 6, 15
545 };
546 
547  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
548 static const yytype_uint8 yyr1[] =
549 {
550  0, 11, 12, 12, 13, 13, 13, 14, 14, 15,
551  15
552 };
553 
554  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
555 static const yytype_uint8 yyr2[] =
556 {
557  0, 2, 2, 1, 3, 3, 3, 3, 1, 3,
558  1
559 };
560 
561 
562 #define yyerrok (yyerrstatus = 0)
563 #define yyclearin (yychar = YYEMPTY)
564 #define YYEMPTY (-2)
565 #define YYEOF 0
566 
567 #define YYACCEPT goto yyacceptlab
568 #define YYABORT goto yyabortlab
569 #define YYERROR goto yyerrorlab
570 
571 
572 #define YYRECOVERING() (!!yyerrstatus)
573 
574 #define YYBACKUP(Token, Value) \
575 do \
576  if (yychar == YYEMPTY) \
577  { \
578  yychar = (Token); \
579  yylval = (Value); \
580  YYPOPSTACK (yylen); \
581  yystate = *yyssp; \
582  goto yybackup; \
583  } \
584  else \
585  { \
586  yyerror (format, name, YY_("syntax error: cannot back up")); \
587  YYERROR; \
588  } \
589 while (0)
590 
591 /* Error token number */
592 #define YYTERROR 1
593 #define YYERRCODE 256
594 
595 
596 
597 /* Enable debugging if requested. */
598 #if YYDEBUG
599 
600 # ifndef YYFPRINTF
601 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
602 # define YYFPRINTF fprintf
603 # endif
604 
605 # define YYDPRINTF(Args) \
606 do { \
607  if (yydebug) \
608  YYFPRINTF Args; \
609 } while (0)
610 
611 /* This macro is provided for backward compatibility. */
612 #ifndef YY_LOCATION_PRINT
613 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
614 #endif
615 
616 
617 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
618 do { \
619  if (yydebug) \
620  { \
621  YYFPRINTF (stderr, "%s ", Title); \
622  yy_symbol_print (stderr, \
623  Type, Value, format, name); \
624  YYFPRINTF (stderr, "\n"); \
625  } \
626 } while (0)
627 
628 
629 /*----------------------------------------.
630 | Print this symbol's value on YYOUTPUT. |
631 `----------------------------------------*/
632 
633 static void
634 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct list_head *format, char *name)
635 {
636  FILE *yyo = yyoutput;
637  YYUSE (yyo);
638  YYUSE (format);
639  YYUSE (name);
640  if (!yyvaluep)
641  return;
642 # ifdef YYPRINT
643  if (yytype < YYNTOKENS)
644  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
645 # endif
646  YYUSE (yytype);
647 }
648 
649 
650 /*--------------------------------.
651 | Print this symbol on YYOUTPUT. |
652 `--------------------------------*/
653 
654 static void
655 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct list_head *format, char *name)
656 {
657  YYFPRINTF (yyoutput, "%s %s (",
658  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
659 
660  yy_symbol_value_print (yyoutput, yytype, yyvaluep, format, name);
661  YYFPRINTF (yyoutput, ")");
662 }
663 
664 /*------------------------------------------------------------------.
665 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
666 | TOP (included). |
667 `------------------------------------------------------------------*/
668 
669 static void
670 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
671 {
672  YYFPRINTF (stderr, "Stack now");
673  for (; yybottom <= yytop; yybottom++)
674  {
675  int yybot = *yybottom;
676  YYFPRINTF (stderr, " %d", yybot);
677  }
678  YYFPRINTF (stderr, "\n");
679 }
680 
681 # define YY_STACK_PRINT(Bottom, Top) \
682 do { \
683  if (yydebug) \
684  yy_stack_print ((Bottom), (Top)); \
685 } while (0)
686 
687 
688 /*------------------------------------------------.
689 | Report that the YYRULE is going to be reduced. |
690 `------------------------------------------------*/
691 
692 static void
693 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, struct list_head *format, char *name)
694 {
695  unsigned long int yylno = yyrline[yyrule];
696  int yynrhs = yyr2[yyrule];
697  int yyi;
698  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
699  yyrule - 1, yylno);
700  /* The symbols being reduced. */
701  for (yyi = 0; yyi < yynrhs; yyi++)
702  {
703  YYFPRINTF (stderr, " $%d = ", yyi + 1);
704  yy_symbol_print (stderr,
705  yystos[yyssp[yyi + 1 - yynrhs]],
706  &(yyvsp[(yyi + 1) - (yynrhs)])
707  , format, name);
708  YYFPRINTF (stderr, "\n");
709  }
710 }
711 
712 # define YY_REDUCE_PRINT(Rule) \
713 do { \
714  if (yydebug) \
715  yy_reduce_print (yyssp, yyvsp, Rule, format, name); \
716 } while (0)
717 
718 /* Nonzero means print parse trace. It is left uninitialized so that
719  multiple parsers can coexist. */
720 int yydebug;
721 #else /* !YYDEBUG */
722 # define YYDPRINTF(Args)
723 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
724 # define YY_STACK_PRINT(Bottom, Top)
725 # define YY_REDUCE_PRINT(Rule)
726 #endif /* !YYDEBUG */
727 
728 
729 /* YYINITDEPTH -- initial size of the parser's stacks. */
730 #ifndef YYINITDEPTH
731 # define YYINITDEPTH 200
732 #endif
733 
734 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
735  if the built-in stack extension method is used).
736 
737  Do not make this value too large; the results are undefined if
738  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
739  evaluated with infinite-precision integer arithmetic. */
740 
741 #ifndef YYMAXDEPTH
742 # define YYMAXDEPTH 10000
743 #endif
744 
745 
746 #if YYERROR_VERBOSE
747 
748 # ifndef yystrlen
749 # if defined __GLIBC__ && defined _STRING_H
750 # define yystrlen strlen
751 # else
752 /* Return the length of YYSTR. */
753 static YYSIZE_T
754 yystrlen (const char *yystr)
755 {
756  YYSIZE_T yylen;
757  for (yylen = 0; yystr[yylen]; yylen++)
758  continue;
759  return yylen;
760 }
761 # endif
762 # endif
763 
764 # ifndef yystpcpy
765 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
766 # define yystpcpy stpcpy
767 # else
768 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
769  YYDEST. */
770 static char *
771 yystpcpy (char *yydest, const char *yysrc)
772 {
773  char *yyd = yydest;
774  const char *yys = yysrc;
775 
776  while ((*yyd++ = *yys++) != '\0')
777  continue;
778 
779  return yyd - 1;
780 }
781 # endif
782 # endif
783 
784 # ifndef yytnamerr
785 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
786  quotes and backslashes, so that it's suitable for yyerror. The
787  heuristic is that double-quoting is unnecessary unless the string
788  contains an apostrophe, a comma, or backslash (other than
789  backslash-backslash). YYSTR is taken from yytname. If YYRES is
790  null, do not copy; instead, return the length of what the result
791  would have been. */
792 static YYSIZE_T
793 yytnamerr (char *yyres, const char *yystr)
794 {
795  if (*yystr == '"')
796  {
797  YYSIZE_T yyn = 0;
798  char const *yyp = yystr;
799 
800  for (;;)
801  switch (*++yyp)
802  {
803  case '\'':
804  case ',':
805  goto do_not_strip_quotes;
806 
807  case '\\':
808  if (*++yyp != '\\')
809  goto do_not_strip_quotes;
810  /* Fall through. */
811  default:
812  if (yyres)
813  yyres[yyn] = *yyp;
814  yyn++;
815  break;
816 
817  case '"':
818  if (yyres)
819  yyres[yyn] = '\0';
820  return yyn;
821  }
822  do_not_strip_quotes: ;
823  }
824 
825  if (! yyres)
826  return yystrlen (yystr);
827 
828  return yystpcpy (yyres, yystr) - yyres;
829 }
830 # endif
831 
832 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
833  about the unexpected token YYTOKEN for the state stack whose top is
834  YYSSP.
835 
836  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
837  not large enough to hold the message. In that case, also set
838  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
839  required number of bytes is too large to store. */
840 static int
841 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
842  yytype_int16 *yyssp, int yytoken)
843 {
844  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
845  YYSIZE_T yysize = yysize0;
846  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
847  /* Internationalized format string. */
848  const char *yyformat = YY_NULLPTR;
849  /* Arguments of yyformat. */
850  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
851  /* Number of reported tokens (one for the "unexpected", one per
852  "expected"). */
853  int yycount = 0;
854 
855  /* There are many possibilities here to consider:
856  - If this state is a consistent state with a default action, then
857  the only way this function was invoked is if the default action
858  is an error action. In that case, don't check for expected
859  tokens because there are none.
860  - The only way there can be no lookahead present (in yychar) is if
861  this state is a consistent state with a default action. Thus,
862  detecting the absence of a lookahead is sufficient to determine
863  that there is no unexpected or expected token to report. In that
864  case, just report a simple "syntax error".
865  - Don't assume there isn't a lookahead just because this state is a
866  consistent state with a default action. There might have been a
867  previous inconsistent state, consistent state with a non-default
868  action, or user semantic action that manipulated yychar.
869  - Of course, the expected token list depends on states to have
870  correct lookahead information, and it depends on the parser not
871  to perform extra reductions after fetching a lookahead from the
872  scanner and before detecting a syntax error. Thus, state merging
873  (from LALR or IELR) and default reductions corrupt the expected
874  token list. However, the list is correct for canonical LR with
875  one exception: it will still contain any token that will not be
876  accepted due to an error action in a later state.
877  */
878  if (yytoken != YYEMPTY)
879  {
880  int yyn = yypact[*yyssp];
881  yyarg[yycount++] = yytname[yytoken];
882  if (!yypact_value_is_default (yyn))
883  {
884  /* Start YYX at -YYN if negative to avoid negative indexes in
885  YYCHECK. In other words, skip the first -YYN actions for
886  this state because they are default actions. */
887  int yyxbegin = yyn < 0 ? -yyn : 0;
888  /* Stay within bounds of both yycheck and yytname. */
889  int yychecklim = YYLAST - yyn + 1;
890  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
891  int yyx;
892 
893  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
894  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
895  && !yytable_value_is_error (yytable[yyx + yyn]))
896  {
897  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
898  {
899  yycount = 1;
900  yysize = yysize0;
901  break;
902  }
903  yyarg[yycount++] = yytname[yyx];
904  {
905  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
906  if (! (yysize <= yysize1
907  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
908  return 2;
909  yysize = yysize1;
910  }
911  }
912  }
913  }
914 
915  switch (yycount)
916  {
917 # define YYCASE_(N, S) \
918  case N: \
919  yyformat = S; \
920  break
921  YYCASE_(0, YY_("syntax error"));
922  YYCASE_(1, YY_("syntax error, unexpected %s"));
923  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
924  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
925  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
926  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
927 # undef YYCASE_
928  }
929 
930  {
931  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
932  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
933  return 2;
934  yysize = yysize1;
935  }
936 
937  if (*yymsg_alloc < yysize)
938  {
939  *yymsg_alloc = 2 * yysize;
940  if (! (yysize <= *yymsg_alloc
941  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
942  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
943  return 1;
944  }
945 
946  /* Avoid sprintf, as that infringes on the user's name space.
947  Don't have undefined behavior even if the translation
948  produced a string with the wrong number of "%s"s. */
949  {
950  char *yyp = *yymsg;
951  int yyi = 0;
952  while ((*yyp = *yyformat) != '\0')
953  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
954  {
955  yyp += yytnamerr (yyp, yyarg[yyi++]);
956  yyformat += 2;
957  }
958  else
959  {
960  yyp++;
961  yyformat++;
962  }
963  }
964  return 0;
965 }
966 #endif /* YYERROR_VERBOSE */
967 
968 /*-----------------------------------------------.
969 | Release the memory associated to this symbol. |
970 `-----------------------------------------------*/
971 
972 static void
973 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct list_head *format, char *name)
974 {
975  YYUSE (yyvaluep);
976  YYUSE (format);
977  YYUSE (name);
978  if (!yymsg)
979  yymsg = "Deleting";
980  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
981 
983  YYUSE (yytype);
985 }
986 
987 
988 
989 
990 /* The lookahead symbol. */
991 int yychar;
992 
993 /* The semantic value of the lookahead symbol. */
995 /* Number of syntax errors so far. */
997 
998 
999 /*----------.
1000 | yyparse. |
1001 `----------*/
1002 
1003 int
1004 yyparse (struct list_head *format, char *name)
1005 {
1006  int yystate;
1007  /* Number of tokens to shift before error messages enabled. */
1008  int yyerrstatus;
1009 
1010  /* The stacks and their tools:
1011  'yyss': related to states.
1012  'yyvs': related to semantic values.
1013 
1014  Refer to the stacks through separate pointers, to allow yyoverflow
1015  to reallocate them elsewhere. */
1016 
1017  /* The state stack. */
1018  yytype_int16 yyssa[YYINITDEPTH];
1019  yytype_int16 *yyss;
1020  yytype_int16 *yyssp;
1021 
1022  /* The semantic value stack. */
1023  YYSTYPE yyvsa[YYINITDEPTH];
1024  YYSTYPE *yyvs;
1025  YYSTYPE *yyvsp;
1026 
1027  YYSIZE_T yystacksize;
1028 
1029  int yyn;
1030  int yyresult;
1031  /* Lookahead token as an internal (translated) token number. */
1032  int yytoken = 0;
1033  /* The variables used to return semantic value and location from the
1034  action routines. */
1035  YYSTYPE yyval;
1036 
1037 #if YYERROR_VERBOSE
1038  /* Buffer for error messages, and its allocated size. */
1039  char yymsgbuf[128];
1040  char *yymsg = yymsgbuf;
1041  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1042 #endif
1043 
1044 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1045 
1046  /* The number of symbols on the RHS of the reduced rule.
1047  Keep to zero when no symbol should be popped. */
1048  int yylen = 0;
1049 
1050  yyssp = yyss = yyssa;
1051  yyvsp = yyvs = yyvsa;
1052  yystacksize = YYINITDEPTH;
1053 
1054  YYDPRINTF ((stderr, "Starting parse\n"));
1055 
1056  yystate = 0;
1057  yyerrstatus = 0;
1058  yynerrs = 0;
1059  yychar = YYEMPTY; /* Cause a token to be read. */
1060  goto yysetstate;
1061 
1062 /*------------------------------------------------------------.
1063 | yynewstate -- Push a new state, which is found in yystate. |
1064 `------------------------------------------------------------*/
1065  yynewstate:
1066  /* In all cases, when you get here, the value and location stacks
1067  have just been pushed. So pushing a state here evens the stacks. */
1068  yyssp++;
1069 
1070  yysetstate:
1071  *yyssp = yystate;
1072 
1073  if (yyss + yystacksize - 1 <= yyssp)
1074  {
1075  /* Get the current used size of the three stacks, in elements. */
1076  YYSIZE_T yysize = yyssp - yyss + 1;
1077 
1078 #ifdef yyoverflow
1079  {
1080  /* Give user a chance to reallocate the stack. Use copies of
1081  these so that the &'s don't force the real ones into
1082  memory. */
1083  YYSTYPE *yyvs1 = yyvs;
1084  yytype_int16 *yyss1 = yyss;
1085 
1086  /* Each stack pointer address is followed by the size of the
1087  data in use in that stack, in bytes. This used to be a
1088  conditional around just the two extra args, but that might
1089  be undefined if yyoverflow is a macro. */
1090  yyoverflow (YY_("memory exhausted"),
1091  &yyss1, yysize * sizeof (*yyssp),
1092  &yyvs1, yysize * sizeof (*yyvsp),
1093  &yystacksize);
1094 
1095  yyss = yyss1;
1096  yyvs = yyvs1;
1097  }
1098 #else /* no yyoverflow */
1099 # ifndef YYSTACK_RELOCATE
1100  goto yyexhaustedlab;
1101 # else
1102  /* Extend the stack our own way. */
1103  if (YYMAXDEPTH <= yystacksize)
1104  goto yyexhaustedlab;
1105  yystacksize *= 2;
1106  if (YYMAXDEPTH < yystacksize)
1107  yystacksize = YYMAXDEPTH;
1108 
1109  {
1110  yytype_int16 *yyss1 = yyss;
1111  union yyalloc *yyptr =
1112  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1113  if (! yyptr)
1114  goto yyexhaustedlab;
1115  YYSTACK_RELOCATE (yyss_alloc, yyss);
1116  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1117 # undef YYSTACK_RELOCATE
1118  if (yyss1 != yyssa)
1119  YYSTACK_FREE (yyss1);
1120  }
1121 # endif
1122 #endif /* no yyoverflow */
1123 
1124  yyssp = yyss + yysize - 1;
1125  yyvsp = yyvs + yysize - 1;
1126 
1127  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1128  (unsigned long int) yystacksize));
1129 
1130  if (yyss + yystacksize - 1 <= yyssp)
1131  YYABORT;
1132  }
1133 
1134  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1135 
1136  if (yystate == YYFINAL)
1137  YYACCEPT;
1138 
1139  goto yybackup;
1140 
1141 /*-----------.
1142 | yybackup. |
1143 `-----------*/
1144 yybackup:
1145 
1146  /* Do appropriate processing given the current state. Read a
1147  lookahead token if we need one and don't already have one. */
1148 
1149  /* First try to decide what to do without reference to lookahead token. */
1150  yyn = yypact[yystate];
1151  if (yypact_value_is_default (yyn))
1152  goto yydefault;
1153 
1154  /* Not known => get a lookahead token if don't already have one. */
1155 
1156  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1157  if (yychar == YYEMPTY)
1158  {
1159  YYDPRINTF ((stderr, "Reading a token: "));
1160  yychar = yylex ();
1161  }
1162 
1163  if (yychar <= YYEOF)
1164  {
1165  yychar = yytoken = YYEOF;
1166  YYDPRINTF ((stderr, "Now at end of input.\n"));
1167  }
1168  else
1169  {
1170  yytoken = YYTRANSLATE (yychar);
1171  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1172  }
1173 
1174  /* If the proper action on seeing token YYTOKEN is to reduce or to
1175  detect an error, take that action. */
1176  yyn += yytoken;
1177  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1178  goto yydefault;
1179  yyn = yytable[yyn];
1180  if (yyn <= 0)
1181  {
1182  if (yytable_value_is_error (yyn))
1183  goto yyerrlab;
1184  yyn = -yyn;
1185  goto yyreduce;
1186  }
1187 
1188  /* Count tokens shifted since error; after three, turn off error
1189  status. */
1190  if (yyerrstatus)
1191  yyerrstatus--;
1192 
1193  /* Shift the lookahead token. */
1194  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1195 
1196  /* Discard the shifted token. */
1197  yychar = YYEMPTY;
1198 
1199  yystate = yyn;
1201  *++yyvsp = yylval;
1203 
1204  goto yynewstate;
1205 
1206 
1207 /*-----------------------------------------------------------.
1208 | yydefault -- do the default action for the current state. |
1209 `-----------------------------------------------------------*/
1210 yydefault:
1211  yyn = yydefact[yystate];
1212  if (yyn == 0)
1213  goto yyerrlab;
1214  goto yyreduce;
1215 
1216 
1217 /*-----------------------------.
1218 | yyreduce -- Do a reduction. |
1219 `-----------------------------*/
1220 yyreduce:
1221  /* yyn is the number of a rule to reduce with. */
1222  yylen = yyr2[yyn];
1223 
1224  /* If YYLEN is nonzero, implement the default value of the action:
1225  '$$ = $1'.
1226 
1227  Otherwise, the following line sets YYVAL to garbage.
1228  This behavior is undocumented and Bison
1229  users should not rely upon it. Assigning to YYVAL
1230  unconditionally makes the parser a bit smaller, and it avoids a
1231  GCC warning that YYVAL may be used uninitialized. */
1232  yyval = yyvsp[1-yylen];
1233 
1234 
1235  YY_REDUCE_PRINT (yyn);
1236  switch (yyn)
1237  {
1238  case 4:
1239 #line 44 "util/pmu.y" /* yacc.c:1646 */
1240  {
1241  ABORT_ON(perf_pmu__new_format(format, name,
1243  (yyvsp[0].bits)));
1244 }
1245 #line 1246 "util/pmu-bison.c" /* yacc.c:1646 */
1246  break;
1247 
1248  case 5:
1249 #line 51 "util/pmu.y" /* yacc.c:1646 */
1250  {
1251  ABORT_ON(perf_pmu__new_format(format, name,
1253  (yyvsp[0].bits)));
1254 }
1255 #line 1256 "util/pmu-bison.c" /* yacc.c:1646 */
1256  break;
1257 
1258  case 6:
1259 #line 58 "util/pmu.y" /* yacc.c:1646 */
1260  {
1261  ABORT_ON(perf_pmu__new_format(format, name,
1263  (yyvsp[0].bits)));
1264 }
1265 #line 1266 "util/pmu-bison.c" /* yacc.c:1646 */
1266  break;
1267 
1268  case 7:
1269 #line 66 "util/pmu.y" /* yacc.c:1646 */
1270  {
1271  bitmap_or((yyval.bits), (yyvsp[-2].bits), (yyvsp[0].bits), 64);
1272 }
1273 #line 1274 "util/pmu-bison.c" /* yacc.c:1646 */
1274  break;
1275 
1276  case 8:
1277 #line 71 "util/pmu.y" /* yacc.c:1646 */
1278  {
1279  memcpy((yyval.bits), (yyvsp[0].bits), sizeof((yyvsp[0].bits)));
1280 }
1281 #line 1282 "util/pmu-bison.c" /* yacc.c:1646 */
1282  break;
1283 
1284  case 9:
1285 #line 77 "util/pmu.y" /* yacc.c:1646 */
1286  {
1287  perf_pmu__set_format((yyval.bits), (yyvsp[-2].num), (yyvsp[0].num));
1288 }
1289 #line 1290 "util/pmu-bison.c" /* yacc.c:1646 */
1290  break;
1291 
1292  case 10:
1293 #line 82 "util/pmu.y" /* yacc.c:1646 */
1294  {
1295  perf_pmu__set_format((yyval.bits), (yyvsp[0].num), 0);
1296 }
1297 #line 1298 "util/pmu-bison.c" /* yacc.c:1646 */
1298  break;
1299 
1300 
1301 #line 1302 "util/pmu-bison.c" /* yacc.c:1646 */
1302  default: break;
1303  }
1304  /* User semantic actions sometimes alter yychar, and that requires
1305  that yytoken be updated with the new translation. We take the
1306  approach of translating immediately before every use of yytoken.
1307  One alternative is translating here after every semantic action,
1308  but that translation would be missed if the semantic action invokes
1309  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1310  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1311  incorrect destructor might then be invoked immediately. In the
1312  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1313  to an incorrect destructor call or verbose syntax error message
1314  before the lookahead is translated. */
1315  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1316 
1317  YYPOPSTACK (yylen);
1318  yylen = 0;
1319  YY_STACK_PRINT (yyss, yyssp);
1320 
1321  *++yyvsp = yyval;
1322 
1323  /* Now 'shift' the result of the reduction. Determine what state
1324  that goes to, based on the state we popped back to and the rule
1325  number reduced by. */
1326 
1327  yyn = yyr1[yyn];
1328 
1329  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1330  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1331  yystate = yytable[yystate];
1332  else
1333  yystate = yydefgoto[yyn - YYNTOKENS];
1334 
1335  goto yynewstate;
1336 
1337 
1338 /*--------------------------------------.
1339 | yyerrlab -- here on detecting error. |
1340 `--------------------------------------*/
1341 yyerrlab:
1342  /* Make sure we have latest lookahead translation. See comments at
1343  user semantic actions for why this is necessary. */
1344  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1345 
1346  /* If not already recovering from an error, report this error. */
1347  if (!yyerrstatus)
1348  {
1349  ++yynerrs;
1350 #if ! YYERROR_VERBOSE
1351  yyerror (format, name, YY_("syntax error"));
1352 #else
1353 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1354  yyssp, yytoken)
1355  {
1356  char const *yymsgp = YY_("syntax error");
1357  int yysyntax_error_status;
1358  yysyntax_error_status = YYSYNTAX_ERROR;
1359  if (yysyntax_error_status == 0)
1360  yymsgp = yymsg;
1361  else if (yysyntax_error_status == 1)
1362  {
1363  if (yymsg != yymsgbuf)
1364  YYSTACK_FREE (yymsg);
1365  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1366  if (!yymsg)
1367  {
1368  yymsg = yymsgbuf;
1369  yymsg_alloc = sizeof yymsgbuf;
1370  yysyntax_error_status = 2;
1371  }
1372  else
1373  {
1374  yysyntax_error_status = YYSYNTAX_ERROR;
1375  yymsgp = yymsg;
1376  }
1377  }
1378  yyerror (format, name, yymsgp);
1379  if (yysyntax_error_status == 2)
1380  goto yyexhaustedlab;
1381  }
1382 # undef YYSYNTAX_ERROR
1383 #endif
1384  }
1385 
1386 
1387 
1388  if (yyerrstatus == 3)
1389  {
1390  /* If just tried and failed to reuse lookahead token after an
1391  error, discard it. */
1392 
1393  if (yychar <= YYEOF)
1394  {
1395  /* Return failure if at end of input. */
1396  if (yychar == YYEOF)
1397  YYABORT;
1398  }
1399  else
1400  {
1401  yydestruct ("Error: discarding",
1402  yytoken, &yylval, format, name);
1403  yychar = YYEMPTY;
1404  }
1405  }
1406 
1407  /* Else will try to reuse lookahead token after shifting the error
1408  token. */
1409  goto yyerrlab1;
1410 
1411 
1412 /*---------------------------------------------------.
1413 | yyerrorlab -- error raised explicitly by YYERROR. |
1414 `---------------------------------------------------*/
1415 yyerrorlab:
1416 
1417  /* Pacify compilers like GCC when the user code never invokes
1418  YYERROR and the label yyerrorlab therefore never appears in user
1419  code. */
1420  if (/*CONSTCOND*/ 0)
1421  goto yyerrorlab;
1422 
1423  /* Do not reclaim the symbols of the rule whose action triggered
1424  this YYERROR. */
1425  YYPOPSTACK (yylen);
1426  yylen = 0;
1427  YY_STACK_PRINT (yyss, yyssp);
1428  yystate = *yyssp;
1429  goto yyerrlab1;
1430 
1431 
1432 /*-------------------------------------------------------------.
1433 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1434 `-------------------------------------------------------------*/
1435 yyerrlab1:
1436  yyerrstatus = 3; /* Each real token shifted decrements this. */
1437 
1438  for (;;)
1439  {
1440  yyn = yypact[yystate];
1441  if (!yypact_value_is_default (yyn))
1442  {
1443  yyn += YYTERROR;
1444  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1445  {
1446  yyn = yytable[yyn];
1447  if (0 < yyn)
1448  break;
1449  }
1450  }
1451 
1452  /* Pop the current state because it cannot handle the error token. */
1453  if (yyssp == yyss)
1454  YYABORT;
1455 
1456 
1457  yydestruct ("Error: popping",
1458  yystos[yystate], yyvsp, format, name);
1459  YYPOPSTACK (1);
1460  yystate = *yyssp;
1461  YY_STACK_PRINT (yyss, yyssp);
1462  }
1463 
1465  *++yyvsp = yylval;
1467 
1468 
1469  /* Shift the error token. */
1470  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1471 
1472  yystate = yyn;
1473  goto yynewstate;
1474 
1475 
1476 /*-------------------------------------.
1477 | yyacceptlab -- YYACCEPT comes here. |
1478 `-------------------------------------*/
1479 yyacceptlab:
1480  yyresult = 0;
1481  goto yyreturn;
1482 
1483 /*-----------------------------------.
1484 | yyabortlab -- YYABORT comes here. |
1485 `-----------------------------------*/
1486 yyabortlab:
1487  yyresult = 1;
1488  goto yyreturn;
1489 
1490 #if !defined yyoverflow || YYERROR_VERBOSE
1491 /*-------------------------------------------------.
1492 | yyexhaustedlab -- memory exhaustion comes here. |
1493 `-------------------------------------------------*/
1494 yyexhaustedlab:
1495  yyerror (format, name, YY_("memory exhausted"));
1496  yyresult = 2;
1497  /* Fall through. */
1498 #endif
1499 
1500 yyreturn:
1501  if (yychar != YYEMPTY)
1502  {
1503  /* Make sure we have latest lookahead translation. See comments at
1504  user semantic actions for why this is necessary. */
1505  yytoken = YYTRANSLATE (yychar);
1506  yydestruct ("Cleanup: discarding lookahead",
1507  yytoken, &yylval, format, name);
1508  }
1509  /* Do not reclaim the symbols of the rule whose action triggered
1510  this YYABORT or YYACCEPT. */
1511  YYPOPSTACK (yylen);
1512  YY_STACK_PRINT (yyss, yyssp);
1513  while (yyssp != yyss)
1514  {
1515  yydestruct ("Cleanup: popping",
1516  yystos[*yyssp], yyvsp, format, name);
1517  YYPOPSTACK (1);
1518  }
1519 #ifndef yyoverflow
1520  if (yyss != yyssa)
1521  YYSTACK_FREE (yyss);
1522 #endif
1523 #if YYERROR_VERBOSE
1524  if (yymsg != yymsgbuf)
1525  YYSTACK_FREE (yymsg);
1526 #endif
1527  return yyresult;
1528 }
1529 #line 86 "util/pmu.y" /* yacc.c:1906 */
1530 
1531 
1532 void perf_pmu_error(struct list_head *list __maybe_unused,
1533  char *name __maybe_unused,
1534  char const *msg __maybe_unused)
1535 {
1536 }
unsigned char yytype_uint8
Definition: pmu-bison.c:170
signed char yytype_int8
Definition: expr-bison.c:189
#define YYFINAL
Definition: pmu-bison.c:401
#define YYSTACK_ALLOC
Definition: pmu-bison.c:311
#define YYTRANSLATE(YYX)
Definition: pmu-bison.c:419
static const yytype_int8 yypact[]
Definition: pmu-bison.c:497
static const yytype_uint8 yyr2[]
Definition: pmu-bison.c:555
#define YYDPRINTF(Args)
Definition: pmu-bison.c:722
#define yydebug
Definition: pmu-bison.c:66
static const yytype_int8 yydefgoto[]
Definition: pmu-bison.c:519
#define YYNTOKENS
Definition: pmu-bison.c:406
#define YYSTACK_BYTES(N)
Definition: pmu-bison.c:356
#define YY_NULLPTR
Definition: pmu-bison.c:97
#define YY_(Msgid)
Definition: pmu-bison.c:214
static const yytype_int8 yypgoto[]
Definition: pmu-bison.c:513
unsigned short int yytype_uint16
Definition: pmu-bison.c:182
#define yytable_value_is_error(Yytable_value)
Definition: pmu-bison.c:492
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: pmu-bison.c:264
#define YY_STACK_PRINT(Bottom, Top)
Definition: pmu-bison.c:724
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: pmu-bison.c:723
#define yyparse
Definition: pmu-bison.c:63
unsigned short int yytype_uint16
Definition: expr-bison.c:195
#define YYMAXDEPTH
Definition: pmu-bison.c:742
#define YY_REDUCE_PRINT(Rule)
Definition: pmu-bison.c:725
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *_data, void *scanner)
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, YYLTYPE const *const yylocationp, void *_data, void *scanner)
unsigned char yytype_uint8
Definition: expr-bison.c:183
void perf_pmu__set_format(unsigned long *bits, long from, long to)
Definition: pmu.c:1177
const char * name
#define YYINITDEPTH
Definition: pmu-bison.c:731
#define YYSTACK_FREE
Definition: pmu-bison.c:312
static const yytype_uint8 yystos[]
Definition: pmu-bison.c:541
int perf_pmu__new_format(struct list_head *list, char *name, int config, unsigned long *bits)
Definition: pmu.c:1160
yytype_int16 yyss_alloc
Definition: expr-bison.c:360
YYSTYPE yyvs_alloc
Definition: expr-bison.c:361
int perf_pmu_lex(void)
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, YYLTYPE const *const yylocationp, void *_data, void *scanner)
#define ABORT_ON(val)
Definition: pmu-bison.c:84
int perf_pmu_parse(struct list_head *format, char *name)
#define YYACCEPT
Definition: pmu-bison.c:567
x86 movsq based memcpy() in arch/x86/lib/memcpy_64.S") MEMCPY_FN(memcpy_erms
#define YYPOPSTACK(N)
static const yytype_uint8 yycheck[]
Definition: pmu-bison.c:533
yytokentype
Definition: expr-bison.c:114
void free(void *)
DECLARE_BITMAP(bits, PERF_PMU_FORMAT_BITS)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: pmu-bison.c:367
void * malloc(YYSIZE_T)
void perf_pmu_error(struct list_head *list __maybe_unused, char *name __maybe_unused, char const *msg __maybe_unused)
Definition: pmu-bison.c:1532
signed char yytype_int8
Definition: pmu-bison.c:176
#define yynerrs
Definition: pmu-bison.c:67
#define yylval
Definition: pmu-bison.c:69
short int yytype_int16
Definition: expr-bison.c:201
short int yytype_int16
Definition: pmu-bison.c:188
static const yytype_uint8 yydefact[]
Definition: pmu-bison.c:506
#define yyerror
Definition: pmu-bison.c:65
YYSTYPE perf_pmu_lval
#define YYSIZE_T
Definition: pmu-bison.c:198
#define yychar
Definition: pmu-bison.c:70
#define yylex
Definition: pmu-bison.c:64
#define YYEOF
Definition: pmu-bison.c:565
static const char *const yytname[]
#define YYSTACK_ALLOC_MAXIMUM
Definition: pmu-bison.c:314
#define YYABORT
Definition: pmu-bison.c:568
#define yypact_value_is_default(Yystate)
Definition: pmu-bison.c:487
static const yytype_uint16 yyrline[]
#define YYFPRINTF
static const yytype_uint8 yyr1[]
Definition: pmu-bison.c:548
unsigned long num
Definition: pmu-bison.c:141
#define YYEMPTY
Definition: pmu-bison.c:564
#define YYLAST
Definition: pmu-bison.c:403
static const yytype_uint8 yytable[]
Definition: pmu-bison.c:527
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: pmu-bison.c:265
#define YYTERROR
Definition: pmu-bison.c:592
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct list_head *format, char *name)
Definition: pmu-bison.c:973
static const yytype_uint8 yytranslate[]
Definition: pmu-bison.c:424
#define PERF_PMU_FORMAT_BITS
Definition: pmu.h:18
#define YYUSE(E)
Definition: pmu-bison.c:247
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)