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