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