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