1
2 /* A Bison parser, made by GNU Bison 2.4.1. */
3
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
8
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45 /* Identify Bison output. */
46 #define YYBISON 1
47
48 /* Bison version. */
49 #define YYBISON_VERSION "2.4.1"
50
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers. */
55 #define YYPURE 0
56
57 /* Push parsers. */
58 #define YYPUSH 0
59
60 /* Pull parsers. */
61 #define YYPULL 1
62
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
65
66
67
68 /* Copy the first part of user declarations. */
69
70 /* Line 189 of yacc.c */
71 #line 10 "parse_y.y"
72
73 /*
74 * COPYRIGHT
75 *
76 * PCB, interactive printed circuit board design
77 * Copyright (C) 1994,1995,1996 Thomas Nau
78 *
79 * This program is free software; you can redistribute it and/or modify
80 * it under the terms of the GNU General Public License as published by
81 * the Free Software Foundation; either version 2 of the License, or
82 * (at your option) any later version.
83 *
84 * This program is distributed in the hope that it will be useful,
85 * but WITHOUT ANY WARRANTY; without even the implied warranty of
86 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 * GNU General Public License for more details.
88 *
89 * You should have received a copy of the GNU General Public License along
90 * with this program; if not, write to the Free Software Foundation, Inc.,
91 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
92 *
93 * Contact addresses for paper mail and Email:
94 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
95 * Thomas.Nau@rz.uni-ulm.de
96 *
97 */
98
99 /* grammar to parse ASCII input of PCB description
100 */
101
102 #ifdef HAVE_CONFIG_H
103 #include "config.h"
104 #endif
105
106 #include "global.h"
107 #include "create.h"
108 #include "data.h"
109 #include "error.h"
110 #include "file.h"
111 #include "flags.h"
112 #include "layerflags.h"
113 #include "mymem.h"
114 #include "misc.h"
115 #include "parse_l.h"
116 #include "polygon.h"
117 #include "remove.h"
118 #include "rtree.h"
119 #include "strflags.h"
120 #include "thermal.h"
121 #include "move.h"
122
123 #ifdef HAVE_LIBDMALLOC
124 # include <dmalloc.h> /* see http://dmalloc.com */
125 #endif
126
127 static LayerType *Layer;
128 static PolygonType *Polygon;
129 static SymbolType *Symbol;
130 static int pin_num;
131 static LibraryMenuType *Menu;
132 static bool LayerFlag[MAX_ALL_LAYER];
133
134 enum FileType {NOFILE=0, PCBFILE, DATAFILE, FONTFILE} file_type;
135
136 extern char *yytext; /* defined by LEX */
137 extern PCBType *yyPCB;
138 extern DataType *yyData;
139 extern ElementType *yyElement;
140 extern FontType *yyFont;
141 extern int yylineno; /* linenumber */
142 extern char *yyfilename; /* in this file */
143
144 static AttributeListType *attr_list;
145
146 int yyerror(const char *s);
147 int yylex();
148 static int check_file_version (int);
149
150 static void do_measure (PLMeasure *m, Coord i, double d, int u);
151 #define M(r,f,d) do_measure (&(r), f, d, 1)
152
153 /* Macros for interpreting what "measure" means - integer value only,
154 old units (mil), or new units (cmil). */
155 #define IV(m) integer_value (m)
156 #define OU(m) old_units (m)
157 #define NU(m) new_units (m)
158
159 static int integer_value (PLMeasure m);
160 static Coord old_units (PLMeasure m);
161 static Coord new_units (PLMeasure m);
162
163 /*
164 #define YYDEBUG 1
165 #define YYERROR_VERBOSE 1
166 int yydebug=1;
167 */
168
169 #include "parse_y.h"
170
171
172
173 /* Line 189 of yacc.c */
174 #line 175 "parse_y.c"
175
176 /* Enabling traces. */
177 #ifndef YYDEBUG
178 # define YYDEBUG 0
179 #endif
180
181 /* Enabling verbose error messages. */
182 #ifdef YYERROR_VERBOSE
183 # undef YYERROR_VERBOSE
184 # define YYERROR_VERBOSE 1
185 #else
186 # define YYERROR_VERBOSE 0
187 #endif
188
189 /* Enabling the token table. */
190 #ifndef YYTOKEN_TABLE
191 # define YYTOKEN_TABLE 0
192 #endif
193
194
195 /* Tokens. */
196 #ifndef YYTOKENTYPE
197 # define YYTOKENTYPE
198 /* Put the tokens into the symbol table, so that GDB and other debuggers
199 know about them. */
200 enum yytokentype {
201 FLOATING = 258,
202 INTEGER = 259,
203 CHAR_CONST = 260,
204 STRING = 261,
205 T_FILEVERSION = 262,
206 T_PCB = 263,
207 T_LAYER = 264,
208 T_VIA = 265,
209 T_RAT = 266,
210 T_LINE = 267,
211 T_ARC = 268,
212 T_RECTANGLE = 269,
213 T_TEXT = 270,
214 T_ELEMENTLINE = 271,
215 T_ELEMENT = 272,
216 T_PIN = 273,
217 T_PAD = 274,
218 T_GRID = 275,
219 T_FLAGS = 276,
220 T_SYMBOL = 277,
221 T_SYMBOLLINE = 278,
222 T_CURSOR = 279,
223 T_ELEMENTARC = 280,
224 T_MARK = 281,
225 T_GROUPS = 282,
226 T_STYLES = 283,
227 T_POLYGON = 284,
228 T_POLYGON_HOLE = 285,
229 T_NETLIST = 286,
230 T_NET = 287,
231 T_CONN = 288,
232 T_AREA = 289,
233 T_THERMAL = 290,
234 T_DRC = 291,
235 T_ATTRIBUTE = 292,
236 T_UMIL = 293,
237 T_CMIL = 294,
238 T_MIL = 295,
239 T_IN = 296,
240 T_NM = 297,
241 T_UM = 298,
242 T_MM = 299,
243 T_M = 300,
244 T_KM = 301,
245 T_PX = 302
246 };
247 #endif
248 /* Tokens. */
249 #define FLOATING 258
250 #define INTEGER 259
251 #define CHAR_CONST 260
252 #define STRING 261
253 #define T_FILEVERSION 262
254 #define T_PCB 263
255 #define T_LAYER 264
256 #define T_VIA 265
257 #define T_RAT 266
258 #define T_LINE 267
259 #define T_ARC 268
260 #define T_RECTANGLE 269
261 #define T_TEXT 270
262 #define T_ELEMENTLINE 271
263 #define T_ELEMENT 272
264 #define T_PIN 273
265 #define T_PAD 274
266 #define T_GRID 275
267 #define T_FLAGS 276
268 #define T_SYMBOL 277
269 #define T_SYMBOLLINE 278
270 #define T_CURSOR 279
271 #define T_ELEMENTARC 280
272 #define T_MARK 281
273 #define T_GROUPS 282
274 #define T_STYLES 283
275 #define T_POLYGON 284
276 #define T_POLYGON_HOLE 285
277 #define T_NETLIST 286
278 #define T_NET 287
279 #define T_CONN 288
280 #define T_AREA 289
281 #define T_THERMAL 290
282 #define T_DRC 291
283 #define T_ATTRIBUTE 292
284 #define T_UMIL 293
285 #define T_CMIL 294
286 #define T_MIL 295
287 #define T_IN 296
288 #define T_NM 297
289 #define T_UM 298
290 #define T_MM 299
291 #define T_M 300
292 #define T_KM 301
293 #define T_PX 302
294
295
296
297
298 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
299 typedef union YYSTYPE
300 {
301
302 /* Line 214 of yacc.c */
303 #line 114 "parse_y.y"
304
305 int integer;
306 double number;
307 char *string;
308 FlagType flagtype;
309 PLMeasure measure;
310
311
312
313 /* Line 214 of yacc.c */
314 #line 315 "parse_y.c"
315 } YYSTYPE;
316 # define YYSTYPE_IS_TRIVIAL 1
317 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
318 # define YYSTYPE_IS_DECLARED 1
319 #endif
320
321
322 /* Copy the second part of user declarations. */
323
324
325 /* Line 264 of yacc.c */
326 #line 327 "parse_y.c"
327
328 #ifdef short
329 # undef short
330 #endif
331
332 #ifdef YYTYPE_UINT8
333 typedef YYTYPE_UINT8 yytype_uint8;
334 #else
335 typedef unsigned char yytype_uint8;
336 #endif
337
338 #ifdef YYTYPE_INT8
339 typedef YYTYPE_INT8 yytype_int8;
340 #elif (defined __STDC__ || defined __C99__FUNC__ \
341 || defined __cplusplus || defined _MSC_VER)
342 typedef signed char yytype_int8;
343 #else
344 typedef short int yytype_int8;
345 #endif
346
347 #ifdef YYTYPE_UINT16
348 typedef YYTYPE_UINT16 yytype_uint16;
349 #else
350 typedef unsigned short int yytype_uint16;
351 #endif
352
353 #ifdef YYTYPE_INT16
354 typedef YYTYPE_INT16 yytype_int16;
355 #else
356 typedef short int yytype_int16;
357 #endif
358
359 #ifndef YYSIZE_T
360 # ifdef __SIZE_TYPE__
361 # define YYSIZE_T __SIZE_TYPE__
362 # elif defined size_t
363 # define YYSIZE_T size_t
364 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
365 || defined __cplusplus || defined _MSC_VER)
366 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
367 # define YYSIZE_T size_t
368 # else
369 # define YYSIZE_T unsigned int
370 # endif
371 #endif
372
373 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
374
375 #ifndef YY_
376 # if YYENABLE_NLS
377 # if ENABLE_NLS
378 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
379 # define YY_(msgid) dgettext ("bison-runtime", msgid)
380 # endif
381 # endif
382 # ifndef YY_
383 # define YY_(msgid) msgid
384 # endif
385 #endif
386
387 /* Suppress unused-variable warnings by "using" E. */
388 #if ! defined lint || defined __GNUC__
389 # define YYUSE(e) ((void) (e))
390 #else
391 # define YYUSE(e) /* empty */
392 #endif
393
394 /* Identity function, used to suppress warnings about constant conditions. */
395 #ifndef lint
396 # define YYID(n) (n)
397 #else
398 #if (defined __STDC__ || defined __C99__FUNC__ \
399 || defined __cplusplus || defined _MSC_VER)
400 static int
YYID(int yyi)401 YYID (int yyi)
402 #else
403 static int
404 YYID (yyi)
405 int yyi;
406 #endif
407 {
408 return yyi;
409 }
410 #endif
411
412 #if ! defined yyoverflow || YYERROR_VERBOSE
413
414 /* The parser invokes alloca or malloc; define the necessary symbols. */
415
416 # ifdef YYSTACK_USE_ALLOCA
417 # if YYSTACK_USE_ALLOCA
418 # ifdef __GNUC__
419 # define YYSTACK_ALLOC __builtin_alloca
420 # elif defined __BUILTIN_VA_ARG_INCR
421 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
422 # elif defined _AIX
423 # define YYSTACK_ALLOC __alloca
424 # elif defined _MSC_VER
425 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
426 # define alloca _alloca
427 # else
428 # define YYSTACK_ALLOC alloca
429 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
430 || defined __cplusplus || defined _MSC_VER)
431 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
432 # ifndef _STDLIB_H
433 # define _STDLIB_H 1
434 # endif
435 # endif
436 # endif
437 # endif
438 # endif
439
440 # ifdef YYSTACK_ALLOC
441 /* Pacify GCC's `empty if-body' warning. */
442 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
443 # ifndef YYSTACK_ALLOC_MAXIMUM
444 /* The OS might guarantee only one guard page at the bottom of the stack,
445 and a page size can be as small as 4096 bytes. So we cannot safely
446 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
447 to allow for a few compiler-allocated temporary stack slots. */
448 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
449 # endif
450 # else
451 # define YYSTACK_ALLOC YYMALLOC
452 # define YYSTACK_FREE YYFREE
453 # ifndef YYSTACK_ALLOC_MAXIMUM
454 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
455 # endif
456 # if (defined __cplusplus && ! defined _STDLIB_H \
457 && ! ((defined YYMALLOC || defined malloc) \
458 && (defined YYFREE || defined free)))
459 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
460 # ifndef _STDLIB_H
461 # define _STDLIB_H 1
462 # endif
463 # endif
464 # ifndef YYMALLOC
465 # define YYMALLOC malloc
466 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
467 || defined __cplusplus || defined _MSC_VER)
468 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
469 # endif
470 # endif
471 # ifndef YYFREE
472 # define YYFREE free
473 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
474 || defined __cplusplus || defined _MSC_VER)
475 void free (void *); /* INFRINGES ON USER NAME SPACE */
476 # endif
477 # endif
478 # endif
479 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
480
481
482 #if (! defined yyoverflow \
483 && (! defined __cplusplus \
484 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
485
486 /* A type that is properly aligned for any stack member. */
487 union yyalloc
488 {
489 yytype_int16 yyss_alloc;
490 YYSTYPE yyvs_alloc;
491 };
492
493 /* The size of the maximum gap between one aligned stack and the next. */
494 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
495
496 /* The size of an array large to enough to hold all stacks, each with
497 N elements. */
498 # define YYSTACK_BYTES(N) \
499 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
500 + YYSTACK_GAP_MAXIMUM)
501
502 /* Copy COUNT objects from FROM to TO. The source and destination do
503 not overlap. */
504 # ifndef YYCOPY
505 # if defined __GNUC__ && 1 < __GNUC__
506 # define YYCOPY(To, From, Count) \
507 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
508 # else
509 # define YYCOPY(To, From, Count) \
510 do \
511 { \
512 YYSIZE_T yyi; \
513 for (yyi = 0; yyi < (Count); yyi++) \
514 (To)[yyi] = (From)[yyi]; \
515 } \
516 while (YYID (0))
517 # endif
518 # endif
519
520 /* Relocate STACK from its old location to the new one. The
521 local variables YYSIZE and YYSTACKSIZE give the old and new number of
522 elements in the stack, and YYPTR gives the new location of the
523 stack. Advance YYPTR to a properly aligned location for the next
524 stack. */
525 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
526 do \
527 { \
528 YYSIZE_T yynewbytes; \
529 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
530 Stack = &yyptr->Stack_alloc; \
531 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
532 yyptr += yynewbytes / sizeof (*yyptr); \
533 } \
534 while (YYID (0))
535
536 #endif
537
538 /* YYFINAL -- State number of the termination state. */
539 #define YYFINAL 9
540 /* YYLAST -- Last index in YYTABLE. */
541 #define YYLAST 795
542
543 /* YYNTOKENS -- Number of terminals. */
544 #define YYNTOKENS 52
545 /* YYNNTS -- Number of nonterminals. */
546 #define YYNNTS 108
547 /* YYNRULES -- Number of rules. */
548 #define YYNRULES 205
549 /* YYNRULES -- Number of states. */
550 #define YYNSTATES 621
551
552 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
553 #define YYUNDEFTOK 2
554 #define YYMAXUTOK 302
555
556 #define YYTRANSLATE(YYX) \
557 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
558
559 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
560 static const yytype_uint8 yytranslate[] =
561 {
562 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 50, 51, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 48, 2, 49, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
588 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
589 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
590 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
591 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
592 45, 46, 47
593 };
594
595 #if YYDEBUG
596 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
597 YYRHS. */
598 static const yytype_uint16 yyprhs[] =
599 {
600 0, 0, 3, 5, 7, 9, 11, 12, 27, 28,
601 31, 32, 35, 36, 37, 40, 41, 46, 51, 58,
602 65, 67, 69, 71, 78, 86, 94, 101, 108, 109,
603 110, 115, 116, 121, 122, 124, 126, 128, 135, 143,
604 153, 158, 163, 164, 169, 170, 175, 180, 181, 183,
605 184, 186, 189, 191, 192, 195, 197, 199, 200, 203,
606 205, 207, 209, 211, 213, 215, 229, 241, 253, 264,
607 274, 283, 294, 305, 306, 317, 319, 320, 322, 325,
608 327, 329, 331, 333, 335, 337, 346, 348, 350, 352,
609 353, 356, 358, 369, 380, 390, 403, 416, 428, 437,
610 447, 457, 458, 468, 469, 472, 473, 479, 480, 483,
611 488, 493, 495, 497, 499, 501, 503, 504, 517, 518,
612 534, 535, 552, 553, 572, 573, 592, 594, 597, 599,
613 601, 603, 605, 607, 616, 625, 636, 647, 653, 659,
614 660, 663, 665, 668, 670, 672, 674, 676, 685, 694,
615 705, 716, 717, 720, 733, 746, 757, 767, 776, 790,
616 804, 816, 827, 829, 831, 833, 836, 840, 847, 854,
617 856, 858, 859, 862, 865, 874, 883, 885, 886, 893,
618 895, 896, 898, 901, 902, 912, 914, 915, 917, 920,
619 925, 931, 933, 934, 936, 938, 940, 943, 946, 949,
620 952, 955, 958, 961, 964, 967
621 };
622
623 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
624 static const yytype_int16 yyrhs[] =
625 {
626 53, 0, -1, 54, -1, 56, -1, 60, -1, 1,
627 -1, -1, 55, 62, 63, 64, 68, 69, 70, 71,
628 75, 76, 77, 58, 78, 147, -1, -1, 57, 78,
629 -1, -1, 59, 60, -1, -1, -1, 61, 140, -1,
630 -1, 7, 48, 4, 49, -1, 8, 50, 6, 51,
631 -1, 8, 50, 6, 159, 159, 51, -1, 8, 48,
632 6, 159, 159, 49, -1, 65, -1, 66, -1, 67,
633 -1, 20, 50, 159, 159, 159, 51, -1, 20, 50,
634 159, 159, 159, 4, 51, -1, 20, 48, 159, 159,
635 159, 4, 49, -1, 24, 50, 159, 159, 158, 51,
636 -1, 24, 48, 159, 159, 158, 49, -1, -1, -1,
637 34, 48, 158, 49, -1, -1, 35, 48, 158, 49,
638 -1, -1, 72, -1, 73, -1, 74, -1, 36, 48,
639 159, 159, 159, 49, -1, 36, 48, 159, 159, 159,
640 159, 49, -1, 36, 48, 159, 159, 159, 159, 159,
641 159, 49, -1, 21, 50, 4, 51, -1, 21, 50,
642 6, 51, -1, -1, 27, 50, 6, 51, -1, -1,
643 28, 50, 6, 51, -1, 28, 48, 6, 49, -1,
644 -1, 79, -1, -1, 80, -1, 79, 80, -1, 83,
645 -1, -1, 81, 156, -1, 90, -1, 91, -1, -1,
646 82, 113, -1, 84, -1, 85, -1, 86, -1, 87,
647 -1, 88, -1, 89, -1, 10, 48, 159, 159, 159,
648 159, 159, 159, 4, 4, 6, 139, 49, -1, 10,
649 48, 159, 159, 159, 159, 159, 159, 6, 139, 49,
650 -1, 10, 50, 159, 159, 159, 159, 159, 159, 6,
651 4, 51, -1, 10, 50, 159, 159, 159, 159, 159,
652 6, 4, 51, -1, 10, 50, 159, 159, 159, 159,
653 6, 4, 51, -1, 10, 50, 159, 159, 159, 6,
654 4, 51, -1, 11, 48, 159, 159, 4, 159, 159,
655 4, 139, 49, -1, 11, 50, 159, 159, 4, 159,
656 159, 4, 4, 51, -1, -1, 9, 50, 4, 6,
657 157, 51, 50, 92, 93, 51, -1, 94, -1, -1,
658 95, -1, 94, 95, -1, 97, -1, 98, -1, 99,
659 -1, 100, -1, 101, -1, 102, -1, 14, 50, 159,
660 159, 159, 159, 4, 51, -1, 105, -1, 104, -1,
661 103, -1, -1, 96, 156, -1, 106, -1, 12, 48,
662 159, 159, 159, 159, 159, 159, 139, 49, -1, 12,
663 50, 159, 159, 159, 159, 159, 159, 4, 51, -1,
664 12, 50, 159, 159, 159, 159, 159, 159, 51, -1,
665 13, 48, 159, 159, 159, 159, 159, 159, 158, 158,
666 139, 49, -1, 13, 50, 159, 159, 159, 159, 159,
667 159, 158, 158, 4, 51, -1, 13, 50, 159, 159,
668 159, 159, 159, 159, 158, 4, 51, -1, 15, 50,
669 159, 159, 158, 6, 4, 51, -1, 15, 50, 159,
670 159, 158, 158, 6, 4, 51, -1, 15, 48, 159,
671 159, 158, 158, 6, 139, 49, -1, -1, 29, 50,
672 139, 51, 50, 107, 111, 108, 51, -1, -1, 108,
673 109, -1, -1, 30, 50, 110, 111, 51, -1, -1,
674 112, 111, -1, 50, 159, 159, 51, -1, 48, 159,
675 159, 49, -1, 114, -1, 116, -1, 118, -1, 120,
676 -1, 122, -1, -1, 17, 50, 6, 6, 159, 159,
677 4, 51, 50, 115, 124, 51, -1, -1, 17, 50,
678 4, 6, 6, 159, 159, 159, 159, 4, 51, 50,
679 117, 124, 51, -1, -1, 17, 50, 4, 6, 6,
680 6, 159, 159, 159, 159, 4, 51, 50, 119, 124,
681 51, -1, -1, 17, 50, 4, 6, 6, 6, 159,
682 159, 159, 159, 158, 158, 4, 51, 50, 121, 127,
683 51, -1, -1, 17, 48, 139, 6, 6, 6, 159,
684 159, 159, 159, 158, 158, 139, 49, 50, 123, 127,
685 51, -1, 125, -1, 124, 125, -1, 132, -1, 133,
686 -1, 134, -1, 137, -1, 138, -1, 16, 48, 159,
687 159, 159, 159, 159, 49, -1, 16, 50, 159, 159,
688 159, 159, 159, 51, -1, 25, 48, 159, 159, 159,
689 159, 158, 158, 159, 49, -1, 25, 50, 159, 159,
690 159, 159, 158, 158, 159, 51, -1, 26, 48, 159,
691 159, 49, -1, 26, 50, 159, 159, 51, -1, -1,
692 126, 156, -1, 128, -1, 127, 128, -1, 131, -1,
693 130, -1, 136, -1, 135, -1, 16, 48, 159, 159,
694 159, 159, 159, 49, -1, 16, 50, 159, 159, 159,
695 159, 159, 51, -1, 25, 48, 159, 159, 159, 159,
696 158, 158, 159, 49, -1, 25, 50, 159, 159, 159,
697 159, 158, 158, 159, 51, -1, -1, 129, 156, -1,
698 18, 48, 159, 159, 159, 159, 159, 159, 6, 6,
699 139, 49, -1, 18, 50, 159, 159, 159, 159, 159,
700 159, 6, 6, 4, 51, -1, 18, 50, 159, 159,
701 159, 159, 6, 6, 4, 51, -1, 18, 50, 159,
702 159, 159, 159, 6, 4, 51, -1, 18, 50, 159,
703 159, 159, 6, 4, 51, -1, 19, 48, 159, 159,
704 159, 159, 159, 159, 159, 6, 6, 139, 49, -1,
705 19, 50, 159, 159, 159, 159, 159, 159, 159, 6,
706 6, 4, 51, -1, 19, 50, 159, 159, 159, 159,
707 159, 6, 6, 4, 51, -1, 19, 50, 159, 159,
708 159, 159, 159, 6, 4, 51, -1, 4, -1, 6,
709 -1, 141, -1, 140, 141, -1, 142, 144, 51, -1,
710 22, 48, 143, 159, 49, 50, -1, 22, 50, 143,
711 159, 51, 50, -1, 4, -1, 5, -1, -1, 144,
712 145, -1, 144, 146, -1, 23, 50, 159, 159, 159,
713 159, 159, 51, -1, 23, 48, 159, 159, 159, 159,
714 159, 49, -1, 148, -1, -1, 31, 50, 51, 50,
715 149, 51, -1, 150, -1, -1, 151, -1, 150, 151,
716 -1, -1, 32, 50, 6, 6, 51, 50, 152, 153,
717 51, -1, 154, -1, -1, 155, -1, 154, 155, -1,
718 33, 50, 6, 51, -1, 37, 50, 6, 6, 51,
719 -1, 6, -1, -1, 3, -1, 4, -1, 158, -1,
720 158, 38, -1, 158, 39, -1, 158, 40, -1, 158,
721 41, -1, 158, 42, -1, 158, 47, -1, 158, 43,
722 -1, 158, 44, -1, 158, 45, -1, 158, 46, -1
723 };
724
725 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
726 static const yytype_uint16 yyrline[] =
727 {
728 0, 140, 140, 141, 142, 143, 179, 179, 234, 234,
729 262, 262, 265, 270, 270, 310, 312, 351, 357, 363,
730 401, 402, 403, 406, 414, 427, 466, 471, 476, 492,
731 494, 519, 521, 552, 554, 555, 556, 560, 570, 581,
732 608, 612, 617, 645, 654, 710, 719, 728, 732, 733,
733 737, 738, 742, 743, 743, 744, 745, 746, 746, 784,
734 785, 786, 787, 788, 789, 851, 861, 871, 882, 892,
735 902, 942, 947, 991, 990, 1020, 1021, 1025, 1026, 1030,
736 1031, 1032, 1033, 1034, 1035, 1037, 1042, 1043, 1044, 1045,
737 1045, 1046, 1085, 1094, 1103, 1160, 1169, 1178, 1224, 1234,
738 1252, 1316, 1315, 1355, 1357, 1362, 1361, 1368, 1370, 1375,
739 1379, 1450, 1451, 1452, 1453, 1454, 1462, 1461, 1480, 1479,
740 1498, 1497, 1518, 1516, 1540, 1538, 1640, 1641, 1645, 1646,
741 1647, 1648, 1649, 1651, 1656, 1661, 1666, 1671, 1676, 1681,
742 1681, 1685, 1686, 1690, 1691, 1692, 1693, 1695, 1701, 1708,
743 1713, 1718, 1718, 1768, 1780, 1792, 1803, 1819, 1877, 1891,
744 1904, 1915, 1926, 1927, 1931, 1932, 1965, 1967, 1983, 2002,
745 2003, 2006, 2008, 2009, 2039, 2046, 2062, 2063, 2067, 2072,
746 2073, 2077, 2078, 2101, 2100, 2110, 2111, 2115, 2116, 2135,
747 2194, 2202, 2203, 2207, 2208, 2213, 2214, 2215, 2216, 2217,
748 2218, 2219, 2220, 2221, 2222, 2223
749 };
750 #endif
751
752 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
753 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
754 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
755 static const char *const yytname[] =
756 {
757 "$end", "error", "$undefined", "FLOATING", "INTEGER", "CHAR_CONST",
758 "STRING", "T_FILEVERSION", "T_PCB", "T_LAYER", "T_VIA", "T_RAT",
759 "T_LINE", "T_ARC", "T_RECTANGLE", "T_TEXT", "T_ELEMENTLINE", "T_ELEMENT",
760 "T_PIN", "T_PAD", "T_GRID", "T_FLAGS", "T_SYMBOL", "T_SYMBOLLINE",
761 "T_CURSOR", "T_ELEMENTARC", "T_MARK", "T_GROUPS", "T_STYLES",
762 "T_POLYGON", "T_POLYGON_HOLE", "T_NETLIST", "T_NET", "T_CONN", "T_AREA",
763 "T_THERMAL", "T_DRC", "T_ATTRIBUTE", "T_UMIL", "T_CMIL", "T_MIL", "T_IN",
764 "T_NM", "T_UM", "T_MM", "T_M", "T_KM", "T_PX", "'['", "']'", "'('",
765 "')'", "$accept", "parse", "parsepcb", "$@1", "parsedata", "$@2",
766 "pcbfont", "$@3", "parsefont", "$@4", "pcbfileversion", "pcbname",
767 "pcbgrid", "pcbgridold", "pcbgridnew", "pcbhigrid", "pcbcursor",
768 "polyarea", "pcbthermal", "pcbdrc", "pcbdrc1", "pcbdrc2", "pcbdrc3",
769 "pcbflags", "pcbgroups", "pcbstyles", "pcbdata", "pcbdefinitions",
770 "pcbdefinition", "$@5", "$@6", "via", "via_ehi_format", "via_hi_format",
771 "via_2.0_format", "via_1.7_format", "via_newformat", "via_oldformat",
772 "rats", "layer", "$@7", "layerdata", "layerdefinitions",
773 "layerdefinition", "$@8", "line_hi_format", "line_1.7_format",
774 "line_oldformat", "arc_hi_format", "arc_1.7_format", "arc_oldformat",
775 "text_oldformat", "text_newformat", "text_hi_format", "polygon_format",
776 "$@9", "polygonholes", "polygonhole", "$@10", "polygonpoints",
777 "polygonpoint", "element", "element_oldformat", "$@11",
778 "element_1.3.4_format", "$@12", "element_newformat", "$@13",
779 "element_1.7_format", "$@14", "element_hi_format", "$@15",
780 "elementdefinitions", "elementdefinition", "$@16", "relementdefs",
781 "relementdef", "$@17", "pin_hi_format", "pin_1.7_format",
782 "pin_1.6.3_format", "pin_newformat", "pin_oldformat", "pad_hi_format",
783 "pad_1.7_format", "pad_newformat", "pad", "flags", "symbols", "symbol",
784 "symbolhead", "symbolid", "symboldata", "symboldefinition",
785 "hiressymbol", "pcbnetlist", "pcbnetdef", "nets", "netdefs", "net",
786 "$@18", "connections", "conndefs", "conn", "attribute", "opt_string",
787 "number", "measure", 0
788 };
789 #endif
790
791 # ifdef YYPRINT
792 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
793 token YYLEX-NUM. */
794 static const yytype_uint16 yytoknum[] =
795 {
796 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
797 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
798 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
799 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
800 295, 296, 297, 298, 299, 300, 301, 302, 91, 93,
801 40, 41
802 };
803 # endif
804
805 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
806 static const yytype_uint8 yyr1[] =
807 {
808 0, 52, 53, 53, 53, 53, 55, 54, 57, 56,
809 59, 58, 58, 61, 60, 62, 62, 63, 63, 63,
810 64, 64, 64, 65, 66, 67, 68, 68, 68, 69,
811 69, 70, 70, 71, 71, 71, 71, 72, 73, 74,
812 75, 75, 75, 76, 76, 77, 77, 77, 78, 78,
813 79, 79, 80, 81, 80, 80, 80, 82, 80, 83,
814 83, 83, 83, 83, 83, 84, 85, 86, 87, 88,
815 89, 90, 90, 92, 91, 93, 93, 94, 94, 95,
816 95, 95, 95, 95, 95, 95, 95, 95, 95, 96,
817 95, 95, 97, 98, 99, 100, 101, 102, 103, 104,
818 105, 107, 106, 108, 108, 110, 109, 111, 111, 112,
819 112, 113, 113, 113, 113, 113, 115, 114, 117, 116,
820 119, 118, 121, 120, 123, 122, 124, 124, 125, 125,
821 125, 125, 125, 125, 125, 125, 125, 125, 125, 126,
822 125, 127, 127, 128, 128, 128, 128, 128, 128, 128,
823 128, 129, 128, 130, 131, 132, 133, 134, 135, 136,
824 137, 138, 139, 139, 140, 140, 141, 142, 142, 143,
825 143, 144, 144, 144, 145, 146, 147, 147, 148, 149,
826 149, 150, 150, 152, 151, 153, 153, 154, 154, 155,
827 156, 157, 157, 158, 158, 159, 159, 159, 159, 159,
828 159, 159, 159, 159, 159, 159
829 };
830
831 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
832 static const yytype_uint8 yyr2[] =
833 {
834 0, 2, 1, 1, 1, 1, 0, 14, 0, 2,
835 0, 2, 0, 0, 2, 0, 4, 4, 6, 6,
836 1, 1, 1, 6, 7, 7, 6, 6, 0, 0,
837 4, 0, 4, 0, 1, 1, 1, 6, 7, 9,
838 4, 4, 0, 4, 0, 4, 4, 0, 1, 0,
839 1, 2, 1, 0, 2, 1, 1, 0, 2, 1,
840 1, 1, 1, 1, 1, 13, 11, 11, 10, 9,
841 8, 10, 10, 0, 10, 1, 0, 1, 2, 1,
842 1, 1, 1, 1, 1, 8, 1, 1, 1, 0,
843 2, 1, 10, 10, 9, 12, 12, 11, 8, 9,
844 9, 0, 9, 0, 2, 0, 5, 0, 2, 4,
845 4, 1, 1, 1, 1, 1, 0, 12, 0, 15,
846 0, 16, 0, 18, 0, 18, 1, 2, 1, 1,
847 1, 1, 1, 8, 8, 10, 10, 5, 5, 0,
848 2, 1, 2, 1, 1, 1, 1, 8, 8, 10,
849 10, 0, 2, 12, 12, 10, 9, 8, 13, 13,
850 11, 10, 1, 1, 1, 2, 3, 6, 6, 1,
851 1, 0, 2, 2, 8, 8, 1, 0, 6, 1,
852 0, 1, 2, 0, 9, 1, 0, 1, 2, 4,
853 5, 1, 0, 1, 1, 1, 2, 2, 2, 2,
854 2, 2, 2, 2, 2, 2
855 };
856
857 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
858 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
859 means the default is an error. */
860 static const yytype_uint8 yydefact[] =
861 {
862 0, 5, 0, 2, 15, 3, 49, 4, 0, 1,
863 0, 0, 0, 0, 0, 9, 48, 50, 0, 0,
864 52, 59, 60, 61, 62, 63, 64, 55, 56, 0,
865 14, 164, 171, 0, 0, 0, 0, 0, 0, 0,
866 0, 51, 0, 54, 0, 58, 111, 112, 113, 114,
867 115, 0, 0, 165, 0, 0, 0, 0, 0, 28,
868 20, 21, 22, 0, 193, 194, 195, 0, 0, 0,
869 0, 0, 0, 0, 169, 170, 0, 0, 0, 166,
870 172, 173, 16, 0, 0, 0, 0, 0, 29, 192,
871 196, 197, 198, 199, 200, 202, 203, 204, 205, 201,
872 0, 0, 0, 0, 0, 162, 163, 0, 0, 0,
873 0, 0, 0, 0, 0, 17, 0, 0, 0, 0,
874 0, 0, 31, 191, 0, 0, 0, 0, 0, 0,
875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
876 0, 0, 0, 0, 0, 33, 0, 0, 0, 0,
877 0, 0, 190, 0, 0, 0, 167, 168, 0, 0,
878 19, 18, 0, 0, 0, 0, 0, 0, 0, 42,
879 34, 35, 36, 73, 0, 0, 0, 0, 0, 0,
880 0, 0, 0, 0, 0, 0, 0, 0, 23, 0,
881 0, 30, 0, 0, 0, 44, 76, 0, 70, 0,
882 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
883 25, 24, 27, 26, 32, 0, 0, 0, 47, 0,
884 0, 0, 0, 0, 0, 75, 77, 0, 79, 80,
885 81, 82, 83, 84, 88, 87, 86, 91, 0, 0,
886 69, 0, 0, 0, 0, 0, 0, 0, 0, 0,
887 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
888 0, 0, 0, 0, 0, 74, 78, 90, 0, 0,
889 68, 0, 71, 72, 0, 0, 0, 116, 175, 174,
890 0, 40, 41, 0, 0, 0, 49, 13, 0, 0,
891 0, 0, 0, 0, 0, 0, 0, 66, 67, 0,
892 0, 0, 139, 37, 0, 43, 0, 0, 177, 11,
893 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
894 194, 0, 0, 0, 0, 0, 0, 0, 139, 126,
895 0, 128, 129, 130, 131, 132, 38, 0, 46, 45,
896 0, 7, 176, 0, 0, 0, 0, 0, 0, 0,
897 101, 65, 0, 0, 0, 118, 0, 0, 0, 0,
898 0, 0, 0, 0, 117, 127, 140, 0, 0, 0,
899 0, 0, 0, 0, 0, 0, 0, 107, 0, 120,
900 0, 139, 0, 0, 0, 0, 0, 0, 0, 0,
901 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
902 0, 0, 103, 107, 0, 139, 0, 139, 0, 0,
903 0, 0, 0, 0, 0, 0, 180, 0, 0, 0,
904 0, 85, 0, 98, 0, 0, 0, 0, 108, 124,
905 139, 122, 119, 0, 0, 0, 0, 0, 0, 137,
906 138, 0, 0, 179, 181, 0, 0, 94, 0, 0,
907 100, 99, 0, 0, 0, 102, 104, 151, 121, 151,
908 0, 0, 0, 0, 0, 0, 0, 0, 178, 182,
909 92, 93, 0, 194, 0, 110, 109, 105, 0, 0,
910 0, 0, 151, 141, 0, 144, 143, 146, 145, 151,
911 0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
912 0, 107, 0, 0, 0, 0, 0, 0, 0, 0,
913 125, 142, 152, 123, 133, 134, 157, 0, 0, 0,
914 0, 0, 0, 95, 96, 0, 0, 0, 0, 0,
915 0, 0, 0, 0, 156, 0, 0, 0, 0, 0,
916 0, 106, 0, 0, 0, 0, 0, 0, 0, 0,
917 155, 161, 0, 135, 136, 183, 0, 0, 0, 0,
918 0, 0, 0, 0, 160, 186, 0, 0, 0, 0,
919 0, 0, 0, 0, 0, 0, 185, 187, 0, 0,
920 0, 0, 0, 0, 0, 0, 0, 184, 188, 147,
921 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
922 0, 0, 0, 0, 189, 0, 0, 0, 0, 149,
923 150, 0, 0, 0, 0, 153, 154, 0, 0, 158,
924 159
925 };
926
927 /* YYDEFGOTO[NTERM-NUM]. */
928 static const yytype_int16 yydefgoto[] =
929 {
930 -1, 2, 3, 4, 5, 6, 286, 287, 7, 8,
931 11, 35, 59, 60, 61, 62, 88, 122, 145, 169,
932 170, 171, 172, 195, 218, 256, 15, 16, 17, 18,
933 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
934 196, 224, 225, 226, 227, 228, 229, 230, 231, 232,
935 233, 234, 235, 236, 237, 377, 427, 456, 501, 402,
936 403, 45, 46, 302, 47, 381, 48, 405, 49, 459,
937 50, 457, 328, 329, 330, 482, 483, 484, 485, 486,
938 331, 332, 333, 487, 488, 334, 335, 107, 30, 31,
939 32, 76, 54, 80, 81, 341, 342, 442, 443, 444,
940 565, 575, 576, 577, 43, 124, 66, 67
941 };
942
943 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
944 STATE-NUM. */
945 #define YYPACT_NINF -468
946 static const yytype_int16 yypact[] =
947 {
948 152, -468, 37, -468, 33, -468, 55, -468, -5, -468,
949 -4, 46, 19, 90, 108, -468, 55, -468, 40, 74,
950 -468, -468, -468, -468, -468, -468, -468, -468, -468, 132,
951 -5, -468, -468, 110, 138, 95, 114, 20, 20, 20,
952 20, -468, 60, -468, 168, -468, -468, -468, -468, -468,
953 -468, 23, 23, -468, -2, 70, 117, 120, 184, 105,
954 -468, -468, -468, 127, -468, -468, 154, 20, 20, 20,
955 20, 135, 49, 198, -468, -468, 20, 20, 190, -468,
956 -468, -468, -468, 20, 5, 20, 20, 191, 111, 148,
957 -468, -468, -468, -468, -468, -468, -468, -468, -468, -468,
958 20, 20, 171, 183, 158, -468, -468, 166, 204, 222,
959 186, 197, 20, 20, 20, -468, 20, 20, 20, 20,
960 20, 216, 262, -468, 226, 20, 67, 20, 20, 229,
961 295, 296, 20, 253, 254, 20, 20, 261, 263, 20,
962 20, 20, 20, 20, 265, 279, 266, 20, 313, 80,
963 20, 20, -468, 320, 131, 20, -468, -468, 20, 20,
964 -468, -468, 323, -1, 20, 20, 280, 20, 282, 307,
965 -468, -468, -468, -468, 20, 284, 332, 211, 333, 334,
966 20, 20, 20, 335, 20, 20, 291, 292, -468, 293,
967 301, -468, 304, 20, 308, 314, 136, 239, -468, 309,
968 355, 358, 49, 357, 20, 20, 20, 315, 20, 20,
969 -468, -468, -468, -468, -468, 20, 240, 317, 337, 199,
970 209, 318, 210, 319, 325, 136, -468, 40, -468, -468,
971 -468, -468, -468, -468, -468, -468, -468, -468, 373, 49,
972 -468, 327, 375, 331, 330, 20, 20, 20, 336, 340,
973 339, 20, 341, 342, 379, 217, 369, 20, 20, 20,
974 20, 20, 20, 20, 49, -468, -468, -468, 388, 352,
975 -468, 351, -468, -468, 20, 20, 399, -468, -468, -468,
976 8, -468, -468, 353, 400, 401, 55, -468, 20, 20,
977 20, 20, 20, 20, 20, 354, 49, -468, -468, 20,
978 92, 359, 165, -468, 10, -468, 360, 362, 377, -468,
979 20, 20, 20, 20, 20, 20, 20, 364, 366, 20,
980 365, 20, 367, 220, 368, 370, 221, 233, 0, -468,
981 40, -468, -468, -468, -468, -468, -468, 20, -468, -468,
982 374, -468, -468, 20, 20, 20, 20, 20, 20, 223,
983 -468, -468, 49, 380, 415, -468, 20, 20, 20, 20,
984 20, 20, 20, 20, -468, -468, -468, 376, 381, 20,
985 20, 20, 20, 423, 425, 429, 428, 237, 386, -468,
986 385, 165, 20, 20, 20, 20, 20, 20, 20, 20,
987 -468, 387, 20, 20, 20, 20, 389, 49, 390, 434,
988 20, 20, -468, 237, 392, 165, 393, 17, 20, 20,
989 20, 20, 20, 20, 395, 394, 407, 49, 1, 20,
990 20, -468, 398, -468, 397, 20, 20, -10, -468, -468,
991 106, -468, -468, 20, 20, 227, 20, 20, 20, -468,
992 -468, 402, 403, 407, -468, 404, 405, -468, 20, 96,
993 -468, -468, 406, 409, 411, -468, -468, 187, -468, 187,
994 20, 20, 445, 444, 20, 20, 20, 451, -468, -468,
995 -468, -468, 49, 412, 447, -468, -468, -468, 238, 241,
996 242, 245, 42, -468, 40, -468, -468, -468, -468, 160,
997 413, 421, 422, 290, 468, 20, 20, 469, 427, -468,
998 426, 237, 20, 20, 20, 20, 20, 20, 20, 20,
999 -468, -468, -468, -468, -468, -468, -468, 430, 475, 294,
1000 20, 20, 433, -468, -468, 435, 20, 20, 20, 20,
1001 20, 20, 20, 20, -468, 436, 446, 476, 449, 448,
1002 450, -468, 20, 20, 20, 20, 20, 20, 20, 20,
1003 -468, -468, 452, -468, -468, -468, 20, 20, 20, 20,
1004 20, 20, 20, 20, -468, 463, 20, 20, 20, 20,
1005 20, 20, 20, 20, 462, 464, 463, -468, 453, 465,
1006 20, 20, 20, 20, 20, 20, 479, -468, -468, -468,
1007 -468, 495, 507, 20, 20, 20, 20, 466, 508, 520,
1008 521, 531, 489, 488, -468, 49, 536, 535, 540, -468,
1009 -468, 500, 499, 49, 547, -468, -468, 503, 502, -468,
1010 -468
1011 };
1012
1013 /* YYPGOTO[NTERM-NUM]. */
1014 static const yytype_int16 yypgoto[] =
1015 {
1016 -468, -468, -468, -468, -468, -468, -468, -468, 267, -468,
1017 -468, -468, -468, -468, -468, -468, -468, -468, -468, -468,
1018 -468, -468, -468, -468, -468, -468, 273, -468, 544, -468,
1019 -468, -468, -468, -468, -468, -468, -468, -468, -468, -468,
1020 -468, -468, -468, 338, -468, -468, -468, -468, -468, -468,
1021 -468, -468, -468, -468, -468, -468, -468, -468, -468, -396,
1022 -468, -468, -468, -468, -468, -468, -468, -468, -468, -468,
1023 -468, -468, -371, -322, -468, 102, -467, -468, -468, -468,
1024 -468, -468, -468, -468, -468, -468, -468, 182, -468, 532,
1025 -468, 512, -468, -468, -468, -468, -468, -468, -468, 122,
1026 -468, -468, -468, -9, -223, -468, -37, -38
1027 };
1028
1029 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1030 positive, shift that token. If negative, reduce the rule which
1031 number is the opposite. If zero, do what YYDEFACT says.
1032 If YYTABLE_NINF, syntax error. */
1033 #define YYTABLE_NINF -90
1034 static const yytype_int16 yytable[] =
1035 {
1036 68, 69, 70, 187, 267, 446, 365, 428, 64, 65,
1037 407, 64, 65, 64, 65, 511, 323, 29, 324, 325,
1038 454, 78, 511, 64, 65, 326, 327, 74, 75, 100,
1039 101, 102, 103, 323, 430, 324, 325, 9, 110, 111,
1040 10, 455, 326, 327, 33, 114, 116, 117, 118, 79,
1041 188, 364, 447, 105, 34, 106, 115, 303, 478, 336,
1042 479, 480, 125, 126, 12, 13, 14, 481, 432, 36,
1043 64, 65, -57, 148, 135, 136, 137, 42, 138, 139,
1044 140, 141, 142, 64, 65, 365, 176, 147, 149, 150,
1045 151, 44, -53, 510, 155, 64, 320, 158, 159, 64,
1046 473, 162, 163, 164, 165, 525, 166, 366, 365, 174,
1047 71, 177, 178, 179, 55, 58, 182, 183, 63, 82,
1048 184, 185, 323, 83, 324, 325, 84, 189, 190, 87,
1049 192, 326, 327, 89, 64, 65, 197, 181, 37, 201,
1050 38, 104, 204, 205, 206, 121, 208, 209, 219, 220,
1051 221, 222, -8, 1, 123, 215, 39, 458, 40, -6,
1052 -6, -8, -8, -8, 129, 223, 245, 246, 247, -8,
1053 249, 250, 130, -89, -13, 127, 478, 251, 479, 480,
1054 51, 323, 52, 324, 325, 481, 56, 128, 57, -8,
1055 326, 327, 90, 91, 92, 93, 94, 95, 96, 97,
1056 98, 99, 108, 478, 109, 479, 480, 274, 275, 276,
1057 131, 513, 481, 280, 64, 65, 72, 200, 73, 288,
1058 289, 290, 291, 292, 293, 294, 64, 65, 132, 375,
1059 64, 65, 85, 462, 86, 133, 299, 300, 112, 119,
1060 113, 120, 304, 238, 252, 239, 253, 257, 134, 258,
1061 310, 311, 312, 313, 314, 315, 316, 259, 262, 260,
1062 263, 512, 319, 321, 143, 284, 337, 285, 356, 360,
1063 357, 361, 343, 344, 345, 346, 347, 146, 348, 349,
1064 152, 362, 352, 363, 354, 400, 502, 401, 503, 504,
1065 506, 505, 507, 508, 517, 509, 518, 144, 536, 367,
1066 537, 153, 154, 156, 157, 369, 370, 371, 372, 373,
1067 160, 374, 376, 167, 161, 168, 173, 175, 382, 383,
1068 384, 385, 386, 387, 388, 389, 180, 186, 194, 191,
1069 193, 392, 393, 394, 395, 198, 199, 202, 203, 207,
1070 210, 217, 212, 211, 408, 409, 410, 411, 412, 413,
1071 414, 415, 213, 214, 417, 418, 419, 420, 216, 241,
1072 240, 244, 425, 426, 242, 255, 248, 254, 261, 264,
1073 433, 434, 435, 436, 437, 438, 265, 268, 270, 271,
1074 272, 273, 448, 449, 243, 283, 277, 452, 453, 278,
1075 279, -10, 281, 282, 296, 460, 461, 463, 464, 465,
1076 466, 297, 298, 301, 305, 317, 306, 307, 340, 338,
1077 322, 472, 474, 339, 350, 351, 353, 355, 358, 380,
1078 359, 269, 490, 491, 368, 390, 494, 396, 495, 496,
1079 379, 397, 391, 398, 399, 404, 406, 416, 424, 441,
1080 421, 423, 429, 431, 439, 440, 295, 450, 451, 492,
1081 493, 500, 467, 470, 468, 475, 471, 497, 520, 521,
1082 476, 477, 514, 499, 526, 527, 528, 529, 530, 531,
1083 532, 533, 515, 516, 519, 522, 523, 524, 318, 535,
1084 552, 534, 538, 539, 540, 597, 541, 550, 542, 543,
1085 544, 545, 546, 547, 548, 549, 574, 551, 553, 554,
1086 555, 598, 589, 564, 556, 557, 558, 559, 560, 561,
1087 562, 563, 586, 599, 605, 587, 590, 604, 566, 567,
1088 568, 569, 570, 571, 572, 573, 606, 607, 578, 579,
1089 580, 581, 582, 583, 378, 584, 585, 608, 609, 610,
1090 612, 613, 591, 592, 593, 594, 614, 595, 596, 615,
1091 616, 618, 619, 620, 309, 600, 601, 602, 603, 308,
1092 41, 489, 53, 266, 77, 469, 0, 588, 0, 0,
1093 0, 0, 0, 0, 0, 0, 0, 0, 0, 422,
1094 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1095 0, 0, 0, 0, 0, 0, 0, 0, 0, 445,
1096 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1097 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1098 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1101 0, 0, 0, 0, 498, 0, 0, 0, 0, 0,
1102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1113 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1114 0, 0, 0, 0, 0, 0, 0, 611, 0, 0,
1115 0, 0, 0, 0, 0, 617
1116 };
1117
1118 static const yytype_int16 yycheck[] =
1119 {
1120 38, 39, 40, 4, 227, 4, 328, 403, 3, 4,
1121 381, 3, 4, 3, 4, 482, 16, 22, 18, 19,
1122 30, 23, 489, 3, 4, 25, 26, 4, 5, 67,
1123 68, 69, 70, 16, 405, 18, 19, 0, 76, 77,
1124 7, 51, 25, 26, 48, 83, 84, 85, 86, 51,
1125 51, 51, 51, 4, 8, 6, 51, 49, 16, 49,
1126 18, 19, 100, 101, 9, 10, 11, 25, 51, 50,
1127 3, 4, 17, 6, 112, 113, 114, 37, 116, 117,
1128 118, 119, 120, 3, 4, 407, 6, 125, 126, 127,
1129 128, 17, 37, 51, 132, 3, 4, 135, 136, 3,
1130 4, 139, 140, 141, 142, 501, 143, 330, 430, 147,
1131 50, 149, 150, 151, 4, 20, 154, 155, 4, 49,
1132 158, 159, 16, 6, 18, 19, 6, 164, 165, 24,
1133 167, 25, 26, 6, 3, 4, 174, 6, 48, 177,
1134 50, 6, 180, 181, 182, 34, 184, 185, 12, 13,
1135 14, 15, 0, 1, 6, 193, 48, 51, 50, 7,
1136 8, 9, 10, 11, 6, 29, 204, 205, 206, 17,
1137 208, 209, 6, 37, 22, 4, 16, 215, 18, 19,
1138 48, 16, 50, 18, 19, 25, 48, 4, 50, 37,
1139 25, 26, 38, 39, 40, 41, 42, 43, 44, 45,
1140 46, 47, 4, 16, 6, 18, 19, 245, 246, 247,
1141 6, 51, 25, 251, 3, 4, 48, 6, 50, 257,
1142 258, 259, 260, 261, 262, 263, 3, 4, 6, 6,
1143 3, 4, 48, 6, 50, 49, 274, 275, 48, 48,
1144 50, 50, 280, 4, 4, 6, 6, 48, 51, 50,
1145 288, 289, 290, 291, 292, 293, 294, 48, 48, 50,
1146 50, 484, 299, 300, 48, 48, 304, 50, 48, 48,
1147 50, 50, 310, 311, 312, 313, 314, 51, 315, 316,
1148 51, 48, 319, 50, 321, 48, 48, 50, 50, 48,
1149 48, 50, 50, 48, 4, 50, 6, 35, 4, 337,
1150 6, 6, 6, 50, 50, 343, 344, 345, 346, 347,
1151 49, 348, 349, 48, 51, 36, 50, 4, 356, 357,
1152 358, 359, 360, 361, 362, 363, 6, 4, 21, 49,
1153 48, 369, 370, 371, 372, 51, 4, 4, 4, 4,
1154 49, 27, 49, 51, 382, 383, 384, 385, 386, 387,
1155 388, 389, 51, 49, 392, 393, 394, 395, 50, 4,
1156 51, 4, 400, 401, 6, 28, 51, 50, 50, 50,
1157 408, 409, 410, 411, 412, 413, 51, 4, 51, 4,
1158 49, 51, 419, 420, 202, 6, 50, 425, 426, 49,
1159 51, 22, 51, 51, 6, 433, 434, 435, 436, 437,
1160 438, 49, 51, 4, 51, 51, 6, 6, 31, 49,
1161 51, 448, 449, 51, 50, 49, 51, 50, 50, 4,
1162 50, 239, 460, 461, 50, 49, 464, 4, 465, 466,
1163 50, 6, 51, 4, 6, 49, 51, 50, 4, 32,
1164 51, 51, 50, 50, 49, 51, 264, 49, 51, 4,
1165 6, 4, 50, 49, 51, 49, 51, 6, 495, 496,
1166 51, 50, 49, 51, 502, 503, 504, 505, 506, 507,
1167 508, 509, 51, 51, 6, 6, 49, 51, 296, 4,
1168 4, 51, 520, 521, 51, 6, 51, 51, 526, 527,
1169 528, 529, 530, 531, 532, 533, 33, 51, 49, 51,
1170 50, 6, 49, 51, 542, 543, 544, 545, 546, 547,
1171 548, 549, 50, 6, 6, 51, 51, 51, 556, 557,
1172 558, 559, 560, 561, 562, 563, 6, 6, 566, 567,
1173 568, 569, 570, 571, 352, 572, 573, 6, 49, 51,
1174 4, 6, 580, 581, 582, 583, 6, 584, 585, 49,
1175 51, 4, 49, 51, 287, 593, 594, 595, 596, 286,
1176 16, 459, 30, 225, 52, 443, -1, 576, -1, -1,
1177 -1, -1, -1, -1, -1, -1, -1, -1, -1, 397,
1178 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1179 -1, -1, -1, -1, -1, -1, -1, -1, -1, 417,
1180 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1181 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1182 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1183 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1184 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1185 -1, -1, -1, -1, 472, -1, -1, -1, -1, -1,
1186 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1187 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1188 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1189 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1190 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1191 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1192 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1193 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1194 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1195 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1196 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1197 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1198 -1, -1, -1, -1, -1, -1, -1, 605, -1, -1,
1199 -1, -1, -1, -1, -1, 613
1200 };
1201
1202 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1203 symbol of state STATE-NUM. */
1204 static const yytype_uint8 yystos[] =
1205 {
1206 0, 1, 53, 54, 55, 56, 57, 60, 61, 0,
1207 7, 62, 9, 10, 11, 78, 79, 80, 81, 82,
1208 83, 84, 85, 86, 87, 88, 89, 90, 91, 22,
1209 140, 141, 142, 48, 8, 63, 50, 48, 50, 48,
1210 50, 80, 37, 156, 17, 113, 114, 116, 118, 120,
1211 122, 48, 50, 141, 144, 4, 48, 50, 20, 64,
1212 65, 66, 67, 4, 3, 4, 158, 159, 159, 159,
1213 159, 50, 48, 50, 4, 5, 143, 143, 23, 51,
1214 145, 146, 49, 6, 6, 48, 50, 24, 68, 6,
1215 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
1216 159, 159, 159, 159, 6, 4, 6, 139, 4, 6,
1217 159, 159, 48, 50, 159, 51, 159, 159, 159, 48,
1218 50, 34, 69, 6, 157, 159, 159, 4, 4, 6,
1219 6, 6, 6, 49, 51, 159, 159, 159, 159, 159,
1220 159, 159, 159, 48, 35, 70, 51, 159, 6, 159,
1221 159, 159, 51, 6, 6, 159, 50, 50, 159, 159,
1222 49, 51, 159, 159, 159, 159, 158, 48, 36, 71,
1223 72, 73, 74, 50, 159, 4, 6, 159, 159, 159,
1224 6, 6, 159, 159, 159, 159, 4, 4, 51, 158,
1225 158, 49, 158, 48, 21, 75, 92, 159, 51, 4,
1226 6, 159, 4, 4, 159, 159, 159, 4, 159, 159,
1227 49, 51, 49, 51, 49, 159, 50, 27, 76, 12,
1228 13, 14, 15, 29, 93, 94, 95, 96, 97, 98,
1229 99, 100, 101, 102, 103, 104, 105, 106, 4, 6,
1230 51, 4, 6, 139, 4, 159, 159, 159, 51, 159,
1231 159, 159, 4, 6, 50, 28, 77, 48, 50, 48,
1232 50, 50, 48, 50, 50, 51, 95, 156, 4, 139,
1233 51, 4, 49, 51, 159, 159, 159, 50, 49, 51,
1234 159, 51, 51, 6, 48, 50, 58, 59, 159, 159,
1235 159, 159, 159, 159, 159, 139, 6, 49, 51, 159,
1236 159, 4, 115, 49, 159, 51, 6, 6, 78, 60,
1237 159, 159, 159, 159, 159, 159, 159, 51, 139, 158,
1238 4, 158, 51, 16, 18, 19, 25, 26, 124, 125,
1239 126, 132, 133, 134, 137, 138, 49, 159, 49, 51,
1240 31, 147, 148, 159, 159, 159, 159, 159, 158, 158,
1241 50, 49, 158, 51, 158, 50, 48, 50, 50, 50,
1242 48, 50, 48, 50, 51, 125, 156, 159, 50, 159,
1243 159, 159, 159, 159, 158, 6, 158, 107, 139, 50,
1244 4, 117, 159, 159, 159, 159, 159, 159, 159, 159,
1245 49, 51, 159, 159, 159, 159, 4, 6, 4, 6,
1246 48, 50, 111, 112, 49, 119, 51, 124, 159, 159,
1247 159, 159, 159, 159, 159, 159, 50, 159, 159, 159,
1248 159, 51, 139, 51, 4, 159, 159, 108, 111, 50,
1249 124, 50, 51, 159, 159, 159, 159, 159, 159, 49,
1250 51, 32, 149, 150, 151, 139, 4, 51, 158, 158,
1251 49, 51, 159, 159, 30, 51, 109, 123, 51, 121,
1252 159, 159, 6, 159, 159, 159, 159, 50, 51, 151,
1253 49, 51, 158, 4, 158, 49, 51, 50, 16, 18,
1254 19, 25, 127, 128, 129, 130, 131, 135, 136, 127,
1255 159, 159, 4, 6, 159, 158, 158, 6, 139, 51,
1256 4, 110, 48, 50, 48, 50, 48, 50, 48, 50,
1257 51, 128, 156, 51, 49, 51, 51, 4, 6, 6,
1258 158, 158, 6, 49, 51, 111, 159, 159, 159, 159,
1259 159, 159, 159, 159, 51, 4, 4, 6, 159, 159,
1260 51, 51, 159, 159, 159, 159, 159, 159, 159, 159,
1261 51, 51, 4, 49, 51, 50, 159, 159, 159, 159,
1262 159, 159, 159, 159, 51, 152, 159, 159, 159, 159,
1263 159, 159, 159, 159, 33, 153, 154, 155, 159, 159,
1264 159, 159, 159, 159, 158, 158, 50, 51, 155, 49,
1265 51, 159, 159, 159, 159, 158, 158, 6, 6, 6,
1266 159, 159, 159, 159, 51, 6, 6, 6, 6, 49,
1267 51, 139, 4, 6, 6, 49, 51, 139, 4, 49,
1268 51
1269 };
1270
1271 #define yyerrok (yyerrstatus = 0)
1272 #define yyclearin (yychar = YYEMPTY)
1273 #define YYEMPTY (-2)
1274 #define YYEOF 0
1275
1276 #define YYACCEPT goto yyacceptlab
1277 #define YYABORT goto yyabortlab
1278 #define YYERROR goto yyerrorlab
1279
1280
1281 /* Like YYERROR except do call yyerror. This remains here temporarily
1282 to ease the transition to the new meaning of YYERROR, for GCC.
1283 Once GCC version 2 has supplanted version 1, this can go. */
1284
1285 #define YYFAIL goto yyerrlab
1286
1287 #define YYRECOVERING() (!!yyerrstatus)
1288
1289 #define YYBACKUP(Token, Value) \
1290 do \
1291 if (yychar == YYEMPTY && yylen == 1) \
1292 { \
1293 yychar = (Token); \
1294 yylval = (Value); \
1295 yytoken = YYTRANSLATE (yychar); \
1296 YYPOPSTACK (1); \
1297 goto yybackup; \
1298 } \
1299 else \
1300 { \
1301 yyerror (YY_("syntax error: cannot back up")); \
1302 YYERROR; \
1303 } \
1304 while (YYID (0))
1305
1306
1307 #define YYTERROR 1
1308 #define YYERRCODE 256
1309
1310
1311 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1312 If N is 0, then set CURRENT to the empty location which ends
1313 the previous symbol: RHS[0] (always defined). */
1314
1315 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1316 #ifndef YYLLOC_DEFAULT
1317 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1318 do \
1319 if (YYID (N)) \
1320 { \
1321 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1322 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1323 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1324 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1325 } \
1326 else \
1327 { \
1328 (Current).first_line = (Current).last_line = \
1329 YYRHSLOC (Rhs, 0).last_line; \
1330 (Current).first_column = (Current).last_column = \
1331 YYRHSLOC (Rhs, 0).last_column; \
1332 } \
1333 while (YYID (0))
1334 #endif
1335
1336
1337 /* YY_LOCATION_PRINT -- Print the location on the stream.
1338 This macro was not mandated originally: define only if we know
1339 we won't break user code: when these are the locations we know. */
1340
1341 #ifndef YY_LOCATION_PRINT
1342 # if YYLTYPE_IS_TRIVIAL
1343 # define YY_LOCATION_PRINT(File, Loc) \
1344 fprintf (File, "%d.%d-%d.%d", \
1345 (Loc).first_line, (Loc).first_column, \
1346 (Loc).last_line, (Loc).last_column)
1347 # else
1348 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1349 # endif
1350 #endif
1351
1352
1353 /* YYLEX -- calling `yylex' with the right arguments. */
1354
1355 #ifdef YYLEX_PARAM
1356 # define YYLEX yylex (YYLEX_PARAM)
1357 #else
1358 # define YYLEX yylex ()
1359 #endif
1360
1361 /* Enable debugging if requested. */
1362 #if YYDEBUG
1363
1364 # ifndef YYFPRINTF
1365 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1366 # define YYFPRINTF fprintf
1367 # endif
1368
1369 # define YYDPRINTF(Args) \
1370 do { \
1371 if (yydebug) \
1372 YYFPRINTF Args; \
1373 } while (YYID (0))
1374
1375 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1376 do { \
1377 if (yydebug) \
1378 { \
1379 YYFPRINTF (stderr, "%s ", Title); \
1380 yy_symbol_print (stderr, \
1381 Type, Value); \
1382 YYFPRINTF (stderr, "\n"); \
1383 } \
1384 } while (YYID (0))
1385
1386
1387 /*--------------------------------.
1388 | Print this symbol on YYOUTPUT. |
1389 `--------------------------------*/
1390
1391 /*ARGSUSED*/
1392 #if (defined __STDC__ || defined __C99__FUNC__ \
1393 || defined __cplusplus || defined _MSC_VER)
1394 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1395 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1396 #else
1397 static void
1398 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1399 FILE *yyoutput;
1400 int yytype;
1401 YYSTYPE const * const yyvaluep;
1402 #endif
1403 {
1404 if (!yyvaluep)
1405 return;
1406 # ifdef YYPRINT
1407 if (yytype < YYNTOKENS)
1408 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1409 # else
1410 YYUSE (yyoutput);
1411 # endif
1412 switch (yytype)
1413 {
1414 default:
1415 break;
1416 }
1417 }
1418
1419
1420 /*--------------------------------.
1421 | Print this symbol on YYOUTPUT. |
1422 `--------------------------------*/
1423
1424 #if (defined __STDC__ || defined __C99__FUNC__ \
1425 || defined __cplusplus || defined _MSC_VER)
1426 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1427 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1428 #else
1429 static void
1430 yy_symbol_print (yyoutput, yytype, yyvaluep)
1431 FILE *yyoutput;
1432 int yytype;
1433 YYSTYPE const * const yyvaluep;
1434 #endif
1435 {
1436 if (yytype < YYNTOKENS)
1437 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1438 else
1439 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1440
1441 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1442 YYFPRINTF (yyoutput, ")");
1443 }
1444
1445 /*------------------------------------------------------------------.
1446 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1447 | TOP (included). |
1448 `------------------------------------------------------------------*/
1449
1450 #if (defined __STDC__ || defined __C99__FUNC__ \
1451 || defined __cplusplus || defined _MSC_VER)
1452 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)1453 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1454 #else
1455 static void
1456 yy_stack_print (yybottom, yytop)
1457 yytype_int16 *yybottom;
1458 yytype_int16 *yytop;
1459 #endif
1460 {
1461 YYFPRINTF (stderr, "Stack now");
1462 for (; yybottom <= yytop; yybottom++)
1463 {
1464 int yybot = *yybottom;
1465 YYFPRINTF (stderr, " %d", yybot);
1466 }
1467 YYFPRINTF (stderr, "\n");
1468 }
1469
1470 # define YY_STACK_PRINT(Bottom, Top) \
1471 do { \
1472 if (yydebug) \
1473 yy_stack_print ((Bottom), (Top)); \
1474 } while (YYID (0))
1475
1476
1477 /*------------------------------------------------.
1478 | Report that the YYRULE is going to be reduced. |
1479 `------------------------------------------------*/
1480
1481 #if (defined __STDC__ || defined __C99__FUNC__ \
1482 || defined __cplusplus || defined _MSC_VER)
1483 static void
yy_reduce_print(YYSTYPE * yyvsp,int yyrule)1484 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1485 #else
1486 static void
1487 yy_reduce_print (yyvsp, yyrule)
1488 YYSTYPE *yyvsp;
1489 int yyrule;
1490 #endif
1491 {
1492 int yynrhs = yyr2[yyrule];
1493 int yyi;
1494 unsigned long int yylno = yyrline[yyrule];
1495 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1496 yyrule - 1, yylno);
1497 /* The symbols being reduced. */
1498 for (yyi = 0; yyi < yynrhs; yyi++)
1499 {
1500 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1501 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1502 &(yyvsp[(yyi + 1) - (yynrhs)])
1503 );
1504 YYFPRINTF (stderr, "\n");
1505 }
1506 }
1507
1508 # define YY_REDUCE_PRINT(Rule) \
1509 do { \
1510 if (yydebug) \
1511 yy_reduce_print (yyvsp, Rule); \
1512 } while (YYID (0))
1513
1514 /* Nonzero means print parse trace. It is left uninitialized so that
1515 multiple parsers can coexist. */
1516 int yydebug;
1517 #else /* !YYDEBUG */
1518 # define YYDPRINTF(Args)
1519 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1520 # define YY_STACK_PRINT(Bottom, Top)
1521 # define YY_REDUCE_PRINT(Rule)
1522 #endif /* !YYDEBUG */
1523
1524
1525 /* YYINITDEPTH -- initial size of the parser's stacks. */
1526 #ifndef YYINITDEPTH
1527 # define YYINITDEPTH 200
1528 #endif
1529
1530 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1531 if the built-in stack extension method is used).
1532
1533 Do not make this value too large; the results are undefined if
1534 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1535 evaluated with infinite-precision integer arithmetic. */
1536
1537 #ifndef YYMAXDEPTH
1538 # define YYMAXDEPTH 10000
1539 #endif
1540
1541
1542
1543 #if YYERROR_VERBOSE
1544
1545 # ifndef yystrlen
1546 # if defined __GLIBC__ && defined _STRING_H
1547 # define yystrlen strlen
1548 # else
1549 /* Return the length of YYSTR. */
1550 #if (defined __STDC__ || defined __C99__FUNC__ \
1551 || defined __cplusplus || defined _MSC_VER)
1552 static YYSIZE_T
yystrlen(const char * yystr)1553 yystrlen (const char *yystr)
1554 #else
1555 static YYSIZE_T
1556 yystrlen (yystr)
1557 const char *yystr;
1558 #endif
1559 {
1560 YYSIZE_T yylen;
1561 for (yylen = 0; yystr[yylen]; yylen++)
1562 continue;
1563 return yylen;
1564 }
1565 # endif
1566 # endif
1567
1568 # ifndef yystpcpy
1569 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1570 # define yystpcpy stpcpy
1571 # else
1572 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1573 YYDEST. */
1574 #if (defined __STDC__ || defined __C99__FUNC__ \
1575 || defined __cplusplus || defined _MSC_VER)
1576 static char *
yystpcpy(char * yydest,const char * yysrc)1577 yystpcpy (char *yydest, const char *yysrc)
1578 #else
1579 static char *
1580 yystpcpy (yydest, yysrc)
1581 char *yydest;
1582 const char *yysrc;
1583 #endif
1584 {
1585 char *yyd = yydest;
1586 const char *yys = yysrc;
1587
1588 while ((*yyd++ = *yys++) != '\0')
1589 continue;
1590
1591 return yyd - 1;
1592 }
1593 # endif
1594 # endif
1595
1596 # ifndef yytnamerr
1597 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1598 quotes and backslashes, so that it's suitable for yyerror. The
1599 heuristic is that double-quoting is unnecessary unless the string
1600 contains an apostrophe, a comma, or backslash (other than
1601 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1602 null, do not copy; instead, return the length of what the result
1603 would have been. */
1604 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1605 yytnamerr (char *yyres, const char *yystr)
1606 {
1607 if (*yystr == '"')
1608 {
1609 YYSIZE_T yyn = 0;
1610 char const *yyp = yystr;
1611
1612 for (;;)
1613 switch (*++yyp)
1614 {
1615 case '\'':
1616 case ',':
1617 goto do_not_strip_quotes;
1618
1619 case '\\':
1620 if (*++yyp != '\\')
1621 goto do_not_strip_quotes;
1622 /* Fall through. */
1623 default:
1624 if (yyres)
1625 yyres[yyn] = *yyp;
1626 yyn++;
1627 break;
1628
1629 case '"':
1630 if (yyres)
1631 yyres[yyn] = '\0';
1632 return yyn;
1633 }
1634 do_not_strip_quotes: ;
1635 }
1636
1637 if (! yyres)
1638 return yystrlen (yystr);
1639
1640 return yystpcpy (yyres, yystr) - yyres;
1641 }
1642 # endif
1643
1644 /* Copy into YYRESULT an error message about the unexpected token
1645 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1646 including the terminating null byte. If YYRESULT is null, do not
1647 copy anything; just return the number of bytes that would be
1648 copied. As a special case, return 0 if an ordinary "syntax error"
1649 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1650 size calculation. */
1651 static YYSIZE_T
yysyntax_error(char * yyresult,int yystate,int yychar)1652 yysyntax_error (char *yyresult, int yystate, int yychar)
1653 {
1654 int yyn = yypact[yystate];
1655
1656 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1657 return 0;
1658 else
1659 {
1660 int yytype = YYTRANSLATE (yychar);
1661 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1662 YYSIZE_T yysize = yysize0;
1663 YYSIZE_T yysize1;
1664 int yysize_overflow = 0;
1665 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1666 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1667 int yyx;
1668
1669 # if 0
1670 /* This is so xgettext sees the translatable formats that are
1671 constructed on the fly. */
1672 YY_("syntax error, unexpected %s");
1673 YY_("syntax error, unexpected %s, expecting %s");
1674 YY_("syntax error, unexpected %s, expecting %s or %s");
1675 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1676 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1677 # endif
1678 char *yyfmt;
1679 char const *yyf;
1680 static char const yyunexpected[] = "syntax error, unexpected %s";
1681 static char const yyexpecting[] = ", expecting %s";
1682 static char const yyor[] = " or %s";
1683 char yyformat[sizeof yyunexpected
1684 + sizeof yyexpecting - 1
1685 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1686 * (sizeof yyor - 1))];
1687 char const *yyprefix = yyexpecting;
1688
1689 /* Start YYX at -YYN if negative to avoid negative indexes in
1690 YYCHECK. */
1691 int yyxbegin = yyn < 0 ? -yyn : 0;
1692
1693 /* Stay within bounds of both yycheck and yytname. */
1694 int yychecklim = YYLAST - yyn + 1;
1695 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1696 int yycount = 1;
1697
1698 yyarg[0] = yytname[yytype];
1699 yyfmt = yystpcpy (yyformat, yyunexpected);
1700
1701 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1702 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1703 {
1704 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1705 {
1706 yycount = 1;
1707 yysize = yysize0;
1708 yyformat[sizeof yyunexpected - 1] = '\0';
1709 break;
1710 }
1711 yyarg[yycount++] = yytname[yyx];
1712 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1713 yysize_overflow |= (yysize1 < yysize);
1714 yysize = yysize1;
1715 yyfmt = yystpcpy (yyfmt, yyprefix);
1716 yyprefix = yyor;
1717 }
1718
1719 yyf = YY_(yyformat);
1720 yysize1 = yysize + yystrlen (yyf);
1721 yysize_overflow |= (yysize1 < yysize);
1722 yysize = yysize1;
1723
1724 if (yysize_overflow)
1725 return YYSIZE_MAXIMUM;
1726
1727 if (yyresult)
1728 {
1729 /* Avoid sprintf, as that infringes on the user's name space.
1730 Don't have undefined behavior even if the translation
1731 produced a string with the wrong number of "%s"s. */
1732 char *yyp = yyresult;
1733 int yyi = 0;
1734 while ((*yyp = *yyf) != '\0')
1735 {
1736 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1737 {
1738 yyp += yytnamerr (yyp, yyarg[yyi++]);
1739 yyf += 2;
1740 }
1741 else
1742 {
1743 yyp++;
1744 yyf++;
1745 }
1746 }
1747 }
1748 return yysize;
1749 }
1750 }
1751 #endif /* YYERROR_VERBOSE */
1752
1753
1754 /*-----------------------------------------------.
1755 | Release the memory associated to this symbol. |
1756 `-----------------------------------------------*/
1757
1758 /*ARGSUSED*/
1759 #if (defined __STDC__ || defined __C99__FUNC__ \
1760 || defined __cplusplus || defined _MSC_VER)
1761 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1762 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1763 #else
1764 static void
1765 yydestruct (yymsg, yytype, yyvaluep)
1766 const char *yymsg;
1767 int yytype;
1768 YYSTYPE *yyvaluep;
1769 #endif
1770 {
1771 YYUSE (yyvaluep);
1772
1773 if (!yymsg)
1774 yymsg = "Deleting";
1775 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1776
1777 switch (yytype)
1778 {
1779
1780 default:
1781 break;
1782 }
1783 }
1784
1785 /* Prevent warnings from -Wmissing-prototypes. */
1786 #ifdef YYPARSE_PARAM
1787 #if defined __STDC__ || defined __cplusplus
1788 int yyparse (void *YYPARSE_PARAM);
1789 #else
1790 int yyparse ();
1791 #endif
1792 #else /* ! YYPARSE_PARAM */
1793 #if defined __STDC__ || defined __cplusplus
1794 int yyparse (void);
1795 #else
1796 int yyparse ();
1797 #endif
1798 #endif /* ! YYPARSE_PARAM */
1799
1800
1801 /* The lookahead symbol. */
1802 int yychar;
1803
1804 /* The semantic value of the lookahead symbol. */
1805 YYSTYPE yylval;
1806
1807 /* Number of syntax errors so far. */
1808 int yynerrs;
1809
1810
1811
1812 /*-------------------------.
1813 | yyparse or yypush_parse. |
1814 `-------------------------*/
1815
1816 #ifdef YYPARSE_PARAM
1817 #if (defined __STDC__ || defined __C99__FUNC__ \
1818 || defined __cplusplus || defined _MSC_VER)
1819 int
yyparse(void * YYPARSE_PARAM)1820 yyparse (void *YYPARSE_PARAM)
1821 #else
1822 int
1823 yyparse (YYPARSE_PARAM)
1824 void *YYPARSE_PARAM;
1825 #endif
1826 #else /* ! YYPARSE_PARAM */
1827 #if (defined __STDC__ || defined __C99__FUNC__ \
1828 || defined __cplusplus || defined _MSC_VER)
1829 int
1830 yyparse (void)
1831 #else
1832 int
1833 yyparse ()
1834
1835 #endif
1836 #endif
1837 {
1838
1839
1840 int yystate;
1841 /* Number of tokens to shift before error messages enabled. */
1842 int yyerrstatus;
1843
1844 /* The stacks and their tools:
1845 `yyss': related to states.
1846 `yyvs': related to semantic values.
1847
1848 Refer to the stacks thru separate pointers, to allow yyoverflow
1849 to reallocate them elsewhere. */
1850
1851 /* The state stack. */
1852 yytype_int16 yyssa[YYINITDEPTH];
1853 yytype_int16 *yyss;
1854 yytype_int16 *yyssp;
1855
1856 /* The semantic value stack. */
1857 YYSTYPE yyvsa[YYINITDEPTH];
1858 YYSTYPE *yyvs;
1859 YYSTYPE *yyvsp;
1860
1861 YYSIZE_T yystacksize;
1862
1863 int yyn;
1864 int yyresult;
1865 /* Lookahead token as an internal (translated) token number. */
1866 int yytoken;
1867 /* The variables used to return semantic value and location from the
1868 action routines. */
1869 YYSTYPE yyval;
1870
1871 #if YYERROR_VERBOSE
1872 /* Buffer for error messages, and its allocated size. */
1873 char yymsgbuf[128];
1874 char *yymsg = yymsgbuf;
1875 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1876 #endif
1877
1878 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1879
1880 /* The number of symbols on the RHS of the reduced rule.
1881 Keep to zero when no symbol should be popped. */
1882 int yylen = 0;
1883
1884 yytoken = 0;
1885 yyss = yyssa;
1886 yyvs = yyvsa;
1887 yystacksize = YYINITDEPTH;
1888
1889 YYDPRINTF ((stderr, "Starting parse\n"));
1890
1891 yystate = 0;
1892 yyerrstatus = 0;
1893 yynerrs = 0;
1894 yychar = YYEMPTY; /* Cause a token to be read. */
1895
1896 /* Initialize stack pointers.
1897 Waste one element of value and location stack
1898 so that they stay on the same level as the state stack.
1899 The wasted elements are never initialized. */
1900 yyssp = yyss;
1901 yyvsp = yyvs;
1902
1903 goto yysetstate;
1904
1905 /*------------------------------------------------------------.
1906 | yynewstate -- Push a new state, which is found in yystate. |
1907 `------------------------------------------------------------*/
1908 yynewstate:
1909 /* In all cases, when you get here, the value and location stacks
1910 have just been pushed. So pushing a state here evens the stacks. */
1911 yyssp++;
1912
1913 yysetstate:
1914 *yyssp = yystate;
1915
1916 if (yyss + yystacksize - 1 <= yyssp)
1917 {
1918 /* Get the current used size of the three stacks, in elements. */
1919 YYSIZE_T yysize = yyssp - yyss + 1;
1920
1921 #ifdef yyoverflow
1922 {
1923 /* Give user a chance to reallocate the stack. Use copies of
1924 these so that the &'s don't force the real ones into
1925 memory. */
1926 YYSTYPE *yyvs1 = yyvs;
1927 yytype_int16 *yyss1 = yyss;
1928
1929 /* Each stack pointer address is followed by the size of the
1930 data in use in that stack, in bytes. This used to be a
1931 conditional around just the two extra args, but that might
1932 be undefined if yyoverflow is a macro. */
1933 yyoverflow (YY_("memory exhausted"),
1934 &yyss1, yysize * sizeof (*yyssp),
1935 &yyvs1, yysize * sizeof (*yyvsp),
1936 &yystacksize);
1937
1938 yyss = yyss1;
1939 yyvs = yyvs1;
1940 }
1941 #else /* no yyoverflow */
1942 # ifndef YYSTACK_RELOCATE
1943 goto yyexhaustedlab;
1944 # else
1945 /* Extend the stack our own way. */
1946 if (YYMAXDEPTH <= yystacksize)
1947 goto yyexhaustedlab;
1948 yystacksize *= 2;
1949 if (YYMAXDEPTH < yystacksize)
1950 yystacksize = YYMAXDEPTH;
1951
1952 {
1953 yytype_int16 *yyss1 = yyss;
1954 union yyalloc *yyptr =
1955 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1956 if (! yyptr)
1957 goto yyexhaustedlab;
1958 YYSTACK_RELOCATE (yyss_alloc, yyss);
1959 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1960 # undef YYSTACK_RELOCATE
1961 if (yyss1 != yyssa)
1962 YYSTACK_FREE (yyss1);
1963 }
1964 # endif
1965 #endif /* no yyoverflow */
1966
1967 yyssp = yyss + yysize - 1;
1968 yyvsp = yyvs + yysize - 1;
1969
1970 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1971 (unsigned long int) yystacksize));
1972
1973 if (yyss + yystacksize - 1 <= yyssp)
1974 YYABORT;
1975 }
1976
1977 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1978
1979 if (yystate == YYFINAL)
1980 YYACCEPT;
1981
1982 goto yybackup;
1983
1984 /*-----------.
1985 | yybackup. |
1986 `-----------*/
1987 yybackup:
1988
1989 /* Do appropriate processing given the current state. Read a
1990 lookahead token if we need one and don't already have one. */
1991
1992 /* First try to decide what to do without reference to lookahead token. */
1993 yyn = yypact[yystate];
1994 if (yyn == YYPACT_NINF)
1995 goto yydefault;
1996
1997 /* Not known => get a lookahead token if don't already have one. */
1998
1999 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2000 if (yychar == YYEMPTY)
2001 {
2002 YYDPRINTF ((stderr, "Reading a token: "));
2003 yychar = YYLEX;
2004 }
2005
2006 if (yychar <= YYEOF)
2007 {
2008 yychar = yytoken = YYEOF;
2009 YYDPRINTF ((stderr, "Now at end of input.\n"));
2010 }
2011 else
2012 {
2013 yytoken = YYTRANSLATE (yychar);
2014 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2015 }
2016
2017 /* If the proper action on seeing token YYTOKEN is to reduce or to
2018 detect an error, take that action. */
2019 yyn += yytoken;
2020 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2021 goto yydefault;
2022 yyn = yytable[yyn];
2023 if (yyn <= 0)
2024 {
2025 if (yyn == 0 || yyn == YYTABLE_NINF)
2026 goto yyerrlab;
2027 yyn = -yyn;
2028 goto yyreduce;
2029 }
2030
2031 /* Count tokens shifted since error; after three, turn off error
2032 status. */
2033 if (yyerrstatus)
2034 yyerrstatus--;
2035
2036 /* Shift the lookahead token. */
2037 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2038
2039 /* Discard the shifted token. */
2040 yychar = YYEMPTY;
2041
2042 yystate = yyn;
2043 *++yyvsp = yylval;
2044
2045 goto yynewstate;
2046
2047
2048 /*-----------------------------------------------------------.
2049 | yydefault -- do the default action for the current state. |
2050 `-----------------------------------------------------------*/
2051 yydefault:
2052 yyn = yydefact[yystate];
2053 if (yyn == 0)
2054 goto yyerrlab;
2055 goto yyreduce;
2056
2057
2058 /*-----------------------------.
2059 | yyreduce -- Do a reduction. |
2060 `-----------------------------*/
2061 yyreduce:
2062 /* yyn is the number of a rule to reduce with. */
2063 yylen = yyr2[yyn];
2064
2065 /* If YYLEN is nonzero, implement the default value of the action:
2066 `$$ = $1'.
2067
2068 Otherwise, the following line sets YYVAL to garbage.
2069 This behavior is undocumented and Bison
2070 users should not rely upon it. Assigning to YYVAL
2071 unconditionally makes the parser a bit smaller, and it avoids a
2072 GCC warning that YYVAL may be used uninitialized. */
2073 yyval = yyvsp[1-yylen];
2074
2075
2076 YY_REDUCE_PRINT (yyn);
2077 switch (yyn)
2078 {
2079 case 5:
2080
2081 /* Line 1455 of yacc.c */
2082 #line 143 "parse_y.y"
2083 { YYABORT; }
2084 break;
2085
2086 case 6:
2087
2088 /* Line 1455 of yacc.c */
2089 #line 179 "parse_y.y"
2090 { /* reset flags for 'used layers';
2091 * init font and data pointers
2092 */
2093 int i;
2094 file_type = PCBFILE;
2095 if (!yyPCB)
2096 {
2097 Message(_("illegal pcb file format\n"));
2098 YYABORT;
2099 }
2100 for (i = 0; i < MAX_ALL_LAYER; i++)
2101 LayerFlag[i] = false;
2102 yyFont = &yyPCB->Font;
2103 yyData = yyPCB->Data;
2104 yyData->pcb = yyPCB;
2105 yyData->LayerN = 0;
2106 /* Parse the default layer group string, just in case the file doesn't have one */
2107 if (ParseGroupString (Settings.Groups, &yyPCB->LayerGroups, &yyData->LayerN))
2108 {
2109 Message(_("illegal default layer-group string\n"));
2110 YYABORT;
2111 }
2112 }
2113 break;
2114
2115 case 7:
2116
2117 /* Line 1455 of yacc.c */
2118 #line 215 "parse_y.y"
2119 {
2120 PCBType *pcb_save = PCB;
2121
2122 CreateNewPCBPost (yyPCB, 0);
2123 /* initialize the polygon clipping now since
2124 * we didn't know the layer grouping before.
2125 */
2126 PCB = yyPCB;
2127 ALLPOLYGON_LOOP (yyData);
2128 {
2129 InitClip (yyData, layer, polygon);
2130 }
2131 ENDALL_LOOP;
2132 PCB = pcb_save;
2133 }
2134 break;
2135
2136 case 8:
2137
2138 /* Line 1455 of yacc.c */
2139 #line 234 "parse_y.y"
2140 {
2141 /* reset flags for 'used layers';
2142 * init font and data pointers
2143 */
2144 int i;
2145 file_type = DATAFILE;
2146 /* Loading a footprint file as a layout */
2147 if (yyPCB)
2148 {
2149 yyFont = &yyPCB->Font;
2150 yyData = yyPCB->Data;
2151 yyData->pcb = yyPCB;
2152 }
2153 /* e.g. loading data to a buffer */
2154 else if (!yyData || !yyFont)
2155 {
2156 Message(_("PCB data not initialized! Cannot load data file\n"));
2157 YYABORT;
2158 }
2159
2160 for (i = 0; i < MAX_ALL_LAYER; i++)
2161 LayerFlag[i] = false;
2162 yyData->LayerN = 0;
2163 }
2164 break;
2165
2166 case 10:
2167
2168 /* Line 1455 of yacc.c */
2169 #line 262 "parse_y.y"
2170 {
2171 file_type = FONTFILE;
2172 }
2173 break;
2174
2175 case 13:
2176
2177 /* Line 1455 of yacc.c */
2178 #line 270 "parse_y.y"
2179 {
2180 /* mark all symbols invalid */
2181 int i;
2182
2183 if (!yyFont)
2184 {
2185 Message(_("illegal file format\n"));
2186 YYABORT;
2187 }
2188 yyFont->Valid = false;
2189 for (i = 0; i <= MAX_FONTPOSITION; i++)
2190 free (yyFont->Symbol[i].Line);
2191 bzero(yyFont->Symbol, sizeof(yyFont->Symbol));
2192 }
2193 break;
2194
2195 case 14:
2196
2197 /* Line 1455 of yacc.c */
2198 #line 285 "parse_y.y"
2199 {
2200 yyFont->Valid = true;
2201 SetFontInfo(yyFont);
2202 }
2203 break;
2204
2205 case 16:
2206
2207 /* Line 1455 of yacc.c */
2208 #line 313 "parse_y.y"
2209 {
2210 if (check_file_version ((yyvsp[(3) - (4)].integer)) != 0)
2211 {
2212 YYABORT;
2213 }
2214 }
2215 break;
2216
2217 case 17:
2218
2219 /* Line 1455 of yacc.c */
2220 #line 352 "parse_y.y"
2221 {
2222 yyPCB->Name = (yyvsp[(3) - (4)].string);
2223 yyPCB->MaxWidth = MAX_COORD;
2224 yyPCB->MaxHeight = MAX_COORD;
2225 }
2226 break;
2227
2228 case 18:
2229
2230 /* Line 1455 of yacc.c */
2231 #line 358 "parse_y.y"
2232 {
2233 yyPCB->Name = (yyvsp[(3) - (6)].string);
2234 yyPCB->MaxWidth = OU ((yyvsp[(4) - (6)].measure));
2235 yyPCB->MaxHeight = OU ((yyvsp[(5) - (6)].measure));
2236 }
2237 break;
2238
2239 case 19:
2240
2241 /* Line 1455 of yacc.c */
2242 #line 364 "parse_y.y"
2243 {
2244 yyPCB->Name = (yyvsp[(3) - (6)].string);
2245 yyPCB->MaxWidth = NU ((yyvsp[(4) - (6)].measure));
2246 yyPCB->MaxHeight = NU ((yyvsp[(5) - (6)].measure));
2247 }
2248 break;
2249
2250 case 23:
2251
2252 /* Line 1455 of yacc.c */
2253 #line 407 "parse_y.y"
2254 {
2255 yyPCB->Grid = OU ((yyvsp[(3) - (6)].measure));
2256 yyPCB->GridOffsetX = OU ((yyvsp[(4) - (6)].measure));
2257 yyPCB->GridOffsetY = OU ((yyvsp[(5) - (6)].measure));
2258 }
2259 break;
2260
2261 case 24:
2262
2263 /* Line 1455 of yacc.c */
2264 #line 415 "parse_y.y"
2265 {
2266 yyPCB->Grid = OU ((yyvsp[(3) - (7)].measure));
2267 yyPCB->GridOffsetX = OU ((yyvsp[(4) - (7)].measure));
2268 yyPCB->GridOffsetY = OU ((yyvsp[(5) - (7)].measure));
2269 if ((yyvsp[(6) - (7)].integer))
2270 Settings.DrawGrid = true;
2271 else
2272 Settings.DrawGrid = false;
2273 }
2274 break;
2275
2276 case 25:
2277
2278 /* Line 1455 of yacc.c */
2279 #line 428 "parse_y.y"
2280 {
2281 yyPCB->Grid = NU ((yyvsp[(3) - (7)].measure));
2282 yyPCB->GridOffsetX = NU ((yyvsp[(4) - (7)].measure));
2283 yyPCB->GridOffsetY = NU ((yyvsp[(5) - (7)].measure));
2284 if ((yyvsp[(6) - (7)].integer))
2285 Settings.DrawGrid = true;
2286 else
2287 Settings.DrawGrid = false;
2288 }
2289 break;
2290
2291 case 26:
2292
2293 /* Line 1455 of yacc.c */
2294 #line 467 "parse_y.y"
2295 {
2296 yyPCB->CursorX = OU ((yyvsp[(3) - (6)].measure));
2297 yyPCB->CursorY = OU ((yyvsp[(4) - (6)].measure));
2298 }
2299 break;
2300
2301 case 27:
2302
2303 /* Line 1455 of yacc.c */
2304 #line 472 "parse_y.y"
2305 {
2306 yyPCB->CursorX = NU ((yyvsp[(3) - (6)].measure));
2307 yyPCB->CursorY = NU ((yyvsp[(4) - (6)].measure));
2308 }
2309 break;
2310
2311 case 30:
2312
2313 /* Line 1455 of yacc.c */
2314 #line 495 "parse_y.y"
2315 {
2316 /* Read in cmil^2 for now; in future this should be a noop. */
2317 yyPCB->IsleArea = MIL_TO_COORD (MIL_TO_COORD ((yyvsp[(3) - (4)].number)) / 100.0) / 100.0;
2318 }
2319 break;
2320
2321 case 32:
2322
2323 /* Line 1455 of yacc.c */
2324 #line 522 "parse_y.y"
2325 {
2326 yyPCB->ThermScale = (yyvsp[(3) - (4)].number);
2327 }
2328 break;
2329
2330 case 37:
2331
2332 /* Line 1455 of yacc.c */
2333 #line 561 "parse_y.y"
2334 {
2335 yyPCB->Bloat = NU ((yyvsp[(3) - (6)].measure));
2336 yyPCB->Shrink = NU ((yyvsp[(4) - (6)].measure));
2337 yyPCB->minWid = NU ((yyvsp[(5) - (6)].measure));
2338 yyPCB->minRing = NU ((yyvsp[(5) - (6)].measure));
2339 }
2340 break;
2341
2342 case 38:
2343
2344 /* Line 1455 of yacc.c */
2345 #line 571 "parse_y.y"
2346 {
2347 yyPCB->Bloat = NU ((yyvsp[(3) - (7)].measure));
2348 yyPCB->Shrink = NU ((yyvsp[(4) - (7)].measure));
2349 yyPCB->minWid = NU ((yyvsp[(5) - (7)].measure));
2350 yyPCB->minSlk = NU ((yyvsp[(6) - (7)].measure));
2351 yyPCB->minRing = NU ((yyvsp[(5) - (7)].measure));
2352 }
2353 break;
2354
2355 case 39:
2356
2357 /* Line 1455 of yacc.c */
2358 #line 582 "parse_y.y"
2359 {
2360 yyPCB->Bloat = NU ((yyvsp[(3) - (9)].measure));
2361 yyPCB->Shrink = NU ((yyvsp[(4) - (9)].measure));
2362 yyPCB->minWid = NU ((yyvsp[(5) - (9)].measure));
2363 yyPCB->minSlk = NU ((yyvsp[(6) - (9)].measure));
2364 yyPCB->minDrill = NU ((yyvsp[(7) - (9)].measure));
2365 yyPCB->minRing = NU ((yyvsp[(8) - (9)].measure));
2366 }
2367 break;
2368
2369 case 40:
2370
2371 /* Line 1455 of yacc.c */
2372 #line 609 "parse_y.y"
2373 {
2374 yyPCB->Flags = MakeFlags ((yyvsp[(3) - (4)].integer) & PCB_FLAGS);
2375 }
2376 break;
2377
2378 case 41:
2379
2380 /* Line 1455 of yacc.c */
2381 #line 613 "parse_y.y"
2382 {
2383 yyPCB->Flags = string_to_pcbflags ((yyvsp[(3) - (4)].string), yyerror);
2384 free ((yyvsp[(3) - (4)].string));
2385 }
2386 break;
2387
2388 case 43:
2389
2390 /* Line 1455 of yacc.c */
2391 #line 646 "parse_y.y"
2392 {
2393 if (ParseGroupString ((yyvsp[(3) - (4)].string), &yyPCB->LayerGroups, &yyData->LayerN))
2394 {
2395 Message(_("illegal layer-group string\n"));
2396 YYABORT;
2397 }
2398 free ((yyvsp[(3) - (4)].string));
2399 }
2400 break;
2401
2402 case 45:
2403
2404 /* Line 1455 of yacc.c */
2405 #line 711 "parse_y.y"
2406 {
2407 if (ParseRouteString(((yyvsp[(3) - (4)].string) == NULL ? "" : (yyvsp[(3) - (4)].string)), &yyPCB->RouteStyle[0], "mil"))
2408 {
2409 Message(_("illegal route-style string\n"));
2410 YYABORT;
2411 }
2412 free ((yyvsp[(3) - (4)].string));
2413 }
2414 break;
2415
2416 case 46:
2417
2418 /* Line 1455 of yacc.c */
2419 #line 720 "parse_y.y"
2420 {
2421 if (ParseRouteString(((yyvsp[(3) - (4)].string) == NULL ? "" : (yyvsp[(3) - (4)].string)), &yyPCB->RouteStyle[0], "cmil"))
2422 {
2423 Message(_("illegal route-style string\n"));
2424 YYABORT;
2425 }
2426 free ((yyvsp[(3) - (4)].string));
2427 }
2428 break;
2429
2430 case 53:
2431
2432 /* Line 1455 of yacc.c */
2433 #line 743 "parse_y.y"
2434 { attr_list = & yyPCB->Attributes; }
2435 break;
2436
2437 case 57:
2438
2439 /* Line 1455 of yacc.c */
2440 #line 746 "parse_y.y"
2441 {
2442 if ( file_type == DATAFILE ) {
2443
2444 if (yyPCB != NULL)
2445 {
2446 /* This case is when we load a footprint with file->open, or from the command line */
2447 yyFont = &yyPCB->Font;
2448 yyData = yyPCB->Data;
2449 yyData->pcb = yyPCB;
2450 yyData->LayerN = 0;
2451 }
2452 }
2453 }
2454 break;
2455
2456 case 58:
2457
2458 /* Line 1455 of yacc.c */
2459 #line 760 "parse_y.y"
2460 {
2461 if (file_type == DATAFILE){
2462 PCBType *pcb_save = PCB;
2463 ElementType *e;
2464 if (yyPCB != NULL)
2465 {
2466 /* This case is when we load a footprint with file->open, or from the command line */
2467 CreateNewPCBPost (yyPCB, 0);
2468 ParseGroupString("1,c:2,s", &yyPCB->LayerGroups, &yyData->LayerN);
2469 e = yyPCB->Data->Element->data; /* we know there's only one */
2470 PCB = yyPCB;
2471 MoveElementLowLevel (yyPCB->Data, e, -e->BoundingBox.X1, -e->BoundingBox.Y1);
2472 PCB = pcb_save;
2473 yyPCB->MaxWidth = e->BoundingBox.X2;
2474 yyPCB->MaxHeight = e->BoundingBox.Y2;
2475 yyPCB->is_footprint = 1;
2476 }
2477 }
2478 }
2479 break;
2480
2481 case 65:
2482
2483 /* Line 1455 of yacc.c */
2484 #line 852 "parse_y.y"
2485 {
2486 CreateNewViaEx (yyData, NU ((yyvsp[(3) - (13)].measure)), NU ((yyvsp[(4) - (13)].measure)), NU ((yyvsp[(5) - (13)].measure)), NU ((yyvsp[(6) - (13)].measure)), NU ((yyvsp[(7) - (13)].measure)),
2487 NU ((yyvsp[(8) - (13)].measure)), (yyvsp[(11) - (13)].string), (yyvsp[(12) - (13)].flagtype), (yyvsp[(9) - (13)].integer), (yyvsp[(10) - (13)].integer));
2488 free ((yyvsp[(11) - (13)].string));
2489 }
2490 break;
2491
2492 case 66:
2493
2494 /* Line 1455 of yacc.c */
2495 #line 862 "parse_y.y"
2496 {
2497 CreateNewVia(yyData, NU ((yyvsp[(3) - (11)].measure)), NU ((yyvsp[(4) - (11)].measure)), NU ((yyvsp[(5) - (11)].measure)), NU ((yyvsp[(6) - (11)].measure)), NU ((yyvsp[(7) - (11)].measure)),
2498 NU ((yyvsp[(8) - (11)].measure)), (yyvsp[(9) - (11)].string), (yyvsp[(10) - (11)].flagtype));
2499 free ((yyvsp[(9) - (11)].string));
2500 }
2501 break;
2502
2503 case 67:
2504
2505 /* Line 1455 of yacc.c */
2506 #line 872 "parse_y.y"
2507 {
2508 CreateNewVia(yyData, OU ((yyvsp[(3) - (11)].measure)), OU ((yyvsp[(4) - (11)].measure)), OU ((yyvsp[(5) - (11)].measure)), OU ((yyvsp[(6) - (11)].measure)), OU ((yyvsp[(7) - (11)].measure)), OU ((yyvsp[(8) - (11)].measure)), (yyvsp[(9) - (11)].string),
2509 OldFlags((yyvsp[(10) - (11)].integer)));
2510 free ((yyvsp[(9) - (11)].string));
2511 }
2512 break;
2513
2514 case 68:
2515
2516 /* Line 1455 of yacc.c */
2517 #line 883 "parse_y.y"
2518 {
2519 CreateNewVia(yyData, OU ((yyvsp[(3) - (10)].measure)), OU ((yyvsp[(4) - (10)].measure)), OU ((yyvsp[(5) - (10)].measure)), OU ((yyvsp[(6) - (10)].measure)),
2520 OU ((yyvsp[(5) - (10)].measure)) + OU((yyvsp[(6) - (10)].measure)), OU ((yyvsp[(7) - (10)].measure)), (yyvsp[(8) - (10)].string), OldFlags((yyvsp[(9) - (10)].integer)));
2521 free ((yyvsp[(8) - (10)].string));
2522 }
2523 break;
2524
2525 case 69:
2526
2527 /* Line 1455 of yacc.c */
2528 #line 893 "parse_y.y"
2529 {
2530 CreateNewVia(yyData, OU ((yyvsp[(3) - (9)].measure)), OU ((yyvsp[(4) - (9)].measure)), OU ((yyvsp[(5) - (9)].measure)), 2*GROUNDPLANEFRAME,
2531 OU((yyvsp[(5) - (9)].measure)) + 2*MASKFRAME, OU ((yyvsp[(6) - (9)].measure)), (yyvsp[(7) - (9)].string), OldFlags((yyvsp[(8) - (9)].integer)));
2532 free ((yyvsp[(7) - (9)].string));
2533 }
2534 break;
2535
2536 case 70:
2537
2538 /* Line 1455 of yacc.c */
2539 #line 903 "parse_y.y"
2540 {
2541 Coord hole = (OU((yyvsp[(5) - (8)].measure)) * DEFAULT_DRILLINGHOLE);
2542
2543 CreateNewVia(yyData, OU ((yyvsp[(3) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)), OU ((yyvsp[(5) - (8)].measure)), 2*GROUNDPLANEFRAME,
2544 OU((yyvsp[(5) - (8)].measure)) + 2*MASKFRAME, hole, (yyvsp[(6) - (8)].string), OldFlags((yyvsp[(7) - (8)].integer)));
2545 free ((yyvsp[(6) - (8)].string));
2546 }
2547 break;
2548
2549 case 71:
2550
2551 /* Line 1455 of yacc.c */
2552 #line 943 "parse_y.y"
2553 {
2554 CreateNewRat(yyData, NU ((yyvsp[(3) - (10)].measure)), NU ((yyvsp[(4) - (10)].measure)), NU ((yyvsp[(6) - (10)].measure)), NU ((yyvsp[(7) - (10)].measure)), (yyvsp[(5) - (10)].integer), (yyvsp[(8) - (10)].integer),
2555 Settings.RatThickness, (yyvsp[(9) - (10)].flagtype));
2556 }
2557 break;
2558
2559 case 72:
2560
2561 /* Line 1455 of yacc.c */
2562 #line 948 "parse_y.y"
2563 {
2564 CreateNewRat(yyData, OU ((yyvsp[(3) - (10)].measure)), OU ((yyvsp[(4) - (10)].measure)), OU ((yyvsp[(6) - (10)].measure)), OU ((yyvsp[(7) - (10)].measure)), (yyvsp[(5) - (10)].integer), (yyvsp[(8) - (10)].integer),
2565 Settings.RatThickness, OldFlags((yyvsp[(9) - (10)].integer)));
2566 }
2567 break;
2568
2569 case 73:
2570
2571 /* Line 1455 of yacc.c */
2572 #line 991 "parse_y.y"
2573 {
2574 if ((yyvsp[(3) - (7)].integer) <= 0 || (yyvsp[(3) - (7)].integer) > MAX_ALL_LAYER)
2575 {
2576 yyerror("Layernumber out of range");
2577 YYABORT;
2578 }
2579 if (LayerFlag[(yyvsp[(3) - (7)].integer)-1])
2580 {
2581 yyerror("Layernumber used twice");
2582 YYABORT;
2583 }
2584 Layer = &yyData->Layer[(yyvsp[(3) - (7)].integer)-1];
2585
2586 /* memory for name is already allocated */
2587 Layer->Name = (yyvsp[(4) - (7)].string);
2588 if (Layer->Name == NULL)
2589 Layer->Name = strdup("");
2590 LayerFlag[(yyvsp[(3) - (7)].integer)-1] = true;
2591 if ((yyvsp[(5) - (7)].string))
2592 Layer->Type = string_to_layertype ((yyvsp[(5) - (7)].string), yyerror);
2593 else
2594 Layer->Type = guess_layertype ((yyvsp[(4) - (7)].string), (yyvsp[(3) - (7)].integer), yyData);
2595 if ((yyvsp[(5) - (7)].string) != NULL)
2596 free ((yyvsp[(5) - (7)].string));
2597 }
2598 break;
2599
2600 case 85:
2601
2602 /* Line 1455 of yacc.c */
2603 #line 1038 "parse_y.y"
2604 {
2605 CreateNewPolygonFromRectangle(Layer,
2606 OU ((yyvsp[(3) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)), OU ((yyvsp[(3) - (8)].measure)) + OU ((yyvsp[(5) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)) + OU ((yyvsp[(6) - (8)].measure)), OldFlags((yyvsp[(7) - (8)].integer)));
2607 }
2608 break;
2609
2610 case 89:
2611
2612 /* Line 1455 of yacc.c */
2613 #line 1045 "parse_y.y"
2614 { attr_list = & Layer->Attributes; }
2615 break;
2616
2617 case 92:
2618
2619 /* Line 1455 of yacc.c */
2620 #line 1086 "parse_y.y"
2621 {
2622 CreateNewLineOnLayer(Layer, NU ((yyvsp[(3) - (10)].measure)), NU ((yyvsp[(4) - (10)].measure)), NU ((yyvsp[(5) - (10)].measure)), NU ((yyvsp[(6) - (10)].measure)),
2623 NU ((yyvsp[(7) - (10)].measure)), NU ((yyvsp[(8) - (10)].measure)), (yyvsp[(9) - (10)].flagtype));
2624 }
2625 break;
2626
2627 case 93:
2628
2629 /* Line 1455 of yacc.c */
2630 #line 1095 "parse_y.y"
2631 {
2632 CreateNewLineOnLayer(Layer, OU ((yyvsp[(3) - (10)].measure)), OU ((yyvsp[(4) - (10)].measure)), OU ((yyvsp[(5) - (10)].measure)), OU ((yyvsp[(6) - (10)].measure)),
2633 OU ((yyvsp[(7) - (10)].measure)), OU ((yyvsp[(8) - (10)].measure)), OldFlags((yyvsp[(9) - (10)].integer)));
2634 }
2635 break;
2636
2637 case 94:
2638
2639 /* Line 1455 of yacc.c */
2640 #line 1104 "parse_y.y"
2641 {
2642 /* eliminate old-style rat-lines */
2643 if ((IV ((yyvsp[(8) - (9)].measure)) & RATFLAG) == 0)
2644 CreateNewLineOnLayer(Layer, OU ((yyvsp[(3) - (9)].measure)), OU ((yyvsp[(4) - (9)].measure)), OU ((yyvsp[(5) - (9)].measure)), OU ((yyvsp[(6) - (9)].measure)), OU ((yyvsp[(7) - (9)].measure)),
2645 200*GROUNDPLANEFRAME, OldFlags(IV ((yyvsp[(8) - (9)].measure))));
2646 }
2647 break;
2648
2649 case 95:
2650
2651 /* Line 1455 of yacc.c */
2652 #line 1161 "parse_y.y"
2653 {
2654 CreateNewArcOnLayer(Layer, NU ((yyvsp[(3) - (12)].measure)), NU ((yyvsp[(4) - (12)].measure)), NU ((yyvsp[(5) - (12)].measure)), NU ((yyvsp[(6) - (12)].measure)), (yyvsp[(9) - (12)].number), (yyvsp[(10) - (12)].number),
2655 NU ((yyvsp[(7) - (12)].measure)), NU ((yyvsp[(8) - (12)].measure)), (yyvsp[(11) - (12)].flagtype));
2656 }
2657 break;
2658
2659 case 96:
2660
2661 /* Line 1455 of yacc.c */
2662 #line 1170 "parse_y.y"
2663 {
2664 CreateNewArcOnLayer(Layer, OU ((yyvsp[(3) - (12)].measure)), OU ((yyvsp[(4) - (12)].measure)), OU ((yyvsp[(5) - (12)].measure)), OU ((yyvsp[(6) - (12)].measure)), (yyvsp[(9) - (12)].number), (yyvsp[(10) - (12)].number),
2665 OU ((yyvsp[(7) - (12)].measure)), OU ((yyvsp[(8) - (12)].measure)), OldFlags((yyvsp[(11) - (12)].integer)));
2666 }
2667 break;
2668
2669 case 97:
2670
2671 /* Line 1455 of yacc.c */
2672 #line 1179 "parse_y.y"
2673 {
2674 CreateNewArcOnLayer(Layer, OU ((yyvsp[(3) - (11)].measure)), OU ((yyvsp[(4) - (11)].measure)), OU ((yyvsp[(5) - (11)].measure)), OU ((yyvsp[(5) - (11)].measure)), IV ((yyvsp[(8) - (11)].measure)), (yyvsp[(9) - (11)].number),
2675 OU ((yyvsp[(7) - (11)].measure)), 200*GROUNDPLANEFRAME, OldFlags((yyvsp[(10) - (11)].integer)));
2676 }
2677 break;
2678
2679 case 98:
2680
2681 /* Line 1455 of yacc.c */
2682 #line 1225 "parse_y.y"
2683 {
2684 /* use a default scale of 100% */
2685 CreateNewText(Layer,yyFont,OU ((yyvsp[(3) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)), (yyvsp[(5) - (8)].number), 100, (yyvsp[(6) - (8)].string), OldFlags((yyvsp[(7) - (8)].integer)));
2686 free ((yyvsp[(6) - (8)].string));
2687 }
2688 break;
2689
2690 case 99:
2691
2692 /* Line 1455 of yacc.c */
2693 #line 1235 "parse_y.y"
2694 {
2695 if ((yyvsp[(8) - (9)].integer) & ONSILKFLAG)
2696 {
2697 LayerType *lay = &yyData->Layer[yyData->LayerN +
2698 (((yyvsp[(8) - (9)].integer) & ONSOLDERFLAG) ? BOTTOM_SILK_LAYER : TOP_SILK_LAYER)];
2699
2700 CreateNewText(lay ,yyFont, OU ((yyvsp[(3) - (9)].measure)), OU ((yyvsp[(4) - (9)].measure)), (yyvsp[(5) - (9)].number), (yyvsp[(6) - (9)].number), (yyvsp[(7) - (9)].string),
2701 OldFlags((yyvsp[(8) - (9)].integer)));
2702 }
2703 else
2704 CreateNewText(Layer, yyFont, OU ((yyvsp[(3) - (9)].measure)), OU ((yyvsp[(4) - (9)].measure)), (yyvsp[(5) - (9)].number), (yyvsp[(6) - (9)].number), (yyvsp[(7) - (9)].string),
2705 OldFlags((yyvsp[(8) - (9)].integer)));
2706 free ((yyvsp[(7) - (9)].string));
2707 }
2708 break;
2709
2710 case 100:
2711
2712 /* Line 1455 of yacc.c */
2713 #line 1253 "parse_y.y"
2714 {
2715 /* FIXME: shouldn't know about .f */
2716 /* I don't think this matters because anything with hi_format
2717 * will have the silk on its own layer in the file rather
2718 * than using the ONSILKFLAG and having it in a copper layer.
2719 * Thus there is no need for anything besides the 'else'
2720 * part of this code.
2721 */
2722 if ((yyvsp[(8) - (9)].flagtype).f & ONSILKFLAG)
2723 {
2724 LayerType *lay = &yyData->Layer[yyData->LayerN +
2725 (((yyvsp[(8) - (9)].flagtype).f & ONSOLDERFLAG) ? BOTTOM_SILK_LAYER : TOP_SILK_LAYER)];
2726
2727 CreateNewText(lay, yyFont, NU ((yyvsp[(3) - (9)].measure)), NU ((yyvsp[(4) - (9)].measure)), (yyvsp[(5) - (9)].number), (yyvsp[(6) - (9)].number), (yyvsp[(7) - (9)].string), (yyvsp[(8) - (9)].flagtype));
2728 }
2729 else
2730 CreateNewText(Layer, yyFont, NU ((yyvsp[(3) - (9)].measure)), NU ((yyvsp[(4) - (9)].measure)), (yyvsp[(5) - (9)].number), (yyvsp[(6) - (9)].number), (yyvsp[(7) - (9)].string), (yyvsp[(8) - (9)].flagtype));
2731 free ((yyvsp[(7) - (9)].string));
2732 }
2733 break;
2734
2735 case 101:
2736
2737 /* Line 1455 of yacc.c */
2738 #line 1316 "parse_y.y"
2739 {
2740 Polygon = CreateNewPolygon(Layer, (yyvsp[(3) - (5)].flagtype));
2741 }
2742 break;
2743
2744 case 102:
2745
2746 /* Line 1455 of yacc.c */
2747 #line 1321 "parse_y.y"
2748 {
2749 Cardinal contour, contour_start, contour_end;
2750 bool bad_contour_found = false;
2751 /* ignore junk */
2752 for (contour = 0; contour <= Polygon->HoleIndexN; contour++)
2753 {
2754 contour_start = (contour == 0) ?
2755 0 : Polygon->HoleIndex[contour - 1];
2756 contour_end = (contour == Polygon->HoleIndexN) ?
2757 Polygon->PointN :
2758 Polygon->HoleIndex[contour];
2759 if (contour_end - contour_start < 3)
2760 bad_contour_found = true;
2761 }
2762
2763 if (bad_contour_found)
2764 {
2765 Message(_("WARNING parsing file '%s'\n"
2766 " line: %i\n"
2767 " description: 'ignored polygon "
2768 "(< 3 points in a contour)'\n"),
2769 yyfilename, yylineno);
2770 DestroyObject(yyData, POLYGON_TYPE, Layer, Polygon, Polygon);
2771 }
2772 else
2773 {
2774 SetPolygonBoundingBox (Polygon);
2775 if (!Layer->polygon_tree)
2776 Layer->polygon_tree = r_create_tree (NULL, 0, 0);
2777 r_insert_entry (Layer->polygon_tree, (BoxType *) Polygon, 0);
2778 }
2779 }
2780 break;
2781
2782 case 105:
2783
2784 /* Line 1455 of yacc.c */
2785 #line 1362 "parse_y.y"
2786 {
2787 CreateNewHoleInPolygon (Polygon);
2788 }
2789 break;
2790
2791 case 109:
2792
2793 /* Line 1455 of yacc.c */
2794 #line 1376 "parse_y.y"
2795 {
2796 CreateNewPointInPolygon(Polygon, OU ((yyvsp[(2) - (4)].measure)), OU ((yyvsp[(3) - (4)].measure)));
2797 }
2798 break;
2799
2800 case 110:
2801
2802 /* Line 1455 of yacc.c */
2803 #line 1380 "parse_y.y"
2804 {
2805 CreateNewPointInPolygon(Polygon, NU ((yyvsp[(2) - (4)].measure)), NU ((yyvsp[(3) - (4)].measure)));
2806 }
2807 break;
2808
2809 case 116:
2810
2811 /* Line 1455 of yacc.c */
2812 #line 1462 "parse_y.y"
2813 {
2814 yyElement = CreateNewElement(yyData, yyFont, NoFlags(),
2815 (yyvsp[(3) - (9)].string), (yyvsp[(4) - (9)].string), NULL, OU ((yyvsp[(5) - (9)].measure)), OU ((yyvsp[(6) - (9)].measure)), (yyvsp[(7) - (9)].integer), 100, NoFlags(), false);
2816 free ((yyvsp[(3) - (9)].string));
2817 free ((yyvsp[(4) - (9)].string));
2818 pin_num = 1;
2819 }
2820 break;
2821
2822 case 117:
2823
2824 /* Line 1455 of yacc.c */
2825 #line 1470 "parse_y.y"
2826 {
2827 SetElementBoundingBox(yyData, yyElement, yyFont);
2828 }
2829 break;
2830
2831 case 118:
2832
2833 /* Line 1455 of yacc.c */
2834 #line 1480 "parse_y.y"
2835 {
2836 yyElement = CreateNewElement(yyData, yyFont, OldFlags((yyvsp[(3) - (12)].integer)),
2837 (yyvsp[(4) - (12)].string), (yyvsp[(5) - (12)].string), NULL, OU ((yyvsp[(6) - (12)].measure)), OU ((yyvsp[(7) - (12)].measure)), IV ((yyvsp[(8) - (12)].measure)), IV ((yyvsp[(9) - (12)].measure)), OldFlags((yyvsp[(10) - (12)].integer)), false);
2838 free ((yyvsp[(4) - (12)].string));
2839 free ((yyvsp[(5) - (12)].string));
2840 pin_num = 1;
2841 }
2842 break;
2843
2844 case 119:
2845
2846 /* Line 1455 of yacc.c */
2847 #line 1488 "parse_y.y"
2848 {
2849 SetElementBoundingBox(yyData, yyElement, yyFont);
2850 }
2851 break;
2852
2853 case 120:
2854
2855 /* Line 1455 of yacc.c */
2856 #line 1498 "parse_y.y"
2857 {
2858 yyElement = CreateNewElement(yyData, yyFont, OldFlags((yyvsp[(3) - (13)].integer)),
2859 (yyvsp[(4) - (13)].string), (yyvsp[(5) - (13)].string), (yyvsp[(6) - (13)].string), OU ((yyvsp[(7) - (13)].measure)), OU ((yyvsp[(8) - (13)].measure)), IV ((yyvsp[(9) - (13)].measure)), IV ((yyvsp[(10) - (13)].measure)), OldFlags((yyvsp[(11) - (13)].integer)), false);
2860 free ((yyvsp[(4) - (13)].string));
2861 free ((yyvsp[(5) - (13)].string));
2862 free ((yyvsp[(6) - (13)].string));
2863 pin_num = 1;
2864 }
2865 break;
2866
2867 case 121:
2868
2869 /* Line 1455 of yacc.c */
2870 #line 1507 "parse_y.y"
2871 {
2872 SetElementBoundingBox(yyData, yyElement, yyFont);
2873 }
2874 break;
2875
2876 case 122:
2877
2878 /* Line 1455 of yacc.c */
2879 #line 1518 "parse_y.y"
2880 {
2881 yyElement = CreateNewElement(yyData, yyFont, OldFlags((yyvsp[(3) - (15)].integer)),
2882 (yyvsp[(4) - (15)].string), (yyvsp[(5) - (15)].string), (yyvsp[(6) - (15)].string), OU ((yyvsp[(7) - (15)].measure)) + OU ((yyvsp[(9) - (15)].measure)), OU ((yyvsp[(8) - (15)].measure)) + OU ((yyvsp[(10) - (15)].measure)),
2883 (yyvsp[(11) - (15)].number), (yyvsp[(12) - (15)].number), OldFlags((yyvsp[(13) - (15)].integer)), false);
2884 yyElement->MarkX = OU ((yyvsp[(7) - (15)].measure));
2885 yyElement->MarkY = OU ((yyvsp[(8) - (15)].measure));
2886 free ((yyvsp[(4) - (15)].string));
2887 free ((yyvsp[(5) - (15)].string));
2888 free ((yyvsp[(6) - (15)].string));
2889 }
2890 break;
2891
2892 case 123:
2893
2894 /* Line 1455 of yacc.c */
2895 #line 1529 "parse_y.y"
2896 {
2897 SetElementBoundingBox(yyData, yyElement, yyFont);
2898 }
2899 break;
2900
2901 case 124:
2902
2903 /* Line 1455 of yacc.c */
2904 #line 1540 "parse_y.y"
2905 {
2906 yyElement = CreateNewElement(yyData, yyFont, (yyvsp[(3) - (15)].flagtype),
2907 (yyvsp[(4) - (15)].string), (yyvsp[(5) - (15)].string), (yyvsp[(6) - (15)].string), NU ((yyvsp[(7) - (15)].measure)) + NU ((yyvsp[(9) - (15)].measure)), NU ((yyvsp[(8) - (15)].measure)) + NU ((yyvsp[(10) - (15)].measure)),
2908 (yyvsp[(11) - (15)].number), (yyvsp[(12) - (15)].number), (yyvsp[(13) - (15)].flagtype), false);
2909 yyElement->MarkX = NU ((yyvsp[(7) - (15)].measure));
2910 yyElement->MarkY = NU ((yyvsp[(8) - (15)].measure));
2911 free ((yyvsp[(4) - (15)].string));
2912 free ((yyvsp[(5) - (15)].string));
2913 free ((yyvsp[(6) - (15)].string));
2914 }
2915 break;
2916
2917 case 125:
2918
2919 /* Line 1455 of yacc.c */
2920 #line 1551 "parse_y.y"
2921 {
2922 SetElementBoundingBox(yyData, yyElement, yyFont);
2923 }
2924 break;
2925
2926 case 133:
2927
2928 /* Line 1455 of yacc.c */
2929 #line 1652 "parse_y.y"
2930 {
2931 CreateNewLineInElement(yyElement, NU ((yyvsp[(3) - (8)].measure)), NU ((yyvsp[(4) - (8)].measure)), NU ((yyvsp[(5) - (8)].measure)), NU ((yyvsp[(6) - (8)].measure)), NU ((yyvsp[(7) - (8)].measure)));
2932 }
2933 break;
2934
2935 case 134:
2936
2937 /* Line 1455 of yacc.c */
2938 #line 1657 "parse_y.y"
2939 {
2940 CreateNewLineInElement(yyElement, OU ((yyvsp[(3) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)), OU ((yyvsp[(5) - (8)].measure)), OU ((yyvsp[(6) - (8)].measure)), OU ((yyvsp[(7) - (8)].measure)));
2941 }
2942 break;
2943
2944 case 135:
2945
2946 /* Line 1455 of yacc.c */
2947 #line 1662 "parse_y.y"
2948 {
2949 CreateNewArcInElement(yyElement, NU ((yyvsp[(3) - (10)].measure)), NU ((yyvsp[(4) - (10)].measure)), NU ((yyvsp[(5) - (10)].measure)), NU ((yyvsp[(6) - (10)].measure)), (yyvsp[(7) - (10)].number), (yyvsp[(8) - (10)].number), NU ((yyvsp[(9) - (10)].measure)));
2950 }
2951 break;
2952
2953 case 136:
2954
2955 /* Line 1455 of yacc.c */
2956 #line 1667 "parse_y.y"
2957 {
2958 CreateNewArcInElement(yyElement, OU ((yyvsp[(3) - (10)].measure)), OU ((yyvsp[(4) - (10)].measure)), OU ((yyvsp[(5) - (10)].measure)), OU ((yyvsp[(6) - (10)].measure)), (yyvsp[(7) - (10)].number), (yyvsp[(8) - (10)].number), OU ((yyvsp[(9) - (10)].measure)));
2959 }
2960 break;
2961
2962 case 137:
2963
2964 /* Line 1455 of yacc.c */
2965 #line 1672 "parse_y.y"
2966 {
2967 yyElement->MarkX = NU ((yyvsp[(3) - (5)].measure));
2968 yyElement->MarkY = NU ((yyvsp[(4) - (5)].measure));
2969 }
2970 break;
2971
2972 case 138:
2973
2974 /* Line 1455 of yacc.c */
2975 #line 1677 "parse_y.y"
2976 {
2977 yyElement->MarkX = OU ((yyvsp[(3) - (5)].measure));
2978 yyElement->MarkY = OU ((yyvsp[(4) - (5)].measure));
2979 }
2980 break;
2981
2982 case 139:
2983
2984 /* Line 1455 of yacc.c */
2985 #line 1681 "parse_y.y"
2986 { attr_list = & yyElement->Attributes; }
2987 break;
2988
2989 case 147:
2990
2991 /* Line 1455 of yacc.c */
2992 #line 1696 "parse_y.y"
2993 {
2994 CreateNewLineInElement(yyElement, NU ((yyvsp[(3) - (8)].measure)) + yyElement->MarkX,
2995 NU ((yyvsp[(4) - (8)].measure)) + yyElement->MarkY, NU ((yyvsp[(5) - (8)].measure)) + yyElement->MarkX,
2996 NU ((yyvsp[(6) - (8)].measure)) + yyElement->MarkY, NU ((yyvsp[(7) - (8)].measure)));
2997 }
2998 break;
2999
3000 case 148:
3001
3002 /* Line 1455 of yacc.c */
3003 #line 1702 "parse_y.y"
3004 {
3005 CreateNewLineInElement(yyElement, OU ((yyvsp[(3) - (8)].measure)) + yyElement->MarkX,
3006 OU ((yyvsp[(4) - (8)].measure)) + yyElement->MarkY, OU ((yyvsp[(5) - (8)].measure)) + yyElement->MarkX,
3007 OU ((yyvsp[(6) - (8)].measure)) + yyElement->MarkY, OU ((yyvsp[(7) - (8)].measure)));
3008 }
3009 break;
3010
3011 case 149:
3012
3013 /* Line 1455 of yacc.c */
3014 #line 1709 "parse_y.y"
3015 {
3016 CreateNewArcInElement(yyElement, NU ((yyvsp[(3) - (10)].measure)) + yyElement->MarkX,
3017 NU ((yyvsp[(4) - (10)].measure)) + yyElement->MarkY, NU ((yyvsp[(5) - (10)].measure)), NU ((yyvsp[(6) - (10)].measure)), (yyvsp[(7) - (10)].number), (yyvsp[(8) - (10)].number), NU ((yyvsp[(9) - (10)].measure)));
3018 }
3019 break;
3020
3021 case 150:
3022
3023 /* Line 1455 of yacc.c */
3024 #line 1714 "parse_y.y"
3025 {
3026 CreateNewArcInElement(yyElement, OU ((yyvsp[(3) - (10)].measure)) + yyElement->MarkX,
3027 OU ((yyvsp[(4) - (10)].measure)) + yyElement->MarkY, OU ((yyvsp[(5) - (10)].measure)), OU ((yyvsp[(6) - (10)].measure)), (yyvsp[(7) - (10)].number), (yyvsp[(8) - (10)].number), OU ((yyvsp[(9) - (10)].measure)));
3028 }
3029 break;
3030
3031 case 151:
3032
3033 /* Line 1455 of yacc.c */
3034 #line 1718 "parse_y.y"
3035 { attr_list = & yyElement->Attributes; }
3036 break;
3037
3038 case 153:
3039
3040 /* Line 1455 of yacc.c */
3041 #line 1769 "parse_y.y"
3042 {
3043 CreateNewPin(yyElement, NU ((yyvsp[(3) - (12)].measure)) + yyElement->MarkX,
3044 NU ((yyvsp[(4) - (12)].measure)) + yyElement->MarkY, NU ((yyvsp[(5) - (12)].measure)), NU ((yyvsp[(6) - (12)].measure)), NU ((yyvsp[(7) - (12)].measure)), NU ((yyvsp[(8) - (12)].measure)), (yyvsp[(9) - (12)].string),
3045 (yyvsp[(10) - (12)].string), (yyvsp[(11) - (12)].flagtype));
3046 free ((yyvsp[(9) - (12)].string));
3047 free ((yyvsp[(10) - (12)].string));
3048 }
3049 break;
3050
3051 case 154:
3052
3053 /* Line 1455 of yacc.c */
3054 #line 1781 "parse_y.y"
3055 {
3056 CreateNewPin(yyElement, OU ((yyvsp[(3) - (12)].measure)) + yyElement->MarkX,
3057 OU ((yyvsp[(4) - (12)].measure)) + yyElement->MarkY, OU ((yyvsp[(5) - (12)].measure)), OU ((yyvsp[(6) - (12)].measure)), OU ((yyvsp[(7) - (12)].measure)), OU ((yyvsp[(8) - (12)].measure)), (yyvsp[(9) - (12)].string),
3058 (yyvsp[(10) - (12)].string), OldFlags((yyvsp[(11) - (12)].integer)));
3059 free ((yyvsp[(9) - (12)].string));
3060 free ((yyvsp[(10) - (12)].string));
3061 }
3062 break;
3063
3064 case 155:
3065
3066 /* Line 1455 of yacc.c */
3067 #line 1793 "parse_y.y"
3068 {
3069 CreateNewPin(yyElement, OU ((yyvsp[(3) - (10)].measure)), OU ((yyvsp[(4) - (10)].measure)), OU ((yyvsp[(5) - (10)].measure)), 2*GROUNDPLANEFRAME,
3070 OU ((yyvsp[(5) - (10)].measure)) + 2*MASKFRAME, OU ((yyvsp[(6) - (10)].measure)), (yyvsp[(7) - (10)].string), (yyvsp[(8) - (10)].string), OldFlags((yyvsp[(9) - (10)].integer)));
3071 free ((yyvsp[(7) - (10)].string));
3072 free ((yyvsp[(8) - (10)].string));
3073 }
3074 break;
3075
3076 case 156:
3077
3078 /* Line 1455 of yacc.c */
3079 #line 1804 "parse_y.y"
3080 {
3081 char p_number[8];
3082
3083 sprintf(p_number, "%d", pin_num++);
3084 CreateNewPin(yyElement, OU ((yyvsp[(3) - (9)].measure)), OU ((yyvsp[(4) - (9)].measure)), OU ((yyvsp[(5) - (9)].measure)), 2*GROUNDPLANEFRAME,
3085 OU ((yyvsp[(5) - (9)].measure)) + 2*MASKFRAME, OU ((yyvsp[(6) - (9)].measure)), (yyvsp[(7) - (9)].string), p_number, OldFlags((yyvsp[(8) - (9)].integer)));
3086
3087 free ((yyvsp[(7) - (9)].string));
3088 }
3089 break;
3090
3091 case 157:
3092
3093 /* Line 1455 of yacc.c */
3094 #line 1820 "parse_y.y"
3095 {
3096 Coord hole = OU ((yyvsp[(5) - (8)].measure)) * DEFAULT_DRILLINGHOLE;
3097 char p_number[8];
3098
3099 sprintf(p_number, "%d", pin_num++);
3100 CreateNewPin(yyElement, OU ((yyvsp[(3) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)), OU ((yyvsp[(5) - (8)].measure)), 2*GROUNDPLANEFRAME,
3101 OU ((yyvsp[(5) - (8)].measure)) + 2*MASKFRAME, hole, (yyvsp[(6) - (8)].string), p_number, OldFlags((yyvsp[(7) - (8)].integer)));
3102 free ((yyvsp[(6) - (8)].string));
3103 }
3104 break;
3105
3106 case 158:
3107
3108 /* Line 1455 of yacc.c */
3109 #line 1878 "parse_y.y"
3110 {
3111 CreateNewPad(yyElement, NU ((yyvsp[(3) - (13)].measure)) + yyElement->MarkX,
3112 NU ((yyvsp[(4) - (13)].measure)) + yyElement->MarkY,
3113 NU ((yyvsp[(5) - (13)].measure)) + yyElement->MarkX,
3114 NU ((yyvsp[(6) - (13)].measure)) + yyElement->MarkY, NU ((yyvsp[(7) - (13)].measure)), NU ((yyvsp[(8) - (13)].measure)), NU ((yyvsp[(9) - (13)].measure)),
3115 (yyvsp[(10) - (13)].string), (yyvsp[(11) - (13)].string), (yyvsp[(12) - (13)].flagtype));
3116 free ((yyvsp[(10) - (13)].string));
3117 free ((yyvsp[(11) - (13)].string));
3118 }
3119 break;
3120
3121 case 159:
3122
3123 /* Line 1455 of yacc.c */
3124 #line 1892 "parse_y.y"
3125 {
3126 CreateNewPad(yyElement,OU ((yyvsp[(3) - (13)].measure)) + yyElement->MarkX,
3127 OU ((yyvsp[(4) - (13)].measure)) + yyElement->MarkY, OU ((yyvsp[(5) - (13)].measure)) + yyElement->MarkX,
3128 OU ((yyvsp[(6) - (13)].measure)) + yyElement->MarkY, OU ((yyvsp[(7) - (13)].measure)), OU ((yyvsp[(8) - (13)].measure)), OU ((yyvsp[(9) - (13)].measure)),
3129 (yyvsp[(10) - (13)].string), (yyvsp[(11) - (13)].string), OldFlags((yyvsp[(12) - (13)].integer)));
3130 free ((yyvsp[(10) - (13)].string));
3131 free ((yyvsp[(11) - (13)].string));
3132 }
3133 break;
3134
3135 case 160:
3136
3137 /* Line 1455 of yacc.c */
3138 #line 1905 "parse_y.y"
3139 {
3140 CreateNewPad(yyElement,OU ((yyvsp[(3) - (11)].measure)),OU ((yyvsp[(4) - (11)].measure)),OU ((yyvsp[(5) - (11)].measure)),OU ((yyvsp[(6) - (11)].measure)),OU ((yyvsp[(7) - (11)].measure)), 2*GROUNDPLANEFRAME,
3141 OU ((yyvsp[(7) - (11)].measure)) + 2*MASKFRAME, (yyvsp[(8) - (11)].string), (yyvsp[(9) - (11)].string), OldFlags((yyvsp[(10) - (11)].integer)));
3142 free ((yyvsp[(8) - (11)].string));
3143 free ((yyvsp[(9) - (11)].string));
3144 }
3145 break;
3146
3147 case 161:
3148
3149 /* Line 1455 of yacc.c */
3150 #line 1916 "parse_y.y"
3151 {
3152 char p_number[8];
3153
3154 sprintf(p_number, "%d", pin_num++);
3155 CreateNewPad(yyElement,OU ((yyvsp[(3) - (10)].measure)),OU ((yyvsp[(4) - (10)].measure)),OU ((yyvsp[(5) - (10)].measure)),OU ((yyvsp[(6) - (10)].measure)),OU ((yyvsp[(7) - (10)].measure)), 2*GROUNDPLANEFRAME,
3156 OU ((yyvsp[(7) - (10)].measure)) + 2*MASKFRAME, (yyvsp[(8) - (10)].string),p_number, OldFlags((yyvsp[(9) - (10)].integer)));
3157 free ((yyvsp[(8) - (10)].string));
3158 }
3159 break;
3160
3161 case 162:
3162
3163 /* Line 1455 of yacc.c */
3164 #line 1926 "parse_y.y"
3165 { (yyval.flagtype) = OldFlags((yyvsp[(1) - (1)].integer)); }
3166 break;
3167
3168 case 163:
3169
3170 /* Line 1455 of yacc.c */
3171 #line 1927 "parse_y.y"
3172 { (yyval.flagtype) = string_to_flags ((yyvsp[(1) - (1)].string), yyerror); free((yyvsp[(1) - (1)].string)); }
3173 break;
3174
3175 case 167:
3176
3177 /* Line 1455 of yacc.c */
3178 #line 1968 "parse_y.y"
3179 {
3180 if ((yyvsp[(3) - (6)].integer) <= 0 || (yyvsp[(3) - (6)].integer) > MAX_FONTPOSITION)
3181 {
3182 yyerror("fontposition out of range");
3183 YYABORT;
3184 }
3185 Symbol = &yyFont->Symbol[(yyvsp[(3) - (6)].integer)];
3186 if (Symbol->Valid)
3187 {
3188 yyerror("symbol ID used twice");
3189 YYABORT;
3190 }
3191 Symbol->Valid = true;
3192 Symbol->Delta = NU ((yyvsp[(4) - (6)].measure));
3193 }
3194 break;
3195
3196 case 168:
3197
3198 /* Line 1455 of yacc.c */
3199 #line 1984 "parse_y.y"
3200 {
3201 if ((yyvsp[(3) - (6)].integer) <= 0 || (yyvsp[(3) - (6)].integer) > MAX_FONTPOSITION)
3202 {
3203 yyerror("fontposition out of range");
3204 YYABORT;
3205 }
3206 Symbol = &yyFont->Symbol[(yyvsp[(3) - (6)].integer)];
3207 if (Symbol->Valid)
3208 {
3209 yyerror("symbol ID used twice");
3210 YYABORT;
3211 }
3212 Symbol->Valid = true;
3213 Symbol->Delta = OU ((yyvsp[(4) - (6)].measure));
3214 }
3215 break;
3216
3217 case 174:
3218
3219 /* Line 1455 of yacc.c */
3220 #line 2040 "parse_y.y"
3221 {
3222 CreateNewLineInSymbol(Symbol, OU ((yyvsp[(3) - (8)].measure)), OU ((yyvsp[(4) - (8)].measure)), OU ((yyvsp[(5) - (8)].measure)), OU ((yyvsp[(6) - (8)].measure)), OU ((yyvsp[(7) - (8)].measure)));
3223 }
3224 break;
3225
3226 case 175:
3227
3228 /* Line 1455 of yacc.c */
3229 #line 2047 "parse_y.y"
3230 {
3231 CreateNewLineInSymbol(Symbol, NU ((yyvsp[(3) - (8)].measure)), NU ((yyvsp[(4) - (8)].measure)), NU ((yyvsp[(5) - (8)].measure)), NU ((yyvsp[(6) - (8)].measure)), NU ((yyvsp[(7) - (8)].measure)));
3232 }
3233 break;
3234
3235 case 183:
3236
3237 /* Line 1455 of yacc.c */
3238 #line 2101 "parse_y.y"
3239 {
3240 Menu = CreateNewNet(&yyPCB->NetlistLib, (yyvsp[(3) - (6)].string), (yyvsp[(4) - (6)].string));
3241 free ((yyvsp[(3) - (6)].string));
3242 free ((yyvsp[(4) - (6)].string));
3243 }
3244 break;
3245
3246 case 189:
3247
3248 /* Line 1455 of yacc.c */
3249 #line 2136 "parse_y.y"
3250 {
3251 CreateNewConnection(Menu, (yyvsp[(3) - (4)].string));
3252 free ((yyvsp[(3) - (4)].string));
3253 }
3254 break;
3255
3256 case 190:
3257
3258 /* Line 1455 of yacc.c */
3259 #line 2195 "parse_y.y"
3260 {
3261 CreateNewAttribute (attr_list, (yyvsp[(3) - (5)].string), (yyvsp[(4) - (5)].string) ? (yyvsp[(4) - (5)].string) : (char *)"");
3262 free ((yyvsp[(3) - (5)].string));
3263 free ((yyvsp[(4) - (5)].string));
3264 }
3265 break;
3266
3267 case 191:
3268
3269 /* Line 1455 of yacc.c */
3270 #line 2202 "parse_y.y"
3271 { (yyval.string) = (yyvsp[(1) - (1)].string); }
3272 break;
3273
3274 case 192:
3275
3276 /* Line 1455 of yacc.c */
3277 #line 2203 "parse_y.y"
3278 { (yyval.string) = 0; }
3279 break;
3280
3281 case 193:
3282
3283 /* Line 1455 of yacc.c */
3284 #line 2207 "parse_y.y"
3285 { (yyval.number) = (yyvsp[(1) - (1)].number); }
3286 break;
3287
3288 case 194:
3289
3290 /* Line 1455 of yacc.c */
3291 #line 2208 "parse_y.y"
3292 { (yyval.number) = (yyvsp[(1) - (1)].integer); }
3293 break;
3294
3295 case 195:
3296
3297 /* Line 1455 of yacc.c */
3298 #line 2213 "parse_y.y"
3299 { do_measure(&(yyval.measure), (yyvsp[(1) - (1)].number), MIL_TO_COORD ((yyvsp[(1) - (1)].number)) / 100.0, 0); }
3300 break;
3301
3302 case 196:
3303
3304 /* Line 1455 of yacc.c */
3305 #line 2214 "parse_y.y"
3306 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MIL_TO_COORD ((yyvsp[(1) - (2)].number)) / 1000000.0); }
3307 break;
3308
3309 case 197:
3310
3311 /* Line 1455 of yacc.c */
3312 #line 2215 "parse_y.y"
3313 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MIL_TO_COORD ((yyvsp[(1) - (2)].number)) / 100.0); }
3314 break;
3315
3316 case 198:
3317
3318 /* Line 1455 of yacc.c */
3319 #line 2216 "parse_y.y"
3320 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MIL_TO_COORD ((yyvsp[(1) - (2)].number))); }
3321 break;
3322
3323 case 199:
3324
3325 /* Line 1455 of yacc.c */
3326 #line 2217 "parse_y.y"
3327 { M ((yyval.measure), (yyvsp[(1) - (2)].number), INCH_TO_COORD ((yyvsp[(1) - (2)].number))); }
3328 break;
3329
3330 case 200:
3331
3332 /* Line 1455 of yacc.c */
3333 #line 2218 "parse_y.y"
3334 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MM_TO_COORD ((yyvsp[(1) - (2)].number)) / 1000000.0); }
3335 break;
3336
3337 case 201:
3338
3339 /* Line 1455 of yacc.c */
3340 #line 2219 "parse_y.y"
3341 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MM_TO_COORD ((yyvsp[(1) - (2)].number)) / 1000000.0); }
3342 break;
3343
3344 case 202:
3345
3346 /* Line 1455 of yacc.c */
3347 #line 2220 "parse_y.y"
3348 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MM_TO_COORD ((yyvsp[(1) - (2)].number)) / 1000.0); }
3349 break;
3350
3351 case 203:
3352
3353 /* Line 1455 of yacc.c */
3354 #line 2221 "parse_y.y"
3355 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MM_TO_COORD ((yyvsp[(1) - (2)].number))); }
3356 break;
3357
3358 case 204:
3359
3360 /* Line 1455 of yacc.c */
3361 #line 2222 "parse_y.y"
3362 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MM_TO_COORD ((yyvsp[(1) - (2)].number)) * 1000.0); }
3363 break;
3364
3365 case 205:
3366
3367 /* Line 1455 of yacc.c */
3368 #line 2223 "parse_y.y"
3369 { M ((yyval.measure), (yyvsp[(1) - (2)].number), MM_TO_COORD ((yyvsp[(1) - (2)].number)) * 1000000.0); }
3370 break;
3371
3372
3373
3374 /* Line 1455 of yacc.c */
3375 #line 3376 "parse_y.c"
3376 default: break;
3377 }
3378 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3379
3380 YYPOPSTACK (yylen);
3381 yylen = 0;
3382 YY_STACK_PRINT (yyss, yyssp);
3383
3384 *++yyvsp = yyval;
3385
3386 /* Now `shift' the result of the reduction. Determine what state
3387 that goes to, based on the state we popped back to and the rule
3388 number reduced by. */
3389
3390 yyn = yyr1[yyn];
3391
3392 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3393 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3394 yystate = yytable[yystate];
3395 else
3396 yystate = yydefgoto[yyn - YYNTOKENS];
3397
3398 goto yynewstate;
3399
3400
3401 /*------------------------------------.
3402 | yyerrlab -- here on detecting error |
3403 `------------------------------------*/
3404 yyerrlab:
3405 /* If not already recovering from an error, report this error. */
3406 if (!yyerrstatus)
3407 {
3408 ++yynerrs;
3409 #if ! YYERROR_VERBOSE
3410 yyerror (YY_("syntax error"));
3411 #else
3412 {
3413 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
3414 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
3415 {
3416 YYSIZE_T yyalloc = 2 * yysize;
3417 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
3418 yyalloc = YYSTACK_ALLOC_MAXIMUM;
3419 if (yymsg != yymsgbuf)
3420 YYSTACK_FREE (yymsg);
3421 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
3422 if (yymsg)
3423 yymsg_alloc = yyalloc;
3424 else
3425 {
3426 yymsg = yymsgbuf;
3427 yymsg_alloc = sizeof yymsgbuf;
3428 }
3429 }
3430
3431 if (0 < yysize && yysize <= yymsg_alloc)
3432 {
3433 (void) yysyntax_error (yymsg, yystate, yychar);
3434 yyerror (yymsg);
3435 }
3436 else
3437 {
3438 yyerror (YY_("syntax error"));
3439 if (yysize != 0)
3440 goto yyexhaustedlab;
3441 }
3442 }
3443 #endif
3444 }
3445
3446
3447
3448 if (yyerrstatus == 3)
3449 {
3450 /* If just tried and failed to reuse lookahead token after an
3451 error, discard it. */
3452
3453 if (yychar <= YYEOF)
3454 {
3455 /* Return failure if at end of input. */
3456 if (yychar == YYEOF)
3457 YYABORT;
3458 }
3459 else
3460 {
3461 yydestruct ("Error: discarding",
3462 yytoken, &yylval);
3463 yychar = YYEMPTY;
3464 }
3465 }
3466
3467 /* Else will try to reuse lookahead token after shifting the error
3468 token. */
3469 goto yyerrlab1;
3470
3471
3472 /*---------------------------------------------------.
3473 | yyerrorlab -- error raised explicitly by YYERROR. |
3474 `---------------------------------------------------*/
3475 yyerrorlab:
3476
3477 /* Pacify compilers like GCC when the user code never invokes
3478 YYERROR and the label yyerrorlab therefore never appears in user
3479 code. */
3480 if (/*CONSTCOND*/ 0)
3481 goto yyerrorlab;
3482
3483 /* Do not reclaim the symbols of the rule which action triggered
3484 this YYERROR. */
3485 YYPOPSTACK (yylen);
3486 yylen = 0;
3487 YY_STACK_PRINT (yyss, yyssp);
3488 yystate = *yyssp;
3489 goto yyerrlab1;
3490
3491
3492 /*-------------------------------------------------------------.
3493 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3494 `-------------------------------------------------------------*/
3495 yyerrlab1:
3496 yyerrstatus = 3; /* Each real token shifted decrements this. */
3497
3498 for (;;)
3499 {
3500 yyn = yypact[yystate];
3501 if (yyn != YYPACT_NINF)
3502 {
3503 yyn += YYTERROR;
3504 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3505 {
3506 yyn = yytable[yyn];
3507 if (0 < yyn)
3508 break;
3509 }
3510 }
3511
3512 /* Pop the current state because it cannot handle the error token. */
3513 if (yyssp == yyss)
3514 YYABORT;
3515
3516
3517 yydestruct ("Error: popping",
3518 yystos[yystate], yyvsp);
3519 YYPOPSTACK (1);
3520 yystate = *yyssp;
3521 YY_STACK_PRINT (yyss, yyssp);
3522 }
3523
3524 *++yyvsp = yylval;
3525
3526
3527 /* Shift the error token. */
3528 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3529
3530 yystate = yyn;
3531 goto yynewstate;
3532
3533
3534 /*-------------------------------------.
3535 | yyacceptlab -- YYACCEPT comes here. |
3536 `-------------------------------------*/
3537 yyacceptlab:
3538 yyresult = 0;
3539 goto yyreturn;
3540
3541 /*-----------------------------------.
3542 | yyabortlab -- YYABORT comes here. |
3543 `-----------------------------------*/
3544 yyabortlab:
3545 yyresult = 1;
3546 goto yyreturn;
3547
3548 #if !defined(yyoverflow) || YYERROR_VERBOSE
3549 /*-------------------------------------------------.
3550 | yyexhaustedlab -- memory exhaustion comes here. |
3551 `-------------------------------------------------*/
3552 yyexhaustedlab:
3553 yyerror (YY_("memory exhausted"));
3554 yyresult = 2;
3555 /* Fall through. */
3556 #endif
3557
3558 yyreturn:
3559 if (yychar != YYEMPTY)
3560 yydestruct ("Cleanup: discarding lookahead",
3561 yytoken, &yylval);
3562 /* Do not reclaim the symbols of the rule which action triggered
3563 this YYABORT or YYACCEPT. */
3564 YYPOPSTACK (yylen);
3565 YY_STACK_PRINT (yyss, yyssp);
3566 while (yyssp != yyss)
3567 {
3568 yydestruct ("Cleanup: popping",
3569 yystos[*yyssp], yyvsp);
3570 YYPOPSTACK (1);
3571 }
3572 #ifndef yyoverflow
3573 if (yyss != yyssa)
3574 YYSTACK_FREE (yyss);
3575 #endif
3576 #if YYERROR_VERBOSE
3577 if (yymsg != yymsgbuf)
3578 YYSTACK_FREE (yymsg);
3579 #endif
3580 /* Make sure YYID is used. */
3581 return YYID (yyresult);
3582 }
3583
3584
3585
3586 /* Line 1675 of yacc.c */
3587 #line 2226 "parse_y.y"
3588
3589
3590 /* ---------------------------------------------------------------------------
3591 * error routine called by parser library
3592 */
yyerror(const char * s)3593 int yyerror(const char * s)
3594 {
3595 Message(_("ERROR parsing file '%s'\n"
3596 " line: %i\n"
3597 " description: '%s'\n"),
3598 yyfilename, yylineno, s);
3599 return(0);
3600 }
3601
yywrap()3602 int yywrap()
3603 {
3604 return 1;
3605 }
3606
3607 static int
check_file_version(int ver)3608 check_file_version (int ver)
3609 {
3610 if ( ver > PCB_FILE_VERSION ) {
3611 Message (_("ERROR: The file you are attempting to load is in a format\n"
3612 "which is too new for this version of pcb. To load this file\n"
3613 "you need a version of pcb which is >= %d. If you are\n"
3614 "using a version built from git source, the source date\n"
3615 "must be >= %d. This copy of pcb can only read files\n"
3616 "up to file version %d.\n"), ver, ver, PCB_FILE_VERSION);
3617 return 1;
3618 }
3619
3620 return 0;
3621 }
3622
3623 static void
do_measure(PLMeasure * m,Coord i,double d,int u)3624 do_measure (PLMeasure *m, Coord i, double d, int u)
3625 {
3626 m->ival = i;
3627 m->bval = round (d);
3628 m->dval = d;
3629 m->has_units = u;
3630 }
3631
3632 static int
integer_value(PLMeasure m)3633 integer_value (PLMeasure m)
3634 {
3635 if (m.has_units)
3636 yyerror("units ignored here");
3637 return m.ival;
3638 }
3639
3640 static Coord
old_units(PLMeasure m)3641 old_units (PLMeasure m)
3642 {
3643 if (m.has_units)
3644 return m.bval;
3645 return round (MIL_TO_COORD (m.ival));
3646 }
3647
3648 static Coord
new_units(PLMeasure m)3649 new_units (PLMeasure m)
3650 {
3651 if (m.has_units)
3652 return m.bval;
3653 return round (MIL_TO_COORD (m.ival) / 100.0);
3654 }
3655
3656