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