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