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