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