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