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