aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dtc/dtc-parser.tab.c_shipped
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dtc/dtc-parser.tab.c_shipped')
-rw-r--r--scripts/dtc/dtc-parser.tab.c_shipped892
1 files changed, 440 insertions, 452 deletions
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
index 27129377e5d2..9be2eea18a30 100644
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ b/scripts/dtc/dtc-parser.tab.c_shipped
@@ -1,24 +1,23 @@
1/* A Bison parser, made by GNU Bison 2.3. */
2 1
3/* Skeleton implementation for Bison's Yacc-like parsers in C 2/* A Bison parser, made by GNU Bison 2.4.1. */
4 3
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 4/* Skeleton implementation for Bison's Yacc-like parsers in C
5
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc. 7 Free Software Foundation, Inc.
7 8
8 This program is free software; you can redistribute it and/or modify 9 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 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option) 11 the Free Software Foundation, either version 3 of the License, or
11 any later version. 12 (at your option) any later version.
12 13
13 This program is distributed in the hope that it will be useful, 14 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 17 GNU General Public License for more details.
17 18
18 You should have received a copy of the GNU General Public License 19 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
22 21
23/* As a special exception, you may create a larger work that contains 22/* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work 23 part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +28,7 @@
29 special exception, which will cause the skeleton and the resulting 28 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public 29 Bison output files to be licensed under the GNU General Public
31 License without this special exception. 30 License without this special exception.
32 31
33 This special exception was added by the Free Software Foundation in 32 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */ 33 version 2.2 of Bison. */
35 34
@@ -47,7 +46,7 @@
47#define YYBISON 1 46#define YYBISON 1
48 47
49/* Bison version. */ 48/* Bison version. */
50#define YYBISON_VERSION "2.3" 49#define YYBISON_VERSION "2.4.1"
51 50
52/* Skeleton name. */ 51/* Skeleton name. */
53#define YYSKELETON_NAME "yacc.c" 52#define YYSKELETON_NAME "yacc.c"
@@ -55,55 +54,32 @@
55/* Pure parsers. */ 54/* Pure parsers. */
56#define YYPURE 0 55#define YYPURE 0
57 56
58/* Using locations. */ 57/* Push parsers. */
59#define YYLSP_NEEDED 1 58#define YYPUSH 0
60
61 59
60/* Pull parsers. */
61#define YYPULL 1
62 62
63/* Tokens. */ 63/* Using locations. */
64#ifndef YYTOKENTYPE 64#define YYLSP_NEEDED 0
65# define YYTOKENTYPE
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
67 know about them. */
68 enum yytokentype {
69 DT_V1 = 258,
70 DT_MEMRESERVE = 259,
71 DT_PROPNODENAME = 260,
72 DT_LITERAL = 261,
73 DT_LEGACYLITERAL = 262,
74 DT_BASE = 263,
75 DT_BYTE = 264,
76 DT_STRING = 265,
77 DT_LABEL = 266,
78 DT_REF = 267,
79 DT_INCBIN = 268
80 };
81#endif
82/* Tokens. */
83#define DT_V1 258
84#define DT_MEMRESERVE 259
85#define DT_PROPNODENAME 260
86#define DT_LITERAL 261
87#define DT_LEGACYLITERAL 262
88#define DT_BASE 263
89#define DT_BYTE 264
90#define DT_STRING 265
91#define DT_LABEL 266
92#define DT_REF 267
93#define DT_INCBIN 268
94
95 65
96 66
97 67
98/* Copy the first part of user declarations. */ 68/* Copy the first part of user declarations. */
99#line 23 "dtc-parser.y" 69
70/* Line 189 of yacc.c */
71#line 21 "dtc-parser.y"
100 72
101#include <stdio.h> 73#include <stdio.h>
102 74
103#include "dtc.h" 75#include "dtc.h"
104#include "srcpos.h" 76#include "srcpos.h"
105 77
78YYLTYPE yylloc;
79
106extern int yylex(void); 80extern int yylex(void);
81extern void print_error(char const *fmt, ...);
82extern void yyerror(char const *s);
107 83
108extern struct boot_info *the_boot_info; 84extern struct boot_info *the_boot_info;
109extern int treesource_error; 85extern int treesource_error;
@@ -111,6 +87,9 @@ extern int treesource_error;
111static unsigned long long eval_literal(const char *s, int base, int bits); 87static unsigned long long eval_literal(const char *s, int base, int bits);
112 88
113 89
90/* Line 189 of yacc.c */
91#line 92 "dtc-parser.tab.c"
92
114/* Enabling traces. */ 93/* Enabling traces. */
115#ifndef YYDEBUG 94#ifndef YYDEBUG
116# define YYDEBUG 0 95# define YYDEBUG 0
@@ -129,10 +108,35 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
129# define YYTOKEN_TABLE 0 108# define YYTOKEN_TABLE 0
130#endif 109#endif
131 110
111
112/* Tokens. */
113#ifndef YYTOKENTYPE
114# define YYTOKENTYPE
115 /* Put the tokens into the symbol table, so that GDB and other debuggers
116 know about them. */
117 enum yytokentype {
118 DT_V1 = 258,
119 DT_MEMRESERVE = 259,
120 DT_PROPNODENAME = 260,
121 DT_LITERAL = 261,
122 DT_BASE = 262,
123 DT_BYTE = 263,
124 DT_STRING = 264,
125 DT_LABEL = 265,
126 DT_REF = 266,
127 DT_INCBIN = 267
128 };
129#endif
130
131
132
132#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 133#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
133typedef union YYSTYPE 134typedef union YYSTYPE
134#line 37 "dtc-parser.y"
135{ 135{
136
137/* Line 214 of yacc.c */
138#line 39 "dtc-parser.y"
139
136 char *propnodename; 140 char *propnodename;
137 char *literal; 141 char *literal;
138 char *labelref; 142 char *labelref;
@@ -147,34 +151,23 @@ typedef union YYSTYPE
147 struct node *node; 151 struct node *node;
148 struct node *nodelist; 152 struct node *nodelist;
149 struct reserve_info *re; 153 struct reserve_info *re;
150} 154
151/* Line 187 of yacc.c. */ 155
152#line 153 "dtc-parser.tab.c" 156
153 YYSTYPE; 157/* Line 214 of yacc.c */
158#line 159 "dtc-parser.tab.c"
159} YYSTYPE;
160# define YYSTYPE_IS_TRIVIAL 1
154# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 161# define yystype YYSTYPE /* obsolescent; will be withdrawn */
155# define YYSTYPE_IS_DECLARED 1 162# define YYSTYPE_IS_DECLARED 1
156# define YYSTYPE_IS_TRIVIAL 1
157#endif
158
159#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
160typedef struct YYLTYPE
161{
162 int first_line;
163 int first_column;
164 int last_line;
165 int last_column;
166} YYLTYPE;
167# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
168# define YYLTYPE_IS_DECLARED 1
169# define YYLTYPE_IS_TRIVIAL 1
170#endif 163#endif
171 164
172 165
173/* Copy the second part of user declarations. */ 166/* Copy the second part of user declarations. */
174 167
175 168
176/* Line 216 of yacc.c. */ 169/* Line 264 of yacc.c */
177#line 178 "dtc-parser.tab.c" 170#line 171 "dtc-parser.tab.c"
178 171
179#ifdef short 172#ifdef short
180# undef short 173# undef short
@@ -249,14 +242,14 @@ typedef short int yytype_int16;
249#if (defined __STDC__ || defined __C99__FUNC__ \ 242#if (defined __STDC__ || defined __C99__FUNC__ \
250 || defined __cplusplus || defined _MSC_VER) 243 || defined __cplusplus || defined _MSC_VER)
251static int 244static int
252YYID (int i) 245YYID (int yyi)
253#else 246#else
254static int 247static int
255YYID (i) 248YYID (yyi)
256 int i; 249 int yyi;
257#endif 250#endif
258{ 251{
259 return i; 252 return yyi;
260} 253}
261#endif 254#endif
262 255
@@ -332,15 +325,13 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
332 325
333#if (! defined yyoverflow \ 326#if (! defined yyoverflow \
334 && (! defined __cplusplus \ 327 && (! defined __cplusplus \
335 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ 328 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
336 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
337 329
338/* A type that is properly aligned for any stack member. */ 330/* A type that is properly aligned for any stack member. */
339union yyalloc 331union yyalloc
340{ 332{
341 yytype_int16 yyss; 333 yytype_int16 yyss_alloc;
342 YYSTYPE yyvs; 334 YYSTYPE yyvs_alloc;
343 YYLTYPE yyls;
344}; 335};
345 336
346/* The size of the maximum gap between one aligned stack and the next. */ 337/* The size of the maximum gap between one aligned stack and the next. */
@@ -349,8 +340,8 @@ union yyalloc
349/* The size of an array large to enough to hold all stacks, each with 340/* The size of an array large to enough to hold all stacks, each with
350 N elements. */ 341 N elements. */
351# define YYSTACK_BYTES(N) \ 342# define YYSTACK_BYTES(N) \
352 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ 343 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
353 + 2 * YYSTACK_GAP_MAXIMUM) 344 + YYSTACK_GAP_MAXIMUM)
354 345
355/* Copy COUNT objects from FROM to TO. The source and destination do 346/* Copy COUNT objects from FROM to TO. The source and destination do
356 not overlap. */ 347 not overlap. */
@@ -375,12 +366,12 @@ union yyalloc
375 elements in the stack, and YYPTR gives the new location of the 366 elements in the stack, and YYPTR gives the new location of the
376 stack. Advance YYPTR to a properly aligned location for the next 367 stack. Advance YYPTR to a properly aligned location for the next
377 stack. */ 368 stack. */
378# define YYSTACK_RELOCATE(Stack) \ 369# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
379 do \ 370 do \
380 { \ 371 { \
381 YYSIZE_T yynewbytes; \ 372 YYSIZE_T yynewbytes; \
382 YYCOPY (&yyptr->Stack, Stack, yysize); \ 373 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
383 Stack = &yyptr->Stack; \ 374 Stack = &yyptr->Stack_alloc; \
384 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 375 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
385 yyptr += yynewbytes / sizeof (*yyptr); \ 376 yyptr += yynewbytes / sizeof (*yyptr); \
386 } \ 377 } \
@@ -389,22 +380,22 @@ union yyalloc
389#endif 380#endif
390 381
391/* YYFINAL -- State number of the termination state. */ 382/* YYFINAL -- State number of the termination state. */
392#define YYFINAL 9 383#define YYFINAL 4
393/* YYLAST -- Last index in YYTABLE. */ 384/* YYLAST -- Last index in YYTABLE. */
394#define YYLAST 73 385#define YYLAST 56
395 386
396/* YYNTOKENS -- Number of terminals. */ 387/* YYNTOKENS -- Number of terminals. */
397#define YYNTOKENS 27 388#define YYNTOKENS 25
398/* YYNNTS -- Number of nonterminals. */ 389/* YYNNTS -- Number of nonterminals. */
399#define YYNNTS 20 390#define YYNNTS 16
400/* YYNRULES -- Number of rules. */ 391/* YYNRULES -- Number of rules. */
401#define YYNRULES 45 392#define YYNRULES 39
402/* YYNRULES -- Number of states. */ 393/* YYNRULES -- Number of states. */
403#define YYNSTATES 76 394#define YYNSTATES 67
404 395
405/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 396/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
406#define YYUNDEFTOK 2 397#define YYUNDEFTOK 2
407#define YYMAXUTOK 268 398#define YYMAXUTOK 267
408 399
409#define YYTRANSLATE(YYX) \ 400#define YYTRANSLATE(YYX) \
410 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 401 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -416,15 +407,15 @@ static const yytype_uint8 yytranslate[] =
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 24, 26, 2, 2, 25, 15, 2, 16, 2, 2, 410 22, 24, 2, 2, 23, 2, 2, 14, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 14, 411 2, 2, 2, 2, 2, 2, 2, 2, 2, 13,
421 20, 19, 21, 2, 2, 2, 2, 2, 2, 2, 412 18, 17, 19, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 22, 2, 23, 2, 2, 2, 2, 2, 2, 415 2, 20, 2, 21, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 17, 2, 18, 2, 2, 2, 2, 418 2, 2, 2, 15, 2, 16, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -438,7 +429,7 @@ static const yytype_uint8 yytranslate[] =
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 431 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
441 5, 6, 7, 8, 9, 10, 11, 12, 13 432 5, 6, 7, 8, 9, 10, 11, 12
442}; 433};
443 434
444#if YYDEBUG 435#if YYDEBUG
@@ -446,41 +437,37 @@ static const yytype_uint8 yytranslate[] =
446 YYRHS. */ 437 YYRHS. */
447static const yytype_uint8 yyprhs[] = 438static const yytype_uint8 yyprhs[] =
448{ 439{
449 0, 0, 3, 8, 11, 12, 15, 21, 22, 25, 440 0, 0, 3, 8, 9, 12, 17, 20, 22, 25,
450 27, 34, 36, 38, 41, 47, 48, 51, 57, 61, 441 29, 33, 39, 40, 43, 48, 51, 54, 57, 62,
451 64, 69, 74, 77, 87, 93, 96, 97, 100, 103, 442 67, 70, 80, 86, 89, 90, 93, 96, 97, 100,
452 104, 107, 110, 113, 114, 116, 118, 121, 122, 125, 443 103, 106, 108, 109, 112, 115, 116, 119, 122, 125
453 128, 129, 132, 135, 139, 140
454}; 444};
455 445
456/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 446/* YYRHS -- A `-1'-separated list of the rules' RHS. */
457static const yytype_int8 yyrhs[] = 447static const yytype_int8 yyrhs[] =
458{ 448{
459 28, 0, -1, 3, 14, 29, 34, -1, 31, 34, 449 26, 0, -1, 3, 13, 27, 30, -1, -1, 28,
460 -1, -1, 30, 29, -1, 46, 4, 33, 33, 14, 450 27, -1, 4, 29, 29, 13, -1, 10, 28, -1,
461 -1, -1, 32, 31, -1, 30, -1, 46, 4, 33, 451 6, -1, 14, 31, -1, 30, 14, 31, -1, 30,
462 15, 33, 14, -1, 6, -1, 7, -1, 16, 35, 452 11, 31, -1, 15, 32, 39, 16, 13, -1, -1,
463 -1, 17, 36, 44, 18, 14, -1, -1, 36, 37, 453 32, 33, -1, 5, 17, 34, 13, -1, 5, 13,
464 -1, 46, 5, 19, 38, 14, -1, 46, 5, 14, 454 -1, 10, 33, -1, 35, 9, -1, 35, 18, 36,
465 -1, 39, 10, -1, 39, 20, 40, 21, -1, 39, 455 19, -1, 35, 20, 38, 21, -1, 35, 11, -1,
466 22, 43, 23, -1, 39, 12, -1, 39, 13, 24, 456 35, 12, 22, 9, 23, 29, 23, 29, 24, -1,
467 10, 25, 33, 25, 33, 26, -1, 39, 13, 24, 457 35, 12, 22, 9, 24, -1, 34, 10, -1, -1,
468 10, 26, -1, 38, 11, -1, -1, 38, 25, -1, 458 34, 23, -1, 35, 10, -1, -1, 36, 37, -1,
469 39, 11, -1, -1, 40, 42, -1, 40, 12, -1, 459 36, 11, -1, 36, 10, -1, 6, -1, -1, 38,
470 40, 11, -1, -1, 8, -1, 6, -1, 41, 7, 460 8, -1, 38, 10, -1, -1, 40, 39, -1, 40,
471 -1, -1, 43, 9, -1, 43, 11, -1, -1, 45, 461 33, -1, 5, 31, -1, 10, 40, -1
472 44, -1, 45, 37, -1, 46, 5, 35, -1, -1,
473 11, -1
474}; 462};
475 463
476/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 464/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
477static const yytype_uint16 yyrline[] = 465static const yytype_uint16 yyrline[] =
478{ 466{
479 0, 89, 89, 93, 101, 104, 111, 119, 122, 129, 467 0, 86, 86, 95, 98, 105, 109, 117, 124, 128,
480 133, 140, 144, 151, 158, 166, 169, 176, 180, 187, 468 132, 145, 153, 156, 163, 167, 171, 179, 183, 187,
481 191, 195, 199, 203, 220, 231, 239, 242, 246, 254, 469 191, 195, 212, 222, 230, 233, 237, 245, 248, 252,
482 257, 261, 266, 274, 277, 281, 285, 293, 296, 300, 470 257, 264, 272, 275, 279, 287, 290, 294, 302, 306
483 308, 311, 315, 323, 331, 334
484}; 471};
485#endif 472#endif
486 473
@@ -490,13 +477,12 @@ static const yytype_uint16 yyrline[] =
490static const char *const yytname[] = 477static const char *const yytname[] =
491{ 478{
492 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", 479 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
493 "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE", 480 "DT_PROPNODENAME", "DT_LITERAL", "DT_BASE", "DT_BYTE", "DT_STRING",
494 "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'-'", 481 "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='",
495 "'/'", "'{'", "'}'", "'='", "'<'", "'>'", "'['", "']'", "'('", "','", 482 "'<'", "'>'", "'['", "']'", "'('", "','", "')'", "$accept", "sourcefile",
496 "')'", "$accept", "sourcefile", "memreserves", "memreserve", 483 "memreserves", "memreserve", "addr", "devicetree", "nodedef", "proplist",
497 "v0_memreserves", "v0_memreserve", "addr", "devicetree", "nodedef", 484 "propdef", "propdata", "propdataprefix", "celllist", "cellval",
498 "proplist", "propdef", "propdata", "propdataprefix", "celllist", 485 "bytestring", "subnodes", "subnode", 0
499 "cellbase", "cellval", "bytestring", "subnodes", "subnode", "label", 0
500}; 486};
501#endif 487#endif
502 488
@@ -506,29 +492,27 @@ static const char *const yytname[] =
506static const yytype_uint16 yytoknum[] = 492static const yytype_uint16 yytoknum[] =
507{ 493{
508 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 494 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
509 265, 266, 267, 268, 59, 45, 47, 123, 125, 61, 495 265, 266, 267, 59, 47, 123, 125, 61, 60, 62,
510 60, 62, 91, 93, 40, 44, 41 496 91, 93, 40, 44, 41
511}; 497};
512# endif 498# endif
513 499
514/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 500/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
515static const yytype_uint8 yyr1[] = 501static const yytype_uint8 yyr1[] =
516{ 502{
517 0, 27, 28, 28, 29, 29, 30, 31, 31, 32, 503 0, 25, 26, 27, 27, 28, 28, 29, 30, 30,
518 32, 33, 33, 34, 35, 36, 36, 37, 37, 38, 504 30, 31, 32, 32, 33, 33, 33, 34, 34, 34,
519 38, 38, 38, 38, 38, 38, 39, 39, 39, 40, 505 34, 34, 34, 34, 35, 35, 35, 36, 36, 36,
520 40, 40, 40, 41, 41, 42, 42, 43, 43, 43, 506 36, 37, 38, 38, 38, 39, 39, 39, 40, 40
521 44, 44, 44, 45, 46, 46
522}; 507};
523 508
524/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 509/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
525static const yytype_uint8 yyr2[] = 510static const yytype_uint8 yyr2[] =
526{ 511{
527 0, 2, 4, 2, 0, 2, 5, 0, 2, 1, 512 0, 2, 4, 0, 2, 4, 2, 1, 2, 3,
528 6, 1, 1, 2, 5, 0, 2, 5, 3, 2, 513 3, 5, 0, 2, 4, 2, 2, 2, 4, 4,
529 4, 4, 2, 9, 5, 2, 0, 2, 2, 0, 514 2, 9, 5, 2, 0, 2, 2, 0, 2, 2,
530 2, 2, 2, 0, 1, 1, 2, 0, 2, 2, 515 2, 1, 0, 2, 2, 0, 2, 2, 2, 2
531 0, 2, 2, 3, 0, 1
532}; 516};
533 517
534/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 518/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -536,86 +520,79 @@ static const yytype_uint8 yyr2[] =
536 means the default is an error. */ 520 means the default is an error. */
537static const yytype_uint8 yydefact[] = 521static const yytype_uint8 yydefact[] =
538{ 522{
539 7, 0, 45, 0, 9, 0, 7, 0, 4, 1, 523 0, 0, 0, 3, 1, 0, 0, 0, 3, 7,
540 0, 3, 8, 0, 0, 4, 0, 15, 13, 11, 524 0, 6, 0, 2, 4, 0, 12, 8, 0, 0,
541 12, 0, 2, 5, 0, 40, 0, 0, 0, 16, 525 5, 35, 10, 9, 0, 0, 13, 0, 35, 15,
542 0, 40, 0, 0, 6, 0, 42, 41, 0, 10, 526 24, 38, 16, 39, 0, 37, 36, 0, 0, 11,
543 14, 18, 26, 43, 0, 0, 25, 17, 27, 19, 527 23, 14, 25, 17, 26, 20, 0, 27, 32, 0,
544 28, 22, 0, 29, 37, 0, 33, 0, 0, 35, 528 0, 0, 0, 31, 30, 29, 18, 28, 33, 34,
545 34, 32, 31, 20, 0, 30, 38, 39, 21, 0, 529 19, 0, 22, 0, 0, 0, 21
546 24, 36, 0, 0, 0, 23
547}; 530};
548 531
549/* YYDEFGOTO[NTERM-NUM]. */ 532/* YYDEFGOTO[NTERM-NUM]. */
550static const yytype_int8 yydefgoto[] = 533static const yytype_int8 yydefgoto[] =
551{ 534{
552 -1, 3, 14, 4, 5, 6, 27, 11, 18, 25, 535 -1, 2, 7, 8, 10, 13, 17, 21, 26, 37,
553 29, 44, 45, 56, 64, 65, 57, 30, 31, 7 536 38, 50, 57, 51, 27, 28
554}; 537};
555 538
556/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 539/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
557 STATE-NUM. */ 540 STATE-NUM. */
558#define YYPACT_NINF -14 541#define YYPACT_NINF -12
559static const yytype_int8 yypact[] = 542static const yytype_int8 yypact[] =
560{ 543{
561 30, -11, -14, 7, -14, -1, 27, 13, 27, -14, 544 10, -11, 18, -1, -12, 22, -1, 15, -1, -12,
562 8, -14, -14, 40, -1, 27, 35, -14, -14, -14, 545 22, -12, 20, 1, -12, 17, -12, -12, 20, 20,
563 -14, 21, -14, -14, 40, 24, 40, 28, 40, -14, 546 -12, 6, -12, -12, 21, 6, -12, 23, 6, -12,
564 32, 24, 46, 38, -14, 39, -14, -14, 26, -14, 547 -12, -12, -12, -12, 28, -12, -12, -6, 13, -12,
565 -14, -14, -14, -14, -9, 10, -14, -14, -14, -14, 548 -12, -12, -12, -12, -12, -12, 24, -12, -12, 33,
566 -14, -14, 31, -14, -14, 44, -2, 3, 23, -14, 549 -5, 0, -4, -12, -12, -12, -12, -12, -12, -12,
567 -14, -14, -14, -14, 50, -14, -14, -14, -14, 40, 550 -12, 22, -12, 25, 22, 19, -12
568 -14, -14, 33, 40, 36, -14
569}; 551};
570 552
571/* YYPGOTO[NTERM-NUM]. */ 553/* YYPGOTO[NTERM-NUM]. */
572static const yytype_int8 yypgoto[] = 554static const yytype_int8 yypgoto[] =
573{ 555{
574 -14, -14, 48, 29, 53, -14, -13, 47, 34, -14, 556 -12, -12, 36, 39, -10, -12, 8, -12, 12, -12,
575 37, -14, -14, -14, -14, -14, -14, 42, -14, -7 557 -12, -12, -12, -12, 27, 31
576}; 558};
577 559
578/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 560/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
579 positive, shift that token. If negative, reduce the rule which 561 positive, shift that token. If negative, reduce the rule which
580 number is the opposite. If zero, do what YYDEFACT says. 562 number is the opposite. If zero, do what YYDEFACT says.
581 If YYTABLE_NINF, syntax error. */ 563 If YYTABLE_NINF, syntax error. */
582#define YYTABLE_NINF -45 564#define YYTABLE_NINF -1
583static const yytype_int8 yytable[] = 565static const yytype_uint8 yytable[] =
584{ 566{
585 21, 16, 46, 8, 59, 47, 60, 9, 16, 61, 567 15, 53, 3, 5, 40, 54, 55, 41, 58, 6,
586 62, 28, 66, 33, 67, 10, 48, 13, 32, 63, 568 59, 24, 18, 1, 56, 19, 25, 42, 4, 61,
587 49, 50, 51, 52, 32, 17, 68, 19, 20, -44, 569 62, 60, 43, 44, 45, 46, 22, 23, 9, 12,
588 53, -44, 54, 1, -44, 2, 26, 15, 2, 24, 570 20, 47, 31, 48, 29, 16, 16, 32, 30, 34,
589 41, 2, 34, 17, 15, 42, 19, 20, 69, 70, 571 35, 39, 52, 66, 14, 11, 49, 0, 64, 0,
590 35, 38, 39, 40, 58, 55, 72, 71, 73, 12, 572 0, 63, 0, 0, 65, 36, 33
591 74, 22, 75, 23, 0, 0, 0, 0, 36, 0,
592 0, 0, 43, 37
593}; 573};
594 574
595static const yytype_int8 yycheck[] = 575static const yytype_int8 yycheck[] =
596{ 576{
597 13, 8, 11, 14, 6, 14, 8, 0, 15, 11, 577 10, 6, 13, 4, 10, 10, 11, 13, 8, 10,
598 12, 24, 9, 26, 11, 16, 25, 4, 25, 21, 578 10, 5, 11, 3, 19, 14, 10, 23, 0, 23,
599 10, 11, 12, 13, 31, 17, 23, 6, 7, 5, 579 24, 21, 9, 10, 11, 12, 18, 19, 6, 14,
600 20, 4, 22, 3, 4, 11, 15, 8, 11, 4, 580 13, 18, 24, 20, 13, 15, 15, 25, 17, 16,
601 14, 11, 14, 17, 15, 19, 6, 7, 25, 26, 581 28, 13, 9, 24, 8, 6, 22, -1, 23, -1,
602 18, 5, 14, 14, 10, 24, 69, 7, 25, 6, 582 -1, 61, -1, -1, 64, 28, 25
603 73, 14, 26, 15, -1, -1, -1, -1, 31, -1,
604 -1, -1, 38, 31
605}; 583};
606 584
607/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 585/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
608 symbol of state STATE-NUM. */ 586 symbol of state STATE-NUM. */
609static const yytype_uint8 yystos[] = 587static const yytype_uint8 yystos[] =
610{ 588{
611 0, 3, 11, 28, 30, 31, 32, 46, 14, 0, 589 0, 3, 26, 13, 0, 4, 10, 27, 28, 6,
612 16, 34, 31, 4, 29, 30, 46, 17, 35, 6, 590 29, 28, 14, 30, 27, 29, 15, 31, 11, 14,
613 7, 33, 34, 29, 4, 36, 15, 33, 33, 37, 591 13, 32, 31, 31, 5, 10, 33, 39, 40, 13,
614 44, 45, 46, 33, 14, 18, 37, 44, 5, 14, 592 17, 31, 33, 40, 16, 33, 39, 34, 35, 13,
615 14, 14, 19, 35, 38, 39, 11, 14, 25, 10, 593 10, 13, 23, 9, 10, 11, 12, 18, 20, 22,
616 11, 12, 13, 20, 22, 24, 40, 43, 10, 6, 594 36, 38, 9, 6, 10, 11, 19, 37, 8, 10,
617 8, 11, 12, 21, 41, 42, 9, 11, 23, 25, 595 21, 23, 24, 29, 23, 29, 24
618 26, 7, 33, 25, 33, 26
619}; 596};
620 597
621#define yyerrok (yyerrstatus = 0) 598#define yyerrok (yyerrstatus = 0)
@@ -728,7 +705,7 @@ do { \
728 { \ 705 { \
729 YYFPRINTF (stderr, "%s ", Title); \ 706 YYFPRINTF (stderr, "%s ", Title); \
730 yy_symbol_print (stderr, \ 707 yy_symbol_print (stderr, \
731 Type, Value, Location); \ 708 Type, Value); \
732 YYFPRINTF (stderr, "\n"); \ 709 YYFPRINTF (stderr, "\n"); \
733 } \ 710 } \
734} while (YYID (0)) 711} while (YYID (0))
@@ -742,19 +719,17 @@ do { \
742#if (defined __STDC__ || defined __C99__FUNC__ \ 719#if (defined __STDC__ || defined __C99__FUNC__ \
743 || defined __cplusplus || defined _MSC_VER) 720 || defined __cplusplus || defined _MSC_VER)
744static void 721static void
745yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) 722yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
746#else 723#else
747static void 724static void
748yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) 725yy_symbol_value_print (yyoutput, yytype, yyvaluep)
749 FILE *yyoutput; 726 FILE *yyoutput;
750 int yytype; 727 int yytype;
751 YYSTYPE const * const yyvaluep; 728 YYSTYPE const * const yyvaluep;
752 YYLTYPE const * const yylocationp;
753#endif 729#endif
754{ 730{
755 if (!yyvaluep) 731 if (!yyvaluep)
756 return; 732 return;
757 YYUSE (yylocationp);
758# ifdef YYPRINT 733# ifdef YYPRINT
759 if (yytype < YYNTOKENS) 734 if (yytype < YYNTOKENS)
760 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 735 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
@@ -776,14 +751,13 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
776#if (defined __STDC__ || defined __C99__FUNC__ \ 751#if (defined __STDC__ || defined __C99__FUNC__ \
777 || defined __cplusplus || defined _MSC_VER) 752 || defined __cplusplus || defined _MSC_VER)
778static void 753static void
779yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) 754yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
780#else 755#else
781static void 756static void
782yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp) 757yy_symbol_print (yyoutput, yytype, yyvaluep)
783 FILE *yyoutput; 758 FILE *yyoutput;
784 int yytype; 759 int yytype;
785 YYSTYPE const * const yyvaluep; 760 YYSTYPE const * const yyvaluep;
786 YYLTYPE const * const yylocationp;
787#endif 761#endif
788{ 762{
789 if (yytype < YYNTOKENS) 763 if (yytype < YYNTOKENS)
@@ -791,9 +765,7 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
791 else 765 else
792 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 766 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
793 767
794 YY_LOCATION_PRINT (yyoutput, *yylocationp); 768 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
795 YYFPRINTF (yyoutput, ": ");
796 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
797 YYFPRINTF (yyoutput, ")"); 769 YYFPRINTF (yyoutput, ")");
798} 770}
799 771
@@ -805,17 +777,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
805#if (defined __STDC__ || defined __C99__FUNC__ \ 777#if (defined __STDC__ || defined __C99__FUNC__ \
806 || defined __cplusplus || defined _MSC_VER) 778 || defined __cplusplus || defined _MSC_VER)
807static void 779static void
808yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 780yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
809#else 781#else
810static void 782static void
811yy_stack_print (bottom, top) 783yy_stack_print (yybottom, yytop)
812 yytype_int16 *bottom; 784 yytype_int16 *yybottom;
813 yytype_int16 *top; 785 yytype_int16 *yytop;
814#endif 786#endif
815{ 787{
816 YYFPRINTF (stderr, "Stack now"); 788 YYFPRINTF (stderr, "Stack now");
817 for (; bottom <= top; ++bottom) 789 for (; yybottom <= yytop; yybottom++)
818 YYFPRINTF (stderr, " %d", *bottom); 790 {
791 int yybot = *yybottom;
792 YYFPRINTF (stderr, " %d", yybot);
793 }
819 YYFPRINTF (stderr, "\n"); 794 YYFPRINTF (stderr, "\n");
820} 795}
821 796
@@ -833,12 +808,11 @@ do { \
833#if (defined __STDC__ || defined __C99__FUNC__ \ 808#if (defined __STDC__ || defined __C99__FUNC__ \
834 || defined __cplusplus || defined _MSC_VER) 809 || defined __cplusplus || defined _MSC_VER)
835static void 810static void
836yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) 811yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
837#else 812#else
838static void 813static void
839yy_reduce_print (yyvsp, yylsp, yyrule) 814yy_reduce_print (yyvsp, yyrule)
840 YYSTYPE *yyvsp; 815 YYSTYPE *yyvsp;
841 YYLTYPE *yylsp;
842 int yyrule; 816 int yyrule;
843#endif 817#endif
844{ 818{
@@ -850,18 +824,18 @@ yy_reduce_print (yyvsp, yylsp, yyrule)
850 /* The symbols being reduced. */ 824 /* The symbols being reduced. */
851 for (yyi = 0; yyi < yynrhs; yyi++) 825 for (yyi = 0; yyi < yynrhs; yyi++)
852 { 826 {
853 fprintf (stderr, " $%d = ", yyi + 1); 827 YYFPRINTF (stderr, " $%d = ", yyi + 1);
854 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 828 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
855 &(yyvsp[(yyi + 1) - (yynrhs)]) 829 &(yyvsp[(yyi + 1) - (yynrhs)])
856 , &(yylsp[(yyi + 1) - (yynrhs)]) ); 830 );
857 fprintf (stderr, "\n"); 831 YYFPRINTF (stderr, "\n");
858 } 832 }
859} 833}
860 834
861# define YY_REDUCE_PRINT(Rule) \ 835# define YY_REDUCE_PRINT(Rule) \
862do { \ 836do { \
863 if (yydebug) \ 837 if (yydebug) \
864 yy_reduce_print (yyvsp, yylsp, Rule); \ 838 yy_reduce_print (yyvsp, Rule); \
865} while (YYID (0)) 839} while (YYID (0))
866 840
867/* Nonzero means print parse trace. It is left uninitialized so that 841/* Nonzero means print parse trace. It is left uninitialized so that
@@ -1112,18 +1086,16 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
1112#if (defined __STDC__ || defined __C99__FUNC__ \ 1086#if (defined __STDC__ || defined __C99__FUNC__ \
1113 || defined __cplusplus || defined _MSC_VER) 1087 || defined __cplusplus || defined _MSC_VER)
1114static void 1088static void
1115yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) 1089yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1116#else 1090#else
1117static void 1091static void
1118yydestruct (yymsg, yytype, yyvaluep, yylocationp) 1092yydestruct (yymsg, yytype, yyvaluep)
1119 const char *yymsg; 1093 const char *yymsg;
1120 int yytype; 1094 int yytype;
1121 YYSTYPE *yyvaluep; 1095 YYSTYPE *yyvaluep;
1122 YYLTYPE *yylocationp;
1123#endif 1096#endif
1124{ 1097{
1125 YYUSE (yyvaluep); 1098 YYUSE (yyvaluep);
1126 YYUSE (yylocationp);
1127 1099
1128 if (!yymsg) 1100 if (!yymsg)
1129 yymsg = "Deleting"; 1101 yymsg = "Deleting";
@@ -1136,10 +1108,8 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1136 break; 1108 break;
1137 } 1109 }
1138} 1110}
1139
1140 1111
1141/* Prevent warnings from -Wmissing-prototypes. */ 1112/* Prevent warnings from -Wmissing-prototypes. */
1142
1143#ifdef YYPARSE_PARAM 1113#ifdef YYPARSE_PARAM
1144#if defined __STDC__ || defined __cplusplus 1114#if defined __STDC__ || defined __cplusplus
1145int yyparse (void *YYPARSE_PARAM); 1115int yyparse (void *YYPARSE_PARAM);
@@ -1155,23 +1125,20 @@ int yyparse ();
1155#endif /* ! YYPARSE_PARAM */ 1125#endif /* ! YYPARSE_PARAM */
1156 1126
1157 1127
1158 1128/* The lookahead symbol. */
1159/* The look-ahead symbol. */
1160int yychar; 1129int yychar;
1161 1130
1162/* The semantic value of the look-ahead symbol. */ 1131/* The semantic value of the lookahead symbol. */
1163YYSTYPE yylval; 1132YYSTYPE yylval;
1164 1133
1165/* Number of syntax errors so far. */ 1134/* Number of syntax errors so far. */
1166int yynerrs; 1135int yynerrs;
1167/* Location data for the look-ahead symbol. */
1168YYLTYPE yylloc;
1169 1136
1170 1137
1171 1138
1172/*----------. 1139/*-------------------------.
1173| yyparse. | 1140| yyparse or yypush_parse. |
1174`----------*/ 1141`-------------------------*/
1175 1142
1176#ifdef YYPARSE_PARAM 1143#ifdef YYPARSE_PARAM
1177#if (defined __STDC__ || defined __C99__FUNC__ \ 1144#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1195,79 +1162,70 @@ yyparse ()
1195#endif 1162#endif
1196#endif 1163#endif
1197{ 1164{
1198
1199 int yystate;
1200 int yyn;
1201 int yyresult;
1202 /* Number of tokens to shift before error messages enabled. */
1203 int yyerrstatus;
1204 /* Look-ahead token as an internal (translated) token number. */
1205 int yytoken = 0;
1206#if YYERROR_VERBOSE
1207 /* Buffer for error messages, and its allocated size. */
1208 char yymsgbuf[128];
1209 char *yymsg = yymsgbuf;
1210 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1211#endif
1212 1165
1213 /* Three stacks and their tools:
1214 `yyss': related to states,
1215 `yyvs': related to semantic values,
1216 `yyls': related to locations.
1217 1166
1218 Refer to the stacks thru separate pointers, to allow yyoverflow 1167 int yystate;
1219 to reallocate them elsewhere. */ 1168 /* Number of tokens to shift before error messages enabled. */
1169 int yyerrstatus;
1220 1170
1221 /* The state stack. */ 1171 /* The stacks and their tools:
1222 yytype_int16 yyssa[YYINITDEPTH]; 1172 `yyss': related to states.
1223 yytype_int16 *yyss = yyssa; 1173 `yyvs': related to semantic values.
1224 yytype_int16 *yyssp;
1225 1174
1226 /* The semantic value stack. */ 1175 Refer to the stacks thru separate pointers, to allow yyoverflow
1227 YYSTYPE yyvsa[YYINITDEPTH]; 1176 to reallocate them elsewhere. */
1228 YYSTYPE *yyvs = yyvsa;
1229 YYSTYPE *yyvsp;
1230 1177
1231 /* The location stack. */ 1178 /* The state stack. */
1232 YYLTYPE yylsa[YYINITDEPTH]; 1179 yytype_int16 yyssa[YYINITDEPTH];
1233 YYLTYPE *yyls = yylsa; 1180 yytype_int16 *yyss;
1234 YYLTYPE *yylsp; 1181 yytype_int16 *yyssp;
1235 /* The locations where the error started and ended. */
1236 YYLTYPE yyerror_range[2];
1237 1182
1238#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) 1183 /* The semantic value stack. */
1184 YYSTYPE yyvsa[YYINITDEPTH];
1185 YYSTYPE *yyvs;
1186 YYSTYPE *yyvsp;
1239 1187
1240 YYSIZE_T yystacksize = YYINITDEPTH; 1188 YYSIZE_T yystacksize;
1241 1189
1190 int yyn;
1191 int yyresult;
1192 /* Lookahead token as an internal (translated) token number. */
1193 int yytoken;
1242 /* The variables used to return semantic value and location from the 1194 /* The variables used to return semantic value and location from the
1243 action routines. */ 1195 action routines. */
1244 YYSTYPE yyval; 1196 YYSTYPE yyval;
1245 YYLTYPE yyloc; 1197
1198#if YYERROR_VERBOSE
1199 /* Buffer for error messages, and its allocated size. */
1200 char yymsgbuf[128];
1201 char *yymsg = yymsgbuf;
1202 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1203#endif
1204
1205#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1246 1206
1247 /* The number of symbols on the RHS of the reduced rule. 1207 /* The number of symbols on the RHS of the reduced rule.
1248 Keep to zero when no symbol should be popped. */ 1208 Keep to zero when no symbol should be popped. */
1249 int yylen = 0; 1209 int yylen = 0;
1250 1210
1211 yytoken = 0;
1212 yyss = yyssa;
1213 yyvs = yyvsa;
1214 yystacksize = YYINITDEPTH;
1215
1251 YYDPRINTF ((stderr, "Starting parse\n")); 1216 YYDPRINTF ((stderr, "Starting parse\n"));
1252 1217
1253 yystate = 0; 1218 yystate = 0;
1254 yyerrstatus = 0; 1219 yyerrstatus = 0;
1255 yynerrs = 0; 1220 yynerrs = 0;
1256 yychar = YYEMPTY; /* Cause a token to be read. */ 1221 yychar = YYEMPTY; /* Cause a token to be read. */
1257 1222
1258 /* Initialize stack pointers. 1223 /* Initialize stack pointers.
1259 Waste one element of value and location stack 1224 Waste one element of value and location stack
1260 so that they stay on the same level as the state stack. 1225 so that they stay on the same level as the state stack.
1261 The wasted elements are never initialized. */ 1226 The wasted elements are never initialized. */
1262
1263 yyssp = yyss; 1227 yyssp = yyss;
1264 yyvsp = yyvs; 1228 yyvsp = yyvs;
1265 yylsp = yyls;
1266#if YYLTYPE_IS_TRIVIAL
1267 /* Initialize the default location before parsing starts. */
1268 yylloc.first_line = yylloc.last_line = 1;
1269 yylloc.first_column = yylloc.last_column = 0;
1270#endif
1271 1229
1272 goto yysetstate; 1230 goto yysetstate;
1273 1231
@@ -1294,7 +1252,6 @@ yyparse ()
1294 memory. */ 1252 memory. */
1295 YYSTYPE *yyvs1 = yyvs; 1253 YYSTYPE *yyvs1 = yyvs;
1296 yytype_int16 *yyss1 = yyss; 1254 yytype_int16 *yyss1 = yyss;
1297 YYLTYPE *yyls1 = yyls;
1298 1255
1299 /* Each stack pointer address is followed by the size of the 1256 /* Each stack pointer address is followed by the size of the
1300 data in use in that stack, in bytes. This used to be a 1257 data in use in that stack, in bytes. This used to be a
@@ -1303,9 +1260,8 @@ yyparse ()
1303 yyoverflow (YY_("memory exhausted"), 1260 yyoverflow (YY_("memory exhausted"),
1304 &yyss1, yysize * sizeof (*yyssp), 1261 &yyss1, yysize * sizeof (*yyssp),
1305 &yyvs1, yysize * sizeof (*yyvsp), 1262 &yyvs1, yysize * sizeof (*yyvsp),
1306 &yyls1, yysize * sizeof (*yylsp),
1307 &yystacksize); 1263 &yystacksize);
1308 yyls = yyls1; 1264
1309 yyss = yyss1; 1265 yyss = yyss1;
1310 yyvs = yyvs1; 1266 yyvs = yyvs1;
1311 } 1267 }
@@ -1326,9 +1282,8 @@ yyparse ()
1326 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1282 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1327 if (! yyptr) 1283 if (! yyptr)
1328 goto yyexhaustedlab; 1284 goto yyexhaustedlab;
1329 YYSTACK_RELOCATE (yyss); 1285 YYSTACK_RELOCATE (yyss_alloc, yyss);
1330 YYSTACK_RELOCATE (yyvs); 1286 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1331 YYSTACK_RELOCATE (yyls);
1332# undef YYSTACK_RELOCATE 1287# undef YYSTACK_RELOCATE
1333 if (yyss1 != yyssa) 1288 if (yyss1 != yyssa)
1334 YYSTACK_FREE (yyss1); 1289 YYSTACK_FREE (yyss1);
@@ -1338,7 +1293,6 @@ yyparse ()
1338 1293
1339 yyssp = yyss + yysize - 1; 1294 yyssp = yyss + yysize - 1;
1340 yyvsp = yyvs + yysize - 1; 1295 yyvsp = yyvs + yysize - 1;
1341 yylsp = yyls + yysize - 1;
1342 1296
1343 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1297 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1344 (unsigned long int) yystacksize)); 1298 (unsigned long int) yystacksize));
@@ -1349,6 +1303,9 @@ yyparse ()
1349 1303
1350 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1304 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1351 1305
1306 if (yystate == YYFINAL)
1307 YYACCEPT;
1308
1352 goto yybackup; 1309 goto yybackup;
1353 1310
1354/*-----------. 1311/*-----------.
@@ -1357,16 +1314,16 @@ yyparse ()
1357yybackup: 1314yybackup:
1358 1315
1359 /* Do appropriate processing given the current state. Read a 1316 /* Do appropriate processing given the current state. Read a
1360 look-ahead token if we need one and don't already have one. */ 1317 lookahead token if we need one and don't already have one. */
1361 1318
1362 /* First try to decide what to do without reference to look-ahead token. */ 1319 /* First try to decide what to do without reference to lookahead token. */
1363 yyn = yypact[yystate]; 1320 yyn = yypact[yystate];
1364 if (yyn == YYPACT_NINF) 1321 if (yyn == YYPACT_NINF)
1365 goto yydefault; 1322 goto yydefault;
1366 1323
1367 /* Not known => get a look-ahead token if don't already have one. */ 1324 /* Not known => get a lookahead token if don't already have one. */
1368 1325
1369 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1326 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1370 if (yychar == YYEMPTY) 1327 if (yychar == YYEMPTY)
1371 { 1328 {
1372 YYDPRINTF ((stderr, "Reading a token: ")); 1329 YYDPRINTF ((stderr, "Reading a token: "));
@@ -1398,24 +1355,20 @@ yybackup:
1398 goto yyreduce; 1355 goto yyreduce;
1399 } 1356 }
1400 1357
1401 if (yyn == YYFINAL)
1402 YYACCEPT;
1403
1404 /* Count tokens shifted since error; after three, turn off error 1358 /* Count tokens shifted since error; after three, turn off error
1405 status. */ 1359 status. */
1406 if (yyerrstatus) 1360 if (yyerrstatus)
1407 yyerrstatus--; 1361 yyerrstatus--;
1408 1362
1409 /* Shift the look-ahead token. */ 1363 /* Shift the lookahead token. */
1410 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1364 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1411 1365
1412 /* Discard the shifted token unless it is eof. */ 1366 /* Discard the shifted token. */
1413 if (yychar != YYEOF) 1367 yychar = YYEMPTY;
1414 yychar = YYEMPTY;
1415 1368
1416 yystate = yyn; 1369 yystate = yyn;
1417 *++yyvsp = yylval; 1370 *++yyvsp = yylval;
1418 *++yylsp = yylloc; 1371
1419 goto yynewstate; 1372 goto yynewstate;
1420 1373
1421 1374
@@ -1446,337 +1399,387 @@ yyreduce:
1446 GCC warning that YYVAL may be used uninitialized. */ 1399 GCC warning that YYVAL may be used uninitialized. */
1447 yyval = yyvsp[1-yylen]; 1400 yyval = yyvsp[1-yylen];
1448 1401
1449 /* Default location. */ 1402
1450 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1451 YY_REDUCE_PRINT (yyn); 1403 YY_REDUCE_PRINT (yyn);
1452 switch (yyn) 1404 switch (yyn)
1453 { 1405 {
1454 case 2: 1406 case 2:
1455#line 90 "dtc-parser.y" 1407
1408/* Line 1455 of yacc.c */
1409#line 87 "dtc-parser.y"
1456 { 1410 {
1457 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), 0); 1411 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
1412 guess_boot_cpuid((yyvsp[(4) - (4)].node)));
1458 ;} 1413 ;}
1459 break; 1414 break;
1460 1415
1461 case 3: 1416 case 3:
1462#line 94 "dtc-parser.y" 1417
1418/* Line 1455 of yacc.c */
1419#line 95 "dtc-parser.y"
1463 { 1420 {
1464 the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node), 0); 1421 (yyval.re) = NULL;
1465 ;} 1422 ;}
1466 break; 1423 break;
1467 1424
1468 case 4: 1425 case 4:
1469#line 101 "dtc-parser.y" 1426
1427/* Line 1455 of yacc.c */
1428#line 99 "dtc-parser.y"
1470 { 1429 {
1471 (yyval.re) = NULL; 1430 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1472 ;} 1431 ;}
1473 break; 1432 break;
1474 1433
1475 case 5: 1434 case 5:
1476#line 105 "dtc-parser.y" 1435
1436/* Line 1455 of yacc.c */
1437#line 106 "dtc-parser.y"
1477 { 1438 {
1478 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re)); 1439 (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr));
1479 ;} 1440 ;}
1480 break; 1441 break;
1481 1442
1482 case 6: 1443 case 6:
1483#line 112 "dtc-parser.y" 1444
1445/* Line 1455 of yacc.c */
1446#line 110 "dtc-parser.y"
1484 { 1447 {
1485 (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref)); 1448 add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
1449 (yyval.re) = (yyvsp[(2) - (2)].re);
1486 ;} 1450 ;}
1487 break; 1451 break;
1488 1452
1489 case 7: 1453 case 7:
1490#line 119 "dtc-parser.y" 1454
1455/* Line 1455 of yacc.c */
1456#line 118 "dtc-parser.y"
1491 { 1457 {
1492 (yyval.re) = NULL; 1458 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1493 ;} 1459 ;}
1494 break; 1460 break;
1495 1461
1496 case 8: 1462 case 8:
1497#line 123 "dtc-parser.y" 1463
1464/* Line 1455 of yacc.c */
1465#line 125 "dtc-parser.y"
1498 { 1466 {
1499 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re)); 1467 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
1500 ;} 1468 ;}
1501 break; 1469 break;
1502 1470
1503 case 9: 1471 case 9:
1504#line 130 "dtc-parser.y" 1472
1473/* Line 1455 of yacc.c */
1474#line 129 "dtc-parser.y"
1505 { 1475 {
1506 (yyval.re) = (yyvsp[(1) - (1)].re); 1476 (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1507 ;} 1477 ;}
1508 break; 1478 break;
1509 1479
1510 case 10: 1480 case 10:
1511#line 134 "dtc-parser.y" 1481
1482/* Line 1455 of yacc.c */
1483#line 133 "dtc-parser.y"
1512 { 1484 {
1513 (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref)); 1485 struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
1486
1487 if (target)
1488 merge_nodes(target, (yyvsp[(3) - (3)].node));
1489 else
1490 print_error("label or path, '%s', not found", (yyvsp[(2) - (3)].labelref));
1491 (yyval.node) = (yyvsp[(1) - (3)].node);
1514 ;} 1492 ;}
1515 break; 1493 break;
1516 1494
1517 case 11: 1495 case 11:
1518#line 141 "dtc-parser.y" 1496
1497/* Line 1455 of yacc.c */
1498#line 146 "dtc-parser.y"
1519 { 1499 {
1520 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64); 1500 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1521 ;} 1501 ;}
1522 break; 1502 break;
1523 1503
1524 case 12: 1504 case 12:
1525#line 145 "dtc-parser.y" 1505
1506/* Line 1455 of yacc.c */
1507#line 153 "dtc-parser.y"
1526 { 1508 {
1527 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64); 1509 (yyval.proplist) = NULL;
1528 ;} 1510 ;}
1529 break; 1511 break;
1530 1512
1531 case 13: 1513 case 13:
1532#line 152 "dtc-parser.y" 1514
1515/* Line 1455 of yacc.c */
1516#line 157 "dtc-parser.y"
1533 { 1517 {
1534 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL); 1518 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1535 ;} 1519 ;}
1536 break; 1520 break;
1537 1521
1538 case 14: 1522 case 14:
1539#line 159 "dtc-parser.y" 1523
1524/* Line 1455 of yacc.c */
1525#line 164 "dtc-parser.y"
1540 { 1526 {
1541 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist)); 1527 (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
1542 ;} 1528 ;}
1543 break; 1529 break;
1544 1530
1545 case 15: 1531 case 15:
1546#line 166 "dtc-parser.y" 1532
1533/* Line 1455 of yacc.c */
1534#line 168 "dtc-parser.y"
1547 { 1535 {
1548 (yyval.proplist) = NULL; 1536 (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
1549 ;} 1537 ;}
1550 break; 1538 break;
1551 1539
1552 case 16: 1540 case 16:
1553#line 170 "dtc-parser.y" 1541
1542/* Line 1455 of yacc.c */
1543#line 172 "dtc-parser.y"
1554 { 1544 {
1555 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist)); 1545 add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
1546 (yyval.prop) = (yyvsp[(2) - (2)].prop);
1556 ;} 1547 ;}
1557 break; 1548 break;
1558 1549
1559 case 17: 1550 case 17:
1560#line 177 "dtc-parser.y" 1551
1552/* Line 1455 of yacc.c */
1553#line 180 "dtc-parser.y"
1561 { 1554 {
1562 (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref)); 1555 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1563 ;} 1556 ;}
1564 break; 1557 break;
1565 1558
1566 case 18: 1559 case 18:
1567#line 181 "dtc-parser.y" 1560
1561/* Line 1455 of yacc.c */
1562#line 184 "dtc-parser.y"
1568 { 1563 {
1569 (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref)); 1564 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1570 ;} 1565 ;}
1571 break; 1566 break;
1572 1567
1573 case 19: 1568 case 19:
1569
1570/* Line 1455 of yacc.c */
1574#line 188 "dtc-parser.y" 1571#line 188 "dtc-parser.y"
1575 { 1572 {
1576 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data)); 1573 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1577 ;} 1574 ;}
1578 break; 1575 break;
1579 1576
1580 case 20: 1577 case 20:
1578
1579/* Line 1455 of yacc.c */
1581#line 192 "dtc-parser.y" 1580#line 192 "dtc-parser.y"
1582 { 1581 {
1583 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data)); 1582 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1584 ;} 1583 ;}
1585 break; 1584 break;
1586 1585
1587 case 21: 1586 case 21:
1588#line 196 "dtc-parser.y"
1589 {
1590 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1591 ;}
1592 break;
1593
1594 case 22:
1595#line 200 "dtc-parser.y"
1596 {
1597 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1598 ;}
1599 break;
1600 1587
1601 case 23: 1588/* Line 1455 of yacc.c */
1602#line 204 "dtc-parser.y" 1589#line 196 "dtc-parser.y"
1603 { 1590 {
1604 struct search_path path = { srcpos_file->dir, NULL, NULL }; 1591 FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
1605 struct dtc_file *file = dtc_open_file((yyvsp[(4) - (9)].data).val, &path); 1592 struct data d;
1606 struct data d = empty_data;
1607 1593
1608 if ((yyvsp[(6) - (9)].addr) != 0) 1594 if ((yyvsp[(6) - (9)].addr) != 0)
1609 if (fseek(file->file, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0) 1595 if (fseek(f, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0)
1610 yyerrorf("Couldn't seek to offset %llu in \"%s\": %s", 1596 print_error("Couldn't seek to offset %llu in \"%s\": %s",
1611 (unsigned long long)(yyvsp[(6) - (9)].addr), 1597 (unsigned long long)(yyvsp[(6) - (9)].addr),
1612 (yyvsp[(4) - (9)].data).val, strerror(errno)); 1598 (yyvsp[(4) - (9)].data).val,
1599 strerror(errno));
1613 1600
1614 d = data_copy_file(file->file, (yyvsp[(8) - (9)].addr)); 1601 d = data_copy_file(f, (yyvsp[(8) - (9)].addr));
1615 1602
1616 (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d); 1603 (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
1617 dtc_close_file(file); 1604 fclose(f);
1618 ;} 1605 ;}
1619 break; 1606 break;
1620 1607
1621 case 24: 1608 case 22:
1622#line 221 "dtc-parser.y" 1609
1610/* Line 1455 of yacc.c */
1611#line 213 "dtc-parser.y"
1623 { 1612 {
1624 struct search_path path = { srcpos_file->dir, NULL, NULL }; 1613 FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
1625 struct dtc_file *file = dtc_open_file((yyvsp[(4) - (5)].data).val, &path);
1626 struct data d = empty_data; 1614 struct data d = empty_data;
1627 1615
1628 d = data_copy_file(file->file, -1); 1616 d = data_copy_file(f, -1);
1629 1617
1630 (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d); 1618 (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
1631 dtc_close_file(file); 1619 fclose(f);
1632 ;} 1620 ;}
1633 break; 1621 break;
1634 1622
1635 case 25: 1623 case 23:
1636#line 232 "dtc-parser.y" 1624
1625/* Line 1455 of yacc.c */
1626#line 223 "dtc-parser.y"
1637 { 1627 {
1638 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1628 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1639 ;} 1629 ;}
1640 break; 1630 break;
1641 1631
1642 case 26: 1632 case 24:
1643#line 239 "dtc-parser.y" 1633
1634/* Line 1455 of yacc.c */
1635#line 230 "dtc-parser.y"
1644 { 1636 {
1645 (yyval.data) = empty_data; 1637 (yyval.data) = empty_data;
1646 ;} 1638 ;}
1647 break; 1639 break;
1648 1640
1649 case 27: 1641 case 25:
1650#line 243 "dtc-parser.y" 1642
1643/* Line 1455 of yacc.c */
1644#line 234 "dtc-parser.y"
1651 { 1645 {
1652 (yyval.data) = (yyvsp[(1) - (2)].data); 1646 (yyval.data) = (yyvsp[(1) - (2)].data);
1653 ;} 1647 ;}
1654 break; 1648 break;
1655 1649
1656 case 28: 1650 case 26:
1657#line 247 "dtc-parser.y" 1651
1652/* Line 1455 of yacc.c */
1653#line 238 "dtc-parser.y"
1658 { 1654 {
1659 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1655 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1660 ;} 1656 ;}
1661 break; 1657 break;
1662 1658
1663 case 29: 1659 case 27:
1664#line 254 "dtc-parser.y" 1660
1661/* Line 1455 of yacc.c */
1662#line 245 "dtc-parser.y"
1665 { 1663 {
1666 (yyval.data) = empty_data; 1664 (yyval.data) = empty_data;
1667 ;} 1665 ;}
1668 break; 1666 break;
1669 1667
1670 case 30: 1668 case 28:
1671#line 258 "dtc-parser.y" 1669
1670/* Line 1455 of yacc.c */
1671#line 249 "dtc-parser.y"
1672 { 1672 {
1673 (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell)); 1673 (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
1674 ;} 1674 ;}
1675 break; 1675 break;
1676 1676
1677 case 31: 1677 case 29:
1678#line 262 "dtc-parser.y" 1678
1679/* Line 1455 of yacc.c */
1680#line 253 "dtc-parser.y"
1679 { 1681 {
1680 (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE, 1682 (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
1681 (yyvsp[(2) - (2)].labelref)), -1); 1683 (yyvsp[(2) - (2)].labelref)), -1);
1682 ;} 1684 ;}
1683 break; 1685 break;
1684 1686
1685 case 32: 1687 case 30:
1686#line 267 "dtc-parser.y" 1688
1689/* Line 1455 of yacc.c */
1690#line 258 "dtc-parser.y"
1687 { 1691 {
1688 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1692 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1689 ;} 1693 ;}
1690 break; 1694 break;
1691 1695
1692 case 33: 1696 case 31:
1693#line 274 "dtc-parser.y"
1694 {
1695 (yyval.cbase) = 16;
1696 ;}
1697 break;
1698 1697
1699 case 35: 1698/* Line 1455 of yacc.c */
1700#line 282 "dtc-parser.y" 1699#line 265 "dtc-parser.y"
1701 { 1700 {
1702 (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32); 1701 (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
1703 ;} 1702 ;}
1704 break; 1703 break;
1705 1704
1706 case 36: 1705 case 32:
1707#line 286 "dtc-parser.y"
1708 {
1709 (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
1710 ;}
1711 break;
1712 1706
1713 case 37: 1707/* Line 1455 of yacc.c */
1714#line 293 "dtc-parser.y" 1708#line 272 "dtc-parser.y"
1715 { 1709 {
1716 (yyval.data) = empty_data; 1710 (yyval.data) = empty_data;
1717 ;} 1711 ;}
1718 break; 1712 break;
1719 1713
1720 case 38: 1714 case 33:
1721#line 297 "dtc-parser.y" 1715
1716/* Line 1455 of yacc.c */
1717#line 276 "dtc-parser.y"
1722 { 1718 {
1723 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte)); 1719 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
1724 ;} 1720 ;}
1725 break; 1721 break;
1726 1722
1727 case 39: 1723 case 34:
1728#line 301 "dtc-parser.y" 1724
1725/* Line 1455 of yacc.c */
1726#line 280 "dtc-parser.y"
1729 { 1727 {
1730 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref)); 1728 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1731 ;} 1729 ;}
1732 break; 1730 break;
1733 1731
1734 case 40: 1732 case 35:
1735#line 308 "dtc-parser.y" 1733
1734/* Line 1455 of yacc.c */
1735#line 287 "dtc-parser.y"
1736 { 1736 {
1737 (yyval.nodelist) = NULL; 1737 (yyval.nodelist) = NULL;
1738 ;} 1738 ;}
1739 break; 1739 break;
1740 1740
1741 case 41: 1741 case 36:
1742#line 312 "dtc-parser.y" 1742
1743/* Line 1455 of yacc.c */
1744#line 291 "dtc-parser.y"
1743 { 1745 {
1744 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist)); 1746 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
1745 ;} 1747 ;}
1746 break; 1748 break;
1747 1749
1748 case 42: 1750 case 37:
1749#line 316 "dtc-parser.y" 1751
1752/* Line 1455 of yacc.c */
1753#line 295 "dtc-parser.y"
1750 { 1754 {
1751 yyerror("syntax error: properties must precede subnodes"); 1755 print_error("syntax error: properties must precede subnodes");
1752 YYERROR; 1756 YYERROR;
1753 ;} 1757 ;}
1754 break; 1758 break;
1755 1759
1756 case 43: 1760 case 38:
1757#line 324 "dtc-parser.y"
1758 {
1759 (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
1760 ;}
1761 break;
1762 1761
1763 case 44: 1762/* Line 1455 of yacc.c */
1764#line 331 "dtc-parser.y" 1763#line 303 "dtc-parser.y"
1765 { 1764 {
1766 (yyval.labelref) = NULL; 1765 (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
1767 ;} 1766 ;}
1768 break; 1767 break;
1769 1768
1770 case 45: 1769 case 39:
1771#line 335 "dtc-parser.y" 1770
1771/* Line 1455 of yacc.c */
1772#line 307 "dtc-parser.y"
1772 { 1773 {
1773 (yyval.labelref) = (yyvsp[(1) - (1)].labelref); 1774 add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
1775 (yyval.node) = (yyvsp[(2) - (2)].node);
1774 ;} 1776 ;}
1775 break; 1777 break;
1776 1778
1777 1779
1778/* Line 1267 of yacc.c. */ 1780
1779#line 1780 "dtc-parser.tab.c" 1781/* Line 1455 of yacc.c */
1782#line 1783 "dtc-parser.tab.c"
1780 default: break; 1783 default: break;
1781 } 1784 }
1782 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1785 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -1786,7 +1789,6 @@ yyreduce:
1786 YY_STACK_PRINT (yyss, yyssp); 1789 YY_STACK_PRINT (yyss, yyssp);
1787 1790
1788 *++yyvsp = yyval; 1791 *++yyvsp = yyval;
1789 *++yylsp = yyloc;
1790 1792
1791 /* Now `shift' the result of the reduction. Determine what state 1793 /* Now `shift' the result of the reduction. Determine what state
1792 that goes to, based on the state we popped back to and the rule 1794 that goes to, based on the state we popped back to and the rule
@@ -1848,11 +1850,11 @@ yyerrlab:
1848#endif 1850#endif
1849 } 1851 }
1850 1852
1851 yyerror_range[0] = yylloc; 1853
1852 1854
1853 if (yyerrstatus == 3) 1855 if (yyerrstatus == 3)
1854 { 1856 {
1855 /* If just tried and failed to reuse look-ahead token after an 1857 /* If just tried and failed to reuse lookahead token after an
1856 error, discard it. */ 1858 error, discard it. */
1857 1859
1858 if (yychar <= YYEOF) 1860 if (yychar <= YYEOF)
@@ -1864,12 +1866,12 @@ yyerrlab:
1864 else 1866 else
1865 { 1867 {
1866 yydestruct ("Error: discarding", 1868 yydestruct ("Error: discarding",
1867 yytoken, &yylval, &yylloc); 1869 yytoken, &yylval);
1868 yychar = YYEMPTY; 1870 yychar = YYEMPTY;
1869 } 1871 }
1870 } 1872 }
1871 1873
1872 /* Else will try to reuse look-ahead token after shifting the error 1874 /* Else will try to reuse lookahead token after shifting the error
1873 token. */ 1875 token. */
1874 goto yyerrlab1; 1876 goto yyerrlab1;
1875 1877
@@ -1885,7 +1887,6 @@ yyerrorlab:
1885 if (/*CONSTCOND*/ 0) 1887 if (/*CONSTCOND*/ 0)
1886 goto yyerrorlab; 1888 goto yyerrorlab;
1887 1889
1888 yyerror_range[0] = yylsp[1-yylen];
1889 /* Do not reclaim the symbols of the rule which action triggered 1890 /* Do not reclaim the symbols of the rule which action triggered
1890 this YYERROR. */ 1891 this YYERROR. */
1891 YYPOPSTACK (yylen); 1892 YYPOPSTACK (yylen);
@@ -1919,24 +1920,16 @@ yyerrlab1:
1919 if (yyssp == yyss) 1920 if (yyssp == yyss)
1920 YYABORT; 1921 YYABORT;
1921 1922
1922 yyerror_range[0] = *yylsp; 1923
1923 yydestruct ("Error: popping", 1924 yydestruct ("Error: popping",
1924 yystos[yystate], yyvsp, yylsp); 1925 yystos[yystate], yyvsp);
1925 YYPOPSTACK (1); 1926 YYPOPSTACK (1);
1926 yystate = *yyssp; 1927 yystate = *yyssp;
1927 YY_STACK_PRINT (yyss, yyssp); 1928 YY_STACK_PRINT (yyss, yyssp);
1928 } 1929 }
1929 1930
1930 if (yyn == YYFINAL)
1931 YYACCEPT;
1932
1933 *++yyvsp = yylval; 1931 *++yyvsp = yylval;
1934 1932
1935 yyerror_range[1] = yylloc;
1936 /* Using YYLLOC is tempting, but would change the location of
1937 the look-ahead. YYLOC is available though. */
1938 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
1939 *++yylsp = yyloc;
1940 1933
1941 /* Shift the error token. */ 1934 /* Shift the error token. */
1942 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1935 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
@@ -1959,7 +1952,7 @@ yyabortlab:
1959 yyresult = 1; 1952 yyresult = 1;
1960 goto yyreturn; 1953 goto yyreturn;
1961 1954
1962#ifndef yyoverflow 1955#if !defined(yyoverflow) || YYERROR_VERBOSE
1963/*-------------------------------------------------. 1956/*-------------------------------------------------.
1964| yyexhaustedlab -- memory exhaustion comes here. | 1957| yyexhaustedlab -- memory exhaustion comes here. |
1965`-------------------------------------------------*/ 1958`-------------------------------------------------*/
@@ -1970,9 +1963,9 @@ yyexhaustedlab:
1970#endif 1963#endif
1971 1964
1972yyreturn: 1965yyreturn:
1973 if (yychar != YYEOF && yychar != YYEMPTY) 1966 if (yychar != YYEMPTY)
1974 yydestruct ("Cleanup: discarding lookahead", 1967 yydestruct ("Cleanup: discarding lookahead",
1975 yytoken, &yylval, &yylloc); 1968 yytoken, &yylval);
1976 /* Do not reclaim the symbols of the rule which action triggered 1969 /* Do not reclaim the symbols of the rule which action triggered
1977 this YYABORT or YYACCEPT. */ 1970 this YYABORT or YYACCEPT. */
1978 YYPOPSTACK (yylen); 1971 YYPOPSTACK (yylen);
@@ -1980,7 +1973,7 @@ yyreturn:
1980 while (yyssp != yyss) 1973 while (yyssp != yyss)
1981 { 1974 {
1982 yydestruct ("Cleanup: popping", 1975 yydestruct ("Cleanup: popping",
1983 yystos[*yyssp], yyvsp, yylsp); 1976 yystos[*yyssp], yyvsp);
1984 YYPOPSTACK (1); 1977 YYPOPSTACK (1);
1985 } 1978 }
1986#ifndef yyoverflow 1979#ifndef yyoverflow
@@ -1996,29 +1989,24 @@ yyreturn:
1996} 1989}
1997 1990
1998 1991
1999#line 340 "dtc-parser.y" 1992
1993/* Line 1675 of yacc.c */
1994#line 313 "dtc-parser.y"
2000 1995
2001 1996
2002void yyerrorf(char const *s, ...) 1997void print_error(char const *fmt, ...)
2003{ 1998{
2004 const char *fname = srcpos_file ? srcpos_file->name : "<no-file>";
2005 va_list va; 1999 va_list va;
2006 va_start(va, s);
2007
2008 if (strcmp(fname, "-") == 0)
2009 fname = "stdin";
2010 2000
2011 fprintf(stderr, "%s:%d ", fname, yylloc.first_line); 2001 va_start(va, fmt);
2012 vfprintf(stderr, s, va); 2002 srcpos_verror(&yylloc, fmt, va);
2013 fprintf(stderr, "\n"); 2003 va_end(va);
2014 2004
2015 treesource_error = 1; 2005 treesource_error = 1;
2016 va_end(va);
2017} 2006}
2018 2007
2019void yyerror (char const *s) 2008void yyerror(char const *s) {
2020{ 2009 print_error("%s", s);
2021 yyerrorf("%s", s);
2022} 2010}
2023 2011
2024static unsigned long long eval_literal(const char *s, int base, int bits) 2012static unsigned long long eval_literal(const char *s, int base, int bits)
@@ -2029,12 +2017,12 @@ static unsigned long long eval_literal(const char *s, int base, int bits)
2029 errno = 0; 2017 errno = 0;
2030 val = strtoull(s, &e, base); 2018 val = strtoull(s, &e, base);
2031 if (*e) 2019 if (*e)
2032 yyerror("bad characters in literal"); 2020 print_error("bad characters in literal");
2033 else if ((errno == ERANGE) 2021 else if ((errno == ERANGE)
2034 || ((bits < 64) && (val >= (1ULL << bits)))) 2022 || ((bits < 64) && (val >= (1ULL << bits))))
2035 yyerror("literal out of range"); 2023 print_error("literal out of range");
2036 else if (errno != 0) 2024 else if (errno != 0)
2037 yyerror("bad literal"); 2025 print_error("bad literal");
2038 return val; 2026 return val;
2039} 2027}
2040 2028