Linux Audio

Check our new training course

Loading...
v3.1
   1/* A Bison parser, made by GNU Bison 2.4.3.  */
   2
   3/* Skeleton implementation for Bison's Yacc-like parsers in C
   4   
   5      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
   6   2009, 2010 Free Software Foundation, Inc.
   7   
   8   This program is free software: you can redistribute it and/or modify
   9   it under the terms of the GNU General Public License as published by
  10   the Free Software Foundation, either version 3 of the License, or
  11   (at your option) any later version.
  12   
  13   This program is distributed in the hope that it will be useful,
  14   but WITHOUT ANY WARRANTY; without even the implied warranty of
  15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16   GNU General Public License for more details.
  17   
  18   You should have received a copy of the GNU General Public License
  19   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
  20
  21/* As a special exception, you may create a larger work that contains
  22   part or all of the Bison parser skeleton and distribute that work
  23   under terms of your choice, so long as that work isn't itself a
  24   parser generator using the skeleton or a modified version thereof
  25   as a parser skeleton.  Alternatively, if you modify or redistribute
  26   the parser skeleton itself, you may (at your option) remove this
  27   special exception, which will cause the skeleton and the resulting
  28   Bison output files to be licensed under the GNU General Public
  29   License without this special exception.
  30   
  31   This special exception was added by the Free Software Foundation in
  32   version 2.2 of Bison.  */
  33
  34/* C LALR(1) parser skeleton written by Richard Stallman, by
  35   simplifying the original so-called "semantic" parser.  */
  36
  37/* All symbols defined below should begin with yy or YY, to avoid
  38   infringing on user name space.  This should be done even for local
  39   variables, as they might otherwise be expanded by user macros.
  40   There are some unavoidable exceptions within include files to
  41   define necessary library symbols; they are noted "INFRINGES ON
  42   USER NAME SPACE" below.  */
  43
  44/* Identify Bison output.  */
  45#define YYBISON 1
  46
  47/* Bison version.  */
  48#define YYBISON_VERSION "2.4.3"
  49
  50/* Skeleton name.  */
  51#define YYSKELETON_NAME "yacc.c"
  52
  53/* Pure parsers.  */
  54#define YYPURE 0
  55
  56/* Push parsers.  */
  57#define YYPUSH 0
  58
  59/* Pull parsers.  */
  60#define YYPULL 1
  61
  62/* Using locations.  */
  63#define YYLSP_NEEDED 0
  64
  65
  66
  67/* Copy the first part of user declarations.  */
  68
 
  69
  70#include <stdio.h>
  71
  72#include "dtc.h"
  73#include "srcpos.h"
  74
  75YYLTYPE yylloc;
  76
  77extern int yylex(void);
  78extern void print_error(char const *fmt, ...);
  79extern void yyerror(char const *s);
  80
  81extern struct boot_info *the_boot_info;
  82extern int treesource_error;
  83
  84static unsigned long long eval_literal(const char *s, int base, int bits);
 
  85
 
 
  86
  87
  88/* Enabling traces.  */
  89#ifndef YYDEBUG
  90# define YYDEBUG 1
  91#endif
 
 
  92
  93/* Enabling verbose error messages.  */
  94#ifdef YYERROR_VERBOSE
  95# undef YYERROR_VERBOSE
  96# define YYERROR_VERBOSE 1
  97#else
  98# define YYERROR_VERBOSE 0
  99#endif
 100
 101/* Enabling the token table.  */
 102#ifndef YYTOKEN_TABLE
 103# define YYTOKEN_TABLE 0
 
 
 
 
 
 
 
 104#endif
 105
 106
 107/* Tokens.  */
 108#ifndef YYTOKENTYPE
 109# define YYTOKENTYPE
 110   /* Put the tokens into the symbol table, so that GDB and other debuggers
 111      know about them.  */
 112   enum yytokentype {
 113     DT_V1 = 258,
 114     DT_MEMRESERVE = 259,
 115     DT_PROPNODENAME = 260,
 116     DT_LITERAL = 261,
 117     DT_BASE = 262,
 118     DT_BYTE = 263,
 119     DT_STRING = 264,
 120     DT_LABEL = 265,
 121     DT_REF = 266,
 122     DT_INCBIN = 267
 
 
 
 
 
 
 
 
 
 
 
 
 123   };
 124#endif
 125
 126
 127
 128#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 129typedef union YYSTYPE
 130{
 131
 
 132
 133	char *propnodename;
 134	char *literal;
 135	char *labelref;
 136	unsigned int cbase;
 137	uint8_t byte;
 138	struct data data;
 139
 140	uint64_t addr;
 141	cell_t cell;
 
 
 
 142	struct property *prop;
 143	struct property *proplist;
 144	struct node *node;
 145	struct node *nodelist;
 146	struct reserve_info *re;
 
 147
 148
 149
 
 150} YYSTYPE;
 151# define YYSTYPE_IS_TRIVIAL 1
 152# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 153# define YYSTYPE_IS_DECLARED 1
 154#endif
 155
 
 156
 157/* Copy the second part of user declarations.  */
 
 
 
 
 
 
 
 
 
 
 
 
 158
 
 159
 
 
 
 
 160
 161#ifdef short
 162# undef short
 163#endif
 164
 165#ifdef YYTYPE_UINT8
 166typedef YYTYPE_UINT8 yytype_uint8;
 167#else
 168typedef unsigned char yytype_uint8;
 169#endif
 170
 171#ifdef YYTYPE_INT8
 172typedef YYTYPE_INT8 yytype_int8;
 173#elif (defined __STDC__ || defined __C99__FUNC__ \
 174     || defined __cplusplus || defined _MSC_VER)
 175typedef signed char yytype_int8;
 176#else
 177typedef short int yytype_int8;
 178#endif
 179
 180#ifdef YYTYPE_UINT16
 181typedef YYTYPE_UINT16 yytype_uint16;
 182#else
 183typedef unsigned short int yytype_uint16;
 184#endif
 185
 186#ifdef YYTYPE_INT16
 187typedef YYTYPE_INT16 yytype_int16;
 188#else
 189typedef short int yytype_int16;
 190#endif
 191
 192#ifndef YYSIZE_T
 193# ifdef __SIZE_TYPE__
 194#  define YYSIZE_T __SIZE_TYPE__
 195# elif defined size_t
 196#  define YYSIZE_T size_t
 197# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 198     || defined __cplusplus || defined _MSC_VER)
 199#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 200#  define YYSIZE_T size_t
 201# else
 202#  define YYSIZE_T unsigned int
 203# endif
 204#endif
 205
 206#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 207
 208#ifndef YY_
 209# if defined YYENABLE_NLS && YYENABLE_NLS
 210#  if ENABLE_NLS
 211#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 212#   define YY_(msgid) dgettext ("bison-runtime", msgid)
 213#  endif
 214# endif
 215# ifndef YY_
 216#  define YY_(msgid) msgid
 
 
 
 
 
 
 
 
 217# endif
 218#endif
 219
 220/* Suppress unused-variable warnings by "using" E.  */
 221#if ! defined lint || defined __GNUC__
 222# define YYUSE(e) ((void) (e))
 223#else
 224# define YYUSE(e) /* empty */
 225#endif
 226
 
 227/* Identity function, used to suppress warnings about constant conditions.  */
 228#ifndef lint
 229# define YYID(n) (n)
 230#else
 231#if (defined __STDC__ || defined __C99__FUNC__ \
 232     || defined __cplusplus || defined _MSC_VER)
 233static int
 234YYID (int yyi)
 235#else
 236static int
 237YYID (yyi)
 238    int yyi;
 239#endif
 240{
 241  return yyi;
 242}
 243#endif
 244
 245#if ! defined yyoverflow || YYERROR_VERBOSE
 246
 247/* The parser invokes alloca or malloc; define the necessary symbols.  */
 248
 249# ifdef YYSTACK_USE_ALLOCA
 250#  if YYSTACK_USE_ALLOCA
 251#   ifdef __GNUC__
 252#    define YYSTACK_ALLOC __builtin_alloca
 253#   elif defined __BUILTIN_VA_ARG_INCR
 254#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 255#   elif defined _AIX
 256#    define YYSTACK_ALLOC __alloca
 257#   elif defined _MSC_VER
 258#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 259#    define alloca _alloca
 260#   else
 261#    define YYSTACK_ALLOC alloca
 262#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 263     || defined __cplusplus || defined _MSC_VER)
 264#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 265#     ifndef _STDLIB_H
 266#      define _STDLIB_H 1
 
 267#     endif
 268#    endif
 269#   endif
 270#  endif
 271# endif
 272
 273# ifdef YYSTACK_ALLOC
 274   /* Pacify GCC's `empty if-body' warning.  */
 275#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 276#  ifndef YYSTACK_ALLOC_MAXIMUM
 277    /* The OS might guarantee only one guard page at the bottom of the stack,
 278       and a page size can be as small as 4096 bytes.  So we cannot safely
 279       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 280       to allow for a few compiler-allocated temporary stack slots.  */
 281#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 282#  endif
 283# else
 284#  define YYSTACK_ALLOC YYMALLOC
 285#  define YYSTACK_FREE YYFREE
 286#  ifndef YYSTACK_ALLOC_MAXIMUM
 287#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 288#  endif
 289#  if (defined __cplusplus && ! defined _STDLIB_H \
 290       && ! ((defined YYMALLOC || defined malloc) \
 291	     && (defined YYFREE || defined free)))
 292#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 293#   ifndef _STDLIB_H
 294#    define _STDLIB_H 1
 295#   endif
 296#  endif
 297#  ifndef YYMALLOC
 298#   define YYMALLOC malloc
 299#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 300     || defined __cplusplus || defined _MSC_VER)
 301void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 302#   endif
 303#  endif
 304#  ifndef YYFREE
 305#   define YYFREE free
 306#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
 307     || defined __cplusplus || defined _MSC_VER)
 308void free (void *); /* INFRINGES ON USER NAME SPACE */
 309#   endif
 310#  endif
 311# endif
 312#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 313
 314
 315#if (! defined yyoverflow \
 316     && (! defined __cplusplus \
 317	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 318
 319/* A type that is properly aligned for any stack member.  */
 320union yyalloc
 321{
 322  yytype_int16 yyss_alloc;
 323  YYSTYPE yyvs_alloc;
 324};
 325
 326/* The size of the maximum gap between one aligned stack and the next.  */
 327# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 328
 329/* The size of an array large to enough to hold all stacks, each with
 330   N elements.  */
 331# define YYSTACK_BYTES(N) \
 332     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
 333      + YYSTACK_GAP_MAXIMUM)
 334
 335/* Copy COUNT objects from FROM to TO.  The source and destination do
 336   not overlap.  */
 337# ifndef YYCOPY
 338#  if defined __GNUC__ && 1 < __GNUC__
 339#   define YYCOPY(To, From, Count) \
 340      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 341#  else
 342#   define YYCOPY(To, From, Count)		\
 343      do					\
 344	{					\
 345	  YYSIZE_T yyi;				\
 346	  for (yyi = 0; yyi < (Count); yyi++)	\
 347	    (To)[yyi] = (From)[yyi];		\
 348	}					\
 349      while (YYID (0))
 350#  endif
 351# endif
 352
 353/* Relocate STACK from its old location to the new one.  The
 354   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 355   elements in the stack, and YYPTR gives the new location of the
 356   stack.  Advance YYPTR to a properly aligned location for the next
 357   stack.  */
 358# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
 359    do									\
 360      {									\
 361	YYSIZE_T yynewbytes;						\
 362	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
 363	Stack = &yyptr->Stack_alloc;					\
 364	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 365	yyptr += yynewbytes / sizeof (*yyptr);				\
 366      }									\
 367    while (YYID (0))
 368
 369#endif
 370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 371/* YYFINAL -- State number of the termination state.  */
 372#define YYFINAL  4
 373/* YYLAST -- Last index in YYTABLE.  */
 374#define YYLAST   56
 375
 376/* YYNTOKENS -- Number of terminals.  */
 377#define YYNTOKENS  25
 378/* YYNNTS -- Number of nonterminals.  */
 379#define YYNNTS  16
 380/* YYNRULES -- Number of rules.  */
 381#define YYNRULES  39
 382/* YYNRULES -- Number of states.  */
 383#define YYNSTATES  67
 384
 385/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 386#define YYUNDEFTOK  2
 387#define YYMAXUTOK   267
 388
 389#define YYTRANSLATE(YYX)						\
 390  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 391
 392/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 393static const yytype_uint8 yytranslate[] =
 394{
 395       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 396       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 397       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
 
 
 
 398       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 399      22,    24,     2,     2,    23,     2,     2,    14,     2,     2,
 400       2,     2,     2,     2,     2,     2,     2,     2,     2,    13,
 401      18,    17,    19,     2,     2,     2,     2,     2,     2,     2,
 402       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
 403       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 404       2,    20,     2,    21,     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,    15,     2,    16,     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,     1,     2,     3,     4,
 421       5,     6,     7,     8,     9,    10,    11,    12
 
 422};
 423
 424#if YYDEBUG
 425/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 426   YYRHS.  */
 427static const yytype_uint8 yyprhs[] =
 428{
 429       0,     0,     3,     8,     9,    12,    17,    20,    22,    25,
 430      29,    33,    39,    40,    43,    48,    51,    54,    57,    62,
 431      67,    70,    80,    86,    89,    90,    93,    96,    97,   100,
 432     103,   106,   108,   109,   112,   115,   116,   119,   122,   125
 
 
 
 
 433};
 434
 435/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 436static const yytype_int8 yyrhs[] =
 437{
 438      26,     0,    -1,     3,    13,    27,    30,    -1,    -1,    28,
 439      27,    -1,     4,    29,    29,    13,    -1,    10,    28,    -1,
 440       6,    -1,    14,    31,    -1,    30,    14,    31,    -1,    30,
 441      11,    31,    -1,    15,    32,    39,    16,    13,    -1,    -1,
 442      32,    33,    -1,     5,    17,    34,    13,    -1,     5,    13,
 443      -1,    10,    33,    -1,    35,     9,    -1,    35,    18,    36,
 444      19,    -1,    35,    20,    38,    21,    -1,    35,    11,    -1,
 445      35,    12,    22,     9,    23,    29,    23,    29,    24,    -1,
 446      35,    12,    22,     9,    24,    -1,    34,    10,    -1,    -1,
 447      34,    23,    -1,    35,    10,    -1,    -1,    36,    37,    -1,
 448      36,    11,    -1,    36,    10,    -1,     6,    -1,    -1,    38,
 449       8,    -1,    38,    10,    -1,    -1,    40,    39,    -1,    40,
 450      33,    -1,     5,    31,    -1,    10,    40,    -1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 451};
 452
 453/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 454static const yytype_uint16 yyrline[] =
 455{
 456       0,    86,    86,    95,    98,   105,   109,   117,   124,   128,
 457     132,   145,   153,   156,   163,   167,   171,   179,   183,   187,
 458     191,   195,   212,   222,   230,   233,   237,   245,   248,   252,
 459     257,   264,   272,   275,   279,   287,   290,   294,   302,   306
 
 
 
 
 460};
 461#endif
 462
 463#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 464/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 465   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 466static const char *const yytname[] =
 467{
 468  "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
 469  "DT_PROPNODENAME", "DT_LITERAL", "DT_BASE", "DT_BYTE", "DT_STRING",
 470  "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='",
 471  "'<'", "'>'", "'['", "']'", "'('", "','", "')'", "$accept", "sourcefile",
 472  "memreserves", "memreserve", "addr", "devicetree", "nodedef", "proplist",
 473  "propdef", "propdata", "propdataprefix", "celllist", "cellval",
 474  "bytestring", "subnodes", "subnode", 0
 
 
 
 
 
 
 475};
 476#endif
 477
 478# ifdef YYPRINT
 479/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 480   token YYLEX-NUM.  */
 481static const yytype_uint16 yytoknum[] =
 482{
 483       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 484     265,   266,   267,    59,    47,   123,   125,    61,    60,    62,
 485      91,    93,    40,    44,    41
 
 
 486};
 487# endif
 488
 489/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 490static const yytype_uint8 yyr1[] =
 491{
 492       0,    25,    26,    27,    27,    28,    28,    29,    30,    30,
 493      30,    31,    32,    32,    33,    33,    33,    34,    34,    34,
 494      34,    34,    34,    34,    35,    35,    35,    36,    36,    36,
 495      36,    37,    38,    38,    38,    39,    39,    39,    40,    40
 
 
 
 
 496};
 497
 498/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 499static const yytype_uint8 yyr2[] =
 500{
 501       0,     2,     4,     0,     2,     4,     2,     1,     2,     3,
 502       3,     5,     0,     2,     4,     2,     2,     2,     4,     4,
 503       2,     9,     5,     2,     0,     2,     2,     0,     2,     2,
 504       2,     1,     0,     2,     2,     0,     2,     2,     2,     2
 
 
 
 
 505};
 506
 507/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 508   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
 509   means the default is an error.  */
 510static const yytype_uint8 yydefact[] =
 511{
 512       0,     0,     0,     3,     1,     0,     0,     0,     3,     7,
 513       0,     6,     0,     2,     4,     0,    12,     8,     0,     0,
 514       5,    35,    10,     9,     0,     0,    13,     0,    35,    15,
 515      24,    38,    16,    39,     0,    37,    36,     0,     0,    11,
 516      23,    14,    25,    17,    26,    20,     0,    27,    32,     0,
 517       0,     0,     0,    31,    30,    29,    18,    28,    33,    34,
 518      19,     0,    22,     0,     0,     0,    21
 
 
 
 
 
 
 
 
 519};
 520
 521/* YYDEFGOTO[NTERM-NUM].  */
 522static const yytype_int8 yydefgoto[] =
 523{
 524      -1,     2,     7,     8,    10,    13,    17,    21,    26,    37,
 525      38,    50,    57,    51,    27,    28
 
 526};
 527
 528/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 529   STATE-NUM.  */
 530#define YYPACT_NINF -12
 531static const yytype_int8 yypact[] =
 532{
 533      10,   -11,    18,    -1,   -12,    22,    -1,    15,    -1,   -12,
 534      22,   -12,    20,     1,   -12,    17,   -12,   -12,    20,    20,
 535     -12,     6,   -12,   -12,    21,     6,   -12,    23,     6,   -12,
 536     -12,   -12,   -12,   -12,    28,   -12,   -12,    -6,    13,   -12,
 537     -12,   -12,   -12,   -12,   -12,   -12,    24,   -12,   -12,    33,
 538      -5,     0,    -4,   -12,   -12,   -12,   -12,   -12,   -12,   -12,
 539     -12,    22,   -12,    25,    22,    19,   -12
 
 
 
 
 
 
 
 
 540};
 541
 542/* YYPGOTO[NTERM-NUM].  */
 543static const yytype_int8 yypgoto[] =
 544{
 545     -12,   -12,    36,    39,   -10,   -12,     8,   -12,    12,   -12,
 546     -12,   -12,   -12,   -12,    27,    31
 
 547};
 548
 549/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 550   positive, shift that token.  If negative, reduce the rule which
 551   number is the opposite.  If zero, do what YYDEFACT says.
 552   If YYTABLE_NINF, syntax error.  */
 553#define YYTABLE_NINF -1
 554static const yytype_uint8 yytable[] =
 555{
 556      15,    53,     3,     5,    40,    54,    55,    41,    58,     6,
 557      59,    24,    18,     1,    56,    19,    25,    42,     4,    61,
 558      62,    60,    43,    44,    45,    46,    22,    23,     9,    12,
 559      20,    47,    31,    48,    29,    16,    16,    32,    30,    34,
 560      35,    39,    52,    66,    14,    11,    49,     0,    64,     0,
 561       0,    63,     0,     0,    65,    36,    33
 
 
 
 
 
 
 
 
 562};
 563
 564static const yytype_int8 yycheck[] =
 
 
 
 
 
 
 565{
 566      10,     6,    13,     4,    10,    10,    11,    13,     8,    10,
 567      10,     5,    11,     3,    19,    14,    10,    23,     0,    23,
 568      24,    21,     9,    10,    11,    12,    18,    19,     6,    14,
 569      13,    18,    24,    20,    13,    15,    15,    25,    17,    16,
 570      28,    13,     9,    24,     8,     6,    22,    -1,    23,    -1,
 571      -1,    61,    -1,    -1,    64,    28,    25
 
 
 
 
 
 
 
 
 572};
 573
 574/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 575   symbol of state STATE-NUM.  */
 576static const yytype_uint8 yystos[] =
 577{
 578       0,     3,    26,    13,     0,     4,    10,    27,    28,     6,
 579      29,    28,    14,    30,    27,    29,    15,    31,    11,    14,
 580      13,    32,    31,    31,     5,    10,    33,    39,    40,    13,
 581      17,    31,    33,    40,    16,    33,    39,    34,    35,    13,
 582      10,    13,    23,     9,    10,    11,    12,    18,    20,    22,
 583      36,    38,     9,     6,    10,    11,    19,    37,     8,    10,
 584      21,    23,    24,    29,    23,    29,    24
 
 
 
 
 
 
 
 
 585};
 586
 587#define yyerrok		(yyerrstatus = 0)
 588#define yyclearin	(yychar = YYEMPTY)
 589#define YYEMPTY		(-2)
 590#define YYEOF		0
 591
 592#define YYACCEPT	goto yyacceptlab
 593#define YYABORT		goto yyabortlab
 594#define YYERROR		goto yyerrorlab
 595
 596
 597/* Like YYERROR except do call yyerror.  This remains here temporarily
 598   to ease the transition to the new meaning of YYERROR, for GCC.
 599   Once GCC version 2 has supplanted version 1, this can go.  However,
 600   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
 601   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
 602   discussed.  */
 603
 604#define YYFAIL		goto yyerrlab
 605#if defined YYFAIL
 606  /* This is here to suppress warnings from the GCC cpp's
 607     -Wunused-macros.  Normally we don't worry about that warning, but
 608     some users do, and we want to make it easy for users to remove
 609     YYFAIL uses, which will produce warnings from Bison 2.5.  */
 610#endif
 611
 612#define YYRECOVERING()  (!!yyerrstatus)
 613
 614#define YYBACKUP(Token, Value)					\
 615do								\
 616  if (yychar == YYEMPTY && yylen == 1)				\
 617    {								\
 618      yychar = (Token);						\
 619      yylval = (Value);						\
 620      yytoken = YYTRANSLATE (yychar);				\
 621      YYPOPSTACK (1);						\
 622      goto yybackup;						\
 623    }								\
 624  else								\
 625    {								\
 626      yyerror (YY_("syntax error: cannot back up")); \
 627      YYERROR;							\
 628    }								\
 629while (YYID (0))
 630
 631
 632#define YYTERROR	1
 633#define YYERRCODE	256
 634
 635
 636/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 637   If N is 0, then set CURRENT to the empty location which ends
 638   the previous symbol: RHS[0] (always defined).  */
 639
 640#define YYRHSLOC(Rhs, K) ((Rhs)[K])
 641#ifndef YYLLOC_DEFAULT
 642# define YYLLOC_DEFAULT(Current, Rhs, N)				\
 643    do									\
 644      if (YYID (N))                                                    \
 645	{								\
 646	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
 647	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
 648	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
 649	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
 650	}								\
 651      else								\
 652	{								\
 653	  (Current).first_line   = (Current).last_line   =		\
 654	    YYRHSLOC (Rhs, 0).last_line;				\
 655	  (Current).first_column = (Current).last_column =		\
 656	    YYRHSLOC (Rhs, 0).last_column;				\
 657	}								\
 658    while (YYID (0))
 659#endif
 660
 661
 662/* YY_LOCATION_PRINT -- Print the location on the stream.
 663   This macro was not mandated originally: define only if we know
 664   we won't break user code: when these are the locations we know.  */
 665
 666#ifndef YY_LOCATION_PRINT
 667# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 668#  define YY_LOCATION_PRINT(File, Loc)			\
 669     fprintf (File, "%d.%d-%d.%d",			\
 670	      (Loc).first_line, (Loc).first_column,	\
 671	      (Loc).last_line,  (Loc).last_column)
 672# else
 673#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 674# endif
 675#endif
 676
 677
 678/* YYLEX -- calling `yylex' with the right arguments.  */
 679
 680#ifdef YYLEX_PARAM
 681# define YYLEX yylex (YYLEX_PARAM)
 682#else
 683# define YYLEX yylex ()
 684#endif
 685
 686/* Enable debugging if requested.  */
 687#if YYDEBUG
 688
 689# ifndef YYFPRINTF
 690#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 691#  define YYFPRINTF fprintf
 692# endif
 693
 694# define YYDPRINTF(Args)			\
 695do {						\
 696  if (yydebug)					\
 697    YYFPRINTF Args;				\
 698} while (YYID (0))
 699
 700# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
 701do {									  \
 702  if (yydebug)								  \
 703    {									  \
 704      YYFPRINTF (stderr, "%s ", Title);					  \
 705      yy_symbol_print (stderr,						  \
 706		  Type, Value); \
 707      YYFPRINTF (stderr, "\n");						  \
 708    }									  \
 709} while (YYID (0))
 710
 711
 712/*--------------------------------.
 713| Print this symbol on YYOUTPUT.  |
 714`--------------------------------*/
 715
 716/*ARGSUSED*/
 717#if (defined __STDC__ || defined __C99__FUNC__ \
 718     || defined __cplusplus || defined _MSC_VER)
 719static void
 720yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 721#else
 722static void
 723yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 724    FILE *yyoutput;
 725    int yytype;
 726    YYSTYPE const * const yyvaluep;
 727#endif
 728{
 
 
 729  if (!yyvaluep)
 730    return;
 731# ifdef YYPRINT
 732  if (yytype < YYNTOKENS)
 733    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 734# else
 735  YYUSE (yyoutput);
 736# endif
 737  switch (yytype)
 738    {
 739      default:
 740	break;
 741    }
 742}
 743
 744
 745/*--------------------------------.
 746| Print this symbol on YYOUTPUT.  |
 747`--------------------------------*/
 748
 749#if (defined __STDC__ || defined __C99__FUNC__ \
 750     || defined __cplusplus || defined _MSC_VER)
 751static void
 752yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 753#else
 754static void
 755yy_symbol_print (yyoutput, yytype, yyvaluep)
 756    FILE *yyoutput;
 757    int yytype;
 758    YYSTYPE const * const yyvaluep;
 759#endif
 760{
 761  if (yytype < YYNTOKENS)
 762    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 763  else
 764    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 765
 766  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 767  YYFPRINTF (yyoutput, ")");
 768}
 769
 770/*------------------------------------------------------------------.
 771| yy_stack_print -- Print the state stack from its BOTTOM up to its |
 772| TOP (included).                                                   |
 773`------------------------------------------------------------------*/
 774
 775#if (defined __STDC__ || defined __C99__FUNC__ \
 776     || defined __cplusplus || defined _MSC_VER)
 777static void
 778yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 779#else
 780static void
 781yy_stack_print (yybottom, yytop)
 782    yytype_int16 *yybottom;
 783    yytype_int16 *yytop;
 784#endif
 785{
 786  YYFPRINTF (stderr, "Stack now");
 787  for (; yybottom <= yytop; yybottom++)
 788    {
 789      int yybot = *yybottom;
 790      YYFPRINTF (stderr, " %d", yybot);
 791    }
 792  YYFPRINTF (stderr, "\n");
 793}
 794
 795# define YY_STACK_PRINT(Bottom, Top)				\
 796do {								\
 797  if (yydebug)							\
 798    yy_stack_print ((Bottom), (Top));				\
 799} while (YYID (0))
 800
 801
 802/*------------------------------------------------.
 803| Report that the YYRULE is going to be reduced.  |
 804`------------------------------------------------*/
 805
 806#if (defined __STDC__ || defined __C99__FUNC__ \
 807     || defined __cplusplus || defined _MSC_VER)
 808static void
 809yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 810#else
 811static void
 812yy_reduce_print (yyvsp, yyrule)
 813    YYSTYPE *yyvsp;
 814    int yyrule;
 815#endif
 816{
 817  int yynrhs = yyr2[yyrule];
 818  int yyi;
 819  unsigned long int yylno = yyrline[yyrule];
 820  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 821	     yyrule - 1, yylno);
 822  /* The symbols being reduced.  */
 823  for (yyi = 0; yyi < yynrhs; yyi++)
 824    {
 825      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 826      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 827		       &(yyvsp[(yyi + 1) - (yynrhs)])
 828		       		       );
 829      YYFPRINTF (stderr, "\n");
 830    }
 831}
 832
 833# define YY_REDUCE_PRINT(Rule)		\
 834do {					\
 835  if (yydebug)				\
 836    yy_reduce_print (yyvsp, Rule); \
 837} while (YYID (0))
 838
 839/* Nonzero means print parse trace.  It is left uninitialized so that
 840   multiple parsers can coexist.  */
 841int yydebug;
 842#else /* !YYDEBUG */
 843# define YYDPRINTF(Args)
 844# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 845# define YY_STACK_PRINT(Bottom, Top)
 846# define YY_REDUCE_PRINT(Rule)
 847#endif /* !YYDEBUG */
 848
 849
 850/* YYINITDEPTH -- initial size of the parser's stacks.  */
 851#ifndef	YYINITDEPTH
 852# define YYINITDEPTH 200
 853#endif
 854
 855/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 856   if the built-in stack extension method is used).
 857
 858   Do not make this value too large; the results are undefined if
 859   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
 860   evaluated with infinite-precision integer arithmetic.  */
 861
 862#ifndef YYMAXDEPTH
 863# define YYMAXDEPTH 10000
 864#endif
 865
 866
 867
 868#if YYERROR_VERBOSE
 869
 870# ifndef yystrlen
 871#  if defined __GLIBC__ && defined _STRING_H
 872#   define yystrlen strlen
 873#  else
 874/* Return the length of YYSTR.  */
 875#if (defined __STDC__ || defined __C99__FUNC__ \
 876     || defined __cplusplus || defined _MSC_VER)
 877static YYSIZE_T
 878yystrlen (const char *yystr)
 879#else
 880static YYSIZE_T
 881yystrlen (yystr)
 882    const char *yystr;
 883#endif
 884{
 885  YYSIZE_T yylen;
 886  for (yylen = 0; yystr[yylen]; yylen++)
 887    continue;
 888  return yylen;
 889}
 890#  endif
 891# endif
 892
 893# ifndef yystpcpy
 894#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 895#   define yystpcpy stpcpy
 896#  else
 897/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
 898   YYDEST.  */
 899#if (defined __STDC__ || defined __C99__FUNC__ \
 900     || defined __cplusplus || defined _MSC_VER)
 901static char *
 902yystpcpy (char *yydest, const char *yysrc)
 903#else
 904static char *
 905yystpcpy (yydest, yysrc)
 906    char *yydest;
 907    const char *yysrc;
 908#endif
 909{
 910  char *yyd = yydest;
 911  const char *yys = yysrc;
 912
 913  while ((*yyd++ = *yys++) != '\0')
 914    continue;
 915
 916  return yyd - 1;
 917}
 918#  endif
 919# endif
 920
 921# ifndef yytnamerr
 922/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
 923   quotes and backslashes, so that it's suitable for yyerror.  The
 924   heuristic is that double-quoting is unnecessary unless the string
 925   contains an apostrophe, a comma, or backslash (other than
 926   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
 927   null, do not copy; instead, return the length of what the result
 928   would have been.  */
 929static YYSIZE_T
 930yytnamerr (char *yyres, const char *yystr)
 931{
 932  if (*yystr == '"')
 933    {
 934      YYSIZE_T yyn = 0;
 935      char const *yyp = yystr;
 936
 937      for (;;)
 938	switch (*++yyp)
 939	  {
 940	  case '\'':
 941	  case ',':
 942	    goto do_not_strip_quotes;
 943
 944	  case '\\':
 945	    if (*++yyp != '\\')
 946	      goto do_not_strip_quotes;
 947	    /* Fall through.  */
 948	  default:
 949	    if (yyres)
 950	      yyres[yyn] = *yyp;
 951	    yyn++;
 952	    break;
 953
 954	  case '"':
 955	    if (yyres)
 956	      yyres[yyn] = '\0';
 957	    return yyn;
 958	  }
 959    do_not_strip_quotes: ;
 960    }
 961
 962  if (! yyres)
 963    return yystrlen (yystr);
 964
 965  return yystpcpy (yyres, yystr) - yyres;
 966}
 967# endif
 968
 969/* Copy into YYRESULT an error message about the unexpected token
 970   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
 971   including the terminating null byte.  If YYRESULT is null, do not
 972   copy anything; just return the number of bytes that would be
 973   copied.  As a special case, return 0 if an ordinary "syntax error"
 974   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
 975   size calculation.  */
 976static YYSIZE_T
 977yysyntax_error (char *yyresult, int yystate, int yychar)
 
 
 978{
 979  int yyn = yypact[yystate];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 980
 981  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
 982    return 0;
 983  else
 984    {
 985      int yytype = YYTRANSLATE (yychar);
 986      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
 987      YYSIZE_T yysize = yysize0;
 988      YYSIZE_T yysize1;
 989      int yysize_overflow = 0;
 990      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 991      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 992      int yyx;
 993
 994# if 0
 995      /* This is so xgettext sees the translatable formats that are
 996	 constructed on the fly.  */
 997      YY_("syntax error, unexpected %s");
 998      YY_("syntax error, unexpected %s, expecting %s");
 999      YY_("syntax error, unexpected %s, expecting %s or %s");
1000      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1001      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1002# endif
1003      char *yyfmt;
1004      char const *yyf;
1005      static char const yyunexpected[] = "syntax error, unexpected %s";
1006      static char const yyexpecting[] = ", expecting %s";
1007      static char const yyor[] = " or %s";
1008      char yyformat[sizeof yyunexpected
1009		    + sizeof yyexpecting - 1
1010		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1011		       * (sizeof yyor - 1))];
1012      char const *yyprefix = yyexpecting;
1013
1014      /* Start YYX at -YYN if negative to avoid negative indexes in
1015	 YYCHECK.  */
1016      int yyxbegin = yyn < 0 ? -yyn : 0;
1017
1018      /* Stay within bounds of both yycheck and yytname.  */
1019      int yychecklim = YYLAST - yyn + 1;
1020      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1021      int yycount = 1;
1022
1023      yyarg[0] = yytname[yytype];
1024      yyfmt = yystpcpy (yyformat, yyunexpected);
1025
1026      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1027	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1028	  {
1029	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1030	      {
1031		yycount = 1;
1032		yysize = yysize0;
1033		yyformat[sizeof yyunexpected - 1] = '\0';
1034		break;
1035	      }
1036	    yyarg[yycount++] = yytname[yyx];
1037	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1038	    yysize_overflow |= (yysize1 < yysize);
1039	    yysize = yysize1;
1040	    yyfmt = yystpcpy (yyfmt, yyprefix);
1041	    yyprefix = yyor;
1042	  }
1043
1044      yyf = YY_(yyformat);
1045      yysize1 = yysize + yystrlen (yyf);
1046      yysize_overflow |= (yysize1 < yysize);
1047      yysize = yysize1;
1048
1049      if (yysize_overflow)
1050	return YYSIZE_MAXIMUM;
1051
1052      if (yyresult)
1053	{
1054	  /* Avoid sprintf, as that infringes on the user's name space.
1055	     Don't have undefined behavior even if the translation
1056	     produced a string with the wrong number of "%s"s.  */
1057	  char *yyp = yyresult;
1058	  int yyi = 0;
1059	  while ((*yyp = *yyf) != '\0')
1060	    {
1061	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1062		{
1063		  yyp += yytnamerr (yyp, yyarg[yyi++]);
1064		  yyf += 2;
1065		}
1066	      else
1067		{
1068		  yyp++;
1069		  yyf++;
1070		}
1071	    }
1072	}
1073      return yysize;
1074    }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1075}
1076#endif /* YYERROR_VERBOSE */
1077
1078
1079/*-----------------------------------------------.
1080| Release the memory associated to this symbol.  |
1081`-----------------------------------------------*/
1082
1083/*ARGSUSED*/
1084#if (defined __STDC__ || defined __C99__FUNC__ \
1085     || defined __cplusplus || defined _MSC_VER)
1086static void
1087yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1088#else
1089static void
1090yydestruct (yymsg, yytype, yyvaluep)
1091    const char *yymsg;
1092    int yytype;
1093    YYSTYPE *yyvaluep;
1094#endif
1095{
1096  YYUSE (yyvaluep);
1097
1098  if (!yymsg)
1099    yymsg = "Deleting";
1100  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1101
1102  switch (yytype)
1103    {
1104
1105      default:
1106	break;
1107    }
1108}
1109
1110/* Prevent warnings from -Wmissing-prototypes.  */
1111#ifdef YYPARSE_PARAM
1112#if defined __STDC__ || defined __cplusplus
1113int yyparse (void *YYPARSE_PARAM);
1114#else
1115int yyparse ();
1116#endif
1117#else /* ! YYPARSE_PARAM */
1118#if defined __STDC__ || defined __cplusplus
1119int yyparse (void);
1120#else
1121int yyparse ();
1122#endif
1123#endif /* ! YYPARSE_PARAM */
1124
1125
1126/* The lookahead symbol.  */
1127int yychar;
1128
 
 
 
 
 
 
 
 
 
1129/* The semantic value of the lookahead symbol.  */
1130YYSTYPE yylval;
1131
1132/* Number of syntax errors so far.  */
1133int yynerrs;
1134
1135
1136
1137/*-------------------------.
1138| yyparse or yypush_parse.  |
1139`-------------------------*/
1140
1141#ifdef YYPARSE_PARAM
1142#if (defined __STDC__ || defined __C99__FUNC__ \
1143     || defined __cplusplus || defined _MSC_VER)
1144int
1145yyparse (void *YYPARSE_PARAM)
1146#else
1147int
1148yyparse (YYPARSE_PARAM)
1149    void *YYPARSE_PARAM;
1150#endif
1151#else /* ! YYPARSE_PARAM */
1152#if (defined __STDC__ || defined __C99__FUNC__ \
1153     || defined __cplusplus || defined _MSC_VER)
1154int
1155yyparse (void)
1156#else
1157int
1158yyparse ()
1159
1160#endif
1161#endif
1162{
1163
1164
1165    int yystate;
1166    /* Number of tokens to shift before error messages enabled.  */
1167    int yyerrstatus;
1168
1169    /* The stacks and their tools:
1170       `yyss': related to states.
1171       `yyvs': related to semantic values.
1172
1173       Refer to the stacks thru separate pointers, to allow yyoverflow
1174       to reallocate them elsewhere.  */
1175
1176    /* The state stack.  */
1177    yytype_int16 yyssa[YYINITDEPTH];
1178    yytype_int16 *yyss;
1179    yytype_int16 *yyssp;
1180
1181    /* The semantic value stack.  */
1182    YYSTYPE yyvsa[YYINITDEPTH];
1183    YYSTYPE *yyvs;
1184    YYSTYPE *yyvsp;
1185
1186    YYSIZE_T yystacksize;
1187
1188  int yyn;
1189  int yyresult;
1190  /* Lookahead token as an internal (translated) token number.  */
1191  int yytoken;
1192  /* The variables used to return semantic value and location from the
1193     action routines.  */
1194  YYSTYPE yyval;
1195
1196#if YYERROR_VERBOSE
1197  /* Buffer for error messages, and its allocated size.  */
1198  char yymsgbuf[128];
1199  char *yymsg = yymsgbuf;
1200  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1201#endif
1202
1203#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1204
1205  /* The number of symbols on the RHS of the reduced rule.
1206     Keep to zero when no symbol should be popped.  */
1207  int yylen = 0;
1208
1209  yytoken = 0;
1210  yyss = yyssa;
1211  yyvs = yyvsa;
1212  yystacksize = YYINITDEPTH;
1213
1214  YYDPRINTF ((stderr, "Starting parse\n"));
1215
1216  yystate = 0;
1217  yyerrstatus = 0;
1218  yynerrs = 0;
1219  yychar = YYEMPTY; /* Cause a token to be read.  */
1220
1221  /* Initialize stack pointers.
1222     Waste one element of value and location stack
1223     so that they stay on the same level as the state stack.
1224     The wasted elements are never initialized.  */
1225  yyssp = yyss;
1226  yyvsp = yyvs;
1227
1228  goto yysetstate;
1229
1230/*------------------------------------------------------------.
1231| yynewstate -- Push a new state, which is found in yystate.  |
1232`------------------------------------------------------------*/
1233 yynewstate:
1234  /* In all cases, when you get here, the value and location stacks
1235     have just been pushed.  So pushing a state here evens the stacks.  */
1236  yyssp++;
1237
1238 yysetstate:
1239  *yyssp = yystate;
1240
1241  if (yyss + yystacksize - 1 <= yyssp)
1242    {
1243      /* Get the current used size of the three stacks, in elements.  */
1244      YYSIZE_T yysize = yyssp - yyss + 1;
1245
1246#ifdef yyoverflow
1247      {
1248	/* Give user a chance to reallocate the stack.  Use copies of
1249	   these so that the &'s don't force the real ones into
1250	   memory.  */
1251	YYSTYPE *yyvs1 = yyvs;
1252	yytype_int16 *yyss1 = yyss;
1253
1254	/* Each stack pointer address is followed by the size of the
1255	   data in use in that stack, in bytes.  This used to be a
1256	   conditional around just the two extra args, but that might
1257	   be undefined if yyoverflow is a macro.  */
1258	yyoverflow (YY_("memory exhausted"),
1259		    &yyss1, yysize * sizeof (*yyssp),
1260		    &yyvs1, yysize * sizeof (*yyvsp),
1261		    &yystacksize);
1262
1263	yyss = yyss1;
1264	yyvs = yyvs1;
1265      }
1266#else /* no yyoverflow */
1267# ifndef YYSTACK_RELOCATE
1268      goto yyexhaustedlab;
1269# else
1270      /* Extend the stack our own way.  */
1271      if (YYMAXDEPTH <= yystacksize)
1272	goto yyexhaustedlab;
1273      yystacksize *= 2;
1274      if (YYMAXDEPTH < yystacksize)
1275	yystacksize = YYMAXDEPTH;
1276
1277      {
1278	yytype_int16 *yyss1 = yyss;
1279	union yyalloc *yyptr =
1280	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1281	if (! yyptr)
1282	  goto yyexhaustedlab;
1283	YYSTACK_RELOCATE (yyss_alloc, yyss);
1284	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1285#  undef YYSTACK_RELOCATE
1286	if (yyss1 != yyssa)
1287	  YYSTACK_FREE (yyss1);
1288      }
1289# endif
1290#endif /* no yyoverflow */
1291
1292      yyssp = yyss + yysize - 1;
1293      yyvsp = yyvs + yysize - 1;
1294
1295      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1296		  (unsigned long int) yystacksize));
1297
1298      if (yyss + yystacksize - 1 <= yyssp)
1299	YYABORT;
1300    }
1301
1302  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1303
1304  if (yystate == YYFINAL)
1305    YYACCEPT;
1306
1307  goto yybackup;
1308
1309/*-----------.
1310| yybackup.  |
1311`-----------*/
1312yybackup:
1313
1314  /* Do appropriate processing given the current state.  Read a
1315     lookahead token if we need one and don't already have one.  */
1316
1317  /* First try to decide what to do without reference to lookahead token.  */
1318  yyn = yypact[yystate];
1319  if (yyn == YYPACT_NINF)
1320    goto yydefault;
1321
1322  /* Not known => get a lookahead token if don't already have one.  */
1323
1324  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1325  if (yychar == YYEMPTY)
1326    {
1327      YYDPRINTF ((stderr, "Reading a token: "));
1328      yychar = YYLEX;
1329    }
1330
1331  if (yychar <= YYEOF)
1332    {
1333      yychar = yytoken = YYEOF;
1334      YYDPRINTF ((stderr, "Now at end of input.\n"));
1335    }
1336  else
1337    {
1338      yytoken = YYTRANSLATE (yychar);
1339      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1340    }
1341
1342  /* If the proper action on seeing token YYTOKEN is to reduce or to
1343     detect an error, take that action.  */
1344  yyn += yytoken;
1345  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1346    goto yydefault;
1347  yyn = yytable[yyn];
1348  if (yyn <= 0)
1349    {
1350      if (yyn == 0 || yyn == YYTABLE_NINF)
1351	goto yyerrlab;
1352      yyn = -yyn;
1353      goto yyreduce;
1354    }
1355
1356  /* Count tokens shifted since error; after three, turn off error
1357     status.  */
1358  if (yyerrstatus)
1359    yyerrstatus--;
1360
1361  /* Shift the lookahead token.  */
1362  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1363
1364  /* Discard the shifted token.  */
1365  yychar = YYEMPTY;
1366
1367  yystate = yyn;
 
1368  *++yyvsp = yylval;
 
1369
1370  goto yynewstate;
1371
1372
1373/*-----------------------------------------------------------.
1374| yydefault -- do the default action for the current state.  |
1375`-----------------------------------------------------------*/
1376yydefault:
1377  yyn = yydefact[yystate];
1378  if (yyn == 0)
1379    goto yyerrlab;
1380  goto yyreduce;
1381
1382
1383/*-----------------------------.
1384| yyreduce -- Do a reduction.  |
1385`-----------------------------*/
1386yyreduce:
1387  /* yyn is the number of a rule to reduce with.  */
1388  yylen = yyr2[yyn];
1389
1390  /* If YYLEN is nonzero, implement the default value of the action:
1391     `$$ = $1'.
1392
1393     Otherwise, the following line sets YYVAL to garbage.
1394     This behavior is undocumented and Bison
1395     users should not rely upon it.  Assigning to YYVAL
1396     unconditionally makes the parser a bit smaller, and it avoids a
1397     GCC warning that YYVAL may be used uninitialized.  */
1398  yyval = yyvsp[1-yylen];
1399
1400
1401  YY_REDUCE_PRINT (yyn);
1402  switch (yyn)
1403    {
1404        case 2:
1405
 
1406    {
1407			the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
1408							guess_boot_cpuid((yyvsp[(4) - (4)].node)));
1409		;}
1410    break;
1411
1412  case 3:
1413
 
1414    {
1415			(yyval.re) = NULL;
1416		;}
1417    break;
1418
1419  case 4:
1420
 
1421    {
1422			(yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1423		;}
1424    break;
1425
1426  case 5:
1427
 
1428    {
1429			(yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr));
1430		;}
1431    break;
1432
1433  case 6:
1434
 
1435    {
1436			add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
1437			(yyval.re) = (yyvsp[(2) - (2)].re);
1438		;}
1439    break;
1440
1441  case 7:
1442
1443    {
1444			(yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1445		;}
1446    break;
1447
1448  case 8:
1449
1450    {
1451			(yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
1452		;}
1453    break;
1454
1455  case 9:
1456
 
1457    {
1458			(yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1459		;}
1460    break;
1461
1462  case 10:
1463
 
1464    {
1465			struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
1466
1467			if (target)
1468				merge_nodes(target, (yyvsp[(3) - (3)].node));
1469			else
1470				print_error("label or path, '%s', not found", (yyvsp[(2) - (3)].labelref));
1471			(yyval.node) = (yyvsp[(1) - (3)].node);
1472		;}
1473    break;
1474
1475  case 11:
 
 
 
 
 
 
 
 
 
1476
 
 
 
 
 
 
 
1477    {
1478			(yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1479		;}
1480    break;
1481
1482  case 12:
1483
 
1484    {
1485			(yyval.proplist) = NULL;
1486		;}
1487    break;
1488
1489  case 13:
1490
 
1491    {
1492			(yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1493		;}
1494    break;
1495
1496  case 14:
1497
 
1498    {
1499			(yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
1500		;}
1501    break;
1502
1503  case 15:
1504
 
1505    {
1506			(yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
1507		;}
1508    break;
1509
1510  case 16:
1511
 
1512    {
1513			add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
1514			(yyval.prop) = (yyvsp[(2) - (2)].prop);
1515		;}
1516    break;
1517
1518  case 17:
1519
 
1520    {
1521			(yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1522		;}
 
1523    break;
1524
1525  case 18:
1526
 
1527    {
1528			(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1529		;}
1530    break;
1531
1532  case 19:
1533
 
1534    {
1535			(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1536		;}
1537    break;
1538
1539  case 20:
1540
 
1541    {
1542			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1543		;}
1544    break;
1545
1546  case 21:
 
 
 
 
 
 
1547
 
 
 
1548    {
1549			FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
1550			struct data d;
1551
1552			if ((yyvsp[(6) - (9)].addr) != 0)
1553				if (fseek(f, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0)
1554					print_error("Couldn't seek to offset %llu in \"%s\": %s",
1555						     (unsigned long long)(yyvsp[(6) - (9)].addr),
1556						     (yyvsp[(4) - (9)].data).val,
1557						     strerror(errno));
1558
1559			d = data_copy_file(f, (yyvsp[(8) - (9)].addr));
1560
1561			(yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
1562			fclose(f);
1563		;}
1564    break;
1565
1566  case 22:
1567
 
1568    {
1569			FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
1570			struct data d = empty_data;
1571
1572			d = data_copy_file(f, -1);
1573
1574			(yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
1575			fclose(f);
1576		;}
1577    break;
1578
1579  case 23:
1580
 
1581    {
1582			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1583		;}
1584    break;
1585
1586  case 24:
1587
 
1588    {
1589			(yyval.data) = empty_data;
1590		;}
1591    break;
1592
1593  case 25:
1594
 
1595    {
1596			(yyval.data) = (yyvsp[(1) - (2)].data);
1597		;}
1598    break;
1599
1600  case 26:
1601
 
1602    {
1603			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1604		;}
1605    break;
1606
1607  case 27:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1608
 
 
 
1609    {
1610			(yyval.data) = empty_data;
1611		;}
 
1612    break;
1613
1614  case 28:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1615
 
 
 
 
 
 
 
1616    {
1617			(yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
1618		;}
 
 
 
 
 
 
 
 
 
 
1619    break;
1620
1621  case 29:
 
 
 
 
 
 
1622
 
 
 
1623    {
1624			(yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
1625							      (yyvsp[(2) - (2)].labelref)), -1);
1626		;}
1627    break;
1628
1629  case 30:
 
 
 
 
 
 
1630
 
 
 
1631    {
1632			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1633		;}
1634    break;
1635
1636  case 31:
 
 
 
 
1637
1638    {
1639			(yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
1640		;}
 
1641    break;
1642
1643  case 32:
 
 
 
 
1644
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1645    {
1646			(yyval.data) = empty_data;
1647		;}
1648    break;
1649
1650  case 33:
1651
 
1652    {
1653			(yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
1654		;}
1655    break;
1656
1657  case 34:
1658
 
1659    {
1660			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1661		;}
1662    break;
1663
1664  case 35:
1665
 
1666    {
1667			(yyval.nodelist) = NULL;
1668		;}
1669    break;
1670
1671  case 36:
1672
 
1673    {
1674			(yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
1675		;}
1676    break;
1677
1678  case 37:
1679
 
1680    {
1681			print_error("syntax error: properties must precede subnodes");
1682			YYERROR;
1683		;}
1684    break;
1685
1686  case 38:
1687
 
1688    {
1689			(yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
1690		;}
1691    break;
1692
1693  case 39:
 
 
 
 
 
 
1694
 
 
 
1695    {
1696			add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
1697			(yyval.node) = (yyvsp[(2) - (2)].node);
1698		;}
1699    break;
1700
1701
1702
 
1703      default: break;
1704    }
 
 
 
 
 
 
 
 
 
 
 
1705  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1706
1707  YYPOPSTACK (yylen);
1708  yylen = 0;
1709  YY_STACK_PRINT (yyss, yyssp);
1710
1711  *++yyvsp = yyval;
1712
1713  /* Now `shift' the result of the reduction.  Determine what state
1714     that goes to, based on the state we popped back to and the rule
1715     number reduced by.  */
1716
1717  yyn = yyr1[yyn];
1718
1719  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1720  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1721    yystate = yytable[yystate];
1722  else
1723    yystate = yydefgoto[yyn - YYNTOKENS];
1724
1725  goto yynewstate;
1726
1727
1728/*------------------------------------.
1729| yyerrlab -- here on detecting error |
1730`------------------------------------*/
1731yyerrlab:
 
 
 
 
1732  /* If not already recovering from an error, report this error.  */
1733  if (!yyerrstatus)
1734    {
1735      ++yynerrs;
1736#if ! YYERROR_VERBOSE
1737      yyerror (YY_("syntax error"));
1738#else
 
 
1739      {
1740	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1741	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1742	  {
1743	    YYSIZE_T yyalloc = 2 * yysize;
1744	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1745	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
1746	    if (yymsg != yymsgbuf)
1747	      YYSTACK_FREE (yymsg);
1748	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1749	    if (yymsg)
1750	      yymsg_alloc = yyalloc;
1751	    else
1752	      {
1753		yymsg = yymsgbuf;
1754		yymsg_alloc = sizeof yymsgbuf;
1755	      }
1756	  }
1757
1758	if (0 < yysize && yysize <= yymsg_alloc)
1759	  {
1760	    (void) yysyntax_error (yymsg, yystate, yychar);
1761	    yyerror (yymsg);
1762	  }
1763	else
1764	  {
1765	    yyerror (YY_("syntax error"));
1766	    if (yysize != 0)
1767	      goto yyexhaustedlab;
1768	  }
1769      }
 
1770#endif
1771    }
1772
1773
1774
1775  if (yyerrstatus == 3)
1776    {
1777      /* If just tried and failed to reuse lookahead token after an
1778	 error, discard it.  */
1779
1780      if (yychar <= YYEOF)
1781	{
1782	  /* Return failure if at end of input.  */
1783	  if (yychar == YYEOF)
1784	    YYABORT;
1785	}
1786      else
1787	{
1788	  yydestruct ("Error: discarding",
1789		      yytoken, &yylval);
1790	  yychar = YYEMPTY;
1791	}
1792    }
1793
1794  /* Else will try to reuse lookahead token after shifting the error
1795     token.  */
1796  goto yyerrlab1;
1797
1798
1799/*---------------------------------------------------.
1800| yyerrorlab -- error raised explicitly by YYERROR.  |
1801`---------------------------------------------------*/
1802yyerrorlab:
1803
1804  /* Pacify compilers like GCC when the user code never invokes
1805     YYERROR and the label yyerrorlab therefore never appears in user
1806     code.  */
1807  if (/*CONSTCOND*/ 0)
1808     goto yyerrorlab;
1809
1810  /* Do not reclaim the symbols of the rule which action triggered
1811     this YYERROR.  */
1812  YYPOPSTACK (yylen);
1813  yylen = 0;
1814  YY_STACK_PRINT (yyss, yyssp);
1815  yystate = *yyssp;
1816  goto yyerrlab1;
1817
1818
1819/*-------------------------------------------------------------.
1820| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1821`-------------------------------------------------------------*/
1822yyerrlab1:
1823  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
1824
1825  for (;;)
1826    {
1827      yyn = yypact[yystate];
1828      if (yyn != YYPACT_NINF)
1829	{
1830	  yyn += YYTERROR;
1831	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1832	    {
1833	      yyn = yytable[yyn];
1834	      if (0 < yyn)
1835		break;
1836	    }
1837	}
1838
1839      /* Pop the current state because it cannot handle the error token.  */
1840      if (yyssp == yyss)
1841	YYABORT;
1842
1843
1844      yydestruct ("Error: popping",
1845		  yystos[yystate], yyvsp);
1846      YYPOPSTACK (1);
1847      yystate = *yyssp;
1848      YY_STACK_PRINT (yyss, yyssp);
1849    }
1850
 
1851  *++yyvsp = yylval;
 
1852
1853
1854  /* Shift the error token.  */
1855  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1856
1857  yystate = yyn;
1858  goto yynewstate;
1859
1860
1861/*-------------------------------------.
1862| yyacceptlab -- YYACCEPT comes here.  |
1863`-------------------------------------*/
1864yyacceptlab:
1865  yyresult = 0;
1866  goto yyreturn;
1867
1868/*-----------------------------------.
1869| yyabortlab -- YYABORT comes here.  |
1870`-----------------------------------*/
1871yyabortlab:
1872  yyresult = 1;
1873  goto yyreturn;
1874
1875#if !defined(yyoverflow) || YYERROR_VERBOSE
1876/*-------------------------------------------------.
1877| yyexhaustedlab -- memory exhaustion comes here.  |
1878`-------------------------------------------------*/
1879yyexhaustedlab:
1880  yyerror (YY_("memory exhausted"));
1881  yyresult = 2;
1882  /* Fall through.  */
1883#endif
1884
1885yyreturn:
1886  if (yychar != YYEMPTY)
1887     yydestruct ("Cleanup: discarding lookahead",
1888		 yytoken, &yylval);
 
 
 
 
 
1889  /* Do not reclaim the symbols of the rule which action triggered
1890     this YYABORT or YYACCEPT.  */
1891  YYPOPSTACK (yylen);
1892  YY_STACK_PRINT (yyss, yyssp);
1893  while (yyssp != yyss)
1894    {
1895      yydestruct ("Cleanup: popping",
1896		  yystos[*yyssp], yyvsp);
1897      YYPOPSTACK (1);
1898    }
1899#ifndef yyoverflow
1900  if (yyss != yyssa)
1901    YYSTACK_FREE (yyss);
1902#endif
1903#if YYERROR_VERBOSE
1904  if (yymsg != yymsgbuf)
1905    YYSTACK_FREE (yymsg);
1906#endif
1907  /* Make sure YYID is used.  */
1908  return YYID (yyresult);
1909}
1910
1911
1912
 
1913
1914
1915void print_error(char const *fmt, ...)
1916{
1917	va_list va;
1918
1919	va_start(va, fmt);
1920	srcpos_verror(&yylloc, fmt, va);
1921	va_end(va);
1922
1923	treesource_error = 1;
1924}
1925
1926void yyerror(char const *s) {
1927	print_error("%s", s);
1928}
1929
1930static unsigned long long eval_literal(const char *s, int base, int bits)
1931{
1932	unsigned long long val;
1933	char *e;
1934
1935	errno = 0;
1936	val = strtoull(s, &e, base);
1937	if (*e)
1938		print_error("bad characters in literal");
1939	else if ((errno == ERANGE)
 
 
 
1940		 || ((bits < 64) && (val >= (1ULL << bits))))
1941		print_error("literal out of range");
1942	else if (errno != 0)
1943		print_error("bad literal");
1944	return val;
1945}
1946
v3.15
   1/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
   2
   3/* Bison implementation for Yacc-like parsers in C
   4   
   5      Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
 
   6   
   7   This program is free software: you can redistribute it and/or modify
   8   it under the terms of the GNU General Public License as published by
   9   the Free Software Foundation, either version 3 of the License, or
  10   (at your option) any later version.
  11   
  12   This program is distributed in the hope that it will be useful,
  13   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15   GNU General Public License for more details.
  16   
  17   You should have received a copy of the GNU General Public License
  18   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
  19
  20/* As a special exception, you may create a larger work that contains
  21   part or all of the Bison parser skeleton and distribute that work
  22   under terms of your choice, so long as that work isn't itself a
  23   parser generator using the skeleton or a modified version thereof
  24   as a parser skeleton.  Alternatively, if you modify or redistribute
  25   the parser skeleton itself, you may (at your option) remove this
  26   special exception, which will cause the skeleton and the resulting
  27   Bison output files to be licensed under the GNU General Public
  28   License without this special exception.
  29   
  30   This special exception was added by the Free Software Foundation in
  31   version 2.2 of Bison.  */
  32
  33/* C LALR(1) parser skeleton written by Richard Stallman, by
  34   simplifying the original so-called "semantic" parser.  */
  35
  36/* All symbols defined below should begin with yy or YY, to avoid
  37   infringing on user name space.  This should be done even for local
  38   variables, as they might otherwise be expanded by user macros.
  39   There are some unavoidable exceptions within include files to
  40   define necessary library symbols; they are noted "INFRINGES ON
  41   USER NAME SPACE" below.  */
  42
  43/* Identify Bison output.  */
  44#define YYBISON 1
  45
  46/* Bison version.  */
  47#define YYBISON_VERSION "2.7.12-4996"
  48
  49/* Skeleton name.  */
  50#define YYSKELETON_NAME "yacc.c"
  51
  52/* Pure parsers.  */
  53#define YYPURE 0
  54
  55/* Push parsers.  */
  56#define YYPUSH 0
  57
  58/* Pull parsers.  */
  59#define YYPULL 1
  60
 
 
  61
  62
  63
  64/* Copy the first part of user declarations.  */
  65/* Line 371 of yacc.c  */
  66#line 21 "dtc-parser.y"
  67
  68#include <stdio.h>
  69
  70#include "dtc.h"
  71#include "srcpos.h"
  72
  73YYLTYPE yylloc;
  74
  75extern int yylex(void);
  76extern void print_error(char const *fmt, ...);
  77extern void yyerror(char const *s);
  78
  79extern struct boot_info *the_boot_info;
  80extern int treesource_error;
  81
  82static unsigned long long eval_literal(const char *s, int base, int bits);
  83static unsigned char eval_char_literal(const char *s);
  84
  85/* Line 371 of yacc.c  */
  86#line 87 "dtc-parser.tab.c"
  87
  88# ifndef YY_NULL
  89#  if defined __cplusplus && 201103L <= __cplusplus
  90#   define YY_NULL nullptr
  91#  else
  92#   define YY_NULL 0
  93#  endif
  94# endif
  95
  96/* Enabling verbose error messages.  */
  97#ifdef YYERROR_VERBOSE
  98# undef YYERROR_VERBOSE
  99# define YYERROR_VERBOSE 1
 100#else
 101# define YYERROR_VERBOSE 0
 102#endif
 103
 104/* In a future release of Bison, this section will be replaced
 105   by #include "dtc-parser.tab.h".  */
 106#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
 107# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
 108/* Enabling traces.  */
 109#ifndef YYDEBUG
 110# define YYDEBUG 0
 111#endif
 112#if YYDEBUG
 113extern int yydebug;
 114#endif
 
 115
 116/* Tokens.  */
 117#ifndef YYTOKENTYPE
 118# define YYTOKENTYPE
 119   /* Put the tokens into the symbol table, so that GDB and other debuggers
 120      know about them.  */
 121   enum yytokentype {
 122     DT_V1 = 258,
 123     DT_MEMRESERVE = 259,
 124     DT_LSHIFT = 260,
 125     DT_RSHIFT = 261,
 126     DT_LE = 262,
 127     DT_GE = 263,
 128     DT_EQ = 264,
 129     DT_NE = 265,
 130     DT_AND = 266,
 131     DT_OR = 267,
 132     DT_BITS = 268,
 133     DT_DEL_PROP = 269,
 134     DT_DEL_NODE = 270,
 135     DT_PROPNODENAME = 271,
 136     DT_LITERAL = 272,
 137     DT_CHAR_LITERAL = 273,
 138     DT_BASE = 274,
 139     DT_BYTE = 275,
 140     DT_STRING = 276,
 141     DT_LABEL = 277,
 142     DT_REF = 278,
 143     DT_INCBIN = 279
 144   };
 145#endif
 146
 147
 
 148#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 149typedef union YYSTYPE
 150{
 151/* Line 387 of yacc.c  */
 152#line 40 "dtc-parser.y"
 153
 154	char *propnodename;
 155	char *literal;
 156	char *labelref;
 157	unsigned int cbase;
 158	uint8_t byte;
 159	struct data data;
 160
 161	struct {
 162		struct data	data;
 163		int		bits;
 164	} array;
 165
 166	struct property *prop;
 167	struct property *proplist;
 168	struct node *node;
 169	struct node *nodelist;
 170	struct reserve_info *re;
 171	uint64_t integer;
 172
 173
 174/* Line 387 of yacc.c  */
 175#line 176 "dtc-parser.tab.c"
 176} YYSTYPE;
 177# define YYSTYPE_IS_TRIVIAL 1
 178# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 179# define YYSTYPE_IS_DECLARED 1
 180#endif
 181
 182extern YYSTYPE yylval;
 183
 184#ifdef YYPARSE_PARAM
 185#if defined __STDC__ || defined __cplusplus
 186int yyparse (void *YYPARSE_PARAM);
 187#else
 188int yyparse ();
 189#endif
 190#else /* ! YYPARSE_PARAM */
 191#if defined __STDC__ || defined __cplusplus
 192int yyparse (void);
 193#else
 194int yyparse ();
 195#endif
 196#endif /* ! YYPARSE_PARAM */
 197
 198#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
 199
 200/* Copy the second part of user declarations.  */
 201
 202/* Line 390 of yacc.c  */
 203#line 204 "dtc-parser.tab.c"
 204
 205#ifdef short
 206# undef short
 207#endif
 208
 209#ifdef YYTYPE_UINT8
 210typedef YYTYPE_UINT8 yytype_uint8;
 211#else
 212typedef unsigned char yytype_uint8;
 213#endif
 214
 215#ifdef YYTYPE_INT8
 216typedef YYTYPE_INT8 yytype_int8;
 217#elif (defined __STDC__ || defined __C99__FUNC__ \
 218     || defined __cplusplus || defined _MSC_VER)
 219typedef signed char yytype_int8;
 220#else
 221typedef short int yytype_int8;
 222#endif
 223
 224#ifdef YYTYPE_UINT16
 225typedef YYTYPE_UINT16 yytype_uint16;
 226#else
 227typedef unsigned short int yytype_uint16;
 228#endif
 229
 230#ifdef YYTYPE_INT16
 231typedef YYTYPE_INT16 yytype_int16;
 232#else
 233typedef short int yytype_int16;
 234#endif
 235
 236#ifndef YYSIZE_T
 237# ifdef __SIZE_TYPE__
 238#  define YYSIZE_T __SIZE_TYPE__
 239# elif defined size_t
 240#  define YYSIZE_T size_t
 241# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
 242     || defined __cplusplus || defined _MSC_VER)
 243#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 244#  define YYSIZE_T size_t
 245# else
 246#  define YYSIZE_T unsigned int
 247# endif
 248#endif
 249
 250#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 251
 252#ifndef YY_
 253# if defined YYENABLE_NLS && YYENABLE_NLS
 254#  if ENABLE_NLS
 255#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 256#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
 257#  endif
 258# endif
 259# ifndef YY_
 260#  define YY_(Msgid) Msgid
 261# endif
 262#endif
 263
 264#ifndef __attribute__
 265/* This feature is available in gcc versions 2.5 and later.  */
 266# if (! defined __GNUC__ || __GNUC__ < 2 \
 267      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
 268#  define __attribute__(Spec) /* empty */
 269# endif
 270#endif
 271
 272/* Suppress unused-variable warnings by "using" E.  */
 273#if ! defined lint || defined __GNUC__
 274# define YYUSE(E) ((void) (E))
 275#else
 276# define YYUSE(E) /* empty */
 277#endif
 278
 279
 280/* Identity function, used to suppress warnings about constant conditions.  */
 281#ifndef lint
 282# define YYID(N) (N)
 283#else
 284#if (defined __STDC__ || defined __C99__FUNC__ \
 285     || defined __cplusplus || defined _MSC_VER)
 286static int
 287YYID (int yyi)
 288#else
 289static int
 290YYID (yyi)
 291    int yyi;
 292#endif
 293{
 294  return yyi;
 295}
 296#endif
 297
 298#if ! defined yyoverflow || YYERROR_VERBOSE
 299
 300/* The parser invokes alloca or malloc; define the necessary symbols.  */
 301
 302# ifdef YYSTACK_USE_ALLOCA
 303#  if YYSTACK_USE_ALLOCA
 304#   ifdef __GNUC__
 305#    define YYSTACK_ALLOC __builtin_alloca
 306#   elif defined __BUILTIN_VA_ARG_INCR
 307#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
 308#   elif defined _AIX
 309#    define YYSTACK_ALLOC __alloca
 310#   elif defined _MSC_VER
 311#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
 312#    define alloca _alloca
 313#   else
 314#    define YYSTACK_ALLOC alloca
 315#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
 316     || defined __cplusplus || defined _MSC_VER)
 317#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 318      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
 319#     ifndef EXIT_SUCCESS
 320#      define EXIT_SUCCESS 0
 321#     endif
 322#    endif
 323#   endif
 324#  endif
 325# endif
 326
 327# ifdef YYSTACK_ALLOC
 328   /* Pacify GCC's `empty if-body' warning.  */
 329#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 330#  ifndef YYSTACK_ALLOC_MAXIMUM
 331    /* The OS might guarantee only one guard page at the bottom of the stack,
 332       and a page size can be as small as 4096 bytes.  So we cannot safely
 333       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
 334       to allow for a few compiler-allocated temporary stack slots.  */
 335#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 336#  endif
 337# else
 338#  define YYSTACK_ALLOC YYMALLOC
 339#  define YYSTACK_FREE YYFREE
 340#  ifndef YYSTACK_ALLOC_MAXIMUM
 341#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 342#  endif
 343#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
 344       && ! ((defined YYMALLOC || defined malloc) \
 345	     && (defined YYFREE || defined free)))
 346#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 347#   ifndef EXIT_SUCCESS
 348#    define EXIT_SUCCESS 0
 349#   endif
 350#  endif
 351#  ifndef YYMALLOC
 352#   define YYMALLOC malloc
 353#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
 354     || defined __cplusplus || defined _MSC_VER)
 355void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 356#   endif
 357#  endif
 358#  ifndef YYFREE
 359#   define YYFREE free
 360#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
 361     || defined __cplusplus || defined _MSC_VER)
 362void free (void *); /* INFRINGES ON USER NAME SPACE */
 363#   endif
 364#  endif
 365# endif
 366#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 367
 368
 369#if (! defined yyoverflow \
 370     && (! defined __cplusplus \
 371	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 372
 373/* A type that is properly aligned for any stack member.  */
 374union yyalloc
 375{
 376  yytype_int16 yyss_alloc;
 377  YYSTYPE yyvs_alloc;
 378};
 379
 380/* The size of the maximum gap between one aligned stack and the next.  */
 381# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
 382
 383/* The size of an array large to enough to hold all stacks, each with
 384   N elements.  */
 385# define YYSTACK_BYTES(N) \
 386     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
 387      + YYSTACK_GAP_MAXIMUM)
 388
 389# define YYCOPY_NEEDED 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 390
 391/* Relocate STACK from its old location to the new one.  The
 392   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 393   elements in the stack, and YYPTR gives the new location of the
 394   stack.  Advance YYPTR to a properly aligned location for the next
 395   stack.  */
 396# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
 397    do									\
 398      {									\
 399	YYSIZE_T yynewbytes;						\
 400	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
 401	Stack = &yyptr->Stack_alloc;					\
 402	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 403	yyptr += yynewbytes / sizeof (*yyptr);				\
 404      }									\
 405    while (YYID (0))
 406
 407#endif
 408
 409#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
 410/* Copy COUNT objects from SRC to DST.  The source and destination do
 411   not overlap.  */
 412# ifndef YYCOPY
 413#  if defined __GNUC__ && 1 < __GNUC__
 414#   define YYCOPY(Dst, Src, Count) \
 415      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
 416#  else
 417#   define YYCOPY(Dst, Src, Count)              \
 418      do                                        \
 419        {                                       \
 420          YYSIZE_T yyi;                         \
 421          for (yyi = 0; yyi < (Count); yyi++)   \
 422            (Dst)[yyi] = (Src)[yyi];            \
 423        }                                       \
 424      while (YYID (0))
 425#  endif
 426# endif
 427#endif /* !YYCOPY_NEEDED */
 428
 429/* YYFINAL -- State number of the termination state.  */
 430#define YYFINAL  4
 431/* YYLAST -- Last index in YYTABLE.  */
 432#define YYLAST   133
 433
 434/* YYNTOKENS -- Number of terminals.  */
 435#define YYNTOKENS  48
 436/* YYNNTS -- Number of nonterminals.  */
 437#define YYNNTS  28
 438/* YYNRULES -- Number of rules.  */
 439#define YYNRULES  79
 440/* YYNRULES -- Number of states.  */
 441#define YYNSTATES  141
 442
 443/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 444#define YYUNDEFTOK  2
 445#define YYMAXUTOK   279
 446
 447#define YYTRANSLATE(YYX)						\
 448  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 449
 450/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
 451static const yytype_uint8 yytranslate[] =
 452{
 453       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 454       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 455       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 456       2,     2,     2,    47,     2,     2,     2,    45,    41,     2,
 457      33,    35,    44,    42,    34,    43,     2,    26,     2,     2,
 458       2,     2,     2,     2,     2,     2,     2,     2,    38,    25,
 459      36,    29,    30,    37,     2,     2,     2,     2,     2,     2,
 460       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
 
 
 461       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 462       2,    31,     2,    32,    40,     2,     2,     2,     2,     2,
 463       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 
 464       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 465       2,     2,     2,    27,    39,    28,    46,     2,     2,     2,
 
 466       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 467       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 468       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 469       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 470       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 471       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 472       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 473       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 474       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 475       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 476       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 477       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
 478       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
 479       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
 480      15,    16,    17,    18,    19,    20,    21,    22,    23,    24
 481};
 482
 483#if YYDEBUG
 484/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
 485   YYRHS.  */
 486static const yytype_uint16 yyprhs[] =
 487{
 488       0,     0,     3,     8,     9,    12,    17,    20,    23,    27,
 489      31,    36,    42,    43,    46,    51,    54,    58,    61,    64,
 490      68,    73,    76,    86,    92,    95,    96,    99,   102,   106,
 491     108,   111,   114,   117,   119,   121,   125,   127,   129,   135,
 492     137,   141,   143,   147,   149,   153,   155,   159,   161,   165,
 493     167,   171,   175,   177,   181,   185,   189,   193,   197,   201,
 494     203,   207,   211,   213,   217,   221,   225,   227,   229,   232,
 495     235,   238,   239,   242,   245,   246,   249,   252,   255,   259
 496};
 497
 498/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 499static const yytype_int8 yyrhs[] =
 500{
 501      49,     0,    -1,     3,    25,    50,    52,    -1,    -1,    51,
 502      50,    -1,     4,    59,    59,    25,    -1,    22,    51,    -1,
 503      26,    53,    -1,    52,    26,    53,    -1,    52,    23,    53,
 504      -1,    52,    15,    23,    25,    -1,    27,    54,    74,    28,
 505      25,    -1,    -1,    54,    55,    -1,    16,    29,    56,    25,
 506      -1,    16,    25,    -1,    14,    16,    25,    -1,    22,    55,
 507      -1,    57,    21,    -1,    57,    58,    30,    -1,    57,    31,
 508      73,    32,    -1,    57,    23,    -1,    57,    24,    33,    21,
 509      34,    59,    34,    59,    35,    -1,    57,    24,    33,    21,
 510      35,    -1,    56,    22,    -1,    -1,    56,    34,    -1,    57,
 511      22,    -1,    13,    17,    36,    -1,    36,    -1,    58,    59,
 512      -1,    58,    23,    -1,    58,    22,    -1,    17,    -1,    18,
 513      -1,    33,    60,    35,    -1,    61,    -1,    62,    -1,    62,
 514      37,    60,    38,    61,    -1,    63,    -1,    62,    12,    63,
 515      -1,    64,    -1,    63,    11,    64,    -1,    65,    -1,    64,
 516      39,    65,    -1,    66,    -1,    65,    40,    66,    -1,    67,
 517      -1,    66,    41,    67,    -1,    68,    -1,    67,     9,    68,
 518      -1,    67,    10,    68,    -1,    69,    -1,    68,    36,    69,
 519      -1,    68,    30,    69,    -1,    68,     7,    69,    -1,    68,
 520       8,    69,    -1,    69,     5,    70,    -1,    69,     6,    70,
 521      -1,    70,    -1,    70,    42,    71,    -1,    70,    43,    71,
 522      -1,    71,    -1,    71,    44,    72,    -1,    71,    26,    72,
 523      -1,    71,    45,    72,    -1,    72,    -1,    59,    -1,    43,
 524      72,    -1,    46,    72,    -1,    47,    72,    -1,    -1,    73,
 525      20,    -1,    73,    22,    -1,    -1,    75,    74,    -1,    75,
 526      55,    -1,    16,    53,    -1,    15,    16,    25,    -1,    22,
 527      75,    -1
 528};
 529
 530/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 531static const yytype_uint16 yyrline[] =
 532{
 533       0,   109,   109,   118,   121,   128,   132,   140,   144,   148,
 534     158,   172,   180,   183,   190,   194,   198,   202,   210,   214,
 535     218,   222,   226,   243,   253,   261,   264,   268,   275,   290,
 536     295,   315,   329,   336,   340,   344,   351,   355,   356,   360,
 537     361,   365,   366,   370,   371,   375,   376,   380,   381,   385,
 538     386,   387,   391,   392,   393,   394,   395,   399,   400,   401,
 539     405,   406,   407,   411,   412,   413,   414,   418,   419,   420,
 540     421,   426,   429,   433,   441,   444,   448,   456,   460,   464
 541};
 542#endif
 543
 544#if YYDEBUG || YYERROR_VERBOSE || 0
 545/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
 546   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 547static const char *const yytname[] =
 548{
 549  "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
 550  "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
 551  "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
 552  "DT_CHAR_LITERAL", "DT_BASE", "DT_BYTE", "DT_STRING", "DT_LABEL",
 553  "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
 554  "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
 555  "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
 556  "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
 557  "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
 558  "integer_expr", "integer_trinary", "integer_or", "integer_and",
 559  "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
 560  "integer_rela", "integer_shift", "integer_add", "integer_mul",
 561  "integer_unary", "bytestring", "subnodes", "subnode", YY_NULL
 562};
 563#endif
 564
 565# ifdef YYPRINT
 566/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
 567   token YYLEX-NUM.  */
 568static const yytype_uint16 yytoknum[] =
 569{
 570       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
 571     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
 572     275,   276,   277,   278,   279,    59,    47,   123,   125,    61,
 573      62,    91,    93,    40,    44,    41,    60,    63,    58,   124,
 574      94,    38,    43,    45,    42,    37,   126,    33
 575};
 576# endif
 577
 578/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 579static const yytype_uint8 yyr1[] =
 580{
 581       0,    48,    49,    50,    50,    51,    51,    52,    52,    52,
 582      52,    53,    54,    54,    55,    55,    55,    55,    56,    56,
 583      56,    56,    56,    56,    56,    57,    57,    57,    58,    58,
 584      58,    58,    58,    59,    59,    59,    60,    61,    61,    62,
 585      62,    63,    63,    64,    64,    65,    65,    66,    66,    67,
 586      67,    67,    68,    68,    68,    68,    68,    69,    69,    69,
 587      70,    70,    70,    71,    71,    71,    71,    72,    72,    72,
 588      72,    73,    73,    73,    74,    74,    74,    75,    75,    75
 589};
 590
 591/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
 592static const yytype_uint8 yyr2[] =
 593{
 594       0,     2,     4,     0,     2,     4,     2,     2,     3,     3,
 595       4,     5,     0,     2,     4,     2,     3,     2,     2,     3,
 596       4,     2,     9,     5,     2,     0,     2,     2,     3,     1,
 597       2,     2,     2,     1,     1,     3,     1,     1,     5,     1,
 598       3,     1,     3,     1,     3,     1,     3,     1,     3,     1,
 599       3,     3,     1,     3,     3,     3,     3,     3,     3,     1,
 600       3,     3,     1,     3,     3,     3,     1,     1,     2,     2,
 601       2,     0,     2,     2,     0,     2,     2,     2,     3,     2
 602};
 603
 604/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
 605   Performed when YYTABLE doesn't specify something else to do.  Zero
 606   means the default is an error.  */
 607static const yytype_uint8 yydefact[] =
 608{
 609       0,     0,     0,     3,     1,     0,     0,     0,     3,    33,
 610      34,     0,     0,     6,     0,     2,     4,     0,     0,     0,
 611      67,     0,    36,    37,    39,    41,    43,    45,    47,    49,
 612      52,    59,    62,    66,     0,    12,     7,     0,     0,     0,
 613      68,    69,    70,    35,     0,     0,     0,     0,     0,     0,
 614       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
 615       0,     0,     0,     5,    74,     0,     9,     8,    40,     0,
 616      42,    44,    46,    48,    50,    51,    55,    56,    54,    53,
 617      57,    58,    60,    61,    64,    63,    65,     0,     0,     0,
 618       0,    13,     0,    74,    10,     0,     0,     0,    15,    25,
 619      77,    17,    79,     0,    76,    75,    38,    16,    78,     0,
 620       0,    11,    24,    14,    26,     0,    18,    27,    21,     0,
 621      71,    29,     0,     0,     0,     0,    32,    31,    19,    30,
 622      28,     0,    72,    73,    20,     0,    23,     0,     0,     0,
 623      22
 624};
 625
 626/* YYDEFGOTO[NTERM-NUM].  */
 627static const yytype_int8 yydefgoto[] =
 628{
 629      -1,     2,     7,     8,    15,    36,    64,    91,   109,   110,
 630     122,    20,    21,    22,    23,    24,    25,    26,    27,    28,
 631      29,    30,    31,    32,    33,   125,    92,    93
 632};
 633
 634/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
 635   STATE-NUM.  */
 636#define YYPACT_NINF -78
 637static const yytype_int8 yypact[] =
 638{
 639      22,    11,    51,    10,   -78,    23,    10,     2,    10,   -78,
 640     -78,    -9,    23,   -78,    30,    38,   -78,    -9,    -9,    -9,
 641     -78,    35,   -78,    -6,    52,    29,    48,    49,    33,     3,
 642      71,    36,     0,   -78,    64,   -78,   -78,    68,    30,    30,
 643     -78,   -78,   -78,   -78,    -9,    -9,    -9,    -9,    -9,    -9,
 644      -9,    -9,    -9,    -9,    -9,    -9,    -9,    -9,    -9,    -9,
 645      -9,    -9,    -9,   -78,    44,    67,   -78,   -78,    52,    55,
 646      29,    48,    49,    33,     3,     3,    71,    71,    71,    71,
 647      36,    36,     0,     0,   -78,   -78,   -78,    78,    79,    42,
 648      44,   -78,    69,    44,   -78,    -9,    73,    74,   -78,   -78,
 649     -78,   -78,   -78,    75,   -78,   -78,   -78,   -78,   -78,    -7,
 650      -1,   -78,   -78,   -78,   -78,    84,   -78,   -78,   -78,    63,
 651     -78,   -78,    32,    66,    82,    -3,   -78,   -78,   -78,   -78,
 652     -78,    46,   -78,   -78,   -78,    23,   -78,    70,    23,    72,
 653     -78
 654};
 655
 656/* YYPGOTO[NTERM-NUM].  */
 657static const yytype_int8 yypgoto[] =
 658{
 659     -78,   -78,    97,   100,   -78,   -37,   -78,   -77,   -78,   -78,
 660     -78,    -5,    65,    13,   -78,    76,    77,    62,    80,    83,
 661      34,    20,    26,    28,   -14,   -78,    18,    24
 662};
 663
 664/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
 665   positive, shift that token.  If negative, reduce the rule which
 666   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 
 667#define YYTABLE_NINF -1
 668static const yytype_uint8 yytable[] =
 669{
 670      12,    66,    67,    40,    41,    42,    44,    34,     9,    10,
 671      52,    53,   115,   101,     5,   112,   104,   132,   113,   133,
 672     116,   117,   118,   119,    11,     1,    60,   114,    14,   134,
 673     120,    45,     6,    54,    17,   121,     3,    18,    19,    55,
 674       9,    10,    50,    51,    61,    62,    84,    85,    86,     9,
 675      10,     4,   100,    37,   126,   127,    11,    35,    87,    88,
 676      89,    38,   128,    46,    39,    11,    90,    98,    47,    35,
 677      43,    99,    76,    77,    78,    79,    56,    57,    58,    59,
 678     135,   136,    80,    81,    74,    75,    82,    83,    48,    63,
 679      49,    65,    94,    95,    96,    97,   124,   103,   107,   108,
 680     111,   123,   130,   131,   138,    16,    13,   140,   106,    71,
 681      69,   105,     0,     0,   102,     0,     0,   129,     0,     0,
 682      68,     0,     0,    70,     0,     0,     0,     0,    72,     0,
 683     137,     0,    73,   139
 684};
 685
 686#define yypact_value_is_default(Yystate) \
 687  (!!((Yystate) == (-78)))
 688
 689#define yytable_value_is_error(Yytable_value) \
 690  YYID (0)
 691
 692static const yytype_int16 yycheck[] =
 693{
 694       5,    38,    39,    17,    18,    19,    12,    12,    17,    18,
 695       7,     8,    13,    90,     4,    22,    93,    20,    25,    22,
 696      21,    22,    23,    24,    33,     3,    26,    34,    26,    32,
 697      31,    37,    22,    30,    43,    36,    25,    46,    47,    36,
 698      17,    18,     9,    10,    44,    45,    60,    61,    62,    17,
 699      18,     0,    89,    15,    22,    23,    33,    27,    14,    15,
 700      16,    23,    30,    11,    26,    33,    22,    25,    39,    27,
 701      35,    29,    52,    53,    54,    55,     5,     6,    42,    43,
 702      34,    35,    56,    57,    50,    51,    58,    59,    40,    25,
 703      41,    23,    25,    38,    16,    16,    33,    28,    25,    25,
 704      25,    17,    36,    21,    34,     8,     6,    35,    95,    47,
 705      45,    93,    -1,    -1,    90,    -1,    -1,   122,    -1,    -1,
 706      44,    -1,    -1,    46,    -1,    -1,    -1,    -1,    48,    -1,
 707     135,    -1,    49,   138
 708};
 709
 710/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
 711   symbol of state STATE-NUM.  */
 712static const yytype_uint8 yystos[] =
 713{
 714       0,     3,    49,    25,     0,     4,    22,    50,    51,    17,
 715      18,    33,    59,    51,    26,    52,    50,    43,    46,    47,
 716      59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
 717      69,    70,    71,    72,    59,    27,    53,    15,    23,    26,
 718      72,    72,    72,    35,    12,    37,    11,    39,    40,    41,
 719       9,    10,     7,     8,    30,    36,     5,     6,    42,    43,
 720      26,    44,    45,    25,    54,    23,    53,    53,    63,    60,
 721      64,    65,    66,    67,    68,    68,    69,    69,    69,    69,
 722      70,    70,    71,    71,    72,    72,    72,    14,    15,    16,
 723      22,    55,    74,    75,    25,    38,    16,    16,    25,    29,
 724      53,    55,    75,    28,    55,    74,    61,    25,    25,    56,
 725      57,    25,    22,    25,    34,    13,    21,    22,    23,    24,
 726      31,    36,    58,    17,    33,    73,    22,    23,    30,    59,
 727      36,    21,    20,    22,    32,    34,    35,    59,    34,    59,
 728      35
 729};
 730
 731#define yyerrok		(yyerrstatus = 0)
 732#define yyclearin	(yychar = YYEMPTY)
 733#define YYEMPTY		(-2)
 734#define YYEOF		0
 735
 736#define YYACCEPT	goto yyacceptlab
 737#define YYABORT		goto yyabortlab
 738#define YYERROR		goto yyerrorlab
 739
 740
 741/* Like YYERROR except do call yyerror.  This remains here temporarily
 742   to ease the transition to the new meaning of YYERROR, for GCC.
 743   Once GCC version 2 has supplanted version 1, this can go.  However,
 744   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
 745   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
 746   discussed.  */
 747
 748#define YYFAIL		goto yyerrlab
 749#if defined YYFAIL
 750  /* This is here to suppress warnings from the GCC cpp's
 751     -Wunused-macros.  Normally we don't worry about that warning, but
 752     some users do, and we want to make it easy for users to remove
 753     YYFAIL uses, which will produce warnings from Bison 2.5.  */
 754#endif
 755
 756#define YYRECOVERING()  (!!yyerrstatus)
 757
 758#define YYBACKUP(Token, Value)                                  \
 759do                                                              \
 760  if (yychar == YYEMPTY)                                        \
 761    {                                                           \
 762      yychar = (Token);                                         \
 763      yylval = (Value);                                         \
 764      YYPOPSTACK (yylen);                                       \
 765      yystate = *yyssp;                                         \
 766      goto yybackup;                                            \
 767    }                                                           \
 768  else                                                          \
 769    {                                                           \
 770      yyerror (YY_("syntax error: cannot back up")); \
 771      YYERROR;							\
 772    }								\
 773while (YYID (0))
 774
 775/* Error token number */
 776#define YYTERROR	1
 777#define YYERRCODE	256
 778
 779
 780/* This macro is provided for backward compatibility. */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 781#ifndef YY_LOCATION_PRINT
 782# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 
 
 
 
 
 
 
 783#endif
 784
 785
 786/* YYLEX -- calling `yylex' with the right arguments.  */
 
 787#ifdef YYLEX_PARAM
 788# define YYLEX yylex (YYLEX_PARAM)
 789#else
 790# define YYLEX yylex ()
 791#endif
 792
 793/* Enable debugging if requested.  */
 794#if YYDEBUG
 795
 796# ifndef YYFPRINTF
 797#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
 798#  define YYFPRINTF fprintf
 799# endif
 800
 801# define YYDPRINTF(Args)			\
 802do {						\
 803  if (yydebug)					\
 804    YYFPRINTF Args;				\
 805} while (YYID (0))
 806
 807# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
 808do {									  \
 809  if (yydebug)								  \
 810    {									  \
 811      YYFPRINTF (stderr, "%s ", Title);					  \
 812      yy_symbol_print (stderr,						  \
 813		  Type, Value); \
 814      YYFPRINTF (stderr, "\n");						  \
 815    }									  \
 816} while (YYID (0))
 817
 818
 819/*--------------------------------.
 820| Print this symbol on YYOUTPUT.  |
 821`--------------------------------*/
 822
 823/*ARGSUSED*/
 824#if (defined __STDC__ || defined __C99__FUNC__ \
 825     || defined __cplusplus || defined _MSC_VER)
 826static void
 827yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 828#else
 829static void
 830yy_symbol_value_print (yyoutput, yytype, yyvaluep)
 831    FILE *yyoutput;
 832    int yytype;
 833    YYSTYPE const * const yyvaluep;
 834#endif
 835{
 836  FILE *yyo = yyoutput;
 837  YYUSE (yyo);
 838  if (!yyvaluep)
 839    return;
 840# ifdef YYPRINT
 841  if (yytype < YYNTOKENS)
 842    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
 843# else
 844  YYUSE (yyoutput);
 845# endif
 846  YYUSE (yytype);
 
 
 
 
 847}
 848
 849
 850/*--------------------------------.
 851| Print this symbol on YYOUTPUT.  |
 852`--------------------------------*/
 853
 854#if (defined __STDC__ || defined __C99__FUNC__ \
 855     || defined __cplusplus || defined _MSC_VER)
 856static void
 857yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 858#else
 859static void
 860yy_symbol_print (yyoutput, yytype, yyvaluep)
 861    FILE *yyoutput;
 862    int yytype;
 863    YYSTYPE const * const yyvaluep;
 864#endif
 865{
 866  if (yytype < YYNTOKENS)
 867    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
 868  else
 869    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 870
 871  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
 872  YYFPRINTF (yyoutput, ")");
 873}
 874
 875/*------------------------------------------------------------------.
 876| yy_stack_print -- Print the state stack from its BOTTOM up to its |
 877| TOP (included).                                                   |
 878`------------------------------------------------------------------*/
 879
 880#if (defined __STDC__ || defined __C99__FUNC__ \
 881     || defined __cplusplus || defined _MSC_VER)
 882static void
 883yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 884#else
 885static void
 886yy_stack_print (yybottom, yytop)
 887    yytype_int16 *yybottom;
 888    yytype_int16 *yytop;
 889#endif
 890{
 891  YYFPRINTF (stderr, "Stack now");
 892  for (; yybottom <= yytop; yybottom++)
 893    {
 894      int yybot = *yybottom;
 895      YYFPRINTF (stderr, " %d", yybot);
 896    }
 897  YYFPRINTF (stderr, "\n");
 898}
 899
 900# define YY_STACK_PRINT(Bottom, Top)				\
 901do {								\
 902  if (yydebug)							\
 903    yy_stack_print ((Bottom), (Top));				\
 904} while (YYID (0))
 905
 906
 907/*------------------------------------------------.
 908| Report that the YYRULE is going to be reduced.  |
 909`------------------------------------------------*/
 910
 911#if (defined __STDC__ || defined __C99__FUNC__ \
 912     || defined __cplusplus || defined _MSC_VER)
 913static void
 914yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 915#else
 916static void
 917yy_reduce_print (yyvsp, yyrule)
 918    YYSTYPE *yyvsp;
 919    int yyrule;
 920#endif
 921{
 922  int yynrhs = yyr2[yyrule];
 923  int yyi;
 924  unsigned long int yylno = yyrline[yyrule];
 925  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
 926	     yyrule - 1, yylno);
 927  /* The symbols being reduced.  */
 928  for (yyi = 0; yyi < yynrhs; yyi++)
 929    {
 930      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 931      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
 932		       &(yyvsp[(yyi + 1) - (yynrhs)])
 933		       		       );
 934      YYFPRINTF (stderr, "\n");
 935    }
 936}
 937
 938# define YY_REDUCE_PRINT(Rule)		\
 939do {					\
 940  if (yydebug)				\
 941    yy_reduce_print (yyvsp, Rule); \
 942} while (YYID (0))
 943
 944/* Nonzero means print parse trace.  It is left uninitialized so that
 945   multiple parsers can coexist.  */
 946int yydebug;
 947#else /* !YYDEBUG */
 948# define YYDPRINTF(Args)
 949# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 950# define YY_STACK_PRINT(Bottom, Top)
 951# define YY_REDUCE_PRINT(Rule)
 952#endif /* !YYDEBUG */
 953
 954
 955/* YYINITDEPTH -- initial size of the parser's stacks.  */
 956#ifndef	YYINITDEPTH
 957# define YYINITDEPTH 200
 958#endif
 959
 960/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
 961   if the built-in stack extension method is used).
 962
 963   Do not make this value too large; the results are undefined if
 964   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
 965   evaluated with infinite-precision integer arithmetic.  */
 966
 967#ifndef YYMAXDEPTH
 968# define YYMAXDEPTH 10000
 969#endif
 970
 
 971
 972#if YYERROR_VERBOSE
 973
 974# ifndef yystrlen
 975#  if defined __GLIBC__ && defined _STRING_H
 976#   define yystrlen strlen
 977#  else
 978/* Return the length of YYSTR.  */
 979#if (defined __STDC__ || defined __C99__FUNC__ \
 980     || defined __cplusplus || defined _MSC_VER)
 981static YYSIZE_T
 982yystrlen (const char *yystr)
 983#else
 984static YYSIZE_T
 985yystrlen (yystr)
 986    const char *yystr;
 987#endif
 988{
 989  YYSIZE_T yylen;
 990  for (yylen = 0; yystr[yylen]; yylen++)
 991    continue;
 992  return yylen;
 993}
 994#  endif
 995# endif
 996
 997# ifndef yystpcpy
 998#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 999#   define yystpcpy stpcpy
1000#  else
1001/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1002   YYDEST.  */
1003#if (defined __STDC__ || defined __C99__FUNC__ \
1004     || defined __cplusplus || defined _MSC_VER)
1005static char *
1006yystpcpy (char *yydest, const char *yysrc)
1007#else
1008static char *
1009yystpcpy (yydest, yysrc)
1010    char *yydest;
1011    const char *yysrc;
1012#endif
1013{
1014  char *yyd = yydest;
1015  const char *yys = yysrc;
1016
1017  while ((*yyd++ = *yys++) != '\0')
1018    continue;
1019
1020  return yyd - 1;
1021}
1022#  endif
1023# endif
1024
1025# ifndef yytnamerr
1026/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1027   quotes and backslashes, so that it's suitable for yyerror.  The
1028   heuristic is that double-quoting is unnecessary unless the string
1029   contains an apostrophe, a comma, or backslash (other than
1030   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1031   null, do not copy; instead, return the length of what the result
1032   would have been.  */
1033static YYSIZE_T
1034yytnamerr (char *yyres, const char *yystr)
1035{
1036  if (*yystr == '"')
1037    {
1038      YYSIZE_T yyn = 0;
1039      char const *yyp = yystr;
1040
1041      for (;;)
1042	switch (*++yyp)
1043	  {
1044	  case '\'':
1045	  case ',':
1046	    goto do_not_strip_quotes;
1047
1048	  case '\\':
1049	    if (*++yyp != '\\')
1050	      goto do_not_strip_quotes;
1051	    /* Fall through.  */
1052	  default:
1053	    if (yyres)
1054	      yyres[yyn] = *yyp;
1055	    yyn++;
1056	    break;
1057
1058	  case '"':
1059	    if (yyres)
1060	      yyres[yyn] = '\0';
1061	    return yyn;
1062	  }
1063    do_not_strip_quotes: ;
1064    }
1065
1066  if (! yyres)
1067    return yystrlen (yystr);
1068
1069  return yystpcpy (yyres, yystr) - yyres;
1070}
1071# endif
1072
1073/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1074   about the unexpected token YYTOKEN for the state stack whose top is
1075   YYSSP.
1076
1077   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1078   not large enough to hold the message.  In that case, also set
1079   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1080   required number of bytes is too large to store.  */
1081static int
1082yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1083                yytype_int16 *yyssp, int yytoken)
1084{
1085  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1086  YYSIZE_T yysize = yysize0;
1087  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1088  /* Internationalized format string. */
1089  const char *yyformat = YY_NULL;
1090  /* Arguments of yyformat. */
1091  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1092  /* Number of reported tokens (one for the "unexpected", one per
1093     "expected"). */
1094  int yycount = 0;
1095
1096  /* There are many possibilities here to consider:
1097     - Assume YYFAIL is not used.  It's too flawed to consider.  See
1098       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1099       for details.  YYERROR is fine as it does not invoke this
1100       function.
1101     - If this state is a consistent state with a default action, then
1102       the only way this function was invoked is if the default action
1103       is an error action.  In that case, don't check for expected
1104       tokens because there are none.
1105     - The only way there can be no lookahead present (in yychar) is if
1106       this state is a consistent state with a default action.  Thus,
1107       detecting the absence of a lookahead is sufficient to determine
1108       that there is no unexpected or expected token to report.  In that
1109       case, just report a simple "syntax error".
1110     - Don't assume there isn't a lookahead just because this state is a
1111       consistent state with a default action.  There might have been a
1112       previous inconsistent state, consistent state with a non-default
1113       action, or user semantic action that manipulated yychar.
1114     - Of course, the expected token list depends on states to have
1115       correct lookahead information, and it depends on the parser not
1116       to perform extra reductions after fetching a lookahead from the
1117       scanner and before detecting a syntax error.  Thus, state merging
1118       (from LALR or IELR) and default reductions corrupt the expected
1119       token list.  However, the list is correct for canonical LR with
1120       one exception: it will still contain any token that will not be
1121       accepted due to an error action in a later state.
1122  */
1123  if (yytoken != YYEMPTY)
1124    {
1125      int yyn = yypact[*yyssp];
1126      yyarg[yycount++] = yytname[yytoken];
1127      if (!yypact_value_is_default (yyn))
1128        {
1129          /* Start YYX at -YYN if negative to avoid negative indexes in
1130             YYCHECK.  In other words, skip the first -YYN actions for
1131             this state because they are default actions.  */
1132          int yyxbegin = yyn < 0 ? -yyn : 0;
1133          /* Stay within bounds of both yycheck and yytname.  */
1134          int yychecklim = YYLAST - yyn + 1;
1135          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1136          int yyx;
1137
1138          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1139            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1140                && !yytable_value_is_error (yytable[yyx + yyn]))
1141              {
1142                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1143                  {
1144                    yycount = 1;
1145                    yysize = yysize0;
1146                    break;
1147                  }
1148                yyarg[yycount++] = yytname[yyx];
1149                {
1150                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1151                  if (! (yysize <= yysize1
1152                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1153                    return 2;
1154                  yysize = yysize1;
1155                }
1156              }
1157        }
1158    }
1159
1160  switch (yycount)
 
 
1161    {
1162# define YYCASE_(N, S)                      \
1163      case N:                               \
1164        yyformat = S;                       \
1165      break
1166      YYCASE_(0, YY_("syntax error"));
1167      YYCASE_(1, YY_("syntax error, unexpected %s"));
1168      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1169      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1170      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1171      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1172# undef YYCASE_
1173    }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1174
1175  {
1176    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1177    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1178      return 2;
1179    yysize = yysize1;
1180  }
1181
1182  if (*yymsg_alloc < yysize)
1183    {
1184      *yymsg_alloc = 2 * yysize;
1185      if (! (yysize <= *yymsg_alloc
1186             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1187        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1188      return 1;
 
 
 
 
 
 
 
 
1189    }
1190
1191  /* Avoid sprintf, as that infringes on the user's name space.
1192     Don't have undefined behavior even if the translation
1193     produced a string with the wrong number of "%s"s.  */
1194  {
1195    char *yyp = *yymsg;
1196    int yyi = 0;
1197    while ((*yyp = *yyformat) != '\0')
1198      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1199        {
1200          yyp += yytnamerr (yyp, yyarg[yyi++]);
1201          yyformat += 2;
1202        }
1203      else
1204        {
1205          yyp++;
1206          yyformat++;
1207        }
1208  }
1209  return 0;
1210}
1211#endif /* YYERROR_VERBOSE */
 
1212
1213/*-----------------------------------------------.
1214| Release the memory associated to this symbol.  |
1215`-----------------------------------------------*/
1216
1217/*ARGSUSED*/
1218#if (defined __STDC__ || defined __C99__FUNC__ \
1219     || defined __cplusplus || defined _MSC_VER)
1220static void
1221yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1222#else
1223static void
1224yydestruct (yymsg, yytype, yyvaluep)
1225    const char *yymsg;
1226    int yytype;
1227    YYSTYPE *yyvaluep;
1228#endif
1229{
1230  YYUSE (yyvaluep);
1231
1232  if (!yymsg)
1233    yymsg = "Deleting";
1234  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1235
1236  YYUSE (yytype);
 
 
 
 
 
1237}
1238
1239
 
 
 
 
 
 
 
 
 
 
 
 
 
1240
1241
1242/* The lookahead symbol.  */
1243int yychar;
1244
1245
1246#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1247# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1248# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1249#endif
1250#ifndef YY_INITIAL_VALUE
1251# define YY_INITIAL_VALUE(Value) /* Nothing. */
1252#endif
1253
1254/* The semantic value of the lookahead symbol.  */
1255YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1256
1257/* Number of syntax errors so far.  */
1258int yynerrs;
1259
1260
1261/*----------.
1262| yyparse.  |
1263`----------*/
 
1264
1265#ifdef YYPARSE_PARAM
1266#if (defined __STDC__ || defined __C99__FUNC__ \
1267     || defined __cplusplus || defined _MSC_VER)
1268int
1269yyparse (void *YYPARSE_PARAM)
1270#else
1271int
1272yyparse (YYPARSE_PARAM)
1273    void *YYPARSE_PARAM;
1274#endif
1275#else /* ! YYPARSE_PARAM */
1276#if (defined __STDC__ || defined __C99__FUNC__ \
1277     || defined __cplusplus || defined _MSC_VER)
1278int
1279yyparse (void)
1280#else
1281int
1282yyparse ()
1283
1284#endif
1285#endif
1286{
 
 
1287    int yystate;
1288    /* Number of tokens to shift before error messages enabled.  */
1289    int yyerrstatus;
1290
1291    /* The stacks and their tools:
1292       `yyss': related to states.
1293       `yyvs': related to semantic values.
1294
1295       Refer to the stacks through separate pointers, to allow yyoverflow
1296       to reallocate them elsewhere.  */
1297
1298    /* The state stack.  */
1299    yytype_int16 yyssa[YYINITDEPTH];
1300    yytype_int16 *yyss;
1301    yytype_int16 *yyssp;
1302
1303    /* The semantic value stack.  */
1304    YYSTYPE yyvsa[YYINITDEPTH];
1305    YYSTYPE *yyvs;
1306    YYSTYPE *yyvsp;
1307
1308    YYSIZE_T yystacksize;
1309
1310  int yyn;
1311  int yyresult;
1312  /* Lookahead token as an internal (translated) token number.  */
1313  int yytoken = 0;
1314  /* The variables used to return semantic value and location from the
1315     action routines.  */
1316  YYSTYPE yyval;
1317
1318#if YYERROR_VERBOSE
1319  /* Buffer for error messages, and its allocated size.  */
1320  char yymsgbuf[128];
1321  char *yymsg = yymsgbuf;
1322  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1323#endif
1324
1325#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1326
1327  /* The number of symbols on the RHS of the reduced rule.
1328     Keep to zero when no symbol should be popped.  */
1329  int yylen = 0;
1330
1331  yyssp = yyss = yyssa;
1332  yyvsp = yyvs = yyvsa;
 
1333  yystacksize = YYINITDEPTH;
1334
1335  YYDPRINTF ((stderr, "Starting parse\n"));
1336
1337  yystate = 0;
1338  yyerrstatus = 0;
1339  yynerrs = 0;
1340  yychar = YYEMPTY; /* Cause a token to be read.  */
 
 
 
 
 
 
 
 
1341  goto yysetstate;
1342
1343/*------------------------------------------------------------.
1344| yynewstate -- Push a new state, which is found in yystate.  |
1345`------------------------------------------------------------*/
1346 yynewstate:
1347  /* In all cases, when you get here, the value and location stacks
1348     have just been pushed.  So pushing a state here evens the stacks.  */
1349  yyssp++;
1350
1351 yysetstate:
1352  *yyssp = yystate;
1353
1354  if (yyss + yystacksize - 1 <= yyssp)
1355    {
1356      /* Get the current used size of the three stacks, in elements.  */
1357      YYSIZE_T yysize = yyssp - yyss + 1;
1358
1359#ifdef yyoverflow
1360      {
1361	/* Give user a chance to reallocate the stack.  Use copies of
1362	   these so that the &'s don't force the real ones into
1363	   memory.  */
1364	YYSTYPE *yyvs1 = yyvs;
1365	yytype_int16 *yyss1 = yyss;
1366
1367	/* Each stack pointer address is followed by the size of the
1368	   data in use in that stack, in bytes.  This used to be a
1369	   conditional around just the two extra args, but that might
1370	   be undefined if yyoverflow is a macro.  */
1371	yyoverflow (YY_("memory exhausted"),
1372		    &yyss1, yysize * sizeof (*yyssp),
1373		    &yyvs1, yysize * sizeof (*yyvsp),
1374		    &yystacksize);
1375
1376	yyss = yyss1;
1377	yyvs = yyvs1;
1378      }
1379#else /* no yyoverflow */
1380# ifndef YYSTACK_RELOCATE
1381      goto yyexhaustedlab;
1382# else
1383      /* Extend the stack our own way.  */
1384      if (YYMAXDEPTH <= yystacksize)
1385	goto yyexhaustedlab;
1386      yystacksize *= 2;
1387      if (YYMAXDEPTH < yystacksize)
1388	yystacksize = YYMAXDEPTH;
1389
1390      {
1391	yytype_int16 *yyss1 = yyss;
1392	union yyalloc *yyptr =
1393	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1394	if (! yyptr)
1395	  goto yyexhaustedlab;
1396	YYSTACK_RELOCATE (yyss_alloc, yyss);
1397	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1398#  undef YYSTACK_RELOCATE
1399	if (yyss1 != yyssa)
1400	  YYSTACK_FREE (yyss1);
1401      }
1402# endif
1403#endif /* no yyoverflow */
1404
1405      yyssp = yyss + yysize - 1;
1406      yyvsp = yyvs + yysize - 1;
1407
1408      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1409		  (unsigned long int) yystacksize));
1410
1411      if (yyss + yystacksize - 1 <= yyssp)
1412	YYABORT;
1413    }
1414
1415  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1416
1417  if (yystate == YYFINAL)
1418    YYACCEPT;
1419
1420  goto yybackup;
1421
1422/*-----------.
1423| yybackup.  |
1424`-----------*/
1425yybackup:
1426
1427  /* Do appropriate processing given the current state.  Read a
1428     lookahead token if we need one and don't already have one.  */
1429
1430  /* First try to decide what to do without reference to lookahead token.  */
1431  yyn = yypact[yystate];
1432  if (yypact_value_is_default (yyn))
1433    goto yydefault;
1434
1435  /* Not known => get a lookahead token if don't already have one.  */
1436
1437  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1438  if (yychar == YYEMPTY)
1439    {
1440      YYDPRINTF ((stderr, "Reading a token: "));
1441      yychar = YYLEX;
1442    }
1443
1444  if (yychar <= YYEOF)
1445    {
1446      yychar = yytoken = YYEOF;
1447      YYDPRINTF ((stderr, "Now at end of input.\n"));
1448    }
1449  else
1450    {
1451      yytoken = YYTRANSLATE (yychar);
1452      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1453    }
1454
1455  /* If the proper action on seeing token YYTOKEN is to reduce or to
1456     detect an error, take that action.  */
1457  yyn += yytoken;
1458  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1459    goto yydefault;
1460  yyn = yytable[yyn];
1461  if (yyn <= 0)
1462    {
1463      if (yytable_value_is_error (yyn))
1464        goto yyerrlab;
1465      yyn = -yyn;
1466      goto yyreduce;
1467    }
1468
1469  /* Count tokens shifted since error; after three, turn off error
1470     status.  */
1471  if (yyerrstatus)
1472    yyerrstatus--;
1473
1474  /* Shift the lookahead token.  */
1475  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1476
1477  /* Discard the shifted token.  */
1478  yychar = YYEMPTY;
1479
1480  yystate = yyn;
1481  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1482  *++yyvsp = yylval;
1483  YY_IGNORE_MAYBE_UNINITIALIZED_END
1484
1485  goto yynewstate;
1486
1487
1488/*-----------------------------------------------------------.
1489| yydefault -- do the default action for the current state.  |
1490`-----------------------------------------------------------*/
1491yydefault:
1492  yyn = yydefact[yystate];
1493  if (yyn == 0)
1494    goto yyerrlab;
1495  goto yyreduce;
1496
1497
1498/*-----------------------------.
1499| yyreduce -- Do a reduction.  |
1500`-----------------------------*/
1501yyreduce:
1502  /* yyn is the number of a rule to reduce with.  */
1503  yylen = yyr2[yyn];
1504
1505  /* If YYLEN is nonzero, implement the default value of the action:
1506     `$$ = $1'.
1507
1508     Otherwise, the following line sets YYVAL to garbage.
1509     This behavior is undocumented and Bison
1510     users should not rely upon it.  Assigning to YYVAL
1511     unconditionally makes the parser a bit smaller, and it avoids a
1512     GCC warning that YYVAL may be used uninitialized.  */
1513  yyval = yyvsp[1-yylen];
1514
1515
1516  YY_REDUCE_PRINT (yyn);
1517  switch (yyn)
1518    {
1519        case 2:
1520/* Line 1787 of yacc.c  */
1521#line 110 "dtc-parser.y"
1522    {
1523			the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
1524							guess_boot_cpuid((yyvsp[(4) - (4)].node)));
1525		}
1526    break;
1527
1528  case 3:
1529/* Line 1787 of yacc.c  */
1530#line 118 "dtc-parser.y"
1531    {
1532			(yyval.re) = NULL;
1533		}
1534    break;
1535
1536  case 4:
1537/* Line 1787 of yacc.c  */
1538#line 122 "dtc-parser.y"
1539    {
1540			(yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1541		}
1542    break;
1543
1544  case 5:
1545/* Line 1787 of yacc.c  */
1546#line 129 "dtc-parser.y"
1547    {
1548			(yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].integer), (yyvsp[(3) - (4)].integer));
1549		}
1550    break;
1551
1552  case 6:
1553/* Line 1787 of yacc.c  */
1554#line 133 "dtc-parser.y"
1555    {
1556			add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
1557			(yyval.re) = (yyvsp[(2) - (2)].re);
1558		}
1559    break;
1560
1561  case 7:
1562/* Line 1787 of yacc.c  */
1563#line 141 "dtc-parser.y"
 
 
 
 
 
 
1564    {
1565			(yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
1566		}
1567    break;
1568
1569  case 8:
1570/* Line 1787 of yacc.c  */
1571#line 145 "dtc-parser.y"
1572    {
1573			(yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1574		}
1575    break;
1576
1577  case 9:
1578/* Line 1787 of yacc.c  */
1579#line 149 "dtc-parser.y"
1580    {
1581			struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
1582
1583			if (target)
1584				merge_nodes(target, (yyvsp[(3) - (3)].node));
1585			else
1586				print_error("label or path, '%s', not found", (yyvsp[(2) - (3)].labelref));
1587			(yyval.node) = (yyvsp[(1) - (3)].node);
1588		}
1589    break;
1590
1591  case 10:
1592/* Line 1787 of yacc.c  */
1593#line 159 "dtc-parser.y"
1594    {
1595			struct node *target = get_node_by_ref((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].labelref));
1596
1597			if (!target)
1598				print_error("label or path, '%s', not found", (yyvsp[(3) - (4)].labelref));
1599			else
1600				delete_node(target);
1601
1602			(yyval.node) = (yyvsp[(1) - (4)].node);
1603		}
1604    break;
1605
1606  case 11:
1607/* Line 1787 of yacc.c  */
1608#line 173 "dtc-parser.y"
1609    {
1610			(yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1611		}
1612    break;
1613
1614  case 12:
1615/* Line 1787 of yacc.c  */
1616#line 180 "dtc-parser.y"
1617    {
1618			(yyval.proplist) = NULL;
1619		}
1620    break;
1621
1622  case 13:
1623/* Line 1787 of yacc.c  */
1624#line 184 "dtc-parser.y"
1625    {
1626			(yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1627		}
1628    break;
1629
1630  case 14:
1631/* Line 1787 of yacc.c  */
1632#line 191 "dtc-parser.y"
1633    {
1634			(yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
1635		}
1636    break;
1637
1638  case 15:
1639/* Line 1787 of yacc.c  */
1640#line 195 "dtc-parser.y"
1641    {
1642			(yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
1643		}
1644    break;
1645
1646  case 16:
1647/* Line 1787 of yacc.c  */
1648#line 199 "dtc-parser.y"
1649    {
1650			(yyval.prop) = build_property_delete((yyvsp[(2) - (3)].propnodename));
1651		}
 
1652    break;
1653
1654  case 17:
1655/* Line 1787 of yacc.c  */
1656#line 203 "dtc-parser.y"
1657    {
1658			add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
1659			(yyval.prop) = (yyvsp[(2) - (2)].prop);
1660		}
1661    break;
1662
1663  case 18:
1664/* Line 1787 of yacc.c  */
1665#line 211 "dtc-parser.y"
1666    {
1667			(yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1668		}
1669    break;
1670
1671  case 19:
1672/* Line 1787 of yacc.c  */
1673#line 215 "dtc-parser.y"
1674    {
1675			(yyval.data) = data_merge((yyvsp[(1) - (3)].data), (yyvsp[(2) - (3)].array).data);
1676		}
1677    break;
1678
1679  case 20:
1680/* Line 1787 of yacc.c  */
1681#line 219 "dtc-parser.y"
1682    {
1683			(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1684		}
1685    break;
1686
1687  case 21:
1688/* Line 1787 of yacc.c  */
1689#line 223 "dtc-parser.y"
1690    {
1691			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1692		}
1693    break;
1694
1695  case 22:
1696/* Line 1787 of yacc.c  */
1697#line 227 "dtc-parser.y"
1698    {
1699			FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
1700			struct data d;
1701
1702			if ((yyvsp[(6) - (9)].integer) != 0)
1703				if (fseek(f, (yyvsp[(6) - (9)].integer), SEEK_SET) != 0)
1704					print_error("Couldn't seek to offset %llu in \"%s\": %s",
1705						     (unsigned long long)(yyvsp[(6) - (9)].integer),
1706						     (yyvsp[(4) - (9)].data).val,
1707						     strerror(errno));
1708
1709			d = data_copy_file(f, (yyvsp[(8) - (9)].integer));
1710
1711			(yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
1712			fclose(f);
1713		}
1714    break;
1715
1716  case 23:
1717/* Line 1787 of yacc.c  */
1718#line 244 "dtc-parser.y"
1719    {
1720			FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
1721			struct data d = empty_data;
1722
1723			d = data_copy_file(f, -1);
1724
1725			(yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
1726			fclose(f);
1727		}
1728    break;
1729
1730  case 24:
1731/* Line 1787 of yacc.c  */
1732#line 254 "dtc-parser.y"
1733    {
1734			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1735		}
1736    break;
1737
1738  case 25:
1739/* Line 1787 of yacc.c  */
1740#line 261 "dtc-parser.y"
1741    {
1742			(yyval.data) = empty_data;
1743		}
1744    break;
1745
1746  case 26:
1747/* Line 1787 of yacc.c  */
1748#line 265 "dtc-parser.y"
1749    {
1750			(yyval.data) = (yyvsp[(1) - (2)].data);
1751		}
1752    break;
1753
1754  case 27:
1755/* Line 1787 of yacc.c  */
1756#line 269 "dtc-parser.y"
1757    {
1758			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1759		}
1760    break;
1761
1762  case 28:
1763/* Line 1787 of yacc.c  */
1764#line 276 "dtc-parser.y"
1765    {
1766			(yyval.array).data = empty_data;
1767			(yyval.array).bits = eval_literal((yyvsp[(2) - (3)].literal), 0, 7);
1768
1769			if (((yyval.array).bits !=  8) &&
1770			    ((yyval.array).bits != 16) &&
1771			    ((yyval.array).bits != 32) &&
1772			    ((yyval.array).bits != 64))
1773			{
1774				print_error("Only 8, 16, 32 and 64-bit elements"
1775					    " are currently supported");
1776				(yyval.array).bits = 32;
1777			}
1778		}
1779    break;
1780
1781  case 29:
1782/* Line 1787 of yacc.c  */
1783#line 291 "dtc-parser.y"
1784    {
1785			(yyval.array).data = empty_data;
1786			(yyval.array).bits = 32;
1787		}
1788    break;
1789
1790  case 30:
1791/* Line 1787 of yacc.c  */
1792#line 296 "dtc-parser.y"
1793    {
1794			if ((yyvsp[(1) - (2)].array).bits < 64) {
1795				uint64_t mask = (1ULL << (yyvsp[(1) - (2)].array).bits) - 1;
1796				/*
1797				 * Bits above mask must either be all zero
1798				 * (positive within range of mask) or all one
1799				 * (negative and sign-extended). The second
1800				 * condition is true if when we set all bits
1801				 * within the mask to one (i.e. | in the
1802				 * mask), all bits are one.
1803				 */
1804				if (((yyvsp[(2) - (2)].integer) > mask) && (((yyvsp[(2) - (2)].integer) | mask) != -1ULL))
1805					print_error(
1806						"integer value out of range "
1807						"%016lx (%d bits)", (yyvsp[(1) - (2)].array).bits);
1808			}
1809
1810			(yyval.array).data = data_append_integer((yyvsp[(1) - (2)].array).data, (yyvsp[(2) - (2)].integer), (yyvsp[(1) - (2)].array).bits);
1811		}
1812    break;
1813
1814  case 31:
1815/* Line 1787 of yacc.c  */
1816#line 316 "dtc-parser.y"
1817    {
1818			uint64_t val = ~0ULL >> (64 - (yyvsp[(1) - (2)].array).bits);
1819
1820			if ((yyvsp[(1) - (2)].array).bits == 32)
1821				(yyvsp[(1) - (2)].array).data = data_add_marker((yyvsp[(1) - (2)].array).data,
1822							  REF_PHANDLE,
1823							  (yyvsp[(2) - (2)].labelref));
1824			else
1825				print_error("References are only allowed in "
1826					    "arrays with 32-bit elements.");
1827
1828			(yyval.array).data = data_append_integer((yyvsp[(1) - (2)].array).data, val, (yyvsp[(1) - (2)].array).bits);
1829		}
1830    break;
1831
1832  case 32:
1833/* Line 1787 of yacc.c  */
1834#line 330 "dtc-parser.y"
1835    {
1836			(yyval.array).data = data_add_marker((yyvsp[(1) - (2)].array).data, LABEL, (yyvsp[(2) - (2)].labelref));
1837		}
1838    break;
1839
1840  case 33:
1841/* Line 1787 of yacc.c  */
1842#line 337 "dtc-parser.y"
1843    {
1844			(yyval.integer) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1845		}
 
1846    break;
1847
1848  case 34:
1849/* Line 1787 of yacc.c  */
1850#line 341 "dtc-parser.y"
1851    {
1852			(yyval.integer) = eval_char_literal((yyvsp[(1) - (1)].literal));
1853		}
1854    break;
1855
1856  case 35:
1857/* Line 1787 of yacc.c  */
1858#line 345 "dtc-parser.y"
1859    {
1860			(yyval.integer) = (yyvsp[(2) - (3)].integer);
1861		}
1862    break;
1863
1864  case 38:
1865/* Line 1787 of yacc.c  */
1866#line 356 "dtc-parser.y"
1867    { (yyval.integer) = (yyvsp[(1) - (5)].integer) ? (yyvsp[(3) - (5)].integer) : (yyvsp[(5) - (5)].integer); }
1868    break;
1869
1870  case 40:
1871/* Line 1787 of yacc.c  */
1872#line 361 "dtc-parser.y"
1873    { (yyval.integer) = (yyvsp[(1) - (3)].integer) || (yyvsp[(3) - (3)].integer); }
1874    break;
1875
1876  case 42:
1877/* Line 1787 of yacc.c  */
1878#line 366 "dtc-parser.y"
1879    { (yyval.integer) = (yyvsp[(1) - (3)].integer) && (yyvsp[(3) - (3)].integer); }
1880    break;
1881
1882  case 44:
1883/* Line 1787 of yacc.c  */
1884#line 371 "dtc-parser.y"
1885    { (yyval.integer) = (yyvsp[(1) - (3)].integer) | (yyvsp[(3) - (3)].integer); }
1886    break;
1887
1888  case 46:
1889/* Line 1787 of yacc.c  */
1890#line 376 "dtc-parser.y"
1891    { (yyval.integer) = (yyvsp[(1) - (3)].integer) ^ (yyvsp[(3) - (3)].integer); }
1892    break;
1893
1894  case 48:
1895/* Line 1787 of yacc.c  */
1896#line 381 "dtc-parser.y"
1897    { (yyval.integer) = (yyvsp[(1) - (3)].integer) & (yyvsp[(3) - (3)].integer); }
1898    break;
1899
1900  case 50:
1901/* Line 1787 of yacc.c  */
1902#line 386 "dtc-parser.y"
1903    { (yyval.integer) = (yyvsp[(1) - (3)].integer) == (yyvsp[(3) - (3)].integer); }
1904    break;
1905
1906  case 51:
1907/* Line 1787 of yacc.c  */
1908#line 387 "dtc-parser.y"
1909    { (yyval.integer) = (yyvsp[(1) - (3)].integer) != (yyvsp[(3) - (3)].integer); }
1910    break;
1911
1912  case 53:
1913/* Line 1787 of yacc.c  */
1914#line 392 "dtc-parser.y"
1915    { (yyval.integer) = (yyvsp[(1) - (3)].integer) < (yyvsp[(3) - (3)].integer); }
1916    break;
1917
1918  case 54:
1919/* Line 1787 of yacc.c  */
1920#line 393 "dtc-parser.y"
1921    { (yyval.integer) = (yyvsp[(1) - (3)].integer) > (yyvsp[(3) - (3)].integer); }
1922    break;
1923
1924  case 55:
1925/* Line 1787 of yacc.c  */
1926#line 394 "dtc-parser.y"
1927    { (yyval.integer) = (yyvsp[(1) - (3)].integer) <= (yyvsp[(3) - (3)].integer); }
1928    break;
1929
1930  case 56:
1931/* Line 1787 of yacc.c  */
1932#line 395 "dtc-parser.y"
1933    { (yyval.integer) = (yyvsp[(1) - (3)].integer) >= (yyvsp[(3) - (3)].integer); }
1934    break;
1935
1936  case 57:
1937/* Line 1787 of yacc.c  */
1938#line 399 "dtc-parser.y"
1939    { (yyval.integer) = (yyvsp[(1) - (3)].integer) << (yyvsp[(3) - (3)].integer); }
1940    break;
1941
1942  case 58:
1943/* Line 1787 of yacc.c  */
1944#line 400 "dtc-parser.y"
1945    { (yyval.integer) = (yyvsp[(1) - (3)].integer) >> (yyvsp[(3) - (3)].integer); }
1946    break;
1947
1948  case 60:
1949/* Line 1787 of yacc.c  */
1950#line 405 "dtc-parser.y"
1951    { (yyval.integer) = (yyvsp[(1) - (3)].integer) + (yyvsp[(3) - (3)].integer); }
1952    break;
1953
1954  case 61:
1955/* Line 1787 of yacc.c  */
1956#line 406 "dtc-parser.y"
1957    { (yyval.integer) = (yyvsp[(1) - (3)].integer) - (yyvsp[(3) - (3)].integer); }
1958    break;
1959
1960  case 63:
1961/* Line 1787 of yacc.c  */
1962#line 411 "dtc-parser.y"
1963    { (yyval.integer) = (yyvsp[(1) - (3)].integer) * (yyvsp[(3) - (3)].integer); }
1964    break;
1965
1966  case 64:
1967/* Line 1787 of yacc.c  */
1968#line 412 "dtc-parser.y"
1969    { (yyval.integer) = (yyvsp[(1) - (3)].integer) / (yyvsp[(3) - (3)].integer); }
1970    break;
1971
1972  case 65:
1973/* Line 1787 of yacc.c  */
1974#line 413 "dtc-parser.y"
1975    { (yyval.integer) = (yyvsp[(1) - (3)].integer) % (yyvsp[(3) - (3)].integer); }
1976    break;
1977
1978  case 68:
1979/* Line 1787 of yacc.c  */
1980#line 419 "dtc-parser.y"
1981    { (yyval.integer) = -(yyvsp[(2) - (2)].integer); }
1982    break;
1983
1984  case 69:
1985/* Line 1787 of yacc.c  */
1986#line 420 "dtc-parser.y"
1987    { (yyval.integer) = ~(yyvsp[(2) - (2)].integer); }
1988    break;
1989
1990  case 70:
1991/* Line 1787 of yacc.c  */
1992#line 421 "dtc-parser.y"
1993    { (yyval.integer) = !(yyvsp[(2) - (2)].integer); }
1994    break;
1995
1996  case 71:
1997/* Line 1787 of yacc.c  */
1998#line 426 "dtc-parser.y"
1999    {
2000			(yyval.data) = empty_data;
2001		}
2002    break;
2003
2004  case 72:
2005/* Line 1787 of yacc.c  */
2006#line 430 "dtc-parser.y"
2007    {
2008			(yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
2009		}
2010    break;
2011
2012  case 73:
2013/* Line 1787 of yacc.c  */
2014#line 434 "dtc-parser.y"
2015    {
2016			(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
2017		}
2018    break;
2019
2020  case 74:
2021/* Line 1787 of yacc.c  */
2022#line 441 "dtc-parser.y"
2023    {
2024			(yyval.nodelist) = NULL;
2025		}
2026    break;
2027
2028  case 75:
2029/* Line 1787 of yacc.c  */
2030#line 445 "dtc-parser.y"
2031    {
2032			(yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
2033		}
2034    break;
2035
2036  case 76:
2037/* Line 1787 of yacc.c  */
2038#line 449 "dtc-parser.y"
2039    {
2040			print_error("syntax error: properties must precede subnodes");
2041			YYERROR;
2042		}
2043    break;
2044
2045  case 77:
2046/* Line 1787 of yacc.c  */
2047#line 457 "dtc-parser.y"
2048    {
2049			(yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
2050		}
2051    break;
2052
2053  case 78:
2054/* Line 1787 of yacc.c  */
2055#line 461 "dtc-parser.y"
2056    {
2057			(yyval.node) = name_node(build_node_delete(), (yyvsp[(2) - (3)].propnodename));
2058		}
2059    break;
2060
2061  case 79:
2062/* Line 1787 of yacc.c  */
2063#line 465 "dtc-parser.y"
2064    {
2065			add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
2066			(yyval.node) = (yyvsp[(2) - (2)].node);
2067		}
2068    break;
2069
2070
2071/* Line 1787 of yacc.c  */
2072#line 2073 "dtc-parser.tab.c"
2073      default: break;
2074    }
2075  /* User semantic actions sometimes alter yychar, and that requires
2076     that yytoken be updated with the new translation.  We take the
2077     approach of translating immediately before every use of yytoken.
2078     One alternative is translating here after every semantic action,
2079     but that translation would be missed if the semantic action invokes
2080     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2081     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2082     incorrect destructor might then be invoked immediately.  In the
2083     case of YYERROR or YYBACKUP, subsequent parser actions might lead
2084     to an incorrect destructor call or verbose syntax error message
2085     before the lookahead is translated.  */
2086  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2087
2088  YYPOPSTACK (yylen);
2089  yylen = 0;
2090  YY_STACK_PRINT (yyss, yyssp);
2091
2092  *++yyvsp = yyval;
2093
2094  /* Now `shift' the result of the reduction.  Determine what state
2095     that goes to, based on the state we popped back to and the rule
2096     number reduced by.  */
2097
2098  yyn = yyr1[yyn];
2099
2100  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2101  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2102    yystate = yytable[yystate];
2103  else
2104    yystate = yydefgoto[yyn - YYNTOKENS];
2105
2106  goto yynewstate;
2107
2108
2109/*------------------------------------.
2110| yyerrlab -- here on detecting error |
2111`------------------------------------*/
2112yyerrlab:
2113  /* Make sure we have latest lookahead translation.  See comments at
2114     user semantic actions for why this is necessary.  */
2115  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2116
2117  /* If not already recovering from an error, report this error.  */
2118  if (!yyerrstatus)
2119    {
2120      ++yynerrs;
2121#if ! YYERROR_VERBOSE
2122      yyerror (YY_("syntax error"));
2123#else
2124# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2125                                        yyssp, yytoken)
2126      {
2127        char const *yymsgp = YY_("syntax error");
2128        int yysyntax_error_status;
2129        yysyntax_error_status = YYSYNTAX_ERROR;
2130        if (yysyntax_error_status == 0)
2131          yymsgp = yymsg;
2132        else if (yysyntax_error_status == 1)
2133          {
2134            if (yymsg != yymsgbuf)
2135              YYSTACK_FREE (yymsg);
2136            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2137            if (!yymsg)
2138              {
2139                yymsg = yymsgbuf;
2140                yymsg_alloc = sizeof yymsgbuf;
2141                yysyntax_error_status = 2;
2142              }
2143            else
2144              {
2145                yysyntax_error_status = YYSYNTAX_ERROR;
2146                yymsgp = yymsg;
2147              }
2148          }
2149        yyerror (yymsgp);
2150        if (yysyntax_error_status == 2)
2151          goto yyexhaustedlab;
 
 
 
 
2152      }
2153# undef YYSYNTAX_ERROR
2154#endif
2155    }
2156
2157
2158
2159  if (yyerrstatus == 3)
2160    {
2161      /* If just tried and failed to reuse lookahead token after an
2162	 error, discard it.  */
2163
2164      if (yychar <= YYEOF)
2165	{
2166	  /* Return failure if at end of input.  */
2167	  if (yychar == YYEOF)
2168	    YYABORT;
2169	}
2170      else
2171	{
2172	  yydestruct ("Error: discarding",
2173		      yytoken, &yylval);
2174	  yychar = YYEMPTY;
2175	}
2176    }
2177
2178  /* Else will try to reuse lookahead token after shifting the error
2179     token.  */
2180  goto yyerrlab1;
2181
2182
2183/*---------------------------------------------------.
2184| yyerrorlab -- error raised explicitly by YYERROR.  |
2185`---------------------------------------------------*/
2186yyerrorlab:
2187
2188  /* Pacify compilers like GCC when the user code never invokes
2189     YYERROR and the label yyerrorlab therefore never appears in user
2190     code.  */
2191  if (/*CONSTCOND*/ 0)
2192     goto yyerrorlab;
2193
2194  /* Do not reclaim the symbols of the rule which action triggered
2195     this YYERROR.  */
2196  YYPOPSTACK (yylen);
2197  yylen = 0;
2198  YY_STACK_PRINT (yyss, yyssp);
2199  yystate = *yyssp;
2200  goto yyerrlab1;
2201
2202
2203/*-------------------------------------------------------------.
2204| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2205`-------------------------------------------------------------*/
2206yyerrlab1:
2207  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
2208
2209  for (;;)
2210    {
2211      yyn = yypact[yystate];
2212      if (!yypact_value_is_default (yyn))
2213	{
2214	  yyn += YYTERROR;
2215	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2216	    {
2217	      yyn = yytable[yyn];
2218	      if (0 < yyn)
2219		break;
2220	    }
2221	}
2222
2223      /* Pop the current state because it cannot handle the error token.  */
2224      if (yyssp == yyss)
2225	YYABORT;
2226
2227
2228      yydestruct ("Error: popping",
2229		  yystos[yystate], yyvsp);
2230      YYPOPSTACK (1);
2231      yystate = *yyssp;
2232      YY_STACK_PRINT (yyss, yyssp);
2233    }
2234
2235  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2236  *++yyvsp = yylval;
2237  YY_IGNORE_MAYBE_UNINITIALIZED_END
2238
2239
2240  /* Shift the error token.  */
2241  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2242
2243  yystate = yyn;
2244  goto yynewstate;
2245
2246
2247/*-------------------------------------.
2248| yyacceptlab -- YYACCEPT comes here.  |
2249`-------------------------------------*/
2250yyacceptlab:
2251  yyresult = 0;
2252  goto yyreturn;
2253
2254/*-----------------------------------.
2255| yyabortlab -- YYABORT comes here.  |
2256`-----------------------------------*/
2257yyabortlab:
2258  yyresult = 1;
2259  goto yyreturn;
2260
2261#if !defined yyoverflow || YYERROR_VERBOSE
2262/*-------------------------------------------------.
2263| yyexhaustedlab -- memory exhaustion comes here.  |
2264`-------------------------------------------------*/
2265yyexhaustedlab:
2266  yyerror (YY_("memory exhausted"));
2267  yyresult = 2;
2268  /* Fall through.  */
2269#endif
2270
2271yyreturn:
2272  if (yychar != YYEMPTY)
2273    {
2274      /* Make sure we have latest lookahead translation.  See comments at
2275         user semantic actions for why this is necessary.  */
2276      yytoken = YYTRANSLATE (yychar);
2277      yydestruct ("Cleanup: discarding lookahead",
2278                  yytoken, &yylval);
2279    }
2280  /* Do not reclaim the symbols of the rule which action triggered
2281     this YYABORT or YYACCEPT.  */
2282  YYPOPSTACK (yylen);
2283  YY_STACK_PRINT (yyss, yyssp);
2284  while (yyssp != yyss)
2285    {
2286      yydestruct ("Cleanup: popping",
2287		  yystos[*yyssp], yyvsp);
2288      YYPOPSTACK (1);
2289    }
2290#ifndef yyoverflow
2291  if (yyss != yyssa)
2292    YYSTACK_FREE (yyss);
2293#endif
2294#if YYERROR_VERBOSE
2295  if (yymsg != yymsgbuf)
2296    YYSTACK_FREE (yymsg);
2297#endif
2298  /* Make sure YYID is used.  */
2299  return YYID (yyresult);
2300}
2301
2302
2303/* Line 2050 of yacc.c  */
2304#line 471 "dtc-parser.y"
2305
2306
2307void print_error(char const *fmt, ...)
2308{
2309	va_list va;
2310
2311	va_start(va, fmt);
2312	srcpos_verror(&yylloc, fmt, va);
2313	va_end(va);
2314
2315	treesource_error = 1;
2316}
2317
2318void yyerror(char const *s) {
2319	print_error("%s", s);
2320}
2321
2322static unsigned long long eval_literal(const char *s, int base, int bits)
2323{
2324	unsigned long long val;
2325	char *e;
2326
2327	errno = 0;
2328	val = strtoull(s, &e, base);
2329	if (*e) {
2330		size_t uls = strspn(e, "UL");
2331		if (e[uls])
2332			print_error("bad characters in literal");
2333	}
2334	if ((errno == ERANGE)
2335		 || ((bits < 64) && (val >= (1ULL << bits))))
2336		print_error("literal out of range");
2337	else if (errno != 0)
2338		print_error("bad literal");
2339	return val;
2340}
2341
2342static unsigned char eval_char_literal(const char *s)
2343{
2344	int i = 1;
2345	char c = s[0];
2346
2347	if (c == '\0')
2348	{
2349		print_error("empty character literal");
2350		return 0;
2351	}
2352
2353	/*
2354	 * If the first character in the character literal is a \ then process
2355	 * the remaining characters as an escape encoding. If the first
2356	 * character is neither an escape or a terminator it should be the only
2357	 * character in the literal and will be returned.
2358	 */
2359	if (c == '\\')
2360		c = get_escape_char(s, &i);
2361
2362	if (s[i] != '\0')
2363		print_error("malformed character literal");
2364
2365	return c;
2366}