Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/* A Bison parser, made by GNU Bison 3.0.4.  */
2
 
3
/* Bison implementation for Yacc-like parsers in C
4
 
5
   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
 
7
   This program is free software: you can redistribute it and/or modify
8
   it under the terms of the GNU General Public License as published by
9
   the Free Software Foundation, either version 3 of the License, or
10
   (at your option) any later version.
11
 
12
   This program is distributed in the hope that it will be useful,
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
   GNU General Public License for more details.
16
 
17
   You should have received a copy of the GNU General Public License
18
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
 
20
/* As a special exception, you may create a larger work that contains
21
   part or all of the Bison parser skeleton and distribute that work
22
   under terms of your choice, so long as that work isn't itself a
23
   parser generator using the skeleton or a modified version thereof
24
   as a parser skeleton.  Alternatively, if you modify or redistribute
25
   the parser skeleton itself, you may (at your option) remove this
26
   special exception, which will cause the skeleton and the resulting
27
   Bison output files to be licensed under the GNU General Public
28
   License without this special exception.
29
 
30
   This special exception was added by the Free Software Foundation in
31
   version 2.2 of Bison.  */
32
 
33
/* C LALR(1) parser skeleton written by Richard Stallman, by
34
   simplifying the original so-called "semantic" parser.  */
35
 
36
/* All symbols defined below should begin with yy or YY, to avoid
37
   infringing on user name space.  This should be done even for local
38
   variables, as they might otherwise be expanded by user macros.
39
   There are some unavoidable exceptions within include files to
40
   define necessary library symbols; they are noted "INFRINGES ON
41
   USER NAME SPACE" below.  */
42
 
43
/* Identify Bison output.  */
44
#define YYBISON 1
45
 
46
/* Bison version.  */
47
#define YYBISON_VERSION "3.0.4"
48
 
49
/* Skeleton name.  */
50
#define YYSKELETON_NAME "yacc.c"
51
 
52
/* Pure parsers.  */
53
#define YYPURE 0
54
 
55
/* Push parsers.  */
56
#define YYPUSH 0
57
 
58
/* Pull parsers.  */
59
#define YYPULL 1
60
 
61
/* Copy the first part of user declarations.  */
62
#line 1 "rep2_yacc.y" /* yacc.c:339  */
63
 
64
/*
65
 * $Header: C:/cvsroot/Vert03/rep2_src/rep2_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
66
 *
67
 * $Log: rep2_yacc.y,v $
68
 * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
69
 * Imported into local repositrory
70
 *
71
 * Revision 1.5  2003/03/04 15:25:12  mjames
72
 * Added #ident
73
 *
74
 * Revision 1.4  2002/10/02 19:37:27  MJAMES
75
 * Moved dummy functions to a separate support file.
76
 *
77
 * Used correct number of arguments to define_pin
78
 *
79
 * Revision 1.3  2002/01/16 10:08:34  mjames
80
 * Removed unused terminals
81
 *
82
 * Revision 1.2  2001/10/31 22:20:15  mjames
83
 * Tidying up problematical comments caused by CVS
84
 * 'intelligent' comment guessing
85
 *
86
 * Revision 1.1  2001/10/02 20:52:58  mjames
87
 * Another .REP file format reader
88
 *
89
 *
90
 
91
 
92
 *  */
93
 
94
#include "database.h"
95
#include "expression.h"
96
#include "generic.h"
97
 
98
#include <stdio.h>
99
#include <stdlib.h>
100
#include <string.h>
101
/*
102
@title
103
PROGRAM rep2read
104
@text
105
Reads Yet Another Bloody Drawing Office File Format.
106
@break
107
Try this one as well as PROGRAM repread on '.REP' files.
108
@end
109
*/
110
 
111
#ident                                                                                        \
112
    "@(#)$Header: C:/cvsroot/Vert03/rep2_src/rep2_yacc.y,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $"
113
 
114
static socket_t *current_chip;
115
static char curr_net_nam[MAXIDLEN];
116
int inside_block;
117
 
118
#line 124 "rep2_yacc.c" /* yacc.c:339  */
119
 
120
#ifndef YY_NULLPTR
121
#if defined __cplusplus && 201103L <= __cplusplus
122
#define YY_NULLPTR nullptr
123
#else
124
#define YY_NULLPTR 0
125
#endif
126
#endif
127
 
128
/* Enabling verbose error messages.  */
129
#ifdef YYERROR_VERBOSE
130
#undef YYERROR_VERBOSE
131
#define YYERROR_VERBOSE 1
132
#else
133
#define YYERROR_VERBOSE 0
134
#endif
135
 
136
/* Debug traces.  */
137
#ifndef YYDEBUG
138
#define YYDEBUG 0
139
#endif
140
#if YYDEBUG
141
extern int yydebug;
142
#endif
143
 
144
/* Token type.  */
145
#ifndef YYTOKENTYPE
146
#define YYTOKENTYPE
147
enum yytokentype
148
{
149
        SPACE = 258,
150
        LF = 259,
151
        CR = 260,
152
        ENDFILE = 261,
153
        ASTRING = 262
154
};
155
#endif
156
/* Tokens.  */
157
#define SPACE 258
158
#define LF 259
159
#define CR 260
160
#define ENDFILE 261
161
#define ASTRING 262
162
 
163
/* Value type.  */
164
#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
165
 
166
union YYSTYPE
167
{
168
#line 58 "rep2_yacc.y" /* yacc.c:355  */
169
        char *string;
170
 
171
#line 178 "rep2_yacc.c" /* yacc.c:355  */
172
};
173
 
174
typedef union YYSTYPE YYSTYPE;
175
#define YYSTYPE_IS_TRIVIAL 1
176
#define YYSTYPE_IS_DECLARED 1
177
#endif
178
 
179
extern YYSTYPE yylval;
180
 
181
int yyparse (void);
182
 
183
/* Copy the second part of user declarations.  */
184
 
185
#line 195 "rep2_yacc.c" /* yacc.c:358  */
186
 
187
#ifdef short
188
#undef short
189
#endif
190
 
191
#ifdef YYTYPE_UINT8
192
typedef YYTYPE_UINT8 yytype_uint8;
193
#else
194
typedef unsigned char yytype_uint8;
195
#endif
196
 
197
#ifdef YYTYPE_INT8
198
typedef YYTYPE_INT8 yytype_int8;
199
#else
200
typedef signed char yytype_int8;
201
#endif
202
 
203
#ifdef YYTYPE_UINT16
204
typedef YYTYPE_UINT16 yytype_uint16;
205
#else
206
typedef unsigned short int yytype_uint16;
207
#endif
208
 
209
#ifdef YYTYPE_INT16
210
typedef YYTYPE_INT16 yytype_int16;
211
#else
212
typedef short int yytype_int16;
213
#endif
214
 
215
#ifndef YYSIZE_T
216
#ifdef __SIZE_TYPE__
217
#define YYSIZE_T __SIZE_TYPE__
218
#elif defined size_t
219
#define YYSIZE_T size_t
220
#elif !defined YYSIZE_T
221
#include <stddef.h> /* INFRINGES ON USER NAME SPACE */
222
#define YYSIZE_T size_t
223
#else
224
#define YYSIZE_T unsigned int
225
#endif
226
#endif
227
 
228
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
229
 
230
#ifndef YY_
231
#if defined YYENABLE_NLS && YYENABLE_NLS
232
#if ENABLE_NLS
233
#include <libintl.h> /* INFRINGES ON USER NAME SPACE */
234
#define YY_(Msgid) dgettext ("bison-runtime", Msgid)
235
#endif
236
#endif
237
#ifndef YY_
238
#define YY_(Msgid) Msgid
239
#endif
240
#endif
241
 
242
#ifndef YY_ATTRIBUTE
243
#if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) ||        \
244
    defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
245
#define YY_ATTRIBUTE(Spec) __attribute__ (Spec)
246
#else
247
#define YY_ATTRIBUTE(Spec) /* empty */
248
#endif
249
#endif
250
 
251
#ifndef YY_ATTRIBUTE_PURE
252
#define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
253
#endif
254
 
255
#ifndef YY_ATTRIBUTE_UNUSED
256
#define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
257
#endif
258
 
259
#if !defined _Noreturn && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
260
#if defined _MSC_VER && 1200 <= _MSC_VER
261
#define _Noreturn __declspec(noreturn)
262
#else
263
#define _Noreturn YY_ATTRIBUTE((__noreturn__))
264
#endif
265
#endif
266
 
267
/* Suppress unused-variable warnings by "using" E.  */
268
#if !defined lint || defined __GNUC__
269
#define YYUSE(E) ((void) (E))
270
#else
271
#define YYUSE(E) /* empty */
272
#endif
273
 
274
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
275
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
276
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                                                   \
277
        _Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic ignored "                    \
278
                                                 "\"-Wuninitialized\"")                       \
279
            _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
280
#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma ("GCC diagnostic pop")
281
#else
282
#define YY_INITIAL_VALUE(Value) Value
283
#endif
284
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
285
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
286
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
287
#endif
288
#ifndef YY_INITIAL_VALUE
289
#define YY_INITIAL_VALUE(Value) /* Nothing. */
290
#endif
291
 
292
#if !defined yyoverflow || YYERROR_VERBOSE
293
 
294
/* The parser invokes alloca or malloc; define the necessary symbols.  */
295
 
296
#ifdef YYSTACK_USE_ALLOCA
297
#if YYSTACK_USE_ALLOCA
298
#ifdef __GNUC__
299
#define YYSTACK_ALLOC __builtin_alloca
300
#elif defined __BUILTIN_VA_ARG_INCR
301
#include <alloca.h> /* INFRINGES ON USER NAME SPACE */
302
#elif defined _AIX
303
#define YYSTACK_ALLOC __alloca
304
#elif defined _MSC_VER
305
#include <malloc.h> /* INFRINGES ON USER NAME SPACE */
306
#define alloca _alloca
307
#else
308
#define YYSTACK_ALLOC alloca
309
#if !defined _ALLOCA_H && !defined EXIT_SUCCESS
310
#include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
311
/* Use EXIT_SUCCESS as a witness for stdlib.h.  */
312
#ifndef EXIT_SUCCESS
313
#define EXIT_SUCCESS 0
314
#endif
315
#endif
316
#endif
317
#endif
318
#endif
319
 
320
#ifdef YYSTACK_ALLOC
321
/* Pacify GCC's 'empty if-body' warning.  */
322
#define YYSTACK_FREE(Ptr)                                                                     \
323
        do                                                                                    \
324
        { /* empty */                                                                         \
325
                ;                                                                             \
326
        } while (0)
327
#ifndef YYSTACK_ALLOC_MAXIMUM
328
/* The OS might guarantee only one guard page at the bottom of the stack,
329
   and a page size can be as small as 4096 bytes.  So we cannot safely
330
   invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
331
   to allow for a few compiler-allocated temporary stack slots.  */
332
#define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
333
#endif
334
#else
335
#define YYSTACK_ALLOC YYMALLOC
336
#define YYSTACK_FREE YYFREE
337
#ifndef YYSTACK_ALLOC_MAXIMUM
338
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
339
#endif
340
#if (                                                                                         \
341
    defined __cplusplus && !defined EXIT_SUCCESS &&                                           \
342
    !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
343
#include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
344
#ifndef EXIT_SUCCESS
345
#define EXIT_SUCCESS 0
346
#endif
347
#endif
348
#ifndef YYMALLOC
349
#define YYMALLOC malloc
350
#if !defined malloc && !defined EXIT_SUCCESS
351
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
352
#endif
353
#endif
354
#ifndef YYFREE
355
#define YYFREE free
356
#if !defined free && !defined EXIT_SUCCESS
357
void free (void *);      /* INFRINGES ON USER NAME SPACE */
358
#endif
359
#endif
360
#endif
361
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
362
 
363
#if (                                                                                         \
364
    !defined yyoverflow &&                                                                    \
365
    (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
366
 
367
/* A type that is properly aligned for any stack member.  */
368
union yyalloc
369
{
370
        yytype_int16 yyss_alloc;
371
        YYSTYPE yyvs_alloc;
372
};
373
 
374
/* The size of the maximum gap between one aligned stack and the next.  */
375
#define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
376
 
377
/* The size of an array large to enough to hold all stacks, each with
378
   N elements.  */
379
#define YYSTACK_BYTES(N)                                                                      \
380
        ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
381
 
382
#define YYCOPY_NEEDED 1
383
 
384
/* Relocate STACK from its old location to the new one.  The
385
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
386
   elements in the stack, and YYPTR gives the new location of the
387
   stack.  Advance YYPTR to a properly aligned location for the next
388
   stack.  */
389
#define YYSTACK_RELOCATE(Stack_alloc, Stack)                                                  \
390
        do                                                                                    \
391
        {                                                                                     \
392
                YYSIZE_T yynewbytes;                                                          \
393
                YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                                  \
394
                Stack = &yyptr->Stack_alloc;                                                  \
395
                yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM;             \
396
                yyptr += yynewbytes / sizeof (*yyptr);                                        \
397
        } while (0)
398
 
399
#endif
400
 
401
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
402
/* Copy COUNT objects from SRC to DST.  The source and destination do
403
   not overlap.  */
404
#ifndef YYCOPY
405
#if defined __GNUC__ && 1 < __GNUC__
406
#define YYCOPY(Dst, Src, Count) __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
407
#else
408
#define YYCOPY(Dst, Src, Count)                                                               \
409
        do                                                                                    \
410
        {                                                                                     \
411
                YYSIZE_T yyi;                                                                 \
412
                for (yyi = 0; yyi < (Count); yyi++)                                           \
413
                        (Dst)[yyi] = (Src)[yyi];                                              \
414
        } while (0)
415
#endif
416
#endif
417
#endif /* !YYCOPY_NEEDED */
418
 
419
/* YYFINAL -- State number of the termination state.  */
420
#define YYFINAL 8
421
/* YYLAST -- Last index in YYTABLE.  */
422
#define YYLAST 18
423
 
424
/* YYNTOKENS -- Number of terminals.  */
425
#define YYNTOKENS 8
426
/* YYNNTS -- Number of nonterminals.  */
427
#define YYNNTS 8
428
/* YYNRULES -- Number of rules.  */
429
#define YYNRULES 13
430
/* YYNSTATES -- Number of states.  */
431
#define YYNSTATES 25
432
 
433
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
434
   by yylex, with out-of-bounds checking.  */
435
#define YYUNDEFTOK 2
436
#define YYMAXUTOK 262
437
 
438
#define YYTRANSLATE(YYX) ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
439
 
440
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
441
   as returned by yylex, without out-of-bounds checking.  */
442
static const yytype_uint8 yytranslate[] = {
443
    0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7};
452
 
453
#if YYDEBUG
454
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
455
static const yytype_uint8 yyrline[] = {
456
    0, 65, 65, 68, 69, 73, 78, 88, 89, 92, 93, 94, 100, 101};
457
#endif
458
 
459
#if YYDEBUG || YYERROR_VERBOSE || 0
460
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
461
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
462
static const char *const yytname[] = {"$end",
463
                                      "error",
464
                                      "$undefined",
465
                                      "SPACE",
466
                                      "LF",
467
                                      "CR",
468
                                      "ENDFILE",
469
                                      "ASTRING",
470
                                      "$accept",
471
                                      "file",
472
                                      "objects",
473
                                      "object",
474
                                      "pin",
475
                                      "netid",
476
                                      "endline",
477
                                      "spaces",
478
                                      YY_NULLPTR};
479
#endif
480
 
481
#ifdef YYPRINT
482
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
483
   (internal) symbol number NUM (which must be that of a token).  */
484
static const yytype_uint16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 262};
485
#endif
486
 
487
#define YYPACT_NINF -7
488
 
489
#define yypact_value_is_default(Yystate) (!!((Yystate) == (-7)))
490
 
491
#define YYTABLE_NINF -1
492
 
493
#define yytable_value_is_error(Yytable_value) 0
494
 
495
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
496
   STATE-NUM.  */
497
static const yytype_int8 yypact[] = {-6, 2, 6, -6, -7, -7, -7, -3, -7, -7, -7, 4, 1,
498
                                     -7, 7, 5, 8,  9,  10, 11, -2, -7, 13, -7, -7};
499
 
500
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
501
   Performed when YYTABLE does not specify something else to do.  Zero
502
   means the default is an error.  */
503
static const yytype_uint8 yydefact[] = {0, 0, 0, 2, 4, 5, 13, 0, 1,  3, 12, 0, 8,
504
                                        7, 0, 0, 0, 0, 0, 0,  0, 11, 9, 6,  10};
505
 
506
/* YYPGOTO[NTERM-NUM].  */
507
static const yytype_int8 yypgoto[] = {-7, -7, -7, 12, -7, -7, -7, -7};
508
 
509
/* YYDEFGOTO[NTERM-NUM].  */
510
static const yytype_int8 yydefgoto[] = {-1, 2, 3, 4, 5, 14, 23, 7};
511
 
512
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
513
   positive, shift that token.  If negative, reduce the rule whose
514
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
515
static const yytype_uint8 yytable[] = {
516
    10, 1, 21, 22, 11, 6, 8, 12, 13, 0, 15, 17, 16, 19, 0, 9, 18, 24, 20};
517
 
518
static const yytype_int8 yycheck[] = {
519
    3, 7, 4, 5, 7, 3, 0, 3, 7, -1, 3, 3, 7, 3, -1, 3, 7, 4, 7};
520
 
521
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
522
   symbol of state STATE-NUM.  */
523
static const yytype_uint8 yystos[] = {0, 7,  9, 10, 11, 12, 3, 15, 0, 11, 3,  7, 3,
524
                                      7, 13, 3, 7,  3,  7,  3, 7,  4, 5,  14, 4};
525
 
526
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
527
static const yytype_uint8 yyr1[] = {0, 8, 9, 10, 10, 11, 12, 13, 13, 14, 14, 14, 15, 15};
528
 
529
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
530
static const yytype_uint8 yyr2[] = {0, 2, 1, 2, 1, 1, 12, 1, 0, 1, 2, 1, 2, 1};
531
 
532
#define yyerrok (yyerrstatus = 0)
533
#define yyclearin (yychar = YYEMPTY)
534
#define YYEMPTY (-2)
535
#define YYEOF 0
536
 
537
#define YYACCEPT goto yyacceptlab
538
#define YYABORT goto yyabortlab
539
#define YYERROR goto yyerrorlab
540
 
541
#define YYRECOVERING() (!!yyerrstatus)
542
 
543
#define YYBACKUP(Token, Value)                                                                \
544
        do                                                                                    \
545
                if (yychar == YYEMPTY)                                                        \
546
                {                                                                             \
547
                        yychar = (Token);                                                     \
548
                        yylval = (Value);                                                     \
549
                        YYPOPSTACK (yylen);                                                   \
550
                        yystate = *yyssp;                                                     \
551
                        goto yybackup;                                                        \
552
                }                                                                             \
553
                else                                                                          \
554
                {                                                                             \
555
                        yyerror (YY_ ("syntax error: cannot back up"));                       \
556
                        YYERROR;                                                              \
557
                }                                                                             \
558
        while (0)
559
 
560
/* Error token number */
561
#define YYTERROR 1
562
#define YYERRCODE 256
563
 
564
/* Enable debugging if requested.  */
565
#if YYDEBUG
566
 
567
#ifndef YYFPRINTF
568
#include <stdio.h> /* INFRINGES ON USER NAME SPACE */
569
#define YYFPRINTF fprintf
570
#endif
571
 
572
#define YYDPRINTF(Args)                                                                       \
573
        do                                                                                    \
574
        {                                                                                     \
575
                if (yydebug)                                                                  \
576
                        YYFPRINTF Args;                                                       \
577
        } while (0)
578
 
579
/* This macro is provided for backward compatibility. */
580
#ifndef YY_LOCATION_PRINT
581
#define YY_LOCATION_PRINT(File, Loc) ((void) 0)
582
#endif
583
 
584
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)                                         \
585
        do                                                                                    \
586
        {                                                                                     \
587
                if (yydebug)                                                                  \
588
                {                                                                             \
589
                        YYFPRINTF (stderr, "%s ", Title);                                     \
590
                        yy_symbol_print (stderr, Type, Value);                                \
591
                        YYFPRINTF (stderr, "\n");                                             \
592
                }                                                                             \
593
        } while (0)
594
 
595
/*----------------------------------------.
596
| Print this symbol's value on YYOUTPUT.  |
597
`----------------------------------------*/
598
 
599
static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
600
{
601
        FILE *yyo = yyoutput;
602
        YYUSE (yyo);
603
        if (!yyvaluep)
604
                return;
605
#ifdef YYPRINT
606
        if (yytype < YYNTOKENS)
607
                YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
608
#endif
609
        YYUSE (yytype);
610
}
611
 
612
/*--------------------------------.
613
| Print this symbol on YYOUTPUT.  |
614
`--------------------------------*/
615
 
616
static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
617
{
618
        YYFPRINTF (
619
            yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
620
 
621
        yy_symbol_value_print (yyoutput, yytype, yyvaluep);
622
        YYFPRINTF (yyoutput, ")");
623
}
624
 
625
/*------------------------------------------------------------------.
626
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
627
| TOP (included).                                                   |
628
`------------------------------------------------------------------*/
629
 
630
static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
631
{
632
        YYFPRINTF (stderr, "Stack now");
633
        for (; yybottom <= yytop; yybottom++)
634
        {
635
                int yybot = *yybottom;
636
                YYFPRINTF (stderr, " %d", yybot);
637
        }
638
        YYFPRINTF (stderr, "\n");
639
}
640
 
641
#define YY_STACK_PRINT(Bottom, Top)                                                           \
642
        do                                                                                    \
643
        {                                                                                     \
644
                if (yydebug)                                                                  \
645
                        yy_stack_print ((Bottom), (Top));                                     \
646
        } while (0)
647
 
648
/*------------------------------------------------.
649
| Report that the YYRULE is going to be reduced.  |
650
`------------------------------------------------*/
651
 
652
static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
653
{
654
        unsigned long int yylno = yyrline[yyrule];
655
        int yynrhs = yyr2[yyrule];
656
        int yyi;
657
        YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
658
        /* The symbols being reduced.  */
659
        for (yyi = 0; yyi < yynrhs; yyi++)
660
        {
661
                YYFPRINTF (stderr, "   $%d = ", yyi + 1);
662
                yy_symbol_print (
663
                    stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]));
664
                YYFPRINTF (stderr, "\n");
665
        }
666
}
667
 
668
#define YY_REDUCE_PRINT(Rule)                                                                 \
669
        do                                                                                    \
670
        {                                                                                     \
671
                if (yydebug)                                                                  \
672
                        yy_reduce_print (yyssp, yyvsp, Rule);                                 \
673
        } while (0)
674
 
675
/* Nonzero means print parse trace.  It is left uninitialized so that
676
   multiple parsers can coexist.  */
677
int yydebug;
678
#else /* !YYDEBUG */
679
#define YYDPRINTF(Args)
680
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
681
#define YY_STACK_PRINT(Bottom, Top)
682
#define YY_REDUCE_PRINT(Rule)
683
#endif /* !YYDEBUG */
684
 
685
/* YYINITDEPTH -- initial size of the parser's stacks.  */
686
#ifndef YYINITDEPTH
687
#define YYINITDEPTH 200
688
#endif
689
 
690
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
691
   if the built-in stack extension method is used).
692
 
693
   Do not make this value too large; the results are undefined if
694
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
695
   evaluated with infinite-precision integer arithmetic.  */
696
 
697
#ifndef YYMAXDEPTH
698
#define YYMAXDEPTH 10000
699
#endif
700
 
701
#if YYERROR_VERBOSE
702
 
703
#ifndef yystrlen
704
#if defined __GLIBC__ && defined _STRING_H
705
#define yystrlen strlen
706
#else
707
/* Return the length of YYSTR.  */
708
static YYSIZE_T yystrlen (const char *yystr)
709
{
710
        YYSIZE_T yylen;
711
        for (yylen = 0; yystr[yylen]; yylen++)
712
                continue;
713
        return yylen;
714
}
715
#endif
716
#endif
717
 
718
#ifndef yystpcpy
719
#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
720
#define yystpcpy stpcpy
721
#else
722
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
723
   YYDEST.  */
724
static char *yystpcpy (char *yydest, const char *yysrc)
725
{
726
        char *yyd = yydest;
727
        const char *yys = yysrc;
728
 
729
        while ((*yyd++ = *yys++) != '\0')
730
                continue;
731
 
732
        return yyd - 1;
733
}
734
#endif
735
#endif
736
 
737
#ifndef yytnamerr
738
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
739
   quotes and backslashes, so that it's suitable for yyerror.  The
740
   heuristic is that double-quoting is unnecessary unless the string
741
   contains an apostrophe, a comma, or backslash (other than
742
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
743
   null, do not copy; instead, return the length of what the result
744
   would have been.  */
745
static YYSIZE_T yytnamerr (char *yyres, const char *yystr)
746
{
747
        if (*yystr == '"')
748
        {
749
                YYSIZE_T yyn = 0;
750
                char const *yyp = yystr;
751
 
752
                for (;;)
753
                        switch (*++yyp)
754
                        {
755
                        case '\'':
756
                        case ',':
757
                                goto do_not_strip_quotes;
758
 
759
                        case '\\':
760
                                if (*++yyp != '\\')
761
                                        goto do_not_strip_quotes;
762
                                /* Fall through.  */
763
                        default:
764
                                if (yyres)
765
                                        yyres[yyn] = *yyp;
766
                                yyn++;
767
                                break;
768
 
769
                        case '"':
770
                                if (yyres)
771
                                        yyres[yyn] = '\0';
772
                                return yyn;
773
                        }
774
        do_not_strip_quotes:;
775
        }
776
 
777
        if (!yyres)
778
                return yystrlen (yystr);
779
 
780
        return yystpcpy (yyres, yystr) - yyres;
781
}
782
#endif
783
 
784
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
785
   about the unexpected token YYTOKEN for the state stack whose top is
786
   YYSSP.
787
 
788
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
789
   not large enough to hold the message.  In that case, also set
790
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
791
   required number of bytes is too large to store.  */
792
static int
793
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
794
{
795
        YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
796
        YYSIZE_T yysize = yysize0;
797
        enum
798
        {
799
                YYERROR_VERBOSE_ARGS_MAXIMUM = 5
800
        };
801
        /* Internationalized format string. */
802
        const char *yyformat = YY_NULLPTR;
803
        /* Arguments of yyformat. */
804
        char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
805
        /* Number of reported tokens (one for the "unexpected", one per
806
           "expected"). */
807
        int yycount = 0;
808
 
809
        /* There are many possibilities here to consider:
810
           - If this state is a consistent state with a default action, then
811
             the only way this function was invoked is if the default action
812
             is an error action.  In that case, don't check for expected
813
             tokens because there are none.
814
           - The only way there can be no lookahead present (in yychar) is if
815
             this state is a consistent state with a default action.  Thus,
816
             detecting the absence of a lookahead is sufficient to determine
817
             that there is no unexpected or expected token to report.  In that
818
             case, just report a simple "syntax error".
819
           - Don't assume there isn't a lookahead just because this state is a
820
             consistent state with a default action.  There might have been a
821
             previous inconsistent state, consistent state with a non-default
822
             action, or user semantic action that manipulated yychar.
823
           - Of course, the expected token list depends on states to have
824
             correct lookahead information, and it depends on the parser not
825
             to perform extra reductions after fetching a lookahead from the
826
             scanner and before detecting a syntax error.  Thus, state merging
827
             (from LALR or IELR) and default reductions corrupt the expected
828
             token list.  However, the list is correct for canonical LR with
829
             one exception: it will still contain any token that will not be
830
             accepted due to an error action in a later state.
831
        */
832
        if (yytoken != YYEMPTY)
833
        {
834
                int yyn = yypact[*yyssp];
835
                yyarg[yycount++] = yytname[yytoken];
836
                if (!yypact_value_is_default (yyn))
837
                {
838
                        /* Start YYX at -YYN if negative to avoid negative indexes in
839
                           YYCHECK.  In other words, skip the first -YYN actions for
840
                           this state because they are default actions.  */
841
                        int yyxbegin = yyn < 0 ? -yyn : 0;
842
                        /* Stay within bounds of both yycheck and yytname.  */
843
                        int yychecklim = YYLAST - yyn + 1;
844
                        int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
845
                        int yyx;
846
 
847
                        for (yyx = yyxbegin; yyx < yyxend; ++yyx)
848
                                if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
849
                                    !yytable_value_is_error (yytable[yyx + yyn]))
850
                                {
851
                                        if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
852
                                        {
853
                                                yycount = 1;
854
                                                yysize = yysize0;
855
                                                break;
856
                                        }
857
                                        yyarg[yycount++] = yytname[yyx];
858
                                        {
859
                                                YYSIZE_T yysize1 =
860
                                                    yysize +
861
                                                    yytnamerr (YY_NULLPTR, yytname[yyx]);
862
                                                if (!(yysize <= yysize1 &&
863
                                                      yysize1 <= YYSTACK_ALLOC_MAXIMUM))
864
                                                        return 2;
865
                                                yysize = yysize1;
866
                                        }
867
                                }
868
                }
869
        }
870
 
871
        switch (yycount)
872
        {
873
#define YYCASE_(N, S)                                                                         \
874
        case N:                                                                               \
875
                yyformat = S;                                                                 \
876
                break
877
                YYCASE_ (0, YY_ ("syntax error"));
878
                YYCASE_ (1, YY_ ("syntax error, unexpected %s"));
879
                YYCASE_ (2, YY_ ("syntax error, unexpected %s, expecting %s"));
880
                YYCASE_ (3, YY_ ("syntax error, unexpected %s, expecting %s or %s"));
881
                YYCASE_ (4, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s"));
882
                YYCASE_ (
883
                    5, YY_ ("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
884
#undef YYCASE_
885
        }
886
 
887
        {
888
                YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
889
                if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
890
                        return 2;
891
                yysize = yysize1;
892
        }
893
 
894
        if (*yymsg_alloc < yysize)
895
        {
896
                *yymsg_alloc = 2 * yysize;
897
                if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
898
                        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
899
                return 1;
900
        }
901
 
902
        /* Avoid sprintf, as that infringes on the user's name space.
903
           Don't have undefined behavior even if the translation
904
           produced a string with the wrong number of "%s"s.  */
905
        {
906
                char *yyp = *yymsg;
907
                int yyi = 0;
908
                while ((*yyp = *yyformat) != '\0')
909
                        if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
910
                        {
911
                                yyp += yytnamerr (yyp, yyarg[yyi++]);
912
                                yyformat += 2;
913
                        }
914
                        else
915
                        {
916
                                yyp++;
917
                                yyformat++;
918
                        }
919
        }
920
        return 0;
921
}
922
#endif /* YYERROR_VERBOSE */
923
 
924
/*-----------------------------------------------.
925
| Release the memory associated to this symbol.  |
926
`-----------------------------------------------*/
927
 
928
static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
929
{
930
        YYUSE (yyvaluep);
931
        if (!yymsg)
932
                yymsg = "Deleting";
933
        YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
934
 
935
        YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
936
        YYUSE (yytype);
937
        YY_IGNORE_MAYBE_UNINITIALIZED_END
938
}
939
 
940
/* The lookahead symbol.  */
941
int yychar;
942
 
943
/* The semantic value of the lookahead symbol.  */
944
YYSTYPE yylval;
945
/* Number of syntax errors so far.  */
946
int yynerrs;
947
 
948
/*----------.
949
| yyparse.  |
950
`----------*/
951
 
952
int yyparse (void)
953
{
954
        int yystate;
955
        /* Number of tokens to shift before error messages enabled.  */
956
        int yyerrstatus;
957
 
958
        /* The stacks and their tools:
959
           'yyss': related to states.
960
           'yyvs': related to semantic values.
961
 
962
           Refer to the stacks through separate pointers, to allow yyoverflow
963
           to reallocate them elsewhere.  */
964
 
965
        /* The state stack.  */
966
        yytype_int16 yyssa[YYINITDEPTH];
967
        yytype_int16 *yyss;
968
        yytype_int16 *yyssp;
969
 
970
        /* The semantic value stack.  */
971
        YYSTYPE yyvsa[YYINITDEPTH];
972
        YYSTYPE *yyvs;
973
        YYSTYPE *yyvsp;
974
 
975
        YYSIZE_T yystacksize;
976
 
977
        int yyn;
978
        int yyresult;
979
        /* Lookahead token as an internal (translated) token number.  */
980
        int yytoken = 0;
981
        /* The variables used to return semantic value and location from the
982
           action routines.  */
983
        YYSTYPE yyval;
984
 
985
#if YYERROR_VERBOSE
986
        /* Buffer for error messages, and its allocated size.  */
987
        char yymsgbuf[128];
988
        char *yymsg = yymsgbuf;
989
        YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
990
#endif
991
 
992
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
993
 
994
        /* The number of symbols on the RHS of the reduced rule.
995
           Keep to zero when no symbol should be popped.  */
996
        int yylen = 0;
997
 
998
        yyssp = yyss = yyssa;
999
        yyvsp = yyvs = yyvsa;
1000
        yystacksize = YYINITDEPTH;
1001
 
1002
        YYDPRINTF ((stderr, "Starting parse\n"));
1003
 
1004
        yystate = 0;
1005
        yyerrstatus = 0;
1006
        yynerrs = 0;
1007
        yychar = YYEMPTY; /* Cause a token to be read.  */
1008
        goto yysetstate;
1009
 
1010
        /*------------------------------------------------------------.
1011
        | yynewstate -- Push a new state, which is found in yystate.  |
1012
        `------------------------------------------------------------*/
1013
yynewstate:
1014
        /* In all cases, when you get here, the value and location stacks
1015
           have just been pushed.  So pushing a state here evens the stacks.  */
1016
        yyssp++;
1017
 
1018
yysetstate:
1019
        *yyssp = yystate;
1020
 
1021
        if (yyss + yystacksize - 1 <= yyssp)
1022
        {
1023
                /* Get the current used size of the three stacks, in elements.  */
1024
                YYSIZE_T yysize = yyssp - yyss + 1;
1025
 
1026
#ifdef yyoverflow
1027
                {
1028
                        /* Give user a chance to reallocate the stack.  Use copies of
1029
                           these so that the &'s don't force the real ones into
1030
                           memory.  */
1031
                        YYSTYPE *yyvs1 = yyvs;
1032
                        yytype_int16 *yyss1 = yyss;
1033
 
1034
                        /* Each stack pointer address is followed by the size of the
1035
                           data in use in that stack, in bytes.  This used to be a
1036
                           conditional around just the two extra args, but that might
1037
                           be undefined if yyoverflow is a macro.  */
1038
                        yyoverflow (
1039
                            YY_ ("memory exhausted"),
1040
                            &yyss1,
1041
                            yysize * sizeof (*yyssp),
1042
                            &yyvs1,
1043
                            yysize * sizeof (*yyvsp),
1044
                            &yystacksize);
1045
 
1046
                        yyss = yyss1;
1047
                        yyvs = yyvs1;
1048
                }
1049
#else /* no yyoverflow */
1050
#ifndef YYSTACK_RELOCATE
1051
                goto yyexhaustedlab;
1052
#else
1053
                /* Extend the stack our own way.  */
1054
                if (YYMAXDEPTH <= yystacksize)
1055
                        goto yyexhaustedlab;
1056
                yystacksize *= 2;
1057
                if (YYMAXDEPTH < yystacksize)
1058
                        yystacksize = YYMAXDEPTH;
1059
 
1060
                {
1061
                        yytype_int16 *yyss1 = yyss;
1062
                        union yyalloc *yyptr =
1063
                            (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1064
                        if (!yyptr)
1065
                                goto yyexhaustedlab;
1066
                        YYSTACK_RELOCATE (yyss_alloc, yyss);
1067
                        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1068
#undef YYSTACK_RELOCATE
1069
                        if (yyss1 != yyssa)
1070
                                YYSTACK_FREE (yyss1);
1071
                }
1072
#endif
1073
#endif /* no yyoverflow */
1074
 
1075
                yyssp = yyss + yysize - 1;
1076
                yyvsp = yyvs + yysize - 1;
1077
 
1078
                YYDPRINTF ((
1079
                    stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize));
1080
 
1081
                if (yyss + yystacksize - 1 <= yyssp)
1082
                        YYABORT;
1083
        }
1084
 
1085
        YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1086
 
1087
        if (yystate == YYFINAL)
1088
                YYACCEPT;
1089
 
1090
        goto yybackup;
1091
 
1092
/*-----------.
1093
| yybackup.  |
1094
`-----------*/
1095
yybackup:
1096
 
1097
        /* Do appropriate processing given the current state.  Read a
1098
           lookahead token if we need one and don't already have one.  */
1099
 
1100
        /* First try to decide what to do without reference to lookahead token.  */
1101
        yyn = yypact[yystate];
1102
        if (yypact_value_is_default (yyn))
1103
                goto yydefault;
1104
 
1105
        /* Not known => get a lookahead token if don't already have one.  */
1106
 
1107
        /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1108
        if (yychar == YYEMPTY)
1109
        {
1110
                YYDPRINTF ((stderr, "Reading a token: "));
1111
                yychar = yylex ();
1112
        }
1113
 
1114
        if (yychar <= YYEOF)
1115
        {
1116
                yychar = yytoken = YYEOF;
1117
                YYDPRINTF ((stderr, "Now at end of input.\n"));
1118
        }
1119
        else
1120
        {
1121
                yytoken = YYTRANSLATE (yychar);
1122
                YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1123
        }
1124
 
1125
        /* If the proper action on seeing token YYTOKEN is to reduce or to
1126
           detect an error, take that action.  */
1127
        yyn += yytoken;
1128
        if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1129
                goto yydefault;
1130
        yyn = yytable[yyn];
1131
        if (yyn <= 0)
1132
        {
1133
                if (yytable_value_is_error (yyn))
1134
                        goto yyerrlab;
1135
                yyn = -yyn;
1136
                goto yyreduce;
1137
        }
1138
 
1139
        /* Count tokens shifted since error; after three, turn off error
1140
           status.  */
1141
        if (yyerrstatus)
1142
                yyerrstatus--;
1143
 
1144
        /* Shift the lookahead token.  */
1145
        YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1146
 
1147
        /* Discard the shifted token.  */
1148
        yychar = YYEMPTY;
1149
 
1150
        yystate = yyn;
1151
        YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1152
        *++yyvsp = yylval;
1153
        YY_IGNORE_MAYBE_UNINITIALIZED_END
1154
 
1155
        goto yynewstate;
1156
 
1157
/*-----------------------------------------------------------.
1158
| yydefault -- do the default action for the current state.  |
1159
`-----------------------------------------------------------*/
1160
yydefault:
1161
        yyn = yydefact[yystate];
1162
        if (yyn == 0)
1163
                goto yyerrlab;
1164
        goto yyreduce;
1165
 
1166
/*-----------------------------.
1167
| yyreduce -- Do a reduction.  |
1168
`-----------------------------*/
1169
yyreduce:
1170
        /* yyn is the number of a rule to reduce with.  */
1171
        yylen = yyr2[yyn];
1172
 
1173
        /* If YYLEN is nonzero, implement the default value of the action:
1174
           '$$ = $1'.
1175
 
1176
           Otherwise, the following line sets YYVAL to garbage.
1177
           This behavior is undocumented and Bison
1178
           users should not rely upon it.  Assigning to YYVAL
1179
           unconditionally makes the parser a bit smaller, and it avoids a
1180
           GCC warning that YYVAL may be used uninitialized.  */
1181
        yyval = yyvsp[1 - yylen];
1182
 
1183
        YY_REDUCE_PRINT (yyn);
1184
        switch (yyn)
1185
        {
1186
        case 6:
1187
#line 79 "rep2_yacc.y" /* yacc.c:1646  */
1188
        {
1189
                /* socket pin_id [ net_id ] x y layer */
1190
                define_pin (
1191
                    &routed_list,
1192
                    find_socket (Ident, (yyvsp[-11].string), Create, &socket_head),
1193
                    (yyvsp[-7].string),
1194
                    BIDIR,
1195
                    0,
1196
                    (yyvsp[-9].string),
1197
                    default_vhdl_datatype,
1198
                    NULL);
1199
        }
1200
#line 1280 "rep2_yacc.c" /* yacc.c:1646  */
1201
        break;
1202
 
1203
        case 7:
1204
#line 88 "rep2_yacc.y" /* yacc.c:1646  */
1205
        {
1206
                (yyval.string) = (yyvsp[0].string);
1207
        }
1208
#line 1286 "rep2_yacc.c" /* yacc.c:1646  */
1209
        break;
1210
 
1211
        case 8:
1212
#line 89 "rep2_yacc.y" /* yacc.c:1646  */
1213
        {
1214
                (yyval.string) = "";
1215
        }
1216
#line 1292 "rep2_yacc.c" /* yacc.c:1646  */
1217
        break;
1218
 
1219
#line 1296 "rep2_yacc.c" /* yacc.c:1646  */
1220
        default:
1221
                break;
1222
        }
1223
        /* User semantic actions sometimes alter yychar, and that requires
1224
           that yytoken be updated with the new translation.  We take the
1225
           approach of translating immediately before every use of yytoken.
1226
           One alternative is translating here after every semantic action,
1227
           but that translation would be missed if the semantic action invokes
1228
           YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1229
           if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1230
           incorrect destructor might then be invoked immediately.  In the
1231
           case of YYERROR or YYBACKUP, subsequent parser actions might lead
1232
           to an incorrect destructor call or verbose syntax error message
1233
           before the lookahead is translated.  */
1234
        YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1235
 
1236
        YYPOPSTACK (yylen);
1237
        yylen = 0;
1238
        YY_STACK_PRINT (yyss, yyssp);
1239
 
1240
        *++yyvsp = yyval;
1241
 
1242
        /* Now 'shift' the result of the reduction.  Determine what state
1243
           that goes to, based on the state we popped back to and the rule
1244
           number reduced by.  */
1245
 
1246
        yyn = yyr1[yyn];
1247
 
1248
        yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1249
        if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1250
                yystate = yytable[yystate];
1251
        else
1252
                yystate = yydefgoto[yyn - YYNTOKENS];
1253
 
1254
        goto yynewstate;
1255
 
1256
/*--------------------------------------.
1257
| yyerrlab -- here on detecting error.  |
1258
`--------------------------------------*/
1259
yyerrlab:
1260
        /* Make sure we have latest lookahead translation.  See comments at
1261
           user semantic actions for why this is necessary.  */
1262
        yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1263
 
1264
        /* If not already recovering from an error, report this error.  */
1265
        if (!yyerrstatus)
1266
        {
1267
                ++yynerrs;
1268
#if !YYERROR_VERBOSE
1269
                yyerror (YY_ ("syntax error"));
1270
#else
1271
#define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, yyssp, yytoken)
1272
                {
1273
                        char const *yymsgp = YY_ ("syntax error");
1274
                        int yysyntax_error_status;
1275
                        yysyntax_error_status = YYSYNTAX_ERROR;
1276
                        if (yysyntax_error_status == 0)
1277
                                yymsgp = yymsg;
1278
                        else if (yysyntax_error_status == 1)
1279
                        {
1280
                                if (yymsg != yymsgbuf)
1281
                                        YYSTACK_FREE (yymsg);
1282
                                yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1283
                                if (!yymsg)
1284
                                {
1285
                                        yymsg = yymsgbuf;
1286
                                        yymsg_alloc = sizeof yymsgbuf;
1287
                                        yysyntax_error_status = 2;
1288
                                }
1289
                                else
1290
                                {
1291
                                        yysyntax_error_status = YYSYNTAX_ERROR;
1292
                                        yymsgp = yymsg;
1293
                                }
1294
                        }
1295
                        yyerror (yymsgp);
1296
                        if (yysyntax_error_status == 2)
1297
                                goto yyexhaustedlab;
1298
                }
1299
#undef YYSYNTAX_ERROR
1300
#endif
1301
        }
1302
 
1303
        if (yyerrstatus == 3)
1304
        {
1305
                /* If just tried and failed to reuse lookahead token after an
1306
                   error, discard it.  */
1307
 
1308
                if (yychar <= YYEOF)
1309
                {
1310
                        /* Return failure if at end of input.  */
1311
                        if (yychar == YYEOF)
1312
                                YYABORT;
1313
                }
1314
                else
1315
                {
1316
                        yydestruct ("Error: discarding", yytoken, &yylval);
1317
                        yychar = YYEMPTY;
1318
                }
1319
        }
1320
 
1321
        /* Else will try to reuse lookahead token after shifting the error
1322
           token.  */
1323
        goto yyerrlab1;
1324
 
1325
/*---------------------------------------------------.
1326
| yyerrorlab -- error raised explicitly by YYERROR.  |
1327
`---------------------------------------------------*/
1328
yyerrorlab:
1329
 
1330
        /* Pacify compilers like GCC when the user code never invokes
1331
           YYERROR and the label yyerrorlab therefore never appears in user
1332
           code.  */
1333
        if (/*CONSTCOND*/ 0)
1334
                goto yyerrorlab;
1335
 
1336
        /* Do not reclaim the symbols of the rule whose action triggered
1337
           this YYERROR.  */
1338
        YYPOPSTACK (yylen);
1339
        yylen = 0;
1340
        YY_STACK_PRINT (yyss, yyssp);
1341
        yystate = *yyssp;
1342
        goto yyerrlab1;
1343
 
1344
/*-------------------------------------------------------------.
1345
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1346
`-------------------------------------------------------------*/
1347
yyerrlab1:
1348
        yyerrstatus = 3; /* Each real token shifted decrements this.  */
1349
 
1350
        for (;;)
1351
        {
1352
                yyn = yypact[yystate];
1353
                if (!yypact_value_is_default (yyn))
1354
                {
1355
                        yyn += YYTERROR;
1356
                        if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1357
                        {
1358
                                yyn = yytable[yyn];
1359
                                if (0 < yyn)
1360
                                        break;
1361
                        }
1362
                }
1363
 
1364
                /* Pop the current state because it cannot handle the error token.  */
1365
                if (yyssp == yyss)
1366
                        YYABORT;
1367
 
1368
                yydestruct ("Error: popping", yystos[yystate], yyvsp);
1369
                YYPOPSTACK (1);
1370
                yystate = *yyssp;
1371
                YY_STACK_PRINT (yyss, yyssp);
1372
        }
1373
 
1374
        YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1375
        *++yyvsp = yylval;
1376
        YY_IGNORE_MAYBE_UNINITIALIZED_END
1377
 
1378
        /* Shift the error token.  */
1379
        YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1380
 
1381
        yystate = yyn;
1382
        goto yynewstate;
1383
 
1384
/*-------------------------------------.
1385
| yyacceptlab -- YYACCEPT comes here.  |
1386
`-------------------------------------*/
1387
yyacceptlab:
1388
        yyresult = 0;
1389
        goto yyreturn;
1390
 
1391
/*-----------------------------------.
1392
| yyabortlab -- YYABORT comes here.  |
1393
`-----------------------------------*/
1394
yyabortlab:
1395
        yyresult = 1;
1396
        goto yyreturn;
1397
 
1398
#if !defined yyoverflow || YYERROR_VERBOSE
1399
/*-------------------------------------------------.
1400
| yyexhaustedlab -- memory exhaustion comes here.  |
1401
`-------------------------------------------------*/
1402
yyexhaustedlab:
1403
        yyerror (YY_ ("memory exhausted"));
1404
        yyresult = 2;
1405
        /* Fall through.  */
1406
#endif
1407
 
1408
yyreturn:
1409
        if (yychar != YYEMPTY)
1410
        {
1411
                /* Make sure we have latest lookahead translation.  See comments at
1412
                   user semantic actions for why this is necessary.  */
1413
                yytoken = YYTRANSLATE (yychar);
1414
                yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval);
1415
        }
1416
        /* Do not reclaim the symbols of the rule whose action triggered
1417
           this YYABORT or YYACCEPT.  */
1418
        YYPOPSTACK (yylen);
1419
        YY_STACK_PRINT (yyss, yyssp);
1420
        while (yyssp != yyss)
1421
        {
1422
                yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp);
1423
                YYPOPSTACK (1);
1424
        }
1425
#ifndef yyoverflow
1426
        if (yyss != yyssa)
1427
                YYSTACK_FREE (yyss);
1428
#endif
1429
#if YYERROR_VERBOSE
1430
        if (yymsg != yymsgbuf)
1431
                YYSTACK_FREE (yymsg);
1432
#endif
1433
        return yyresult;
1434
}
1435
#line 103 "rep2_yacc.y" /* yacc.c:1906  */
1436
 
1437
/* defining lineno here */
1438
 
1439
int lineno;
1440
extern char *yytext;
1441
 
1442
int yyerror (char *x)
1443
{
1444
        int token;
1445
        printf ("-- Error --> %s near string (%s) at line %d\n", x, yytext, lineno);
1446
        /*  for(token = yylex();token >= 0 && token!=NL;token = yylex()); */
1447
        return 0;
1448
}
1449
 
1450
int yywrap (void)
1451
{
1452
        return 1;
1453
}