Coverage Report

Created: 2026-04-04 08:16

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/binutils-gdb/binutils/defparse.c
Line
Count
Source
1
/* A Bison parser, made by GNU Bison 3.5.1.  */
2
3
/* Bison implementation for Yacc-like parsers in C
4
5
   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
6
   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
/* Undocumented macros, especially those whose name start with YY_,
45
   are private implementation details.  Do not rely on them.  */
46
47
/* Identify Bison output.  */
48
#define YYBISON 1
49
50
/* Bison version.  */
51
#define YYBISON_VERSION "3.5.1"
52
53
/* Skeleton name.  */
54
#define YYSKELETON_NAME "yacc.c"
55
56
/* Pure parsers.  */
57
#define YYPURE 0
58
59
/* Push parsers.  */
60
#define YYPUSH 0
61
62
/* Pull parsers.  */
63
#define YYPULL 1
64
65
66
67
68
/* First part of user prologue.  */
69
#line 1 "defparse.y"
70
 /* defparse.y - parser for .def files */
71
72
/* Copyright (C) 1995-2026 Free Software Foundation, Inc.
73
74
   This file is part of GNU Binutils.
75
76
   This program is free software; you can redistribute it and/or modify
77
   it under the terms of the GNU General Public License as published by
78
   the Free Software Foundation; either version 3 of the License, or
79
   (at your option) any later version.
80
81
   This program is distributed in the hope that it will be useful,
82
   but WITHOUT ANY WARRANTY; without even the implied warranty of
83
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
84
   GNU General Public License for more details.
85
86
   You should have received a copy of the GNU General Public License
87
   along with this program; if not, write to the Free Software
88
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
89
   MA 02110-1301, USA.  */
90
91
#include "sysdep.h"
92
#include "bfd.h"
93
#include "libiberty.h"
94
#include "dlltool.h"
95
96
#line 97 "defparse.c"
97
98
# ifndef YY_CAST
99
#  ifdef __cplusplus
100
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
101
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
102
#  else
103
236
#   define YY_CAST(Type, Val) ((Type) (Val))
104
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
105
#  endif
106
# endif
107
# ifndef YY_NULLPTR
108
#  if defined __cplusplus
109
#   if 201103L <= __cplusplus
110
#    define YY_NULLPTR nullptr
111
#   else
112
#    define YY_NULLPTR 0
113
#   endif
114
#  else
115
#   define YY_NULLPTR ((void*)0)
116
#  endif
117
# endif
118
119
/* Enabling verbose error messages.  */
120
#ifdef YYERROR_VERBOSE
121
# undef YYERROR_VERBOSE
122
# define YYERROR_VERBOSE 1
123
#else
124
# define YYERROR_VERBOSE 0
125
#endif
126
127
/* Use api.header.include to #include this header
128
   instead of duplicating it here.  */
129
#ifndef YY_YY_DEFPARSE_H_INCLUDED
130
# define YY_YY_DEFPARSE_H_INCLUDED
131
/* Debug traces.  */
132
#ifndef YYDEBUG
133
# define YYDEBUG 0
134
#endif
135
#if YYDEBUG
136
extern int yydebug;
137
#endif
138
139
/* Token type.  */
140
#ifndef YYTOKENTYPE
141
# define YYTOKENTYPE
142
  enum yytokentype
143
  {
144
    NAME = 258,
145
    LIBRARY = 259,
146
    DESCRIPTION = 260,
147
    STACKSIZE = 261,
148
    HEAPSIZE = 262,
149
    CODE = 263,
150
    DATA = 264,
151
    SECTIONS = 265,
152
    EXPORTS = 266,
153
    IMPORTS = 267,
154
    VERSIONK = 268,
155
    BASE = 269,
156
    CONSTANT = 270,
157
    READ = 271,
158
    WRITE = 272,
159
    EXECUTE = 273,
160
    SHARED = 274,
161
    NONSHARED = 275,
162
    NONAME = 276,
163
    PRIVATE = 277,
164
    SINGLE = 278,
165
    MULTIPLE = 279,
166
    INITINSTANCE = 280,
167
    INITGLOBAL = 281,
168
    TERMINSTANCE = 282,
169
    TERMGLOBAL = 283,
170
    EQUAL = 284,
171
    ID = 285,
172
    NUMBER = 286
173
  };
174
#endif
175
/* Tokens.  */
176
#define NAME 258
177
#define LIBRARY 259
178
#define DESCRIPTION 260
179
#define STACKSIZE 261
180
#define HEAPSIZE 262
181
#define CODE 263
182
#define DATA 264
183
#define SECTIONS 265
184
#define EXPORTS 266
185
#define IMPORTS 267
186
#define VERSIONK 268
187
#define BASE 269
188
#define CONSTANT 270
189
#define READ 271
190
#define WRITE 272
191
#define EXECUTE 273
192
#define SHARED 274
193
#define NONSHARED 275
194
#define NONAME 276
195
#define PRIVATE 277
196
#define SINGLE 278
197
#define MULTIPLE 279
198
#define INITINSTANCE 280
199
#define INITGLOBAL 281
200
#define TERMINSTANCE 282
201
#define TERMGLOBAL 283
202
#define EQUAL 284
203
#define ID 285
204
#define NUMBER 286
205
206
/* Value type.  */
207
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
208
union YYSTYPE
209
{
210
#line 28 "defparse.y"
211
212
  char *id;
213
  const char *id_const;
214
  int number;
215
216
#line 217 "defparse.c"
217
218
};
219
typedef union YYSTYPE YYSTYPE;
220
# define YYSTYPE_IS_TRIVIAL 1
221
# define YYSTYPE_IS_DECLARED 1
222
#endif
223
224
225
extern YYSTYPE yylval;
226
227
int yyparse (void);
228
229
#endif /* !YY_YY_DEFPARSE_H_INCLUDED  */
230
231
232
233
#ifdef short
234
# undef short
235
#endif
236
237
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
238
   <limits.h> and (if available) <stdint.h> are included
239
   so that the code can choose integer types of a good width.  */
240
241
#ifndef __PTRDIFF_MAX__
242
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
243
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
244
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
245
#  define YY_STDINT_H
246
# endif
247
#endif
248
249
/* Narrow types that promote to a signed type and that can represent a
250
   signed or unsigned integer of at least N bits.  In tables they can
251
   save space and decrease cache pressure.  Promoting to a signed type
252
   helps avoid bugs in integer arithmetic.  */
253
254
#ifdef __INT_LEAST8_MAX__
255
typedef __INT_LEAST8_TYPE__ yytype_int8;
256
#elif defined YY_STDINT_H
257
typedef int_least8_t yytype_int8;
258
#else
259
typedef signed char yytype_int8;
260
#endif
261
262
#ifdef __INT_LEAST16_MAX__
263
typedef __INT_LEAST16_TYPE__ yytype_int16;
264
#elif defined YY_STDINT_H
265
typedef int_least16_t yytype_int16;
266
#else
267
typedef short yytype_int16;
268
#endif
269
270
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
271
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
272
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
273
       && UINT_LEAST8_MAX <= INT_MAX)
274
typedef uint_least8_t yytype_uint8;
275
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
276
typedef unsigned char yytype_uint8;
277
#else
278
typedef short yytype_uint8;
279
#endif
280
281
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
282
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
283
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
284
       && UINT_LEAST16_MAX <= INT_MAX)
285
typedef uint_least16_t yytype_uint16;
286
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
287
typedef unsigned short yytype_uint16;
288
#else
289
typedef int yytype_uint16;
290
#endif
291
292
#ifndef YYPTRDIFF_T
293
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
294
236
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
295
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
296
# elif defined PTRDIFF_MAX
297
#  ifndef ptrdiff_t
298
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
299
#  endif
300
#  define YYPTRDIFF_T ptrdiff_t
301
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
302
# else
303
#  define YYPTRDIFF_T long
304
#  define YYPTRDIFF_MAXIMUM LONG_MAX
305
# endif
306
#endif
307
308
#ifndef YYSIZE_T
309
# ifdef __SIZE_TYPE__
310
#  define YYSIZE_T __SIZE_TYPE__
311
# elif defined size_t
312
#  define YYSIZE_T size_t
313
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
314
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
315
#  define YYSIZE_T size_t
316
# else
317
#  define YYSIZE_T unsigned
318
# endif
319
#endif
320
321
#define YYSIZE_MAXIMUM                                  \
322
  YY_CAST (YYPTRDIFF_T,                                 \
323
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
324
            ? YYPTRDIFF_MAXIMUM                         \
325
            : YY_CAST (YYSIZE_T, -1)))
326
327
0
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
328
329
/* Stored state numbers (used for stacks). */
330
typedef yytype_uint8 yy_state_t;
331
332
/* State numbers in computations.  */
333
typedef int yy_state_fast_t;
334
335
#ifndef YY_
336
# if defined YYENABLE_NLS && YYENABLE_NLS
337
#  if ENABLE_NLS
338
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
339
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
340
#  endif
341
# endif
342
# ifndef YY_
343
236
#  define YY_(Msgid) Msgid
344
# endif
345
#endif
346
347
#ifndef YY_ATTRIBUTE_PURE
348
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
349
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
350
# else
351
#  define YY_ATTRIBUTE_PURE
352
# endif
353
#endif
354
355
#ifndef YY_ATTRIBUTE_UNUSED
356
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
357
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
358
# else
359
#  define YY_ATTRIBUTE_UNUSED
360
# endif
361
#endif
362
363
/* Suppress unused-variable warnings by "using" E.  */
364
#if ! defined lint || defined __GNUC__
365
236
# define YYUSE(E) ((void) (E))
366
#else
367
# define YYUSE(E) /* empty */
368
#endif
369
370
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
371
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
372
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
373
    _Pragma ("GCC diagnostic push")                                     \
374
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
375
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
376
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
377
    _Pragma ("GCC diagnostic pop")
378
#else
379
# define YY_INITIAL_VALUE(Value) Value
380
#endif
381
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
382
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
383
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
384
#endif
385
#ifndef YY_INITIAL_VALUE
386
# define YY_INITIAL_VALUE(Value) /* Nothing. */
387
#endif
388
389
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
390
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
391
    _Pragma ("GCC diagnostic push")                            \
392
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
393
# define YY_IGNORE_USELESS_CAST_END            \
394
    _Pragma ("GCC diagnostic pop")
395
#endif
396
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
397
# define YY_IGNORE_USELESS_CAST_BEGIN
398
# define YY_IGNORE_USELESS_CAST_END
399
#endif
400
401
402
236
#define YY_ASSERT(E) ((void) (0 && (E)))
403
404
#if ! defined yyoverflow || YYERROR_VERBOSE
405
406
/* The parser invokes alloca or malloc; define the necessary symbols.  */
407
408
# ifdef YYSTACK_USE_ALLOCA
409
#  if YYSTACK_USE_ALLOCA
410
#   ifdef __GNUC__
411
#    define YYSTACK_ALLOC __builtin_alloca
412
#   elif defined __BUILTIN_VA_ARG_INCR
413
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
414
#   elif defined _AIX
415
#    define YYSTACK_ALLOC __alloca
416
#   elif defined _MSC_VER
417
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
418
#    define alloca _alloca
419
#   else
420
#    define YYSTACK_ALLOC alloca
421
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
422
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
423
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
424
#     ifndef EXIT_SUCCESS
425
#      define EXIT_SUCCESS 0
426
#     endif
427
#    endif
428
#   endif
429
#  endif
430
# endif
431
432
# ifdef YYSTACK_ALLOC
433
   /* Pacify GCC's 'empty if-body' warning.  */
434
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
435
#  ifndef YYSTACK_ALLOC_MAXIMUM
436
    /* The OS might guarantee only one guard page at the bottom of the stack,
437
       and a page size can be as small as 4096 bytes.  So we cannot safely
438
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
439
       to allow for a few compiler-allocated temporary stack slots.  */
440
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
441
#  endif
442
# else
443
#  define YYSTACK_ALLOC YYMALLOC
444
0
#  define YYSTACK_FREE YYFREE
445
#  ifndef YYSTACK_ALLOC_MAXIMUM
446
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
447
#  endif
448
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
449
       && ! ((defined YYMALLOC || defined malloc) \
450
             && (defined YYFREE || defined free)))
451
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452
#   ifndef EXIT_SUCCESS
453
#    define EXIT_SUCCESS 0
454
#   endif
455
#  endif
456
#  ifndef YYMALLOC
457
#   define YYMALLOC malloc
458
#   if ! defined malloc && ! defined EXIT_SUCCESS
459
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
460
#   endif
461
#  endif
462
#  ifndef YYFREE
463
0
#   define YYFREE free
464
#   if ! defined free && ! defined EXIT_SUCCESS
465
void free (void *); /* INFRINGES ON USER NAME SPACE */
466
#   endif
467
#  endif
468
# endif
469
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
470
471
472
#if (! defined yyoverflow \
473
     && (! defined __cplusplus \
474
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
475
476
/* A type that is properly aligned for any stack member.  */
477
union yyalloc
478
{
479
  yy_state_t yyss_alloc;
480
  YYSTYPE yyvs_alloc;
481
};
482
483
/* The size of the maximum gap between one aligned stack and the next.  */
484
0
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
485
486
/* The size of an array large to enough to hold all stacks, each with
487
   N elements.  */
488
# define YYSTACK_BYTES(N) \
489
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
490
      + YYSTACK_GAP_MAXIMUM)
491
492
# define YYCOPY_NEEDED 1
493
494
/* Relocate STACK from its old location to the new one.  The
495
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
496
   elements in the stack, and YYPTR gives the new location of the
497
   stack.  Advance YYPTR to a properly aligned location for the next
498
   stack.  */
499
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
500
0
    do                                                                  \
501
0
      {                                                                 \
502
0
        YYPTRDIFF_T yynewbytes;                                         \
503
0
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
504
0
        Stack = &yyptr->Stack_alloc;                                    \
505
0
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
506
0
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
507
0
      }                                                                 \
508
0
    while (0)
509
510
#endif
511
512
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
513
/* Copy COUNT objects from SRC to DST.  The source and destination do
514
   not overlap.  */
515
# ifndef YYCOPY
516
#  if defined __GNUC__ && 1 < __GNUC__
517
#   define YYCOPY(Dst, Src, Count) \
518
0
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
519
#  else
520
#   define YYCOPY(Dst, Src, Count)              \
521
      do                                        \
522
        {                                       \
523
          YYPTRDIFF_T yyi;                      \
524
          for (yyi = 0; yyi < (Count); yyi++)   \
525
            (Dst)[yyi] = (Src)[yyi];            \
526
        }                                       \
527
      while (0)
528
#  endif
529
# endif
530
#endif /* !YYCOPY_NEEDED */
531
532
/* YYFINAL -- State number of the termination state.  */
533
236
#define YYFINAL  66
534
/* YYLAST -- Last index in YYTABLE.  */
535
708
#define YYLAST   141
536
537
/* YYNTOKENS -- Number of terminals.  */
538
0
#define YYNTOKENS  36
539
/* YYNNTS -- Number of nonterminals.  */
540
#define YYNNTS  26
541
/* YYNRULES -- Number of rules.  */
542
#define YYNRULES  98
543
/* YYNSTATES -- Number of states.  */
544
#define YYNSTATES  139
545
546
0
#define YYUNDEFTOK  2
547
706
#define YYMAXUTOK   286
548
549
550
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
551
   as returned by yylex, with out-of-bounds checking.  */
552
#define YYTRANSLATE(YYX)                                                \
553
942
  (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
554
555
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
556
   as returned by yylex.  */
557
static const yytype_int8 yytranslate[] =
558
{
559
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
560
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
561
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
562
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
563
       2,     2,     2,     2,    34,     2,    32,     2,     2,     2,
564
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
565
       2,    33,     2,     2,    35,     2,     2,     2,     2,     2,
566
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
567
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
568
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
569
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
570
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
571
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
572
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
573
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
574
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
575
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
576
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
577
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
578
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
579
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
580
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
581
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
582
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
583
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
584
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
585
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
586
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
587
      25,    26,    27,    28,    29,    30,    31
588
};
589
590
#if YYDEBUG
591
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
592
static const yytype_uint8 yyrline[] =
593
{
594
       0,    49,    49,    50,    54,    55,    56,    57,    58,    59,
595
      60,    61,    62,    63,    64,    65,    69,    71,    75,    80,
596
      81,    85,    87,    89,    91,    93,    95,    97,    99,   104,
597
     105,   109,   113,   114,   118,   119,   121,   122,   126,   127,
598
     128,   129,   130,   131,   132,   136,   137,   141,   142,   146,
599
     147,   151,   152,   155,   160,   161,   162,   163,   164,   165,
600
     166,   167,   168,   169,   170,   171,   172,   173,   174,   175,
601
     176,   177,   178,   179,   180,   181,   182,   183,   186,   187,
602
     193,   200,   207,   216,   217,   221,   222,   226,   227,   231,
603
     232,   235,   236,   239,   241,   245,   246,   247,   248
604
};
605
#endif
606
607
#if YYDEBUG || YYERROR_VERBOSE || 0
608
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
609
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
610
static const char *const yytname[] =
611
{
612
  "$end", "error", "$undefined", "NAME", "LIBRARY", "DESCRIPTION",
613
  "STACKSIZE", "HEAPSIZE", "CODE", "DATA", "SECTIONS", "EXPORTS",
614
  "IMPORTS", "VERSIONK", "BASE", "CONSTANT", "READ", "WRITE", "EXECUTE",
615
  "SHARED", "NONSHARED", "NONAME", "PRIVATE", "SINGLE", "MULTIPLE",
616
  "INITINSTANCE", "INITGLOBAL", "TERMINSTANCE", "TERMGLOBAL", "EQUAL",
617
  "ID", "NUMBER", "'.'", "'='", "','", "'@'", "$accept", "start",
618
  "command", "explist", "expline", "implist", "impline", "seclist",
619
  "secline", "attr_list", "opt_comma", "opt_number", "attr",
620
  "opt_CONSTANT", "opt_NONAME", "opt_DATA", "opt_PRIVATE",
621
  "keyword_as_name", "opt_name2", "opt_name", "opt_ordinal",
622
  "opt_import_name", "opt_equal_name", "opt_base", "option_list", "option", YY_NULLPTR
623
};
624
#endif
625
626
# ifdef YYPRINT
627
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
628
   (internal) symbol number NUM (which must be that of a token).  */
629
static const yytype_int16 yytoknum[] =
630
{
631
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
632
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
633
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
634
     285,   286,    46,    61,    44,    64
635
};
636
# endif
637
638
472
#define YYPACT_NINF (-96)
639
640
#define yypact_value_is_default(Yyn) \
641
472
  ((Yyn) == YYPACT_NINF)
642
643
#define YYTABLE_NINF (-36)
644
645
#define yytable_value_is_error(Yyn) \
646
0
  0
647
648
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
649
     STATE-NUM.  */
650
static const yytype_int8 yypact[] =
651
{
652
      38,    61,    61,   -22,    -1,     8,    39,    39,    -7,   -96,
653
      23,    59,    92,   -96,   -96,   -96,   -96,   -96,   -96,   -96,
654
     -96,   -96,   -96,   -96,   -96,   -96,   -96,   -96,   -96,   -96,
655
     -96,   -96,   -96,   -96,   -96,   -96,   -96,   -96,   -96,    62,
656
      61,    79,   -96,    96,    96,   -96,    80,    80,   -96,   -96,
657
     -96,   -96,   -96,   -96,   -96,   -13,   -96,   -13,    39,    -7,
658
     -96,    82,     1,    23,   -96,    81,   -96,   -96,    61,    79,
659
     -96,    61,    83,   -96,   -96,    84,   -96,   -96,   -96,    39,
660
     -13,   -96,    85,   -96,     5,    87,   -96,    88,   -96,   -96,
661
      89,   -12,   -96,   -96,    61,    86,   -20,    93,    91,   -96,
662
     -96,    -8,   -96,    94,   103,    61,    30,   -96,   -96,    76,
663
     -96,   -96,   -96,   -96,   -96,   -96,   -96,   111,   -96,    93,
664
      93,     0,    93,   -96,   118,   -96,   -96,    78,   -96,   -96,
665
     -96,   106,    93,    93,   -96,    93,   -96,   -96,   -96
666
};
667
668
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
669
     Performed when YYTABLE does not specify something else to do.  Zero
670
     means the default is an error.  */
671
static const yytype_int8 yydefact[] =
672
{
673
       0,    84,    84,     0,     0,     0,     0,     0,     0,    16,
674
       0,     0,     0,     3,    53,    54,    55,    56,    57,    58,
675
      59,    60,    61,    62,    63,    64,    67,    68,    69,    70,
676
      71,    65,    66,    72,    73,    74,    75,    76,    77,    78,
677
       0,     0,    83,    92,    92,     7,    37,    37,    38,    39,
678
      40,    41,    42,    43,    44,    10,    33,    11,     0,    12,
679
      30,     6,     0,    13,    20,    14,     1,     2,     0,    79,
680
      80,     0,     0,     4,    93,     0,     8,     9,    34,     0,
681
      31,    29,    90,    17,     0,     0,    19,     0,    82,    81,
682
       0,     5,    36,    32,     0,    86,    88,    88,     0,    15,
683
      91,     0,    89,     0,    48,     0,     0,    27,    28,     0,
684
      95,    96,    97,    98,    94,    85,    47,    46,    87,    88,
685
      88,    88,    88,    45,    50,    25,    26,     0,    23,    24,
686
      49,    52,    88,    88,    51,    88,    21,    22,    18
687
};
688
689
  /* YYPGOTO[NTERM-NUM].  */
690
static const yytype_int16 yypgoto[] =
691
{
692
     -96,   -96,   117,   -96,   -96,   -96,    67,   -96,    72,    -6,
693
      41,    90,    54,   -96,   -96,   -96,   -96,    95,   -40,   132,
694
     -96,   -95,   -96,    97,   -96,   -96
695
};
696
697
  /* YYDEFGOTO[NTERM-NUM].  */
698
static const yytype_int16 yydefgoto[] =
699
{
700
      -1,    12,    13,    61,    83,    63,    64,    59,    60,    55,
701
      79,    76,    56,   124,   117,   131,   135,    41,    42,    43,
702
     104,   107,    95,    73,    91,   114
703
};
704
705
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
706
     positive, shift that token.  If negative, reduce the rule whose
707
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
708
static const yytype_int16 yytable[] =
709
{
710
      70,    57,   108,   -35,   -35,   -35,   -35,   -35,    45,   105,
711
     -35,   -35,   106,   -35,   -35,   -35,   -35,   110,   111,   112,
712
     113,    78,    78,    58,   125,   126,   128,   129,    88,   105,
713
      46,    89,   127,    84,    85,    96,    97,   136,   137,    47,
714
     138,     1,     2,     3,     4,     5,     6,     7,     8,     9,
715
      10,    11,    80,    62,   102,    48,    49,    50,    51,    52,
716
     119,   120,    53,    54,    14,   118,    15,    16,    17,    18,
717
      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
718
      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
719
      65,    39,    66,    40,    68,     1,     2,     3,     4,     5,
720
       6,     7,     8,     9,    10,    11,   121,   122,   132,   133,
721
      72,    71,    82,    87,    75,    92,    90,    98,    94,    99,
722
     100,   103,   105,   109,   116,   115,   123,   130,   134,    67,
723
      86,    81,   101,    93,    44,    69,     0,    77,     0,     0,
724
       0,    74
725
};
726
727
static const yytype_int16 yycheck[] =
728
{
729
      40,     7,    97,    16,    17,    18,    19,    20,    30,    29,
730
      23,    24,    32,    25,    26,    27,    28,    25,    26,    27,
731
      28,    34,    34,    30,   119,   120,   121,   122,    68,    29,
732
      31,    71,    32,    32,    33,    30,    31,   132,   133,    31,
733
     135,     3,     4,     5,     6,     7,     8,     9,    10,    11,
734
      12,    13,    58,    30,    94,    16,    17,    18,    19,    20,
735
      30,    31,    23,    24,     3,   105,     5,     6,     7,     8,
736
       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
737
      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
738
      31,    30,     0,    32,    32,     3,     4,     5,     6,     7,
739
       8,     9,    10,    11,    12,    13,    30,    31,    30,    31,
740
      14,    32,    30,    32,    34,    31,    33,    30,    33,    31,
741
      31,    35,    29,    32,    21,    31,    15,     9,    22,    12,
742
      63,    59,    91,    79,     2,    40,    -1,    47,    -1,    -1,
743
      -1,    44
744
};
745
746
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
747
     symbol of state STATE-NUM.  */
748
static const yytype_int8 yystos[] =
749
{
750
       0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
751
      12,    13,    37,    38,     3,     5,     6,     7,     8,     9,
752
      10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
753
      20,    21,    22,    23,    24,    25,    26,    27,    28,    30,
754
      32,    53,    54,    55,    55,    30,    31,    31,    16,    17,
755
      18,    19,    20,    23,    24,    45,    48,    45,    30,    43,
756
      44,    39,    30,    41,    42,    31,     0,    38,    32,    53,
757
      54,    32,    14,    59,    59,    34,    47,    47,    34,    46,
758
      45,    44,    30,    40,    32,    33,    42,    32,    54,    54,
759
      33,    60,    31,    48,    33,    58,    30,    31,    30,    31,
760
      31,    46,    54,    35,    56,    29,    32,    57,    57,    32,
761
      25,    26,    27,    28,    61,    31,    21,    50,    54,    30,
762
      31,    30,    31,    15,    49,    57,    57,    32,    57,    57,
763
       9,    51,    30,    31,    22,    52,    57,    57,    57
764
};
765
766
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
767
static const yytype_int8 yyr1[] =
768
{
769
       0,    36,    37,    37,    38,    38,    38,    38,    38,    38,
770
      38,    38,    38,    38,    38,    38,    39,    39,    40,    41,
771
      41,    42,    42,    42,    42,    42,    42,    42,    42,    43,
772
      43,    44,    45,    45,    46,    46,    47,    47,    48,    48,
773
      48,    48,    48,    48,    48,    49,    49,    50,    50,    51,
774
      51,    52,    52,    53,    53,    53,    53,    53,    53,    53,
775
      53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
776
      53,    53,    53,    53,    53,    53,    53,    53,    54,    54,
777
      54,    54,    54,    55,    55,    56,    56,    57,    57,    58,
778
      58,    59,    59,    60,    60,    61,    61,    61,    61
779
};
780
781
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
782
static const yytype_int8 yyr2[] =
783
{
784
       0,     2,     2,     1,     3,     4,     2,     2,     3,     3,
785
       2,     2,     2,     2,     2,     4,     0,     2,     8,     2,
786
       1,     8,     8,     6,     6,     6,     6,     4,     4,     2,
787
       1,     2,     3,     1,     1,     0,     2,     0,     1,     1,
788
       1,     1,     1,     1,     1,     1,     0,     1,     0,     1,
789
       0,     1,     0,     1,     1,     1,     1,     1,     1,     1,
790
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
791
       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
792
       2,     3,     3,     1,     0,     2,     0,     2,     0,     2,
793
       0,     3,     0,     0,     3,     1,     1,     1,     1
794
};
795
796
797
#define yyerrok         (yyerrstatus = 0)
798
#define yyclearin       (yychar = YYEMPTY)
799
944
#define YYEMPTY         (-2)
800
238
#define YYEOF           0
801
802
0
#define YYACCEPT        goto yyacceptlab
803
236
#define YYABORT         goto yyabortlab
804
0
#define YYERROR         goto yyerrorlab
805
806
807
#define YYRECOVERING()  (!!yyerrstatus)
808
809
#define YYBACKUP(Token, Value)                                    \
810
  do                                                              \
811
    if (yychar == YYEMPTY)                                        \
812
      {                                                           \
813
        yychar = (Token);                                         \
814
        yylval = (Value);                                         \
815
        YYPOPSTACK (yylen);                                       \
816
        yystate = *yyssp;                                         \
817
        goto yybackup;                                            \
818
      }                                                           \
819
    else                                                          \
820
      {                                                           \
821
        yyerror (YY_("syntax error: cannot back up")); \
822
        YYERROR;                                                  \
823
      }                                                           \
824
  while (0)
825
826
/* Error token number */
827
472
#define YYTERROR        1
828
#define YYERRCODE       256
829
830
831
832
/* Enable debugging if requested.  */
833
#if YYDEBUG
834
835
# ifndef YYFPRINTF
836
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
837
#  define YYFPRINTF fprintf
838
# endif
839
840
# define YYDPRINTF(Args)                        \
841
do {                                            \
842
  if (yydebug)                                  \
843
    YYFPRINTF Args;                             \
844
} while (0)
845
846
/* This macro is provided for backward compatibility. */
847
#ifndef YY_LOCATION_PRINT
848
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
849
#endif
850
851
852
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
853
do {                                                                      \
854
  if (yydebug)                                                            \
855
    {                                                                     \
856
      YYFPRINTF (stderr, "%s ", Title);                                   \
857
      yy_symbol_print (stderr,                                            \
858
                  Type, Value); \
859
      YYFPRINTF (stderr, "\n");                                           \
860
    }                                                                     \
861
} while (0)
862
863
864
/*-----------------------------------.
865
| Print this symbol's value on YYO.  |
866
`-----------------------------------*/
867
868
static void
869
yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
870
{
871
  FILE *yyoutput = yyo;
872
  YYUSE (yyoutput);
873
  if (!yyvaluep)
874
    return;
875
# ifdef YYPRINT
876
  if (yytype < YYNTOKENS)
877
    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
878
# endif
879
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
880
  YYUSE (yytype);
881
  YY_IGNORE_MAYBE_UNINITIALIZED_END
882
}
883
884
885
/*---------------------------.
886
| Print this symbol on YYO.  |
887
`---------------------------*/
888
889
static void
890
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
891
{
892
  YYFPRINTF (yyo, "%s %s (",
893
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
894
895
  yy_symbol_value_print (yyo, yytype, yyvaluep);
896
  YYFPRINTF (yyo, ")");
897
}
898
899
/*------------------------------------------------------------------.
900
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
901
| TOP (included).                                                   |
902
`------------------------------------------------------------------*/
903
904
static void
905
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
906
{
907
  YYFPRINTF (stderr, "Stack now");
908
  for (; yybottom <= yytop; yybottom++)
909
    {
910
      int yybot = *yybottom;
911
      YYFPRINTF (stderr, " %d", yybot);
912
    }
913
  YYFPRINTF (stderr, "\n");
914
}
915
916
# define YY_STACK_PRINT(Bottom, Top)                            \
917
do {                                                            \
918
  if (yydebug)                                                  \
919
    yy_stack_print ((Bottom), (Top));                           \
920
} while (0)
921
922
923
/*------------------------------------------------.
924
| Report that the YYRULE is going to be reduced.  |
925
`------------------------------------------------*/
926
927
static void
928
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
929
{
930
  int yylno = yyrline[yyrule];
931
  int yynrhs = yyr2[yyrule];
932
  int yyi;
933
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
934
             yyrule - 1, yylno);
935
  /* The symbols being reduced.  */
936
  for (yyi = 0; yyi < yynrhs; yyi++)
937
    {
938
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
939
      yy_symbol_print (stderr,
940
                       yystos[+yyssp[yyi + 1 - yynrhs]],
941
                       &yyvsp[(yyi + 1) - (yynrhs)]
942
                                              );
943
      YYFPRINTF (stderr, "\n");
944
    }
945
}
946
947
# define YY_REDUCE_PRINT(Rule)          \
948
do {                                    \
949
  if (yydebug)                          \
950
    yy_reduce_print (yyssp, yyvsp, Rule); \
951
} while (0)
952
953
/* Nonzero means print parse trace.  It is left uninitialized so that
954
   multiple parsers can coexist.  */
955
int yydebug;
956
#else /* !YYDEBUG */
957
# define YYDPRINTF(Args)
958
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
959
# define YY_STACK_PRINT(Bottom, Top)
960
# define YY_REDUCE_PRINT(Rule)
961
#endif /* !YYDEBUG */
962
963
964
/* YYINITDEPTH -- initial size of the parser's stacks.  */
965
#ifndef YYINITDEPTH
966
236
# define YYINITDEPTH 200
967
#endif
968
969
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
970
   if the built-in stack extension method is used).
971
972
   Do not make this value too large; the results are undefined if
973
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
974
   evaluated with infinite-precision integer arithmetic.  */
975
976
#ifndef YYMAXDEPTH
977
0
# define YYMAXDEPTH 10000
978
#endif
979
980
981
#if YYERROR_VERBOSE
982
983
# ifndef yystrlen
984
#  if defined __GLIBC__ && defined _STRING_H
985
#   define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
986
#  else
987
/* Return the length of YYSTR.  */
988
static YYPTRDIFF_T
989
yystrlen (const char *yystr)
990
{
991
  YYPTRDIFF_T yylen;
992
  for (yylen = 0; yystr[yylen]; yylen++)
993
    continue;
994
  return yylen;
995
}
996
#  endif
997
# endif
998
999
# ifndef yystpcpy
1000
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1001
#   define yystpcpy stpcpy
1002
#  else
1003
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1004
   YYDEST.  */
1005
static char *
1006
yystpcpy (char *yydest, const char *yysrc)
1007
{
1008
  char *yyd = yydest;
1009
  const char *yys = yysrc;
1010
1011
  while ((*yyd++ = *yys++) != '\0')
1012
    continue;
1013
1014
  return yyd - 1;
1015
}
1016
#  endif
1017
# endif
1018
1019
# ifndef yytnamerr
1020
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1021
   quotes and backslashes, so that it's suitable for yyerror.  The
1022
   heuristic is that double-quoting is unnecessary unless the string
1023
   contains an apostrophe, a comma, or backslash (other than
1024
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1025
   null, do not copy; instead, return the length of what the result
1026
   would have been.  */
1027
static YYPTRDIFF_T
1028
yytnamerr (char *yyres, const char *yystr)
1029
{
1030
  if (*yystr == '"')
1031
    {
1032
      YYPTRDIFF_T yyn = 0;
1033
      char const *yyp = yystr;
1034
1035
      for (;;)
1036
        switch (*++yyp)
1037
          {
1038
          case '\'':
1039
          case ',':
1040
            goto do_not_strip_quotes;
1041
1042
          case '\\':
1043
            if (*++yyp != '\\')
1044
              goto do_not_strip_quotes;
1045
            else
1046
              goto append;
1047
1048
          append:
1049
          default:
1050
            if (yyres)
1051
              yyres[yyn] = *yyp;
1052
            yyn++;
1053
            break;
1054
1055
          case '"':
1056
            if (yyres)
1057
              yyres[yyn] = '\0';
1058
            return yyn;
1059
          }
1060
    do_not_strip_quotes: ;
1061
    }
1062
1063
  if (yyres)
1064
    return yystpcpy (yyres, yystr) - yyres;
1065
  else
1066
    return yystrlen (yystr);
1067
}
1068
# endif
1069
1070
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1071
   about the unexpected token YYTOKEN for the state stack whose top is
1072
   YYSSP.
1073
1074
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1075
   not large enough to hold the message.  In that case, also set
1076
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1077
   required number of bytes is too large to store.  */
1078
static int
1079
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1080
                yy_state_t *yyssp, int yytoken)
1081
{
1082
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1083
  /* Internationalized format string. */
1084
  const char *yyformat = YY_NULLPTR;
1085
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1086
     one per "expected"). */
1087
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1088
  /* Actual size of YYARG. */
1089
  int yycount = 0;
1090
  /* Cumulated lengths of YYARG.  */
1091
  YYPTRDIFF_T yysize = 0;
1092
1093
  /* There are many possibilities here to consider:
1094
     - If this state is a consistent state with a default action, then
1095
       the only way this function was invoked is if the default action
1096
       is an error action.  In that case, don't check for expected
1097
       tokens because there are none.
1098
     - The only way there can be no lookahead present (in yychar) is if
1099
       this state is a consistent state with a default action.  Thus,
1100
       detecting the absence of a lookahead is sufficient to determine
1101
       that there is no unexpected or expected token to report.  In that
1102
       case, just report a simple "syntax error".
1103
     - Don't assume there isn't a lookahead just because this state is a
1104
       consistent state with a default action.  There might have been a
1105
       previous inconsistent state, consistent state with a non-default
1106
       action, or user semantic action that manipulated yychar.
1107
     - Of course, the expected token list depends on states to have
1108
       correct lookahead information, and it depends on the parser not
1109
       to perform extra reductions after fetching a lookahead from the
1110
       scanner and before detecting a syntax error.  Thus, state merging
1111
       (from LALR or IELR) and default reductions corrupt the expected
1112
       token list.  However, the list is correct for canonical LR with
1113
       one exception: it will still contain any token that will not be
1114
       accepted due to an error action in a later state.
1115
  */
1116
  if (yytoken != YYEMPTY)
1117
    {
1118
      int yyn = yypact[+*yyssp];
1119
      YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1120
      yysize = yysize0;
1121
      yyarg[yycount++] = yytname[yytoken];
1122
      if (!yypact_value_is_default (yyn))
1123
        {
1124
          /* Start YYX at -YYN if negative to avoid negative indexes in
1125
             YYCHECK.  In other words, skip the first -YYN actions for
1126
             this state because they are default actions.  */
1127
          int yyxbegin = yyn < 0 ? -yyn : 0;
1128
          /* Stay within bounds of both yycheck and yytname.  */
1129
          int yychecklim = YYLAST - yyn + 1;
1130
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1131
          int yyx;
1132
1133
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1134
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1135
                && !yytable_value_is_error (yytable[yyx + yyn]))
1136
              {
1137
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1138
                  {
1139
                    yycount = 1;
1140
                    yysize = yysize0;
1141
                    break;
1142
                  }
1143
                yyarg[yycount++] = yytname[yyx];
1144
                {
1145
                  YYPTRDIFF_T yysize1
1146
                    = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1147
                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1148
                    yysize = yysize1;
1149
                  else
1150
                    return 2;
1151
                }
1152
              }
1153
        }
1154
    }
1155
1156
  switch (yycount)
1157
    {
1158
# define YYCASE_(N, S)                      \
1159
      case N:                               \
1160
        yyformat = S;                       \
1161
      break
1162
    default: /* Avoid compiler warnings. */
1163
      YYCASE_(0, YY_("syntax error"));
1164
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1165
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1166
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1167
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1168
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1169
# undef YYCASE_
1170
    }
1171
1172
  {
1173
    /* Don't count the "%s"s in the final size, but reserve room for
1174
       the terminator.  */
1175
    YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1176
    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1177
      yysize = yysize1;
1178
    else
1179
      return 2;
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
static void
1218
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1219
236
{
1220
236
  YYUSE (yyvaluep);
1221
236
  if (!yymsg)
1222
0
    yymsg = "Deleting";
1223
236
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1224
1225
236
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1226
236
  switch (yytype)
1227
236
    {
1228
205
    case 30: /* ID  */
1229
205
#line 46 "defparse.y"
1230
205
            { free (((*yyvaluep).id)); }
1231
205
#line 1232 "defparse.c"
1232
205
        break;
1233
1234
31
      default:
1235
31
        break;
1236
236
    }
1237
236
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1238
236
}
1239
1240
1241
1242
1243
/* The lookahead symbol.  */
1244
int yychar;
1245
1246
/* The semantic value of the lookahead symbol.  */
1247
YYSTYPE yylval;
1248
/* Number of syntax errors so far.  */
1249
int yynerrs;
1250
1251
1252
/*----------.
1253
| yyparse.  |
1254
`----------*/
1255
1256
int
1257
yyparse (void)
1258
236
{
1259
236
    yy_state_fast_t yystate;
1260
    /* Number of tokens to shift before error messages enabled.  */
1261
236
    int yyerrstatus;
1262
1263
    /* The stacks and their tools:
1264
       'yyss': related to states.
1265
       'yyvs': related to semantic values.
1266
1267
       Refer to the stacks through separate pointers, to allow yyoverflow
1268
       to reallocate them elsewhere.  */
1269
1270
    /* The state stack.  */
1271
236
    yy_state_t yyssa[YYINITDEPTH];
1272
236
    yy_state_t *yyss;
1273
236
    yy_state_t *yyssp;
1274
1275
    /* The semantic value stack.  */
1276
236
    YYSTYPE yyvsa[YYINITDEPTH];
1277
236
    YYSTYPE *yyvs;
1278
236
    YYSTYPE *yyvsp;
1279
1280
236
    YYPTRDIFF_T yystacksize;
1281
1282
236
  int yyn;
1283
236
  int yyresult;
1284
  /* Lookahead token as an internal (translated) token number.  */
1285
236
  int yytoken = 0;
1286
  /* The variables used to return semantic value and location from the
1287
     action routines.  */
1288
236
  YYSTYPE yyval;
1289
1290
#if YYERROR_VERBOSE
1291
  /* Buffer for error messages, and its allocated size.  */
1292
  char yymsgbuf[128];
1293
  char *yymsg = yymsgbuf;
1294
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1295
#endif
1296
1297
236
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1298
1299
  /* The number of symbols on the RHS of the reduced rule.
1300
     Keep to zero when no symbol should be popped.  */
1301
236
  int yylen = 0;
1302
1303
236
  yyssp = yyss = yyssa;
1304
236
  yyvsp = yyvs = yyvsa;
1305
236
  yystacksize = YYINITDEPTH;
1306
1307
236
  YYDPRINTF ((stderr, "Starting parse\n"));
1308
1309
236
  yystate = 0;
1310
236
  yyerrstatus = 0;
1311
236
  yynerrs = 0;
1312
236
  yychar = YYEMPTY; /* Cause a token to be read.  */
1313
236
  goto yysetstate;
1314
1315
1316
/*------------------------------------------------------------.
1317
| yynewstate -- push a new state, which is found in yystate.  |
1318
`------------------------------------------------------------*/
1319
0
yynewstate:
1320
  /* In all cases, when you get here, the value and location stacks
1321
     have just been pushed.  So pushing a state here evens the stacks.  */
1322
0
  yyssp++;
1323
1324
1325
/*--------------------------------------------------------------------.
1326
| yysetstate -- set current state (the top of the stack) to yystate.  |
1327
`--------------------------------------------------------------------*/
1328
236
yysetstate:
1329
236
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1330
236
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1331
236
  YY_IGNORE_USELESS_CAST_BEGIN
1332
236
  *yyssp = YY_CAST (yy_state_t, yystate);
1333
236
  YY_IGNORE_USELESS_CAST_END
1334
1335
236
  if (yyss + yystacksize - 1 <= yyssp)
1336
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1337
    goto yyexhaustedlab;
1338
#else
1339
0
    {
1340
      /* Get the current used size of the three stacks, in elements.  */
1341
0
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1342
1343
# if defined yyoverflow
1344
      {
1345
        /* Give user a chance to reallocate the stack.  Use copies of
1346
           these so that the &'s don't force the real ones into
1347
           memory.  */
1348
        yy_state_t *yyss1 = yyss;
1349
        YYSTYPE *yyvs1 = yyvs;
1350
1351
        /* Each stack pointer address is followed by the size of the
1352
           data in use in that stack, in bytes.  This used to be a
1353
           conditional around just the two extra args, but that might
1354
           be undefined if yyoverflow is a macro.  */
1355
        yyoverflow (YY_("memory exhausted"),
1356
                    &yyss1, yysize * YYSIZEOF (*yyssp),
1357
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1358
                    &yystacksize);
1359
        yyss = yyss1;
1360
        yyvs = yyvs1;
1361
      }
1362
# else /* defined YYSTACK_RELOCATE */
1363
      /* Extend the stack our own way.  */
1364
0
      if (YYMAXDEPTH <= yystacksize)
1365
0
        goto yyexhaustedlab;
1366
0
      yystacksize *= 2;
1367
0
      if (YYMAXDEPTH < yystacksize)
1368
0
        yystacksize = YYMAXDEPTH;
1369
1370
0
      {
1371
0
        yy_state_t *yyss1 = yyss;
1372
0
        union yyalloc *yyptr =
1373
0
          YY_CAST (union yyalloc *,
1374
0
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1375
0
        if (! yyptr)
1376
0
          goto yyexhaustedlab;
1377
0
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1378
0
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1379
0
# undef YYSTACK_RELOCATE
1380
0
        if (yyss1 != yyssa)
1381
0
          YYSTACK_FREE (yyss1);
1382
0
      }
1383
0
# endif
1384
1385
0
      yyssp = yyss + yysize - 1;
1386
0
      yyvsp = yyvs + yysize - 1;
1387
1388
0
      YY_IGNORE_USELESS_CAST_BEGIN
1389
0
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1390
0
                  YY_CAST (long, yystacksize)));
1391
0
      YY_IGNORE_USELESS_CAST_END
1392
1393
0
      if (yyss + yystacksize - 1 <= yyssp)
1394
0
        YYABORT;
1395
0
    }
1396
236
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1397
1398
236
  if (yystate == YYFINAL)
1399
0
    YYACCEPT;
1400
1401
236
  goto yybackup;
1402
1403
1404
/*-----------.
1405
| yybackup.  |
1406
`-----------*/
1407
236
yybackup:
1408
  /* Do appropriate processing given the current state.  Read a
1409
     lookahead token if we need one and don't already have one.  */
1410
1411
  /* First try to decide what to do without reference to lookahead token.  */
1412
236
  yyn = yypact[yystate];
1413
236
  if (yypact_value_is_default (yyn))
1414
0
    goto yydefault;
1415
1416
  /* Not known => get a lookahead token if don't already have one.  */
1417
1418
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1419
236
  if (yychar == YYEMPTY)
1420
236
    {
1421
236
      YYDPRINTF ((stderr, "Reading a token: "));
1422
236
      yychar = yylex ();
1423
236
    }
1424
1425
236
  if (yychar <= YYEOF)
1426
2
    {
1427
2
      yychar = yytoken = YYEOF;
1428
2
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1429
2
    }
1430
234
  else
1431
234
    {
1432
234
      yytoken = YYTRANSLATE (yychar);
1433
234
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1434
234
    }
1435
1436
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1437
     detect an error, take that action.  */
1438
236
  yyn += yytoken;
1439
236
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1440
236
    goto yydefault;
1441
0
  yyn = yytable[yyn];
1442
0
  if (yyn <= 0)
1443
0
    {
1444
0
      if (yytable_value_is_error (yyn))
1445
0
        goto yyerrlab;
1446
0
      yyn = -yyn;
1447
0
      goto yyreduce;
1448
0
    }
1449
1450
  /* Count tokens shifted since error; after three, turn off error
1451
     status.  */
1452
0
  if (yyerrstatus)
1453
0
    yyerrstatus--;
1454
1455
  /* Shift the lookahead token.  */
1456
0
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1457
0
  yystate = yyn;
1458
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1459
0
  *++yyvsp = yylval;
1460
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1461
1462
  /* Discard the shifted token.  */
1463
0
  yychar = YYEMPTY;
1464
0
  goto yynewstate;
1465
1466
1467
/*-----------------------------------------------------------.
1468
| yydefault -- do the default action for the current state.  |
1469
`-----------------------------------------------------------*/
1470
236
yydefault:
1471
236
  yyn = yydefact[yystate];
1472
236
  if (yyn == 0)
1473
236
    goto yyerrlab;
1474
0
  goto yyreduce;
1475
1476
1477
/*-----------------------------.
1478
| yyreduce -- do a reduction.  |
1479
`-----------------------------*/
1480
0
yyreduce:
1481
  /* yyn is the number of a rule to reduce with.  */
1482
0
  yylen = yyr2[yyn];
1483
1484
  /* If YYLEN is nonzero, implement the default value of the action:
1485
     '$$ = $1'.
1486
1487
     Otherwise, the following line sets YYVAL to garbage.
1488
     This behavior is undocumented and Bison
1489
     users should not rely upon it.  Assigning to YYVAL
1490
     unconditionally makes the parser a bit smaller, and it avoids a
1491
     GCC warning that YYVAL may be used uninitialized.  */
1492
0
  yyval = yyvsp[1-yylen];
1493
1494
1495
0
  YY_REDUCE_PRINT (yyn);
1496
0
  switch (yyn)
1497
0
    {
1498
0
  case 4:
1499
0
#line 54 "defparse.y"
1500
0
                                       { def_name ((yyvsp[-1].id), (yyvsp[0].number)); }
1501
0
#line 1502 "defparse.c"
1502
0
    break;
1503
1504
0
  case 5:
1505
0
#line 55 "defparse.y"
1506
0
                                                      { def_library ((yyvsp[-2].id), (yyvsp[-1].number)); }
1507
0
#line 1508 "defparse.c"
1508
0
    break;
1509
1510
0
  case 7:
1511
0
#line 57 "defparse.y"
1512
0
                               { def_description ((yyvsp[0].id));}
1513
0
#line 1514 "defparse.c"
1514
0
    break;
1515
1516
0
  case 8:
1517
0
#line 58 "defparse.y"
1518
0
                                            { def_stacksize ((yyvsp[-1].number), (yyvsp[0].number));}
1519
0
#line 1520 "defparse.c"
1520
0
    break;
1521
1522
0
  case 9:
1523
0
#line 59 "defparse.y"
1524
0
                                           { def_heapsize ((yyvsp[-1].number), (yyvsp[0].number));}
1525
0
#line 1526 "defparse.c"
1526
0
    break;
1527
1528
0
  case 10:
1529
0
#line 60 "defparse.y"
1530
0
                               { def_code ((yyvsp[0].number));}
1531
0
#line 1532 "defparse.c"
1532
0
    break;
1533
1534
0
  case 11:
1535
0
#line 61 "defparse.y"
1536
0
                                { def_data ((yyvsp[0].number));}
1537
0
#line 1538 "defparse.c"
1538
0
    break;
1539
1540
0
  case 14:
1541
0
#line 64 "defparse.y"
1542
0
                                { def_version ((yyvsp[0].number),0);}
1543
0
#line 1544 "defparse.c"
1544
0
    break;
1545
1546
0
  case 15:
1547
0
#line 65 "defparse.y"
1548
0
                                           { def_version ((yyvsp[-2].number),(yyvsp[0].number));}
1549
0
#line 1550 "defparse.c"
1550
0
    break;
1551
1552
0
  case 18:
1553
0
#line 77 "defparse.y"
1554
0
                        { def_exports ((yyvsp[-7].id), (yyvsp[-6].id), (yyvsp[-5].number), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].number), (yyvsp[-1].number), (yyvsp[0].id));}
1555
0
#line 1556 "defparse.c"
1556
0
    break;
1557
1558
0
  case 21:
1559
0
#line 86 "defparse.y"
1560
0
                 { def_import ((yyvsp[-7].id),(yyvsp[-5].id),(yyvsp[-3].id),(yyvsp[-1].id), 0, (yyvsp[0].id)); }
1561
0
#line 1562 "defparse.c"
1562
0
    break;
1563
1564
0
  case 22:
1565
0
#line 88 "defparse.y"
1566
0
                 { def_import ((yyvsp[-7].id),(yyvsp[-5].id),(yyvsp[-3].id), 0,(yyvsp[-1].number), (yyvsp[0].id)); }
1567
0
#line 1568 "defparse.c"
1568
0
    break;
1569
1570
0
  case 23:
1571
0
#line 90 "defparse.y"
1572
0
                 { def_import ((yyvsp[-5].id),(yyvsp[-3].id), 0,(yyvsp[-1].id), 0, (yyvsp[0].id)); }
1573
0
#line 1574 "defparse.c"
1574
0
    break;
1575
1576
0
  case 24:
1577
0
#line 92 "defparse.y"
1578
0
                 { def_import ((yyvsp[-5].id),(yyvsp[-3].id), 0, 0,(yyvsp[-1].number), (yyvsp[0].id)); }
1579
0
#line 1580 "defparse.c"
1580
0
    break;
1581
1582
0
  case 25:
1583
0
#line 94 "defparse.y"
1584
0
                 { def_import ( 0,(yyvsp[-5].id),(yyvsp[-3].id),(yyvsp[-1].id), 0, (yyvsp[0].id)); }
1585
0
#line 1586 "defparse.c"
1586
0
    break;
1587
1588
0
  case 26:
1589
0
#line 96 "defparse.y"
1590
0
                 { def_import ( 0,(yyvsp[-5].id),(yyvsp[-3].id), 0,(yyvsp[-1].number), (yyvsp[0].id)); }
1591
0
#line 1592 "defparse.c"
1592
0
    break;
1593
1594
0
  case 27:
1595
0
#line 98 "defparse.y"
1596
0
                 { def_import ( 0,(yyvsp[-3].id), 0,(yyvsp[-1].id), 0, (yyvsp[0].id)); }
1597
0
#line 1598 "defparse.c"
1598
0
    break;
1599
1600
0
  case 28:
1601
0
#line 100 "defparse.y"
1602
0
                 { def_import ( 0,(yyvsp[-3].id), 0, 0,(yyvsp[-1].number), (yyvsp[0].id)); }
1603
0
#line 1604 "defparse.c"
1604
0
    break;
1605
1606
0
  case 31:
1607
0
#line 109 "defparse.y"
1608
0
                     { def_section ((yyvsp[-1].id),(yyvsp[0].number));}
1609
0
#line 1610 "defparse.c"
1610
0
    break;
1611
1612
0
  case 36:
1613
0
#line 121 "defparse.y"
1614
0
                       { (yyval.number)=(yyvsp[0].number);}
1615
0
#line 1616 "defparse.c"
1616
0
    break;
1617
1618
0
  case 37:
1619
0
#line 122 "defparse.y"
1620
0
                   { (yyval.number)=-1;}
1621
0
#line 1622 "defparse.c"
1622
0
    break;
1623
1624
0
  case 38:
1625
0
#line 126 "defparse.y"
1626
0
                     { (yyval.number) = 1; }
1627
0
#line 1628 "defparse.c"
1628
0
    break;
1629
1630
0
  case 39:
1631
0
#line 127 "defparse.y"
1632
0
                      { (yyval.number) = 2; }
1633
0
#line 1634 "defparse.c"
1634
0
    break;
1635
1636
0
  case 40:
1637
0
#line 128 "defparse.y"
1638
0
                        { (yyval.number) = 4; }
1639
0
#line 1640 "defparse.c"
1640
0
    break;
1641
1642
0
  case 41:
1643
0
#line 129 "defparse.y"
1644
0
                       { (yyval.number) = 8; }
1645
0
#line 1646 "defparse.c"
1646
0
    break;
1647
1648
0
  case 42:
1649
0
#line 130 "defparse.y"
1650
0
                          { (yyval.number) = 0; }
1651
0
#line 1652 "defparse.c"
1652
0
    break;
1653
1654
0
  case 43:
1655
0
#line 131 "defparse.y"
1656
0
                       { (yyval.number) = 0; }
1657
0
#line 1658 "defparse.c"
1658
0
    break;
1659
1660
0
  case 44:
1661
0
#line 132 "defparse.y"
1662
0
                         { (yyval.number) = 0; }
1663
0
#line 1664 "defparse.c"
1664
0
    break;
1665
1666
0
  case 45:
1667
0
#line 136 "defparse.y"
1668
0
                         {(yyval.number)=1;}
1669
0
#line 1670 "defparse.c"
1670
0
    break;
1671
1672
0
  case 46:
1673
0
#line 137 "defparse.y"
1674
0
                         {(yyval.number)=0;}
1675
0
#line 1676 "defparse.c"
1676
0
    break;
1677
1678
0
  case 47:
1679
0
#line 141 "defparse.y"
1680
0
                       {(yyval.number)=1;}
1681
0
#line 1682 "defparse.c"
1682
0
    break;
1683
1684
0
  case 48:
1685
0
#line 142 "defparse.y"
1686
0
                         {(yyval.number)=0;}
1687
0
#line 1688 "defparse.c"
1688
0
    break;
1689
1690
0
  case 49:
1691
0
#line 146 "defparse.y"
1692
0
                     { (yyval.number) = 1; }
1693
0
#line 1694 "defparse.c"
1694
0
    break;
1695
1696
0
  case 50:
1697
0
#line 147 "defparse.y"
1698
0
                     { (yyval.number) = 0; }
1699
0
#line 1700 "defparse.c"
1700
0
    break;
1701
1702
0
  case 51:
1703
0
#line 151 "defparse.y"
1704
0
                        { (yyval.number) = 1; }
1705
0
#line 1706 "defparse.c"
1706
0
    break;
1707
1708
0
  case 52:
1709
0
#line 152 "defparse.y"
1710
0
                        { (yyval.number) = 0; }
1711
0
#line 1712 "defparse.c"
1712
0
    break;
1713
1714
0
  case 53:
1715
0
#line 155 "defparse.y"
1716
0
                      { (yyval.id_const) = "NAME"; }
1717
0
#line 1718 "defparse.c"
1718
0
    break;
1719
1720
0
  case 54:
1721
0
#line 160 "defparse.y"
1722
0
                      { (yyval.id_const) = "DESCRIPTION"; }
1723
0
#line 1724 "defparse.c"
1724
0
    break;
1725
1726
0
  case 55:
1727
0
#line 161 "defparse.y"
1728
0
                    { (yyval.id_const) = "STACKSIZE"; }
1729
0
#line 1730 "defparse.c"
1730
0
    break;
1731
1732
0
  case 56:
1733
0
#line 162 "defparse.y"
1734
0
                   { (yyval.id_const) = "HEAPSIZE"; }
1735
0
#line 1736 "defparse.c"
1736
0
    break;
1737
1738
0
  case 57:
1739
0
#line 163 "defparse.y"
1740
0
               { (yyval.id_const) = "CODE"; }
1741
0
#line 1742 "defparse.c"
1742
0
    break;
1743
1744
0
  case 58:
1745
0
#line 164 "defparse.y"
1746
0
               { (yyval.id_const) = "DATA"; }
1747
0
#line 1748 "defparse.c"
1748
0
    break;
1749
1750
0
  case 59:
1751
0
#line 165 "defparse.y"
1752
0
                   { (yyval.id_const) = "SECTIONS"; }
1753
0
#line 1754 "defparse.c"
1754
0
    break;
1755
1756
0
  case 60:
1757
0
#line 166 "defparse.y"
1758
0
                  { (yyval.id_const) = "EXPORTS"; }
1759
0
#line 1760 "defparse.c"
1760
0
    break;
1761
1762
0
  case 61:
1763
0
#line 167 "defparse.y"
1764
0
                  { (yyval.id_const) = "IMPORTS"; }
1765
0
#line 1766 "defparse.c"
1766
0
    break;
1767
1768
0
  case 62:
1769
0
#line 168 "defparse.y"
1770
0
                   { (yyval.id_const) = "VERSION"; }
1771
0
#line 1772 "defparse.c"
1772
0
    break;
1773
1774
0
  case 63:
1775
0
#line 169 "defparse.y"
1776
0
               { (yyval.id_const) = "BASE"; }
1777
0
#line 1778 "defparse.c"
1778
0
    break;
1779
1780
0
  case 64:
1781
0
#line 170 "defparse.y"
1782
0
                   { (yyval.id_const) = "CONSTANT"; }
1783
0
#line 1784 "defparse.c"
1784
0
    break;
1785
1786
0
  case 65:
1787
0
#line 171 "defparse.y"
1788
0
                 { (yyval.id_const) = "NONAME"; }
1789
0
#line 1790 "defparse.c"
1790
0
    break;
1791
1792
0
  case 66:
1793
0
#line 172 "defparse.y"
1794
0
                  { (yyval.id_const) = "PRIVATE"; }
1795
0
#line 1796 "defparse.c"
1796
0
    break;
1797
1798
0
  case 67:
1799
0
#line 173 "defparse.y"
1800
0
               { (yyval.id_const) = "READ"; }
1801
0
#line 1802 "defparse.c"
1802
0
    break;
1803
1804
0
  case 68:
1805
0
#line 174 "defparse.y"
1806
0
                { (yyval.id_const) = "WRITE"; }
1807
0
#line 1808 "defparse.c"
1808
0
    break;
1809
1810
0
  case 69:
1811
0
#line 175 "defparse.y"
1812
0
                  { (yyval.id_const) = "EXECUTE"; }
1813
0
#line 1814 "defparse.c"
1814
0
    break;
1815
1816
0
  case 70:
1817
0
#line 176 "defparse.y"
1818
0
                 { (yyval.id_const) = "SHARED"; }
1819
0
#line 1820 "defparse.c"
1820
0
    break;
1821
1822
0
  case 71:
1823
0
#line 177 "defparse.y"
1824
0
                    { (yyval.id_const) = "NONSHARED"; }
1825
0
#line 1826 "defparse.c"
1826
0
    break;
1827
1828
0
  case 72:
1829
0
#line 178 "defparse.y"
1830
0
                 { (yyval.id_const) = "SINGLE"; }
1831
0
#line 1832 "defparse.c"
1832
0
    break;
1833
1834
0
  case 73:
1835
0
#line 179 "defparse.y"
1836
0
                   { (yyval.id_const) = "MULTIPLE"; }
1837
0
#line 1838 "defparse.c"
1838
0
    break;
1839
1840
0
  case 74:
1841
0
#line 180 "defparse.y"
1842
0
                       { (yyval.id_const) = "INITINSTANCE"; }
1843
0
#line 1844 "defparse.c"
1844
0
    break;
1845
1846
0
  case 75:
1847
0
#line 181 "defparse.y"
1848
0
                     { (yyval.id_const) = "INITGLOBAL"; }
1849
0
#line 1850 "defparse.c"
1850
0
    break;
1851
1852
0
  case 76:
1853
0
#line 182 "defparse.y"
1854
0
                       { (yyval.id_const) = "TERMINSTANCE"; }
1855
0
#line 1856 "defparse.c"
1856
0
    break;
1857
1858
0
  case 77:
1859
0
#line 183 "defparse.y"
1860
0
                     { (yyval.id_const) = "TERMGLOBAL"; }
1861
0
#line 1862 "defparse.c"
1862
0
    break;
1863
1864
0
  case 78:
1865
0
#line 186 "defparse.y"
1866
0
              { (yyval.id) = (yyvsp[0].id); }
1867
0
#line 1868 "defparse.c"
1868
0
    break;
1869
1870
0
  case 79:
1871
0
#line 188 "defparse.y"
1872
0
          {
1873
0
      char *name = xmalloc (strlen ((yyvsp[0].id_const)) + 2);
1874
0
      sprintf (name, ".%s", (yyvsp[0].id_const));
1875
0
      (yyval.id) = name;
1876
0
    }
1877
0
#line 1878 "defparse.c"
1878
0
    break;
1879
1880
0
  case 80:
1881
0
#line 194 "defparse.y"
1882
0
          {
1883
0
      char *name = xmalloc (strlen ((yyvsp[0].id)) + 2);
1884
0
      sprintf (name, ".%s", (yyvsp[0].id));
1885
0
      free ((yyvsp[0].id));
1886
0
      (yyval.id) = name;
1887
0
    }
1888
0
#line 1889 "defparse.c"
1889
0
    break;
1890
1891
0
  case 81:
1892
0
#line 201 "defparse.y"
1893
0
          {
1894
0
      char *name = xmalloc (strlen ((yyvsp[-2].id_const)) + 1 + strlen ((yyvsp[0].id)) + 1);
1895
0
      sprintf (name, "%s.%s", (yyvsp[-2].id_const), (yyvsp[0].id));
1896
0
      free ((yyvsp[0].id));
1897
0
      (yyval.id) = name;
1898
0
    }
1899
0
#line 1900 "defparse.c"
1900
0
    break;
1901
1902
0
  case 82:
1903
0
#line 208 "defparse.y"
1904
0
          {
1905
0
      char *name = xmalloc (strlen ((yyvsp[-2].id)) + 1 + strlen ((yyvsp[0].id)) + 1);
1906
0
      sprintf (name, "%s.%s", (yyvsp[-2].id), (yyvsp[0].id));
1907
0
      free ((yyvsp[-2].id));
1908
0
      free ((yyvsp[0].id));
1909
0
      (yyval.id) = name;
1910
0
    }
1911
0
#line 1912 "defparse.c"
1912
0
    break;
1913
1914
0
  case 83:
1915
0
#line 216 "defparse.y"
1916
0
                    { (yyval.id) =(yyvsp[0].id); }
1917
0
#line 1918 "defparse.c"
1918
0
    break;
1919
1920
0
  case 84:
1921
0
#line 217 "defparse.y"
1922
0
                        { (yyval.id) = xstrdup (""); }
1923
0
#line 1924 "defparse.c"
1924
0
    break;
1925
1926
0
  case 85:
1927
0
#line 221 "defparse.y"
1928
0
                         { (yyval.number)=(yyvsp[0].number);}
1929
0
#line 1930 "defparse.c"
1930
0
    break;
1931
1932
0
  case 86:
1933
0
#line 222 "defparse.y"
1934
0
                         { (yyval.number)=-1;}
1935
0
#line 1936 "defparse.c"
1936
0
    break;
1937
1938
0
  case 87:
1939
0
#line 226 "defparse.y"
1940
0
                                { (yyval.id) = (yyvsp[0].id); }
1941
0
#line 1942 "defparse.c"
1942
0
    break;
1943
1944
0
  case 88:
1945
0
#line 227 "defparse.y"
1946
0
                        { (yyval.id) = 0; }
1947
0
#line 1948 "defparse.c"
1948
0
    break;
1949
1950
0
  case 89:
1951
0
#line 231 "defparse.y"
1952
0
                        { (yyval.id) = (yyvsp[0].id); }
1953
0
#line 1954 "defparse.c"
1954
0
    break;
1955
1956
0
  case 90:
1957
0
#line 232 "defparse.y"
1958
0
                        { (yyval.id) =  0; }
1959
0
#line 1960 "defparse.c"
1960
0
    break;
1961
1962
0
  case 91:
1963
0
#line 235 "defparse.y"
1964
0
                                { (yyval.number)= (yyvsp[0].number);}
1965
0
#line 1966 "defparse.c"
1966
0
    break;
1967
1968
0
  case 92:
1969
0
#line 236 "defparse.y"
1970
0
                { (yyval.number)=-1;}
1971
0
#line 1972 "defparse.c"
1972
0
    break;
1973
1974
1975
0
#line 1976 "defparse.c"
1976
1977
0
      default: break;
1978
0
    }
1979
  /* User semantic actions sometimes alter yychar, and that requires
1980
     that yytoken be updated with the new translation.  We take the
1981
     approach of translating immediately before every use of yytoken.
1982
     One alternative is translating here after every semantic action,
1983
     but that translation would be missed if the semantic action invokes
1984
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1985
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1986
     incorrect destructor might then be invoked immediately.  In the
1987
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
1988
     to an incorrect destructor call or verbose syntax error message
1989
     before the lookahead is translated.  */
1990
0
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1991
1992
0
  YYPOPSTACK (yylen);
1993
0
  yylen = 0;
1994
0
  YY_STACK_PRINT (yyss, yyssp);
1995
1996
0
  *++yyvsp = yyval;
1997
1998
  /* Now 'shift' the result of the reduction.  Determine what state
1999
     that goes to, based on the state we popped back to and the rule
2000
     number reduced by.  */
2001
0
  {
2002
0
    const int yylhs = yyr1[yyn] - YYNTOKENS;
2003
0
    const int yyi = yypgoto[yylhs] + *yyssp;
2004
0
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2005
0
               ? yytable[yyi]
2006
0
               : yydefgoto[yylhs]);
2007
0
  }
2008
2009
0
  goto yynewstate;
2010
2011
2012
/*--------------------------------------.
2013
| yyerrlab -- here on detecting error.  |
2014
`--------------------------------------*/
2015
236
yyerrlab:
2016
  /* Make sure we have latest lookahead translation.  See comments at
2017
     user semantic actions for why this is necessary.  */
2018
236
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2019
2020
  /* If not already recovering from an error, report this error.  */
2021
236
  if (!yyerrstatus)
2022
236
    {
2023
236
      ++yynerrs;
2024
236
#if ! YYERROR_VERBOSE
2025
236
      yyerror (YY_("syntax error"));
2026
#else
2027
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2028
                                        yyssp, yytoken)
2029
      {
2030
        char const *yymsgp = YY_("syntax error");
2031
        int yysyntax_error_status;
2032
        yysyntax_error_status = YYSYNTAX_ERROR;
2033
        if (yysyntax_error_status == 0)
2034
          yymsgp = yymsg;
2035
        else if (yysyntax_error_status == 1)
2036
          {
2037
            if (yymsg != yymsgbuf)
2038
              YYSTACK_FREE (yymsg);
2039
            yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2040
            if (!yymsg)
2041
              {
2042
                yymsg = yymsgbuf;
2043
                yymsg_alloc = sizeof yymsgbuf;
2044
                yysyntax_error_status = 2;
2045
              }
2046
            else
2047
              {
2048
                yysyntax_error_status = YYSYNTAX_ERROR;
2049
                yymsgp = yymsg;
2050
              }
2051
          }
2052
        yyerror (yymsgp);
2053
        if (yysyntax_error_status == 2)
2054
          goto yyexhaustedlab;
2055
      }
2056
# undef YYSYNTAX_ERROR
2057
#endif
2058
236
    }
2059
2060
2061
2062
236
  if (yyerrstatus == 3)
2063
0
    {
2064
      /* If just tried and failed to reuse lookahead token after an
2065
         error, discard it.  */
2066
2067
0
      if (yychar <= YYEOF)
2068
0
        {
2069
          /* Return failure if at end of input.  */
2070
0
          if (yychar == YYEOF)
2071
0
            YYABORT;
2072
0
        }
2073
0
      else
2074
0
        {
2075
0
          yydestruct ("Error: discarding",
2076
0
                      yytoken, &yylval);
2077
0
          yychar = YYEMPTY;
2078
0
        }
2079
0
    }
2080
2081
  /* Else will try to reuse lookahead token after shifting the error
2082
     token.  */
2083
236
  goto yyerrlab1;
2084
2085
2086
/*---------------------------------------------------.
2087
| yyerrorlab -- error raised explicitly by YYERROR.  |
2088
`---------------------------------------------------*/
2089
236
yyerrorlab:
2090
  /* Pacify compilers when the user code never invokes YYERROR and the
2091
     label yyerrorlab therefore never appears in user code.  */
2092
0
  if (0)
2093
0
    YYERROR;
2094
2095
  /* Do not reclaim the symbols of the rule whose action triggered
2096
     this YYERROR.  */
2097
0
  YYPOPSTACK (yylen);
2098
0
  yylen = 0;
2099
0
  YY_STACK_PRINT (yyss, yyssp);
2100
0
  yystate = *yyssp;
2101
0
  goto yyerrlab1;
2102
2103
2104
/*-------------------------------------------------------------.
2105
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2106
`-------------------------------------------------------------*/
2107
236
yyerrlab1:
2108
236
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2109
2110
236
  for (;;)
2111
236
    {
2112
236
      yyn = yypact[yystate];
2113
236
      if (!yypact_value_is_default (yyn))
2114
236
        {
2115
236
          yyn += YYTERROR;
2116
236
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2117
0
            {
2118
0
              yyn = yytable[yyn];
2119
0
              if (0 < yyn)
2120
0
                break;
2121
0
            }
2122
236
        }
2123
2124
      /* Pop the current state because it cannot handle the error token.  */
2125
236
      if (yyssp == yyss)
2126
236
        YYABORT;
2127
2128
2129
0
      yydestruct ("Error: popping",
2130
0
                  yystos[yystate], yyvsp);
2131
0
      YYPOPSTACK (1);
2132
0
      yystate = *yyssp;
2133
0
      YY_STACK_PRINT (yyss, yyssp);
2134
0
    }
2135
2136
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2137
0
  *++yyvsp = yylval;
2138
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
2139
2140
2141
  /* Shift the error token.  */
2142
0
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2143
2144
0
  yystate = yyn;
2145
0
  goto yynewstate;
2146
2147
2148
/*-------------------------------------.
2149
| yyacceptlab -- YYACCEPT comes here.  |
2150
`-------------------------------------*/
2151
0
yyacceptlab:
2152
0
  yyresult = 0;
2153
0
  goto yyreturn;
2154
2155
2156
/*-----------------------------------.
2157
| yyabortlab -- YYABORT comes here.  |
2158
`-----------------------------------*/
2159
236
yyabortlab:
2160
236
  yyresult = 1;
2161
236
  goto yyreturn;
2162
2163
2164
0
#if !defined yyoverflow || YYERROR_VERBOSE
2165
/*-------------------------------------------------.
2166
| yyexhaustedlab -- memory exhaustion comes here.  |
2167
`-------------------------------------------------*/
2168
0
yyexhaustedlab:
2169
0
  yyerror (YY_("memory exhausted"));
2170
0
  yyresult = 2;
2171
  /* Fall through.  */
2172
0
#endif
2173
2174
2175
/*-----------------------------------------------------.
2176
| yyreturn -- parsing is finished, return the result.  |
2177
`-----------------------------------------------------*/
2178
236
yyreturn:
2179
236
  if (yychar != YYEMPTY)
2180
236
    {
2181
      /* Make sure we have latest lookahead translation.  See comments at
2182
         user semantic actions for why this is necessary.  */
2183
236
      yytoken = YYTRANSLATE (yychar);
2184
236
      yydestruct ("Cleanup: discarding lookahead",
2185
236
                  yytoken, &yylval);
2186
236
    }
2187
  /* Do not reclaim the symbols of the rule whose action triggered
2188
     this YYABORT or YYACCEPT.  */
2189
236
  YYPOPSTACK (yylen);
2190
236
  YY_STACK_PRINT (yyss, yyssp);
2191
236
  while (yyssp != yyss)
2192
0
    {
2193
0
      yydestruct ("Cleanup: popping",
2194
0
                  yystos[+*yyssp], yyvsp);
2195
0
      YYPOPSTACK (1);
2196
0
    }
2197
236
#ifndef yyoverflow
2198
236
  if (yyss != yyssa)
2199
0
    YYSTACK_FREE (yyss);
2200
236
#endif
2201
#if YYERROR_VERBOSE
2202
  if (yymsg != yymsgbuf)
2203
    YYSTACK_FREE (yymsg);
2204
#endif
2205
236
  return yyresult;
2206
0
}