1 /* A Bison parser, made by GNU Bison 2.1. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYBISON_VERSION "2.1"
43 #define YYSKELETON_NAME "yacc.c"
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
56 /* Put the tokens into the symbol table, so that GDB and other debuggers
107 #define BRACKET_ID 260
108 #define DBL_BRACKET_ID 261
117 #define EMPTY_ANGLE 270
125 #define TRANSLATE 278
129 #define PERSPECTIVE 282
139 #define PICTUREBOX 292
152 /* Copy the first part of user declarations. */
162 #define alloca _alloca
164 #define YYSTACK_USE_ALLOCA 1
165 // turn of warning about unused goto label in bison skeleton
166 #pragma warning(disable:4102)
176 void yyerror (char *s
) /* Called by yyparse on error */
178 extern SRC_LINE line
;
182 static SYMBOL_TABLE
*sym_tab
;
186 // exported parse tree and global environment
187 static OBJECT
*objects
;
191 /* Enabling traces. */
196 /* Enabling verbose error messages. */
197 #ifdef YYERROR_VERBOSE
198 # undef YYERROR_VERBOSE
199 # define YYERROR_VERBOSE 1
201 # define YYERROR_VERBOSE 0
204 /* Enabling the token table. */
205 #ifndef YYTOKEN_TABLE
206 # define YYTOKEN_TABLE 0
209 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
211 typedef union YYSTYPE
{
224 /* Line 196 of yacc.c. */
226 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
227 # define YYSTYPE_IS_DECLARED 1
228 # define YYSTYPE_IS_TRIVIAL 1
233 /* Copy the second part of user declarations. */
236 /* Line 219 of yacc.c. */
239 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
240 # define YYSIZE_T __SIZE_TYPE__
242 #if ! defined (YYSIZE_T) && defined (size_t)
243 # define YYSIZE_T size_t
245 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
246 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
247 # define YYSIZE_T size_t
249 #if ! defined (YYSIZE_T)
250 # define YYSIZE_T unsigned int
256 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
257 # define YY_(msgid) dgettext ("bison-runtime", msgid)
261 # define YY_(msgid) msgid
265 #if ! defined (yyoverflow) || YYERROR_VERBOSE
267 /* The parser invokes alloca or malloc; define the necessary symbols. */
269 # ifdef YYSTACK_USE_ALLOCA
270 # if YYSTACK_USE_ALLOCA
272 # define YYSTACK_ALLOC __builtin_alloca
274 # define YYSTACK_ALLOC alloca
275 # if defined (__STDC__) || defined (__cplusplus)
276 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
277 # define YYINCLUDED_STDLIB_H
283 # ifdef YYSTACK_ALLOC
284 /* Pacify GCC's `empty if-body' warning. */
285 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
286 # ifndef YYSTACK_ALLOC_MAXIMUM
287 /* The OS might guarantee only one guard page at the bottom of the stack,
288 and a page size can be as small as 4096 bytes. So we cannot safely
289 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
290 to allow for a few compiler-allocated temporary stack slots. */
291 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
294 # define YYSTACK_ALLOC YYMALLOC
295 # define YYSTACK_FREE YYFREE
296 # ifndef YYSTACK_ALLOC_MAXIMUM
297 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
303 # define YYMALLOC malloc
304 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
305 && (defined (__STDC__) || defined (__cplusplus)))
306 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
311 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
312 && (defined (__STDC__) || defined (__cplusplus)))
313 void free (void *); /* INFRINGES ON USER NAME SPACE */
320 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
323 #if (! defined (yyoverflow) \
324 && (! defined (__cplusplus) \
325 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
327 /* A type that is properly aligned for any stack member. */
334 /* The size of the maximum gap between one aligned stack and the next. */
335 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
337 /* The size of an array large to enough to hold all stacks, each with
339 # define YYSTACK_BYTES(N) \
340 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
341 + YYSTACK_GAP_MAXIMUM)
343 /* Copy COUNT objects from FROM to TO. The source and destination do
346 # if defined (__GNUC__) && 1 < __GNUC__
347 # define YYCOPY(To, From, Count) \
348 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
350 # define YYCOPY(To, From, Count) \
354 for (yyi = 0; yyi < (Count); yyi++) \
355 (To)[yyi] = (From)[yyi]; \
361 /* Relocate STACK from its old location to the new one. The
362 local variables YYSIZE and YYSTACKSIZE give the old and new number of
363 elements in the stack, and YYPTR gives the new location of the
364 stack. Advance YYPTR to a properly aligned location for the next
366 # define YYSTACK_RELOCATE(Stack) \
369 YYSIZE_T yynewbytes; \
370 YYCOPY (&yyptr->Stack, Stack, yysize); \
371 Stack = &yyptr->Stack; \
372 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
373 yyptr += yynewbytes / sizeof (*yyptr); \
379 #if defined (__STDC__) || defined (__cplusplus)
380 typedef signed char yysigned_char
;
382 typedef short int yysigned_char
;
385 /* YYFINAL -- State number of the termination state. */
387 /* YYLAST -- Last index in YYTABLE. */
390 /* YYNTOKENS -- Number of terminals. */
392 /* YYNNTS -- Number of nonterminals. */
394 /* YYNRULES -- Number of rules. */
396 /* YYNRULES -- Number of states. */
397 #define YYNSTATES 254
399 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
401 #define YYMAXUTOK 300
403 #define YYTRANSLATE(YYX) \
404 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
406 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
407 static const unsigned char yytranslate
[] =
409 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 58, 59, 47, 46, 56, 45, 49, 48, 2, 2,
414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 54, 2, 55, 51, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 52, 57, 53, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
435 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
436 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
437 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
438 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
443 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
445 static const unsigned short int yyprhs
[] =
447 0, 0, 3, 6, 11, 12, 15, 17, 20, 25,
448 30, 33, 35, 38, 41, 43, 46, 48, 50, 53,
449 54, 56, 58, 62, 63, 65, 68, 70, 72, 74,
450 78, 82, 86, 91, 95, 97, 99, 101, 105, 109,
451 113, 117, 127, 137, 145, 151, 155, 158, 160, 161,
452 162, 168, 170, 171, 175, 177, 179, 181, 185, 186,
453 188, 191, 193, 195, 199, 201, 203, 205, 207, 209,
454 213, 217, 221, 225, 229, 233, 237, 240, 244, 248,
455 252, 256, 260, 264, 270, 273, 275, 277, 279, 287,
456 293, 295, 297, 305, 311, 313, 315, 354, 358, 364,
457 372, 376, 380, 383, 387, 391, 399, 405, 409, 413,
461 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
462 static const yysigned_char yyrhs
[] =
464 61, 0, -1, 70, 62, -1, 35, 52, 63, 53,
465 -1, -1, 63, 64, -1, 64, -1, 36, 10, -1,
466 37, 54, 88, 55, -1, 37, 69, 89, 89, -1,
467 39, 94, -1, 38, -1, 38, 10, -1, 40, 65,
468 -1, 73, -1, 66, 67, -1, 41, -1, 42, -1,
469 56, 68, -1, -1, 43, -1, 44, -1, 54, 88,
470 55, -1, -1, 71, -1, 71, 72, -1, 72, -1,
471 73, -1, 76, -1, 14, 3, 75, -1, 74, 15,
472 75, -1, 14, 3, 15, -1, 14, 3, 8, 75,
473 -1, 74, 8, 75, -1, 86, -1, 76, -1, 10,
474 -1, 16, 81, 82, -1, 17, 81, 82, -1, 18,
475 81, 82, -1, 19, 81, 82, -1, 21, 81, 52,
476 88, 79, 56, 84, 53, 89, -1, 21, 81, 52,
477 88, 79, 56, 84, 53, 76, -1, 20, 52, 88,
478 56, 84, 53, 76, -1, 22, 52, 94, 53, 76,
479 -1, 11, 81, 82, -1, 11, 81, -1, 7, -1,
480 -1, -1, 52, 77, 70, 78, 53, -1, 15, -1,
481 -1, 80, 56, 3, -1, 3, -1, 10, -1, 5,
482 -1, 54, 80, 55, -1, -1, 83, -1, 83, 89,
483 -1, 89, -1, 85, -1, 85, 56, 94, -1, 94,
484 -1, 87, -1, 89, -1, 91, -1, 93, -1, 86,
485 46, 86, -1, 86, 45, 86, -1, 86, 47, 86,
486 -1, 86, 48, 86, -1, 86, 49, 86, -1, 86,
487 13, 86, -1, 57, 86, 57, -1, 45, 86, -1,
488 86, 51, 86, -1, 58, 86, 59, -1, 33, 86,
489 59, -1, 29, 86, 59, -1, 30, 86, 59, -1,
490 31, 86, 59, -1, 32, 86, 56, 86, 59, -1,
491 86, 12, -1, 9, -1, 3, -1, 86, -1, 58,
492 88, 56, 88, 56, 88, 59, -1, 58, 88, 56,
493 88, 59, -1, 4, -1, 86, -1, 54, 88, 56,
494 88, 56, 88, 55, -1, 54, 88, 56, 88, 55,
495 -1, 5, -1, 86, -1, 54, 54, 88, 56, 88,
496 56, 88, 56, 88, 55, 54, 88, 56, 88, 56,
497 88, 56, 88, 55, 54, 88, 56, 88, 56, 88,
498 56, 88, 55, 54, 88, 56, 88, 56, 88, 56,
499 88, 55, 55, -1, 24, 88, 59, -1, 24, 88,
500 56, 86, 59, -1, 24, 88, 56, 90, 56, 92,
501 59, -1, 23, 92, 59, -1, 25, 86, 59, -1,
502 26, 59, -1, 26, 88, 59, -1, 27, 88, 59,
503 -1, 28, 90, 56, 86, 56, 92, 59, -1, 28,
504 90, 56, 86, 59, -1, 28, 90, 59, -1, 34,
505 94, 59, -1, 6, -1, 86, -1
508 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
509 static const unsigned short int yyrline
[] =
511 0, 105, 105, 108, 109, 112, 113, 116, 120, 124,
512 129, 133, 137, 141, 145, 148, 151, 152, 155, 156,
513 159, 160, 163, 164, 167, 170, 171, 174, 175, 179,
514 180, 181, 184, 185, 188, 189, 190, 193, 194, 195,
515 196, 197, 201, 205, 209, 210, 211, 212, 213, 214,
516 213, 223, 224, 227, 231, 238, 239, 240, 241, 244,
517 247, 248, 251, 254, 255, 258, 259, 260, 261, 262,
518 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
519 273, 274, 275, 276, 277, 280, 281, 284, 287, 291,
520 295, 298, 301, 305, 309, 311, 314, 326, 330, 340,
521 344, 348, 365, 366, 367, 368, 378, 388, 393, 394,
526 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
527 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
528 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
529 static const char *const yytname
[] =
531 "$end", "error", "$undefined", "ID", "PAREN_ID", "BRACKET_ID",
532 "DBL_BRACKET_ID", "CURLY_ID", "ANGLE_ID", "NUM", "OPTS_STR", "SPECIAL",
533 "TICK", "THEN", "DEF", "EMPTY_ANGLE", "DOTS", "LINE", "CURVE", "POLYGON",
534 "REPEAT", "SWEEP", "PUT", "TRANSLATE", "ROTATE", "SCALE", "PROJECT",
535 "PERSPECTIVE", "VIEW", "SQRT", "SIN", "COS", "ATAN2", "UNIT", "INVERSE",
536 "GLOBAL", "SET", "PICTUREBOX", "FRAME", "CAMERA", "LANGUAGE", "PSTRICKS",
537 "TIKZ", "LaTeX", "ConTeXt", "'-'", "'+'", "'*'", "'/'", "'.'", "NEG",
538 "'^'", "'{'", "'}'", "'['", "']'", "','", "'|'", "'('", "')'", "$accept",
539 "input", "global_decl_block", "global_decls", "global_decl",
540 "output_language", "graphics_language", "comma_macro_package",
541 "macro_package", "opt_baseline", "defs_and_decls", "rev_defs_and_decls",
542 "def_or_decl", "def", "tagged_defs", "defable", "decl", "@1", "@2",
543 "opt_star", "option_id_list", "options", "points", "rev_points",
544 "transforms", "rev_transforms", "expr", "scalar", "scalar_expr", "point",
545 "point_expr", "vector", "vector_expr", "transform", "transform_expr", 0
550 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
552 static const unsigned short int yytoknum
[] =
554 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
555 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
556 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
557 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
558 295, 296, 297, 298, 299, 45, 43, 42, 47, 46,
559 300, 94, 123, 125, 91, 93, 44, 124, 40, 41
563 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
564 static const unsigned char yyr1
[] =
566 0, 60, 61, 62, 62, 63, 63, 64, 64, 64,
567 64, 64, 64, 64, 64, 65, 66, 66, 67, 67,
568 68, 68, 69, 69, 70, 71, 71, 72, 72, 73,
569 73, 73, 74, 74, 75, 75, 75, 76, 76, 76,
570 76, 76, 76, 76, 76, 76, 76, 76, 77, 78,
571 76, 79, 79, 80, 80, 81, 81, 81, 81, 82,
572 83, 83, 84, 85, 85, 86, 86, 86, 86, 86,
573 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
574 86, 86, 86, 86, 86, 87, 87, 88, 89, 89,
575 89, 90, 91, 91, 91, 92, 93, 93, 93, 93,
576 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
580 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
581 static const unsigned char yyr2
[] =
583 0, 2, 2, 4, 0, 2, 1, 2, 4, 4,
584 2, 1, 2, 2, 1, 2, 1, 1, 2, 0,
585 1, 1, 3, 0, 1, 2, 1, 1, 1, 3,
586 3, 3, 4, 3, 1, 1, 1, 3, 3, 3,
587 3, 9, 9, 7, 5, 3, 2, 1, 0, 0,
588 5, 1, 0, 3, 1, 1, 1, 3, 0, 1,
589 2, 1, 1, 3, 1, 1, 1, 1, 1, 3,
590 3, 3, 3, 3, 3, 3, 2, 3, 3, 3,
591 3, 3, 3, 5, 2, 1, 1, 1, 7, 5,
592 1, 1, 7, 5, 1, 1, 38, 3, 5, 7,
593 3, 3, 2, 3, 3, 7, 5, 3, 3, 1,
597 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
598 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
599 means the default is an error. */
600 static const unsigned char yydefact
[] =
602 0, 47, 58, 0, 58, 58, 58, 58, 0, 58,
603 0, 48, 0, 4, 24, 26, 27, 0, 28, 56,
604 55, 0, 46, 0, 0, 0, 0, 0, 0, 0,
605 0, 0, 1, 0, 2, 25, 0, 0, 54, 0,
606 90, 0, 45, 59, 61, 86, 94, 109, 0, 85,
607 36, 31, 0, 0, 0, 0, 0, 0, 0, 0,
608 0, 0, 0, 0, 0, 0, 0, 0, 29, 35,
609 34, 65, 66, 67, 68, 37, 38, 39, 40, 87,
610 0, 0, 110, 0, 49, 0, 33, 30, 57, 0,
611 0, 60, 32, 95, 0, 0, 0, 102, 0, 0,
612 91, 0, 0, 0, 0, 0, 0, 0, 76, 0,
613 0, 0, 87, 84, 0, 0, 0, 0, 0, 0,
614 0, 0, 52, 0, 0, 0, 23, 11, 0, 0,
615 0, 6, 14, 53, 0, 100, 0, 97, 101, 103,
616 104, 0, 107, 80, 81, 82, 0, 79, 108, 0,
617 0, 75, 78, 74, 70, 69, 71, 72, 73, 77,
618 0, 62, 64, 51, 0, 44, 50, 7, 0, 0,
619 12, 10, 16, 17, 13, 19, 3, 5, 0, 91,
620 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
621 0, 15, 0, 89, 98, 0, 0, 106, 83, 0,
622 93, 0, 43, 63, 0, 8, 9, 20, 21, 18,
623 0, 0, 0, 0, 0, 0, 88, 99, 105, 0,
624 92, 42, 41, 0, 0, 0, 0, 0, 0, 0,
625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
626 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
630 /* YYDEFGOTO[NTERM-NUM]. */
631 static const short int yydefgoto
[] =
633 -1, 12, 34, 130, 131, 174, 175, 191, 209, 169,
634 13, 14, 15, 16, 17, 68, 69, 31, 124, 164,
635 39, 22, 42, 43, 160, 161, 79, 71, 90, 72,
639 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
641 #define YYPACT_NINF -94
642 static const short int yypact
[] =
644 520, -94, 3, 21, 3, 3, 3, 3, -35, 3,
645 -26, -94, 35, 11, 520, -94, -94, 6, -94, -94,
646 -94, 49, 15, 255, 15, 15, 15, 15, 84, -14,
647 84, 520, -94, 30, -94, -94, 323, 323, -94, -5,
648 -94, 84, -94, 15, -94, -94, -94, -94, 323, -94,
649 -94, -94, 84, 84, 84, 38, 84, 84, 84, 84,
650 84, 84, 84, 84, 84, 379, 84, 84, -94, -94,
651 346, -94, -94, -94, -94, -94, -94, -94, -94, 346,
652 48, 84, 346, 5, -94, 210, -94, -94, -94, 83,
653 63, -94, -94, 346, 32, -41, 111, -94, 61, 62,
654 346, -20, 133, 406, 426, 533, 433, 67, -2, 379,
655 72, 516, 448, -94, 84, 84, 84, 84, 84, 84,
656 84, 84, 79, 536, 77, 121, 78, 151, 84, 14,
657 113, -94, -94, -94, 84, -94, 84, -94, -94, -94,
658 -94, 84, -94, -94, -94, -94, 84, -94, -94, 87,
659 84, -94, -94, 346, 142, 142, -2, -2, -2, -2,
660 112, 115, -94, -94, 116, -94, -94, -94, 84, 15,
661 -94, -94, -94, -94, -94, 118, -94, -94, -11, 457,
662 119, 88, 474, 84, 4, 536, 84, 84, 114, 15,
663 36, -94, 84, -94, -94, 84, 84, -94, -94, 29,
664 -94, 84, -94, -94, 123, 16, -94, -94, -94, -94,
665 108, 124, 127, 84, 122, 410, -94, -94, -94, 43,
666 -94, -94, -94, 84, 141, 134, 84, 143, 84, 147,
667 84, 149, 84, 155, 152, 84, 156, 84, 163, 84,
668 165, 84, 168, 171, 84, 172, 84, 173, 84, 175,
672 /* YYPGOTO[NTERM-NUM]. */
673 static const short int yypgoto
[] =
675 -94, -94, -94, -94, 97, -94, -94, -94, -94, -94,
676 166, -94, 219, -76, -94, -25, 2, -94, -94, -94,
677 -94, 25, 51, -94, 64, -94, 178, -94, -28, -21,
678 117, -94, -93, -94, -23
681 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
682 positive, shift that token. If negative, reduce the rule which
683 number is the opposite. If zero, do what YYDEFACT says.
684 If YYTABLE_NINF, syntax error. */
685 #define YYTABLE_NINF -23
686 static const short int yytable
[] =
688 80, 44, 18, 44, 44, 44, 44, 83, 19, 132,
689 113, 86, 87, 20, 36, 136, 18, 28, 137, 40,
690 -22, 37, 91, 92, 23, 95, 30, 98, 99, 24,
691 25, 26, 27, 18, 29, 32, 141, 110, 81, 142,
692 107, 45, 40, 46, 47, 192, 33, 49, 193, 120,
693 88, 89, 38, 122, 132, 172, 173, 21, 123, 200,
694 201, 52, 53, 54, 55, 56, 57, 58, 59, 60,
695 61, 62, 63, 41, -22, 75, 76, 77, 78, 207,
696 208, 149, 85, 64, 200, 213, 133, 45, 40, 46,
697 47, 135, 65, 49, 163, 66, 67, 97, 220, 223,
698 113, 114, 211, 212, 121, 171, 178, 52, 53, 54,
699 55, 56, 57, 58, 59, 60, 61, 62, 63, 134,
700 139, 140, 184, 113, 114, 165, 148, 3, 150, 64,
701 166, 167, 168, 115, 116, 117, 118, 119, 65, 120,
702 188, 66, 67, 183, 196, 113, 114, 197, 189, 125,
703 126, 127, 128, 129, 113, 199, 115, 116, 117, 118,
704 119, 170, 120, 203, 210, 185, 176, 216, 206, 205,
705 138, 186, 187, 214, 190, 195, 215, 220, 115, 116,
706 117, 118, 119, 217, 120, 219, 218, 202, 226, 117,
707 118, 119, 143, 120, 222, 224, 225, 84, 227, 228,
708 229, 70, 231, 230, 233, 232, 235, 236, 82, 238,
709 234, 240, 237, 242, 70, 70, 245, 221, 247, 239,
710 249, 241, 251, 243, 3, 244, 70, 177, 246, 248,
711 93, 250, 96, 35, 252, 100, 102, 103, 104, 105,
712 106, 82, 108, 253, 111, 112, 125, 126, 127, 128,
713 129, 204, 0, 180, 0, 0, 0, 0, 45, 40,
714 46, 47, 1, 48, 49, 50, 2, 0, 0, 0,
715 51, 4, 5, 6, 7, 8, 9, 10, 52, 53,
716 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
717 0, 0, 153, 154, 155, 156, 157, 158, 159, 82,
718 64, 0, 0, 0, 0, 0, 82, 11, 0, 65,
719 0, 0, 66, 67, 179, 0, 0, 0, 0, 181,
720 0, 0, 0, 0, 182, 0, 45, 40, 46, 47,
721 1, 0, 49, 50, 2, 0, 0, 0, 0, 4,
722 5, 6, 7, 8, 9, 10, 52, 53, 54, 55,
723 56, 57, 58, 59, 60, 61, 62, 63, 113, 114,
724 0, 0, 0, 0, 82, 82, 0, 0, 64, 0,
725 0, 0, 0, 93, 93, 11, 0, 65, 0, 0,
726 66, 67, 45, 40, 46, 47, 0, 0, 49, 0,
727 0, 115, 116, 117, 118, 119, 0, 120, 0, 0,
728 0, 0, 52, 53, 54, 55, 56, 57, 58, 59,
729 60, 61, 62, 63, 40, 0, 0, 1, 113, 114,
730 0, 2, 0, 0, 64, 0, 4, 5, 6, 7,
731 8, 9, 10, 109, 0, 0, 66, 67, 113, 114,
732 0, 0, 0, 0, 0, 113, 114, 0, 0, 0,
733 0, 115, 116, 117, 118, 119, 0, 120, 0, 0,
734 113, 114, 11, 0, 0, 144, 0, 0, 41, 113,
735 114, 115, 116, 117, 118, 119, 0, 120, 115, 116,
736 117, 118, 119, 0, 120, 145, 113, 114, 0, 0,
737 0, 0, 147, 115, 116, 117, 118, 119, 0, 120,
738 0, 0, 115, 116, 117, 118, 119, 152, 120, 0,
739 0, 0, 0, 0, 0, 0, 194, 0, 0, 115,
740 116, 117, 118, 119, 0, 120, 0, 1, 113, 114,
741 0, 2, 0, 198, 3, 0, 4, 5, 6, 7,
742 8, 9, 10, 1, 0, 113, 114, 2, 0, 0,
743 0, 0, 4, 5, 6, 7, 8, 9, 10, 0,
744 0, 115, 116, 117, 118, 119, 0, 120, 0, 0,
745 0, 0, 11, 151, 0, 0, 0, 0, 115, 116,
746 117, 118, 119, 0, 120, 0, 0, 0, 11, 146
749 static const short int yycheck
[] =
751 28, 22, 0, 24, 25, 26, 27, 30, 5, 85,
752 12, 36, 37, 10, 8, 56, 14, 52, 59, 4,
753 4, 15, 43, 48, 3, 53, 52, 55, 56, 4,
754 5, 6, 7, 31, 9, 0, 56, 65, 52, 59,
755 63, 3, 4, 5, 6, 56, 35, 9, 59, 51,
756 55, 56, 3, 81, 130, 41, 42, 54, 53, 55,
757 56, 23, 24, 25, 26, 27, 28, 29, 30, 31,
758 32, 33, 34, 58, 58, 24, 25, 26, 27, 43,
759 44, 109, 52, 45, 55, 56, 3, 3, 4, 5,
760 6, 59, 54, 9, 15, 57, 58, 59, 55, 56,
761 12, 13, 195, 196, 56, 128, 134, 23, 24, 25,
762 26, 27, 28, 29, 30, 31, 32, 33, 34, 56,
763 59, 59, 150, 12, 13, 123, 59, 14, 56, 45,
764 53, 10, 54, 45, 46, 47, 48, 49, 54, 51,
765 168, 57, 58, 56, 56, 12, 13, 59, 169, 36,
766 37, 38, 39, 40, 12, 183, 45, 46, 47, 48,
767 49, 10, 51, 186, 192, 53, 53, 59, 189, 55,
768 59, 56, 56, 201, 56, 56, 53, 55, 45, 46,
769 47, 48, 49, 59, 51, 213, 59, 185, 54, 47,
770 48, 49, 59, 51, 215, 223, 55, 31, 226, 56,
771 228, 23, 230, 56, 232, 56, 54, 235, 30, 237,
772 55, 239, 56, 241, 36, 37, 244, 215, 246, 56,
773 248, 56, 250, 55, 14, 54, 48, 130, 56, 56,
774 52, 56, 54, 14, 55, 57, 58, 59, 60, 61,
775 62, 63, 64, 55, 66, 67, 36, 37, 38, 39,
776 40, 187, -1, 136, -1, -1, -1, -1, 3, 4,
777 5, 6, 7, 8, 9, 10, 11, -1, -1, -1,
778 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
779 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
780 -1, -1, 114, 115, 116, 117, 118, 119, 120, 121,
781 45, -1, -1, -1, -1, -1, 128, 52, -1, 54,
782 -1, -1, 57, 58, 136, -1, -1, -1, -1, 141,
783 -1, -1, -1, -1, 146, -1, 3, 4, 5, 6,
784 7, -1, 9, 10, 11, -1, -1, -1, -1, 16,
785 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
786 27, 28, 29, 30, 31, 32, 33, 34, 12, 13,
787 -1, -1, -1, -1, 186, 187, -1, -1, 45, -1,
788 -1, -1, -1, 195, 196, 52, -1, 54, -1, -1,
789 57, 58, 3, 4, 5, 6, -1, -1, 9, -1,
790 -1, 45, 46, 47, 48, 49, -1, 51, -1, -1,
791 -1, -1, 23, 24, 25, 26, 27, 28, 29, 30,
792 31, 32, 33, 34, 4, -1, -1, 7, 12, 13,
793 -1, 11, -1, -1, 45, -1, 16, 17, 18, 19,
794 20, 21, 22, 54, -1, -1, 57, 58, 12, 13,
795 -1, -1, -1, -1, -1, 12, 13, -1, -1, -1,
796 -1, 45, 46, 47, 48, 49, -1, 51, -1, -1,
797 12, 13, 52, -1, -1, 59, -1, -1, 58, 12,
798 13, 45, 46, 47, 48, 49, -1, 51, 45, 46,
799 47, 48, 49, -1, 51, 59, 12, 13, -1, -1,
800 -1, -1, 59, 45, 46, 47, 48, 49, -1, 51,
801 -1, -1, 45, 46, 47, 48, 49, 59, 51, -1,
802 -1, -1, -1, -1, -1, -1, 59, -1, -1, 45,
803 46, 47, 48, 49, -1, 51, -1, 7, 12, 13,
804 -1, 11, -1, 59, 14, -1, 16, 17, 18, 19,
805 20, 21, 22, 7, -1, 12, 13, 11, -1, -1,
806 -1, -1, 16, 17, 18, 19, 20, 21, 22, -1,
807 -1, 45, 46, 47, 48, 49, -1, 51, -1, -1,
808 -1, -1, 52, 57, -1, -1, -1, -1, 45, 46,
809 47, 48, 49, -1, 51, -1, -1, -1, 52, 56
812 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
813 symbol of state STATE-NUM. */
814 static const unsigned char yystos
[] =
816 0, 7, 11, 14, 16, 17, 18, 19, 20, 21,
817 22, 52, 61, 70, 71, 72, 73, 74, 76, 5,
818 10, 54, 81, 3, 81, 81, 81, 81, 52, 81,
819 52, 77, 0, 35, 62, 72, 8, 15, 3, 80,
820 4, 58, 82, 83, 89, 3, 5, 6, 8, 9,
821 10, 15, 23, 24, 25, 26, 27, 28, 29, 30,
822 31, 32, 33, 34, 45, 54, 57, 58, 75, 76,
823 86, 87, 89, 91, 93, 82, 82, 82, 82, 86,
824 88, 52, 86, 94, 70, 52, 75, 75, 55, 56,
825 88, 89, 75, 86, 92, 88, 86, 59, 88, 88,
826 86, 90, 86, 86, 86, 86, 86, 94, 86, 54,
827 88, 86, 86, 12, 13, 45, 46, 47, 48, 49,
828 51, 56, 88, 53, 78, 36, 37, 38, 39, 40,
829 63, 64, 73, 3, 56, 59, 56, 59, 59, 59,
830 59, 56, 59, 59, 59, 59, 56, 59, 59, 88,
831 56, 57, 59, 86, 86, 86, 86, 86, 86, 86,
832 84, 85, 94, 15, 79, 76, 53, 10, 54, 69,
833 10, 94, 41, 42, 65, 66, 53, 64, 88, 86,
834 90, 86, 86, 56, 88, 53, 56, 56, 88, 89,
835 56, 67, 56, 59, 59, 56, 56, 59, 59, 88,
836 55, 56, 76, 94, 84, 55, 89, 43, 44, 68,
837 88, 92, 92, 56, 88, 53, 59, 59, 59, 88,
838 55, 76, 89, 56, 88, 55, 54, 88, 56, 88,
839 56, 88, 56, 88, 55, 54, 88, 56, 88, 56,
840 88, 56, 88, 55, 54, 88, 56, 88, 56, 88,
844 #define yyerrok (yyerrstatus = 0)
845 #define yyclearin (yychar = YYEMPTY)
849 #define YYACCEPT goto yyacceptlab
850 #define YYABORT goto yyabortlab
851 #define YYERROR goto yyerrorlab
854 /* Like YYERROR except do call yyerror. This remains here temporarily
855 to ease the transition to the new meaning of YYERROR, for GCC.
856 Once GCC version 2 has supplanted version 1, this can go. */
858 #define YYFAIL goto yyerrlab
860 #define YYRECOVERING() (!!yyerrstatus)
862 #define YYBACKUP(Token, Value) \
864 if (yychar == YYEMPTY && yylen == 1) \
868 yytoken = YYTRANSLATE (yychar); \
874 yyerror (YY_("syntax error: cannot back up")); \
881 #define YYERRCODE 256
884 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
885 If N is 0, then set CURRENT to the empty location which ends
886 the previous symbol: RHS[0] (always defined). */
888 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
889 #ifndef YYLLOC_DEFAULT
890 # define YYLLOC_DEFAULT(Current, Rhs, N) \
894 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
895 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
896 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
897 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
901 (Current).first_line = (Current).last_line = \
902 YYRHSLOC (Rhs, 0).last_line; \
903 (Current).first_column = (Current).last_column = \
904 YYRHSLOC (Rhs, 0).last_column; \
910 /* YY_LOCATION_PRINT -- Print the location on the stream.
911 This macro was not mandated originally: define only if we know
912 we won't break user code: when these are the locations we know. */
914 #ifndef YY_LOCATION_PRINT
915 # if YYLTYPE_IS_TRIVIAL
916 # define YY_LOCATION_PRINT(File, Loc) \
917 fprintf (File, "%d.%d-%d.%d", \
918 (Loc).first_line, (Loc).first_column, \
919 (Loc).last_line, (Loc).last_column)
921 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
926 /* YYLEX -- calling `yylex' with the right arguments. */
929 # define YYLEX yylex (YYLEX_PARAM)
931 # define YYLEX yylex ()
934 /* Enable debugging if requested. */
938 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
939 # define YYFPRINTF fprintf
942 # define YYDPRINTF(Args) \
948 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
952 YYFPRINTF (stderr, "%s ", Title); \
953 yysymprint (stderr, \
955 YYFPRINTF (stderr, "\n"); \
959 /*------------------------------------------------------------------.
960 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
962 `------------------------------------------------------------------*/
964 #if defined (__STDC__) || defined (__cplusplus)
966 yy_stack_print (short int *bottom
, short int *top
)
969 yy_stack_print (bottom
, top
)
974 YYFPRINTF (stderr
, "Stack now");
975 for (/* Nothing. */; bottom
<= top
; ++bottom
)
976 YYFPRINTF (stderr
, " %d", *bottom
);
977 YYFPRINTF (stderr
, "\n");
980 # define YY_STACK_PRINT(Bottom, Top) \
983 yy_stack_print ((Bottom), (Top)); \
987 /*------------------------------------------------.
988 | Report that the YYRULE is going to be reduced. |
989 `------------------------------------------------*/
991 #if defined (__STDC__) || defined (__cplusplus)
993 yy_reduce_print (int yyrule
)
996 yy_reduce_print (yyrule
)
1001 unsigned long int yylno
= yyrline
[yyrule
];
1002 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu), ",
1004 /* Print the symbols being reduced, and their result. */
1005 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1006 YYFPRINTF (stderr
, "%s ", yytname
[yyrhs
[yyi
]]);
1007 YYFPRINTF (stderr
, "-> %s\n", yytname
[yyr1
[yyrule
]]);
1010 # define YY_REDUCE_PRINT(Rule) \
1013 yy_reduce_print (Rule); \
1016 /* Nonzero means print parse trace. It is left uninitialized so that
1017 multiple parsers can coexist. */
1019 #else /* !YYDEBUG */
1020 # define YYDPRINTF(Args)
1021 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1022 # define YY_STACK_PRINT(Bottom, Top)
1023 # define YY_REDUCE_PRINT(Rule)
1024 #endif /* !YYDEBUG */
1027 /* YYINITDEPTH -- initial size of the parser's stacks. */
1029 # define YYINITDEPTH 200
1032 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1033 if the built-in stack extension method is used).
1035 Do not make this value too large; the results are undefined if
1036 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1037 evaluated with infinite-precision integer arithmetic. */
1040 # define YYMAXDEPTH 10000
1048 # if defined (__GLIBC__) && defined (_STRING_H)
1049 # define yystrlen strlen
1051 /* Return the length of YYSTR. */
1053 # if defined (__STDC__) || defined (__cplusplus)
1054 yystrlen (const char *yystr
)
1060 const char *yys
= yystr
;
1062 while (*yys
++ != '\0')
1065 return yys
- yystr
- 1;
1071 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1072 # define yystpcpy stpcpy
1074 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1077 # if defined (__STDC__) || defined (__cplusplus)
1078 yystpcpy (char *yydest
, const char *yysrc
)
1080 yystpcpy (yydest
, yysrc
)
1086 const char *yys
= yysrc
;
1088 while ((*yyd
++ = *yys
++) != '\0')
1097 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1098 quotes and backslashes, so that it's suitable for yyerror. The
1099 heuristic is that double-quoting is unnecessary unless the string
1100 contains an apostrophe, a comma, or backslash (other than
1101 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1102 null, do not copy; instead, return the length of what the result
1105 yytnamerr (char *yyres
, const char *yystr
)
1110 char const *yyp
= yystr
;
1117 goto do_not_strip_quotes
;
1121 goto do_not_strip_quotes
;
1134 do_not_strip_quotes
: ;
1138 return yystrlen (yystr
);
1140 return yystpcpy (yyres
, yystr
) - yyres
;
1144 #endif /* YYERROR_VERBOSE */
1149 /*--------------------------------.
1150 | Print this symbol on YYOUTPUT. |
1151 `--------------------------------*/
1153 #if defined (__STDC__) || defined (__cplusplus)
1155 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1158 yysymprint (yyoutput
, yytype
, yyvaluep
)
1164 /* Pacify ``unused variable'' warnings. */
1167 if (yytype
< YYNTOKENS
)
1168 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1170 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1174 if (yytype
< YYNTOKENS
)
1175 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1182 YYFPRINTF (yyoutput
, ")");
1185 #endif /* ! YYDEBUG */
1186 /*-----------------------------------------------.
1187 | Release the memory associated to this symbol. |
1188 `-----------------------------------------------*/
1190 #if defined (__STDC__) || defined (__cplusplus)
1192 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1195 yydestruct (yymsg
, yytype
, yyvaluep
)
1201 /* Pacify ``unused variable'' warnings. */
1206 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1217 /* Prevent warnings from -Wmissing-prototypes. */
1219 #ifdef YYPARSE_PARAM
1220 # if defined (__STDC__) || defined (__cplusplus)
1221 int yyparse (void *YYPARSE_PARAM
);
1225 #else /* ! YYPARSE_PARAM */
1226 #if defined (__STDC__) || defined (__cplusplus)
1231 #endif /* ! YYPARSE_PARAM */
1235 /* The look-ahead symbol. */
1238 /* The semantic value of the look-ahead symbol. */
1241 /* Number of syntax errors so far. */
1250 #ifdef YYPARSE_PARAM
1251 # if defined (__STDC__) || defined (__cplusplus)
1252 int yyparse (void *YYPARSE_PARAM
)
1254 int yyparse (YYPARSE_PARAM
)
1255 void *YYPARSE_PARAM
;
1257 #else /* ! YYPARSE_PARAM */
1258 #if defined (__STDC__) || defined (__cplusplus)
1272 /* Number of tokens to shift before error messages enabled. */
1274 /* Look-ahead token as an internal (translated) token number. */
1277 /* Three stacks and their tools:
1278 `yyss': related to states,
1279 `yyvs': related to semantic values,
1280 `yyls': related to locations.
1282 Refer to the stacks thru separate pointers, to allow yyoverflow
1283 to reallocate them elsewhere. */
1285 /* The state stack. */
1286 short int yyssa
[YYINITDEPTH
];
1287 short int *yyss
= yyssa
;
1290 /* The semantic value stack. */
1291 YYSTYPE yyvsa
[YYINITDEPTH
];
1292 YYSTYPE
*yyvs
= yyvsa
;
1297 #define YYPOPSTACK (yyvsp--, yyssp--)
1299 YYSIZE_T yystacksize
= YYINITDEPTH
;
1301 /* The variables used to return semantic value and location from the
1306 /* When reducing, the number of symbols on the RHS of the reduced
1310 YYDPRINTF ((stderr
, "Starting parse\n"));
1315 yychar
= YYEMPTY
; /* Cause a token to be read. */
1317 /* Initialize stack pointers.
1318 Waste one element of value and location stack
1319 so that they stay on the same level as the state stack.
1320 The wasted elements are never initialized. */
1327 /*------------------------------------------------------------.
1328 | yynewstate -- Push a new state, which is found in yystate. |
1329 `------------------------------------------------------------*/
1331 /* In all cases, when you get here, the value and location stacks
1332 have just been pushed. so pushing a state here evens the stacks.
1339 if (yyss
+ yystacksize
- 1 <= yyssp
)
1341 /* Get the current used size of the three stacks, in elements. */
1342 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1346 /* Give user a chance to reallocate the stack. Use copies of
1347 these so that the &'s don't force the real ones into
1349 YYSTYPE
*yyvs1
= yyvs
;
1350 short int *yyss1
= yyss
;
1353 /* Each stack pointer address is followed by the size of the
1354 data in use in that stack, in bytes. This used to be a
1355 conditional around just the two extra args, but that might
1356 be undefined if yyoverflow is a macro. */
1357 yyoverflow (YY_("memory exhausted"),
1358 &yyss1
, yysize
* sizeof (*yyssp
),
1359 &yyvs1
, yysize
* sizeof (*yyvsp
),
1366 #else /* no yyoverflow */
1367 # ifndef YYSTACK_RELOCATE
1368 goto yyexhaustedlab
;
1370 /* Extend the stack our own way. */
1371 if (YYMAXDEPTH
<= yystacksize
)
1372 goto yyexhaustedlab
;
1374 if (YYMAXDEPTH
< yystacksize
)
1375 yystacksize
= YYMAXDEPTH
;
1378 short int *yyss1
= yyss
;
1379 union yyalloc
*yyptr
=
1380 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1382 goto yyexhaustedlab
;
1383 YYSTACK_RELOCATE (yyss
);
1384 YYSTACK_RELOCATE (yyvs
);
1386 # undef YYSTACK_RELOCATE
1388 YYSTACK_FREE (yyss1
);
1391 #endif /* no yyoverflow */
1393 yyssp
= yyss
+ yysize
- 1;
1394 yyvsp
= yyvs
+ yysize
- 1;
1397 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1398 (unsigned long int) yystacksize
));
1400 if (yyss
+ yystacksize
- 1 <= yyssp
)
1404 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1413 /* Do appropriate processing given the current state. */
1414 /* Read a look-ahead token if we need one and don't already have one. */
1417 /* First try to decide what to do without reference to look-ahead token. */
1419 yyn
= yypact
[yystate
];
1420 if (yyn
== YYPACT_NINF
)
1423 /* Not known => get a look-ahead token if don't already have one. */
1425 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1426 if (yychar
== YYEMPTY
)
1428 YYDPRINTF ((stderr
, "Reading a token: "));
1432 if (yychar
<= YYEOF
)
1434 yychar
= yytoken
= YYEOF
;
1435 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1439 yytoken
= YYTRANSLATE (yychar
);
1440 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1443 /* If the proper action on seeing token YYTOKEN is to reduce or to
1444 detect an error, take that action. */
1446 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1451 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1460 /* Shift the look-ahead token. */
1461 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1463 /* Discard the token being shifted unless it is eof. */
1464 if (yychar
!= YYEOF
)
1470 /* Count tokens shifted since error; after three, turn off error
1479 /*-----------------------------------------------------------.
1480 | yydefault -- do the default action for the current state. |
1481 `-----------------------------------------------------------*/
1483 yyn
= yydefact
[yystate
];
1489 /*-----------------------------.
1490 | yyreduce -- Do a reduction. |
1491 `-----------------------------*/
1493 /* yyn is the number of a rule to reduce with. */
1496 /* If YYLEN is nonzero, implement the default value of the action:
1499 Otherwise, the following line sets YYVAL to garbage.
1500 This behavior is undocumented and Bison
1501 users should not rely upon it. Assigning to YYVAL
1502 unconditionally makes the parser a bit smaller, and it avoids a
1503 GCC warning that YYVAL may be used uninitialized. */
1504 yyval
= yyvsp
[1-yylen
];
1507 YY_REDUCE_PRINT (yyn
);
1511 #line 105 "sketch.y"
1512 { objects
= (yyvsp
[-1].obj
); }
1516 #line 117 "sketch.y"
1518 set_global_env_opts(global_env
, (yyvsp
[0].str
), line
);
1523 #line 121 "sketch.y"
1525 set_global_baseline(global_env
, (yyvsp
[-1].flt
), line
);
1530 #line 125 "sketch.y"
1532 set_global_baseline(global_env
, (yyvsp
[-2].flt
), line
);
1533 set_global_env_extent(global_env
, (yyvsp
[-1].pt
), (yyvsp
[0].pt
), line
);
1538 #line 130 "sketch.y"
1540 set_global_env_camera(global_env
, (yyvsp
[0].xf
), line
);
1545 #line 134 "sketch.y"
1547 set_global_env_frame(global_env
, NULL
, line
);
1552 #line 138 "sketch.y"
1554 set_global_env_frame(global_env
, (yyvsp
[0].str
), line
);
1559 #line 142 "sketch.y"
1561 set_global_output_language(global_env
, (yyvsp
[0].index
), line
);
1566 #line 148 "sketch.y"
1567 { (yyval
.index
) = (yyvsp
[-1].index
) | (yyvsp
[0].index
); }
1571 #line 151 "sketch.y"
1572 { (yyval
.index
) = GEOL_PSTRICKS
; }
1576 #line 152 "sketch.y"
1577 { (yyval
.index
) = GEOL_TIKZ
; }
1581 #line 155 "sketch.y"
1582 { (yyval
.index
) = (yyvsp
[0].index
); }
1586 #line 156 "sketch.y"
1587 { (yyval
.index
) = GEOL_LATEX
; }
1591 #line 159 "sketch.y"
1592 { (yyval
.index
) = GEOL_LATEX
; }
1596 #line 160 "sketch.y"
1597 { (yyval
.index
) = GEOL_CONTEXT
; }
1601 #line 163 "sketch.y"
1602 { (yyval
.flt
) = (yyvsp
[-1].flt
); }
1606 #line 164 "sketch.y"
1607 { (yyval
.flt
) = NO_BASELINE
; }
1611 #line 167 "sketch.y"
1612 { (yyval
.obj
) = sibling_reverse((yyvsp
[0].obj
)); }
1616 #line 170 "sketch.y"
1617 { (yyval
.obj
) = cat_objects((yyvsp
[0].obj
), (yyvsp
[-1].obj
)); }
1621 #line 171 "sketch.y"
1622 { (yyval
.obj
) = (yyvsp
[0].obj
); }
1626 #line 174 "sketch.y"
1627 { (yyval
.obj
) = NULL
; }
1631 #line 175 "sketch.y"
1632 { (yyval
.obj
) = (yyvsp
[0].obj
); }
1636 #line 179 "sketch.y"
1637 { new_symbol(sym_tab
, (yyvsp
[-1].name
), 0, (yyvsp
[0].obj
), line
); }
1641 #line 180 "sketch.y"
1642 { new_symbol(sym_tab
, (yyvsp
[-2].name
), 0, (yyvsp
[0].obj
), line
); }
1646 #line 181 "sketch.y"
1647 { new_symbol(sym_tab
, (yyvsp
[-1].name
), 0, new_tag_def(), line
); }
1651 #line 184 "sketch.y"
1652 { strcpy((yyval
.name
), new_symbol(sym_tab
, (yyvsp
[-2].name
), (yyvsp
[-1].name
), (yyvsp
[0].obj
), line
) ? "" : (yyvsp
[-2].name
)); }
1656 #line 185 "sketch.y"
1657 { strcpy((yyval
.name
), new_symbol(sym_tab
, (yyvsp
[-2].name
), (yyvsp
[-1].name
), (yyvsp
[0].obj
), line
) ? "" : (yyvsp
[-2].name
)); }
1661 #line 188 "sketch.y"
1662 { (yyval
.obj
) = object_from_expr(&(yyvsp
[0].exv
)); }
1666 #line 189 "sketch.y"
1667 { (yyval
.obj
) = (yyvsp
[0].obj
); }
1671 #line 190 "sketch.y"
1672 { (yyval
.obj
) = new_opts_def((yyvsp
[0].str
), line
); }
1676 #line 193 "sketch.y"
1677 { (yyval
.obj
) = new_dots((yyvsp
[-1].opts
), (yyvsp
[0].obj
)); }
1681 #line 194 "sketch.y"
1682 { (yyval
.obj
) = new_line((yyvsp
[-1].opts
), (yyvsp
[0].obj
)); }
1686 #line 195 "sketch.y"
1687 { (yyval
.obj
) = new_curve((yyvsp
[-1].opts
), (yyvsp
[0].obj
)); }
1691 #line 196 "sketch.y"
1692 { (yyval
.obj
) = new_polygon((yyvsp
[-1].opts
), (yyvsp
[0].obj
)); }
1696 #line 198 "sketch.y"
1698 (yyval
.obj
) = new_sweep((yyvsp
[-7].opts
), (yyvsp
[-5].flt
), (yyvsp
[-4].bool), (yyvsp
[-2].obj
), new_point_def((yyvsp
[0].pt
)));
1703 #line 202 "sketch.y"
1705 (yyval
.obj
) = new_sweep((yyvsp
[-7].opts
), (yyvsp
[-5].flt
), (yyvsp
[-4].bool), (yyvsp
[-2].obj
), (yyvsp
[0].obj
));
1710 #line 206 "sketch.y"
1712 (yyval
.obj
) = new_repeat((yyvsp
[-4].flt
), (yyvsp
[-2].obj
), (yyvsp
[0].obj
));
1717 #line 209 "sketch.y"
1718 { (yyval
.obj
) = new_compound((yyvsp
[-2].xf
), (yyvsp
[0].obj
)); }
1722 #line 210 "sketch.y"
1723 { (yyval
.obj
) = new_special((yyvsp
[-2].str
), (yyvsp
[-1].opts
), (yyvsp
[0].obj
), line
); }
1727 #line 211 "sketch.y"
1728 { (yyval
.obj
) = new_special((yyvsp
[-1].str
), (yyvsp
[0].opts
), new_point_def(origin_3d
), line
); }
1732 #line 212 "sketch.y"
1733 { look_up_drawable(sym_tab
, &(yyval
.obj
), line
, (yyvsp
[0].name
)); }
1737 #line 213 "sketch.y"
1738 { sym_tab
= new_scope(sym_tab
); }
1742 #line 214 "sketch.y"
1743 { sym_tab
= old_scope(sym_tab
); }
1747 #line 216 "sketch.y"
1749 if ((yyvsp
[-2].obj
) == NULL
)
1750 err(line
, "no drawables in compound declaration");
1751 (yyval
.obj
) = (yyvsp
[-2].obj
);
1756 #line 223 "sketch.y"
1757 { (yyval
.bool) = 1; }
1761 #line 224 "sketch.y"
1762 { (yyval
.bool) = 0; }
1766 #line 228 "sketch.y"
1768 (yyval
.opts
) = look_up_and_append_to_opts(sym_tab
, &(yyvsp
[-2].opts
), line
, (yyvsp
[0].name
));
1773 #line 232 "sketch.y"
1775 (yyval
.opts
) = NULL
;
1776 (yyval
.opts
) = look_up_and_append_to_opts(sym_tab
, &(yyval
.opts
), line
, (yyvsp
[0].name
));
1781 #line 238 "sketch.y"
1782 { (yyval
.opts
) = new_opts((yyvsp
[0].str
), line
); }
1786 #line 239 "sketch.y"
1787 { look_up_opts(sym_tab
, &(yyval
.opts
), line
, (yyvsp
[0].name
)); }
1791 #line 240 "sketch.y"
1792 { (yyval
.opts
) = (yyvsp
[-1].opts
); }
1796 #line 241 "sketch.y"
1797 { (yyval
.opts
) = NULL
; }
1801 #line 244 "sketch.y"
1802 { (yyval
.obj
) = sibling_reverse((yyvsp
[0].obj
)); }
1806 #line 247 "sketch.y"
1807 { (yyval
.obj
) = cat_objects(new_point_def((yyvsp
[0].pt
)), (yyvsp
[-1].obj
)); }
1811 #line 248 "sketch.y"
1812 { (yyval
.obj
) = new_point_def((yyvsp
[0].pt
)); }
1816 #line 251 "sketch.y"
1817 { (yyval
.obj
) = sibling_reverse((yyvsp
[0].obj
)); }
1821 #line 254 "sketch.y"
1822 { (yyval
.obj
) = cat_objects(new_transform_def((yyvsp
[0].xf
)), (yyvsp
[-2].obj
)); }
1826 #line 255 "sketch.y"
1827 { (yyval
.obj
) = new_transform_def((yyvsp
[0].xf
)); }
1831 #line 258 "sketch.y"
1832 { set_float(&(yyval
.exv
), (yyvsp
[0].flt
)); }
1836 #line 259 "sketch.y"
1837 { set_point(&(yyval
.exv
), (yyvsp
[0].pt
)); }
1841 #line 260 "sketch.y"
1842 { set_vector(&(yyval
.exv
), (yyvsp
[0].vec
)); }
1846 #line 261 "sketch.y"
1847 { set_transform(&(yyval
.exv
), (yyvsp
[0].xf
)); }
1851 #line 262 "sketch.y"
1852 { do_add(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1856 #line 263 "sketch.y"
1857 { do_sub(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1861 #line 264 "sketch.y"
1862 { do_mul(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1866 #line 265 "sketch.y"
1867 { do_dvd(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1871 #line 266 "sketch.y"
1872 { do_dot(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1876 #line 267 "sketch.y"
1877 { do_thn(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1881 #line 268 "sketch.y"
1882 { do_mag(&(yyval
.exv
), &(yyvsp
[-1].exv
), line
); }
1886 #line 269 "sketch.y"
1887 { do_neg(&(yyval
.exv
), &(yyvsp
[0].exv
), line
); }
1891 #line 270 "sketch.y"
1892 { do_pwr(&(yyval
.exv
), &(yyvsp
[-2].exv
), &(yyvsp
[0].exv
), line
); }
1896 #line 271 "sketch.y"
1897 { (yyval
.exv
) = (yyvsp
[-1].exv
); }
1901 #line 272 "sketch.y"
1902 { do_unit(&(yyval
.exv
), &(yyvsp
[-1].exv
), line
); }
1906 #line 273 "sketch.y"
1907 { do_sqrt(&(yyval
.exv
), &(yyvsp
[-1].exv
), line
); }
1911 #line 274 "sketch.y"
1912 { do_sin(&(yyval
.exv
), &(yyvsp
[-1].exv
), line
); }
1916 #line 275 "sketch.y"
1917 { do_cos(&(yyval
.exv
), &(yyvsp
[-1].exv
), line
); }
1921 #line 276 "sketch.y"
1922 { do_atan2(&(yyval
.exv
), &(yyvsp
[-3].exv
), &(yyvsp
[-1].exv
), line
); }
1926 #line 277 "sketch.y"
1927 { do_index(&(yyval
.exv
), &(yyvsp
[-1].exv
), (yyvsp
[0].index
), line
); }
1931 #line 280 "sketch.y"
1932 { (yyval
.flt
) = (yyvsp
[0].flt
); }
1936 #line 281 "sketch.y"
1937 { look_up_scalar(sym_tab
, &(yyval
.flt
), line
, (yyvsp
[0].name
)); }
1941 #line 284 "sketch.y"
1942 { coerce_to_float(&(yyvsp
[0].exv
), &(yyval
.flt
), line
); }
1946 #line 288 "sketch.y"
1948 (yyval
.pt
)[X
] = (yyvsp
[-5].flt
); (yyval
.pt
)[Y
] = (yyvsp
[-3].flt
); (yyval
.pt
)[Z
] = (yyvsp
[-1].flt
);
1953 #line 292 "sketch.y"
1955 (yyval
.pt
)[X
] = (yyvsp
[-3].flt
); (yyval
.pt
)[Y
] = (yyvsp
[-1].flt
); (yyval
.pt
)[Z
] = 0;
1960 #line 295 "sketch.y"
1961 { look_up_point(sym_tab
, (yyval
.pt
), line
, (yyvsp
[0].name
)); }
1965 #line 298 "sketch.y"
1966 { coerce_to_point(&(yyvsp
[0].exv
), (yyval
.pt
), line
); }
1970 #line 302 "sketch.y"
1972 (yyval
.vec
)[X
] = (yyvsp
[-5].flt
); (yyval
.vec
)[Y
] = (yyvsp
[-3].flt
); (yyval
.vec
)[Z
] = (yyvsp
[-1].flt
);
1977 #line 306 "sketch.y"
1979 (yyval
.vec
)[X
] = (yyvsp
[-3].flt
); (yyval
.vec
)[Y
] = (yyvsp
[-1].flt
); (yyval
.vec
)[Z
] = 0;
1984 #line 309 "sketch.y"
1985 { look_up_vector(sym_tab
, (yyval
.vec
), line
, (yyvsp
[0].name
)); }
1989 #line 311 "sketch.y"
1990 { coerce_to_vector(&(yyvsp
[0].exv
), (yyval
.vec
), line
); }
1994 #line 320 "sketch.y"
1995 { // transform is column major while elements are row major
1996 (yyval
.xf
)[0] = (yyvsp
[-35].flt
); (yyval
.xf
)[4] = (yyvsp
[-33].flt
); (yyval
.xf
)[8] = (yyvsp
[-31].flt
); (yyval
.xf
)[12] = (yyvsp
[-29].flt
);
1997 (yyval
.xf
)[1] = (yyvsp
[-26].flt
); (yyval
.xf
)[5] = (yyvsp
[-24].flt
); (yyval
.xf
)[9] = (yyvsp
[-22].flt
); (yyval
.xf
)[13] = (yyvsp
[-20].flt
);
1998 (yyval
.xf
)[2] = (yyvsp
[-17].flt
); (yyval
.xf
)[6] = (yyvsp
[-15].flt
); (yyval
.xf
)[10] = (yyvsp
[-13].flt
); (yyval
.xf
)[14] = (yyvsp
[-11].flt
);
1999 (yyval
.xf
)[3] = (yyvsp
[-8].flt
); (yyval
.xf
)[7] = (yyvsp
[-6].flt
); (yyval
.xf
)[11] = (yyvsp
[-4].flt
); (yyval
.xf
)[15] = (yyvsp
[-2].flt
);
2004 #line 327 "sketch.y"
2006 set_angle_axis_rot_about_point((yyval
.xf
), (yyvsp
[-1].flt
) * (PI
/180), 0, 0);
2011 #line 331 "sketch.y"
2013 if (EXPR_TYPE_IS(&(yyvsp
[-1].exv
), E_POINT
))
2014 set_angle_axis_rot_about_point((yyval
.xf
), (yyvsp
[-3].flt
) * (PI
/180), (yyvsp
[-1].exv
).val
.pt
, 0);
2015 else if (EXPR_TYPE_IS(&(yyvsp
[-1].exv
), E_VECTOR
))
2016 set_angle_axis_rot_about_point((yyval
.xf
), (yyvsp
[-3].flt
) * (PI
/180), 0, (yyvsp
[-1].exv
).val
.vec
);
2018 err(line
, "expected point or vector rotation parameter, and it's a %s",
2019 expr_val_type_str
[(yyvsp
[-1].exv
).tag
]);
2024 #line 341 "sketch.y"
2026 set_angle_axis_rot_about_point((yyval
.xf
), (yyvsp
[-5].flt
) * (PI
/180), (yyvsp
[-3].pt
), (yyvsp
[-1].vec
));
2031 #line 345 "sketch.y"
2033 set_translation((yyval
.xf
), (yyvsp
[-1].vec
)[X
], (yyvsp
[-1].vec
)[Y
], (yyvsp
[-1].vec
)[Z
]);
2038 #line 349 "sketch.y"
2040 if ((yyvsp
[-1].exv
).tag
== E_FLOAT
) {
2041 FLOAT s
= (yyvsp
[-1].exv
).val
.flt
;
2042 set_scale((yyval
.xf
), s
, s
, s
);
2044 else if ((yyvsp
[-1].exv
).tag
== E_VECTOR
) {
2045 VECTOR v
= (yyvsp
[-1].exv
).val
.vec
;
2046 set_scale((yyval
.xf
), v
[X
], v
[Y
], v
[Z
]);
2050 "expected scalar or vector scale parameter, and it's a %s",
2051 expr_val_type_str
[(yyvsp
[-1].exv
).tag
]);
2052 set_ident((yyval
.xf
));
2058 #line 365 "sketch.y"
2059 { set_parallel_projection((yyval
.xf
)); }
2063 #line 366 "sketch.y"
2064 { set_perspective_projection((yyval
.xf
), (yyvsp
[-1].flt
)); }
2068 #line 367 "sketch.y"
2069 { set_perspective_transform((yyval
.xf
), (yyvsp
[-1].flt
)); }
2073 #line 369 "sketch.y"
2075 if ((yyvsp
[-3].exv
).tag
== E_VECTOR
)
2076 set_view_transform((yyval
.xf
), (yyvsp
[-5].pt
), (yyvsp
[-3].exv
).val
.vec
, (yyvsp
[-1].vec
));
2077 else if ((yyvsp
[-3].exv
).tag
== E_POINT
)
2078 set_view_transform_with_look_at((yyval
.xf
), (yyvsp
[-5].pt
), (yyvsp
[-3].exv
).val
.pt
, (yyvsp
[-1].vec
));
2080 err(line
, "expected point or vector view parameter, and it's a %s",
2081 expr_val_type_str
[(yyvsp
[-3].exv
).tag
]);
2086 #line 379 "sketch.y"
2088 if ((yyvsp
[-1].exv
).tag
== E_VECTOR
)
2089 set_view_transform((yyval
.xf
), (yyvsp
[-3].pt
), (yyvsp
[-1].exv
).val
.vec
, NULL
);
2090 else if ((yyvsp
[-1].exv
).tag
== E_POINT
)
2091 set_view_transform_with_look_at((yyval
.xf
), (yyvsp
[-3].pt
), (yyvsp
[-1].exv
).val
.pt
, NULL
);
2093 err(line
, "expected point or vector view parameter, and it's a %s",
2094 expr_val_type_str
[(yyvsp
[-1].exv
).tag
]);
2099 #line 389 "sketch.y"
2101 set_view_transform((yyval
.xf
), (yyvsp
[-1].pt
), NULL
, NULL
);
2106 #line 393 "sketch.y"
2107 { do_inverse((yyval
.xf
), (yyvsp
[-1].xf
), line
); }
2111 #line 394 "sketch.y"
2112 { look_up_transform(sym_tab
, (yyval
.xf
), line
, (yyvsp
[0].name
)); }
2116 #line 397 "sketch.y"
2117 { coerce_to_transform(&(yyvsp
[0].exv
), (yyval
.xf
), line
); }
2124 /* Line 1126 of yacc.c. */
2125 #line 2126 "y.tab.c"
2131 YY_STACK_PRINT (yyss
, yyssp
);
2136 /* Now `shift' the result of the reduction. Determine what state
2137 that goes to, based on the state we popped back to and the rule
2138 number reduced by. */
2142 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2143 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2144 yystate
= yytable
[yystate
];
2146 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2151 /*------------------------------------.
2152 | yyerrlab -- here on detecting error |
2153 `------------------------------------*/
2155 /* If not already recovering from an error, report this error. */
2160 yyn
= yypact
[yystate
];
2162 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
2164 int yytype
= YYTRANSLATE (yychar
);
2165 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
2166 YYSIZE_T yysize
= yysize0
;
2168 int yysize_overflow
= 0;
2170 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2171 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
2175 /* This is so xgettext sees the translatable formats that are
2176 constructed on the fly. */
2177 YY_("syntax error, unexpected %s");
2178 YY_("syntax error, unexpected %s, expecting %s");
2179 YY_("syntax error, unexpected %s, expecting %s or %s");
2180 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2181 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2185 static char const yyunexpected
[] = "syntax error, unexpected %s";
2186 static char const yyexpecting
[] = ", expecting %s";
2187 static char const yyor
[] = " or %s";
2188 char yyformat
[sizeof yyunexpected
2189 + sizeof yyexpecting
- 1
2190 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
2191 * (sizeof yyor
- 1))];
2192 char const *yyprefix
= yyexpecting
;
2194 /* Start YYX at -YYN if negative to avoid negative indexes in
2196 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
2198 /* Stay within bounds of both yycheck and yytname. */
2199 int yychecklim
= YYLAST
- yyn
;
2200 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
2203 yyarg
[0] = yytname
[yytype
];
2204 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
2206 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
2207 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
2209 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
2213 yyformat
[sizeof yyunexpected
- 1] = '\0';
2216 yyarg
[yycount
++] = yytname
[yyx
];
2217 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
2218 yysize_overflow
|= yysize1
< yysize
;
2220 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
2224 yyf
= YY_(yyformat
);
2225 yysize1
= yysize
+ yystrlen (yyf
);
2226 yysize_overflow
|= yysize1
< yysize
;
2229 if (!yysize_overflow
&& yysize
<= YYSTACK_ALLOC_MAXIMUM
)
2230 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
2233 /* Avoid sprintf, as that infringes on the user's name space.
2234 Don't have undefined behavior even if the translation
2235 produced a string with the wrong number of "%s"s. */
2238 while ((*yyp
= *yyf
))
2240 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
2242 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
2252 YYSTACK_FREE (yymsg
);
2256 yyerror (YY_("syntax error"));
2257 goto yyexhaustedlab
;
2261 #endif /* YYERROR_VERBOSE */
2262 yyerror (YY_("syntax error"));
2267 if (yyerrstatus
== 3)
2269 /* If just tried and failed to reuse look-ahead token after an
2270 error, discard it. */
2272 if (yychar
<= YYEOF
)
2274 /* Return failure if at end of input. */
2275 if (yychar
== YYEOF
)
2280 yydestruct ("Error: discarding", yytoken
, &yylval
);
2285 /* Else will try to reuse look-ahead token after shifting the error
2290 /*---------------------------------------------------.
2291 | yyerrorlab -- error raised explicitly by YYERROR. |
2292 `---------------------------------------------------*/
2295 /* Pacify compilers like GCC when the user code never invokes
2296 YYERROR and the label yyerrorlab therefore never appears in user
2307 /*-------------------------------------------------------------.
2308 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2309 `-------------------------------------------------------------*/
2311 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2315 yyn
= yypact
[yystate
];
2316 if (yyn
!= YYPACT_NINF
)
2319 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2327 /* Pop the current state because it cannot handle the error token. */
2332 yydestruct ("Error: popping", yystos
[yystate
], yyvsp
);
2335 YY_STACK_PRINT (yyss
, yyssp
);
2344 /* Shift the error token. */
2345 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2351 /*-------------------------------------.
2352 | yyacceptlab -- YYACCEPT comes here. |
2353 `-------------------------------------*/
2358 /*-----------------------------------.
2359 | yyabortlab -- YYABORT comes here. |
2360 `-----------------------------------*/
2366 /*-------------------------------------------------.
2367 | yyexhaustedlab -- memory exhaustion comes here. |
2368 `-------------------------------------------------*/
2370 yyerror (YY_("memory exhausted"));
2376 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2377 yydestruct ("Cleanup: discarding lookahead",
2379 while (yyssp
!= yyss
)
2381 yydestruct ("Cleanup: popping",
2382 yystos
[*yyssp
], yyvsp
);
2387 YYSTACK_FREE (yyss
);
2393 #line 400 "sketch.y"
2396 int parse(SYMBOL_TABLE
*st
)
2404 // should set sym_tab back to NULL
2405 sym_tab
= old_scope(sym_tab
);
2407 die(no_line
, "zombie symbol table");
2412 OBJECT
*parsed_objects(void)