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