diff options
Diffstat (limited to 'graphics/sketch/y.tab.c')
-rw-r--r-- | graphics/sketch/y.tab.c | 2399 |
1 files changed, 2399 insertions, 0 deletions
diff --git a/graphics/sketch/y.tab.c b/graphics/sketch/y.tab.c new file mode 100644 index 0000000000..a3d7bfead2 --- /dev/null +++ b/graphics/sketch/y.tab.c @@ -0,0 +1,2399 @@ +/* A Bison parser, made by GNU Bison 2.1. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ID = 258, + PAREN_ID = 259, + BRACKET_ID = 260, + DBL_BRACKET_ID = 261, + CURLY_ID = 262, + ANGLE_ID = 263, + BRACKET_ID_LIST = 264, + NUM = 265, + OPTS_STR = 266, + SPECIAL = 267, + TICK = 268, + THEN = 269, + DEF = 270, + EMPTY_ANGLE = 271, + DOTS = 272, + LINE = 273, + CURVE = 274, + POLYGON = 275, + REPEAT = 276, + SWEEP = 277, + PUT = 278, + TRANSLATE = 279, + ROTATE = 280, + SCALE = 281, + PROJECT = 282, + PERSPECTIVE = 283, + VIEW = 284, + SQRT = 285, + SIN = 286, + COS = 287, + ATAN2 = 288, + UNIT = 289, + INVERSE = 290, + GLOBAL = 291, + SET = 292, + PICTUREBOX = 293, + FRAME = 294, + CAMERA = 295, + LANGUAGE = 296, + PSTRICKS = 297, + TIKZ = 298, + LaTeX = 299, + ConTeXt = 300, + NEG = 301 + }; +#endif +/* Tokens. */ +#define ID 258 +#define PAREN_ID 259 +#define BRACKET_ID 260 +#define DBL_BRACKET_ID 261 +#define CURLY_ID 262 +#define ANGLE_ID 263 +#define BRACKET_ID_LIST 264 +#define NUM 265 +#define OPTS_STR 266 +#define SPECIAL 267 +#define TICK 268 +#define THEN 269 +#define DEF 270 +#define EMPTY_ANGLE 271 +#define DOTS 272 +#define LINE 273 +#define CURVE 274 +#define POLYGON 275 +#define REPEAT 276 +#define SWEEP 277 +#define PUT 278 +#define TRANSLATE 279 +#define ROTATE 280 +#define SCALE 281 +#define PROJECT 282 +#define PERSPECTIVE 283 +#define VIEW 284 +#define SQRT 285 +#define SIN 286 +#define COS 287 +#define ATAN2 288 +#define UNIT 289 +#define INVERSE 290 +#define GLOBAL 291 +#define SET 292 +#define PICTUREBOX 293 +#define FRAME 294 +#define CAMERA 295 +#define LANGUAGE 296 +#define PSTRICKS 297 +#define TIKZ 298 +#define LaTeX 299 +#define ConTeXt 300 +#define NEG 301 + + + + +/* Copy the first part of user declarations. */ +#line 21 "sketch.y" + + +#include <stdio.h> +#include <stdlib.h> + +#if defined(_WIN32) +#include <malloc.h> +#if !defined(alloca) +#define alloca _alloca +#endif +#define YYSTACK_USE_ALLOCA 1 +// turn of warning about unused goto label in bison skeleton +#pragma warning(disable:4102) +#endif + +#include "parse.h" +#include "expr.h" +#include "bsp.h" +#include "global.h" + +int yylex(void); + +void yyerror (char *s) /* Called by yyparse on error */ +{ + extern SRC_LINE line; + err(line, "%s", s); +} + +static SYMBOL_TABLE *sym_tab; +static BSP_TREE bsp; +static FILE *yyout; + +// exported parse tree and global environment +static OBJECT *objects; + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 58 "sketch.y" +typedef union YYSTYPE { + char *str; + FLOAT flt; + POINT_3D pt; + VECTOR_3D vec; + TRANSFORM xf; + EXPR_VAL exv; + SYMBOL_NAME name; + SYMBOL_NAME_NODE *name_list; + OBJECT *obj; + OPTS *opts; + int bool; + int index; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 229 "y.tab.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 219 of yacc.c. */ +#line 241 "y.tab.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 32 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 574 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 61 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 34 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 108 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 249 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 301 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 59, 60, 48, 47, 57, 46, 50, 49, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 55, 2, 56, 52, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 53, 58, 54, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 51 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short int yyprhs[] = +{ + 0, 0, 3, 6, 11, 12, 15, 17, 20, 25, + 30, 33, 35, 38, 41, 43, 46, 48, 50, 53, + 54, 56, 58, 62, 63, 65, 68, 70, 72, 74, + 78, 82, 86, 91, 95, 97, 99, 101, 105, 109, + 113, 117, 127, 137, 145, 151, 155, 158, 160, 161, + 162, 168, 170, 171, 173, 175, 177, 178, 180, 183, + 185, 187, 191, 193, 195, 197, 199, 201, 205, 209, + 213, 217, 221, 225, 229, 232, 236, 240, 244, 248, + 252, 256, 262, 265, 267, 269, 271, 279, 285, 287, + 289, 297, 303, 305, 307, 346, 350, 356, 364, 368, + 372, 375, 379, 383, 391, 397, 401, 405, 407 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yysigned_char yyrhs[] = +{ + 62, 0, -1, 71, 63, -1, 36, 53, 64, 54, + -1, -1, 64, 65, -1, 65, -1, 37, 11, -1, + 38, 55, 88, 56, -1, 38, 70, 89, 89, -1, + 40, 94, -1, 39, -1, 39, 11, -1, 41, 66, + -1, 74, -1, 67, 68, -1, 42, -1, 43, -1, + 57, 69, -1, -1, 44, -1, 45, -1, 55, 88, + 56, -1, -1, 72, -1, 72, 73, -1, 73, -1, + 74, -1, 77, -1, 15, 3, 76, -1, 75, 16, + 76, -1, 15, 3, 16, -1, 15, 3, 8, 76, + -1, 75, 8, 76, -1, 86, -1, 77, -1, 11, + -1, 17, 81, 82, -1, 18, 81, 82, -1, 19, + 81, 82, -1, 20, 81, 82, -1, 22, 81, 53, + 88, 80, 57, 84, 54, 89, -1, 22, 81, 53, + 88, 80, 57, 84, 54, 77, -1, 21, 53, 88, + 57, 84, 54, 77, -1, 23, 53, 94, 54, 77, + -1, 12, 81, 82, -1, 12, 81, -1, 7, -1, + -1, -1, 53, 78, 71, 79, 54, -1, 16, -1, + -1, 11, -1, 5, -1, 9, -1, -1, 83, -1, + 83, 89, -1, 89, -1, 85, -1, 85, 57, 94, + -1, 94, -1, 87, -1, 89, -1, 91, -1, 93, + -1, 86, 47, 86, -1, 86, 46, 86, -1, 86, + 48, 86, -1, 86, 49, 86, -1, 86, 50, 86, + -1, 86, 14, 86, -1, 58, 86, 58, -1, 46, + 86, -1, 86, 52, 86, -1, 59, 86, 60, -1, + 34, 86, 60, -1, 30, 86, 60, -1, 31, 86, + 60, -1, 32, 86, 60, -1, 33, 86, 57, 86, + 60, -1, 86, 13, -1, 10, -1, 3, -1, 86, + -1, 59, 88, 57, 88, 57, 88, 60, -1, 59, + 88, 57, 88, 60, -1, 4, -1, 86, -1, 55, + 88, 57, 88, 57, 88, 56, -1, 55, 88, 57, + 88, 56, -1, 5, -1, 86, -1, 55, 55, 88, + 57, 88, 57, 88, 57, 88, 56, 55, 88, 57, + 88, 57, 88, 57, 88, 56, 55, 88, 57, 88, + 57, 88, 57, 88, 56, 55, 88, 57, 88, 57, + 88, 57, 88, 56, 56, -1, 25, 88, 60, -1, + 25, 88, 57, 86, 60, -1, 25, 88, 57, 90, + 57, 92, 60, -1, 24, 92, 60, -1, 26, 86, + 60, -1, 27, 60, -1, 27, 88, 60, -1, 28, + 88, 60, -1, 29, 90, 57, 86, 57, 92, 60, + -1, 29, 90, 57, 86, 60, -1, 29, 90, 60, + -1, 35, 94, 60, -1, 6, -1, 86, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short int yyrline[] = +{ + 0, 107, 107, 110, 111, 114, 115, 118, 122, 126, + 131, 135, 139, 143, 147, 150, 153, 154, 157, 158, + 161, 162, 165, 166, 169, 172, 173, 176, 177, 181, + 182, 183, 186, 187, 190, 191, 192, 195, 196, 197, + 198, 199, 203, 207, 211, 212, 213, 214, 215, 216, + 215, 225, 226, 229, 230, 231, 236, 239, 242, 243, + 246, 249, 250, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 275, 276, 279, 282, 286, 290, 293, + 296, 300, 304, 306, 309, 321, 325, 335, 339, 343, + 360, 361, 362, 363, 373, 383, 388, 389, 392 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ID", "PAREN_ID", "BRACKET_ID", + "DBL_BRACKET_ID", "CURLY_ID", "ANGLE_ID", "BRACKET_ID_LIST", "NUM", + "OPTS_STR", "SPECIAL", "TICK", "THEN", "DEF", "EMPTY_ANGLE", "DOTS", + "LINE", "CURVE", "POLYGON", "REPEAT", "SWEEP", "PUT", "TRANSLATE", + "ROTATE", "SCALE", "PROJECT", "PERSPECTIVE", "VIEW", "SQRT", "SIN", + "COS", "ATAN2", "UNIT", "INVERSE", "GLOBAL", "SET", "PICTUREBOX", + "FRAME", "CAMERA", "LANGUAGE", "PSTRICKS", "TIKZ", "LaTeX", "ConTeXt", + "'-'", "'+'", "'*'", "'/'", "'.'", "NEG", "'^'", "'{'", "'}'", "'['", + "']'", "','", "'|'", "'('", "')'", "$accept", "input", + "global_decl_block", "global_decls", "global_decl", "output_language", + "graphics_language", "comma_macro_package", "macro_package", + "opt_baseline", "defs_and_decls", "rev_defs_and_decls", "def_or_decl", + "def", "tagged_defs", "defable", "decl", "@1", "@2", "opt_star", + "options", "points", "rev_points", "transforms", "rev_transforms", + "expr", "scalar", "scalar_expr", "point", "point_expr", "vector", + "vector_expr", "transform", "transform_expr", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 45, 43, 42, 47, + 46, 301, 94, 123, 125, 91, 93, 44, 124, 40, + 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 61, 62, 63, 63, 64, 64, 65, 65, 65, + 65, 65, 65, 65, 65, 66, 67, 67, 68, 68, + 69, 69, 70, 70, 71, 72, 72, 73, 73, 74, + 74, 74, 75, 75, 76, 76, 76, 77, 77, 77, + 77, 77, 77, 77, 77, 77, 77, 77, 78, 79, + 77, 80, 80, 81, 81, 81, 81, 82, 83, 83, + 84, 85, 85, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 87, 87, 88, 89, 89, 89, 90, + 91, 91, 91, 92, 93, 93, 93, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 94 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 2, 4, 0, 2, 1, 2, 4, 4, + 2, 1, 2, 2, 1, 2, 1, 1, 2, 0, + 1, 1, 3, 0, 1, 2, 1, 1, 1, 3, + 3, 3, 4, 3, 1, 1, 1, 3, 3, 3, + 3, 9, 9, 7, 5, 3, 2, 1, 0, 0, + 5, 1, 0, 1, 1, 1, 0, 1, 2, 1, + 1, 3, 1, 1, 1, 1, 1, 3, 3, 3, + 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, + 3, 5, 2, 1, 1, 1, 7, 5, 1, 1, + 7, 5, 1, 1, 38, 3, 5, 7, 3, 3, + 2, 3, 3, 7, 5, 3, 3, 1, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned char yydefact[] = +{ + 0, 47, 56, 0, 56, 56, 56, 56, 0, 56, + 0, 48, 0, 4, 24, 26, 27, 0, 28, 54, + 55, 53, 46, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 2, 25, 0, 0, 88, 0, + 45, 57, 59, 84, 92, 107, 0, 83, 36, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 29, 35, 34, 63, + 64, 65, 66, 37, 38, 39, 40, 85, 0, 0, + 108, 0, 49, 0, 33, 30, 0, 58, 32, 93, + 0, 0, 0, 100, 0, 0, 89, 0, 0, 0, + 0, 0, 0, 0, 74, 0, 0, 0, 85, 82, + 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, + 0, 0, 23, 11, 0, 0, 0, 6, 14, 0, + 98, 0, 95, 99, 101, 102, 0, 105, 78, 79, + 80, 0, 77, 106, 0, 0, 73, 76, 72, 68, + 67, 69, 70, 71, 75, 0, 60, 62, 51, 0, + 44, 50, 7, 0, 0, 12, 10, 16, 17, 13, + 19, 3, 5, 0, 89, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 87, 96, + 0, 0, 104, 81, 0, 91, 0, 43, 61, 0, + 8, 9, 20, 21, 18, 0, 0, 0, 0, 0, + 0, 86, 97, 103, 0, 90, 42, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 94 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = +{ + -1, 12, 34, 126, 127, 169, 170, 186, 204, 164, + 13, 14, 15, 16, 17, 66, 67, 31, 120, 159, + 22, 40, 41, 155, 156, 77, 69, 86, 70, 97, + 71, 90, 72, 157 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -75 +static const short int yypact[] = +{ + 521, -75, 13, 16, 13, 13, 13, 13, -13, 13, + -11, -75, 49, 17, 521, -75, -75, 5, -75, -75, + -75, -75, 10, 238, 10, 10, 10, 10, 347, 21, + 347, 521, -75, 34, -75, -75, 303, 303, -75, 347, + -75, 10, -75, -75, -75, -75, 303, -75, -75, -75, + 347, 347, 347, 33, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 384, 347, 347, -75, -75, 517, -75, + -75, -75, -75, -75, -75, -75, -75, 517, 25, 347, + 517, 22, -75, 302, -75, -75, 46, -75, -75, 517, + 30, -26, 124, -75, 50, 60, 517, 18, 385, 407, + 414, 503, 433, 69, 19, 384, 61, -2, 455, -75, + 347, 347, 347, 347, 347, 347, 347, 347, 117, 135, + 80, 128, 85, 133, 347, 12, 87, -75, -75, 347, + -75, 347, -75, -75, -75, -75, 347, -75, -75, -75, + -75, 347, -75, -75, 88, 347, -75, -75, 517, 183, + 183, 19, 19, 19, 19, 92, 91, -75, -75, 94, + -75, -75, -75, 347, 10, -75, -75, -75, -75, -75, + 103, -75, -75, 23, 462, 105, 59, 477, 347, 29, + 135, 347, 347, 93, 10, 68, -75, 347, -75, -75, + 347, 347, -75, -75, 58, -75, 347, -75, -75, 121, + 11, -75, -75, -75, -75, 118, 119, 123, 347, 125, + 77, -75, -75, -75, 66, -75, -75, -75, 347, 129, + 122, 347, 134, 347, 141, 347, 146, 347, 130, 137, + 347, 148, 347, 150, 347, 152, 347, 162, 172, 347, + 173, 347, 177, 347, 179, 347, 181, 182, -75 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const short int yypgoto[] = +{ + -75, -75, -75, -75, 113, -75, -75, -75, -75, -75, + 209, -75, 233, -74, -75, -29, 2, -75, -75, -75, + 160, 3, -75, 70, -75, 164, -75, -28, -21, 120, + -75, -59, -75, -20 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -23 +static const short int yytable[] = +{ + 78, 42, 18, 42, 42, 42, 42, 84, 85, 128, + 81, 109, 110, 36, 38, -22, 18, 88, 19, 23, + 87, 37, 20, 91, 21, 94, 95, 73, 74, 75, + 76, 131, 109, 18, 132, 106, 43, 38, 44, 45, + 28, 103, 30, 47, 111, 112, 113, 114, 115, 32, + 116, 118, 128, 33, 167, 168, 146, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 39, + -22, 116, 109, 110, 79, 136, 119, 144, 137, 62, + 187, 38, 117, 188, 1, 195, 196, 83, 63, 2, + 130, 64, 65, 93, 4, 5, 6, 7, 8, 9, + 10, 173, 3, 129, 166, 111, 112, 113, 114, 115, + 134, 116, 202, 203, 195, 208, 191, 179, 145, 192, + 135, 160, 215, 218, 121, 122, 123, 124, 125, 143, + 11, 206, 207, 158, 161, 183, 39, 109, 110, 162, + 163, 171, 1, 184, 165, 178, 180, 2, 181, 200, + 194, 182, 4, 5, 6, 7, 8, 9, 10, 205, + 185, 198, 190, 201, 24, 25, 26, 27, 209, 29, + 111, 112, 113, 114, 115, 210, 116, 221, 211, 212, + 214, 215, 197, 213, 133, 220, 229, 68, 11, 217, + 219, 223, 230, 222, 80, 224, 109, 226, 225, 228, + 68, 68, 231, 227, 233, 232, 235, 234, 237, 236, + 68, 240, 216, 242, 89, 244, 92, 246, 238, 96, + 98, 99, 100, 101, 102, 80, 104, 239, 107, 108, + 241, 113, 114, 115, 243, 116, 245, 247, 248, 172, + 82, 43, 38, 44, 45, 1, 46, 35, 47, 48, + 2, 175, 199, 0, 49, 4, 5, 6, 7, 8, + 9, 10, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 148, 149, 150, 151, 152, 153, + 154, 80, 0, 0, 62, 0, 0, 0, 80, 0, + 0, 11, 0, 63, 0, 174, 64, 65, 0, 0, + 176, 0, 0, 0, 0, 177, 43, 38, 44, 45, + 1, 0, 0, 47, 48, 2, 0, 3, 0, 0, + 4, 5, 6, 7, 8, 9, 10, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 121, + 122, 123, 124, 125, 0, 80, 80, 0, 0, 62, + 43, 38, 44, 45, 89, 89, 11, 47, 63, 0, + 0, 64, 65, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 0, 0, 0, 0, 43, 38, 44, + 45, 0, 0, 62, 47, 0, 0, 0, 109, 110, + 0, 0, 63, 0, 0, 64, 65, 0, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 109, 110, 0, 0, 0, 0, 0, 109, 110, 0, + 62, 111, 112, 113, 114, 115, 0, 116, 0, 105, + 0, 0, 64, 65, 0, 138, 109, 110, 0, 0, + 0, 0, 0, 111, 112, 113, 114, 115, 0, 116, + 111, 112, 113, 114, 115, 0, 116, 139, 109, 110, + 0, 0, 0, 0, 140, 109, 110, 0, 0, 111, + 112, 113, 114, 115, 0, 116, 0, 0, 0, 0, + 109, 110, 0, 142, 0, 0, 0, 0, 0, 0, + 0, 111, 112, 113, 114, 115, 0, 116, 111, 112, + 113, 114, 115, 0, 116, 147, 109, 110, 0, 0, + 0, 0, 189, 111, 112, 113, 114, 115, 1, 116, + 109, 110, 0, 2, 0, 0, 3, 193, 4, 5, + 6, 7, 8, 9, 10, 0, 0, 0, 0, 111, + 112, 113, 114, 115, 0, 116, 0, 0, 0, 0, + 141, 0, 0, 111, 112, 113, 114, 115, 0, 116, + 0, 0, 0, 0, 11 +}; + +static const short int yycheck[] = +{ + 28, 22, 0, 24, 25, 26, 27, 36, 37, 83, + 30, 13, 14, 8, 4, 4, 14, 46, 5, 3, + 41, 16, 9, 51, 11, 53, 54, 24, 25, 26, + 27, 57, 13, 31, 60, 63, 3, 4, 5, 6, + 53, 61, 53, 10, 46, 47, 48, 49, 50, 0, + 52, 79, 126, 36, 42, 43, 58, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 59, + 59, 52, 13, 14, 53, 57, 54, 105, 60, 46, + 57, 4, 57, 60, 7, 56, 57, 53, 55, 12, + 60, 58, 59, 60, 17, 18, 19, 20, 21, 22, + 23, 129, 15, 57, 124, 46, 47, 48, 49, 50, + 60, 52, 44, 45, 56, 57, 57, 145, 57, 60, + 60, 119, 56, 57, 37, 38, 39, 40, 41, 60, + 53, 190, 191, 16, 54, 163, 59, 13, 14, 11, + 55, 54, 7, 164, 11, 57, 54, 12, 57, 56, + 178, 57, 17, 18, 19, 20, 21, 22, 23, 187, + 57, 181, 57, 184, 4, 5, 6, 7, 196, 9, + 46, 47, 48, 49, 50, 54, 52, 55, 60, 60, + 208, 56, 180, 60, 60, 56, 56, 23, 53, 210, + 218, 57, 55, 221, 30, 223, 13, 225, 57, 227, + 36, 37, 230, 57, 232, 57, 234, 57, 236, 57, + 46, 239, 210, 241, 50, 243, 52, 245, 56, 55, + 56, 57, 58, 59, 60, 61, 62, 55, 64, 65, + 57, 48, 49, 50, 57, 52, 57, 56, 56, 126, + 31, 3, 4, 5, 6, 7, 8, 14, 10, 11, + 12, 131, 182, -1, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 110, 111, 112, 113, 114, 115, + 116, 117, -1, -1, 46, -1, -1, -1, 124, -1, + -1, 53, -1, 55, -1, 131, 58, 59, -1, -1, + 136, -1, -1, -1, -1, 141, 3, 4, 5, 6, + 7, -1, -1, 10, 11, 12, -1, 15, -1, -1, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, + 38, 39, 40, 41, -1, 181, 182, -1, -1, 46, + 3, 4, 5, 6, 190, 191, 53, 10, 55, -1, + -1, 58, 59, -1, -1, -1, -1, -1, -1, -1, + -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, -1, -1, -1, -1, 3, 4, 5, + 6, -1, -1, 46, 10, -1, -1, -1, 13, 14, + -1, -1, 55, -1, -1, 58, 59, -1, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 13, 14, -1, -1, -1, -1, -1, 13, 14, -1, + 46, 46, 47, 48, 49, 50, -1, 52, -1, 55, + -1, -1, 58, 59, -1, 60, 13, 14, -1, -1, + -1, -1, -1, 46, 47, 48, 49, 50, -1, 52, + 46, 47, 48, 49, 50, -1, 52, 60, 13, 14, + -1, -1, -1, -1, 60, 13, 14, -1, -1, 46, + 47, 48, 49, 50, -1, 52, -1, -1, -1, -1, + 13, 14, -1, 60, -1, -1, -1, -1, -1, -1, + -1, 46, 47, 48, 49, 50, -1, 52, 46, 47, + 48, 49, 50, -1, 52, 60, 13, 14, -1, -1, + -1, -1, 60, 46, 47, 48, 49, 50, 7, 52, + 13, 14, -1, 12, -1, -1, 15, 60, 17, 18, + 19, 20, 21, 22, 23, -1, -1, -1, -1, 46, + 47, 48, 49, 50, -1, 52, -1, -1, -1, -1, + 57, -1, -1, 46, 47, 48, 49, 50, -1, 52, + -1, -1, -1, -1, 53 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 7, 12, 15, 17, 18, 19, 20, 21, 22, + 23, 53, 62, 71, 72, 73, 74, 75, 77, 5, + 9, 11, 81, 3, 81, 81, 81, 81, 53, 81, + 53, 78, 0, 36, 63, 73, 8, 16, 4, 59, + 82, 83, 89, 3, 5, 6, 8, 10, 11, 16, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 46, 55, 58, 59, 76, 77, 86, 87, + 89, 91, 93, 82, 82, 82, 82, 86, 88, 53, + 86, 94, 71, 53, 76, 76, 88, 89, 76, 86, + 92, 88, 86, 60, 88, 88, 86, 90, 86, 86, + 86, 86, 86, 94, 86, 55, 88, 86, 86, 13, + 14, 46, 47, 48, 49, 50, 52, 57, 88, 54, + 79, 37, 38, 39, 40, 41, 64, 65, 74, 57, + 60, 57, 60, 60, 60, 60, 57, 60, 60, 60, + 60, 57, 60, 60, 88, 57, 58, 60, 86, 86, + 86, 86, 86, 86, 86, 84, 85, 94, 16, 80, + 77, 54, 11, 55, 70, 11, 94, 42, 43, 66, + 67, 54, 65, 88, 86, 90, 86, 86, 57, 88, + 54, 57, 57, 88, 89, 57, 68, 57, 60, 60, + 57, 57, 60, 60, 88, 56, 57, 77, 94, 84, + 56, 89, 44, 45, 69, 88, 92, 92, 57, 88, + 54, 60, 60, 60, 88, 56, 77, 89, 57, 88, + 56, 55, 88, 57, 88, 57, 88, 57, 88, 56, + 55, 88, 57, 88, 57, 88, 57, 88, 56, 55, + 88, 57, 88, 57, 88, 57, 88, 56, 56 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short int *bottom, short int *top) +#else +static void +yy_stack_print (bottom, top) + short int *bottom; + short int *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; +#endif +{ + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +#endif /* YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# else +int yyparse (); +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) +#else +int +yyparse () + ; +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a look-ahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to look-ahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 107 "sketch.y" + { objects = (yyvsp[-1].obj); } + break; + + case 7: +#line 119 "sketch.y" + { + set_global_env_opts(global_env, (yyvsp[0].str), line); + } + break; + + case 8: +#line 123 "sketch.y" + { + set_global_baseline(global_env, (yyvsp[-1].flt), line); + } + break; + + case 9: +#line 127 "sketch.y" + { + set_global_baseline(global_env, (yyvsp[-2].flt), line); + set_global_env_extent(global_env, (yyvsp[-1].pt), (yyvsp[0].pt), line); + } + break; + + case 10: +#line 132 "sketch.y" + { + set_global_env_camera(global_env, (yyvsp[0].xf), line); + } + break; + + case 11: +#line 136 "sketch.y" + { + set_global_env_frame(global_env, NULL, line); + } + break; + + case 12: +#line 140 "sketch.y" + { + set_global_env_frame(global_env, (yyvsp[0].str), line); + } + break; + + case 13: +#line 144 "sketch.y" + { + set_global_output_language(global_env, (yyvsp[0].index), line); + } + break; + + case 15: +#line 150 "sketch.y" + { (yyval.index) = (yyvsp[-1].index) | (yyvsp[0].index); } + break; + + case 16: +#line 153 "sketch.y" + { (yyval.index) = GEOL_PSTRICKS; } + break; + + case 17: +#line 154 "sketch.y" + { (yyval.index) = GEOL_TIKZ; } + break; + + case 18: +#line 157 "sketch.y" + { (yyval.index) = (yyvsp[0].index); } + break; + + case 19: +#line 158 "sketch.y" + { (yyval.index) = GEOL_LATEX; } + break; + + case 20: +#line 161 "sketch.y" + { (yyval.index) = GEOL_LATEX; } + break; + + case 21: +#line 162 "sketch.y" + { (yyval.index) = GEOL_CONTEXT; } + break; + + case 22: +#line 165 "sketch.y" + { (yyval.flt) = (yyvsp[-1].flt); } + break; + + case 23: +#line 166 "sketch.y" + { (yyval.flt) = NO_BASELINE; } + break; + + case 24: +#line 169 "sketch.y" + { (yyval.obj) = sibling_reverse((yyvsp[0].obj)); } + break; + + case 25: +#line 172 "sketch.y" + { (yyval.obj) = cat_objects((yyvsp[0].obj), (yyvsp[-1].obj)); } + break; + + case 26: +#line 173 "sketch.y" + { (yyval.obj) = (yyvsp[0].obj); } + break; + + case 27: +#line 176 "sketch.y" + { (yyval.obj) = NULL; } + break; + + case 28: +#line 177 "sketch.y" + { (yyval.obj) = (yyvsp[0].obj); } + break; + + case 29: +#line 181 "sketch.y" + { new_symbol(sym_tab, (yyvsp[-1].name), 0, (yyvsp[0].obj), line); } + break; + + case 30: +#line 182 "sketch.y" + { new_symbol(sym_tab, (yyvsp[-2].name), 0, (yyvsp[0].obj), line); } + break; + + case 31: +#line 183 "sketch.y" + { new_symbol(sym_tab, (yyvsp[-1].name), 0, new_tag_def(), line); } + break; + + case 32: +#line 186 "sketch.y" + { strcpy((yyval.name), new_symbol(sym_tab, (yyvsp[-2].name), (yyvsp[-1].name), (yyvsp[0].obj), line) ? "" : (yyvsp[-2].name)); } + break; + + case 33: +#line 187 "sketch.y" + { strcpy((yyval.name), new_symbol(sym_tab, (yyvsp[-2].name), (yyvsp[-1].name), (yyvsp[0].obj), line) ? "" : (yyvsp[-2].name)); } + break; + + case 34: +#line 190 "sketch.y" + { (yyval.obj) = object_from_expr(&(yyvsp[0].exv)); } + break; + + case 35: +#line 191 "sketch.y" + { (yyval.obj) = (yyvsp[0].obj); } + break; + + case 36: +#line 192 "sketch.y" + { (yyval.obj) = new_opts_def((yyvsp[0].str), line); } + break; + + case 37: +#line 195 "sketch.y" + { (yyval.obj) = new_dots((yyvsp[-1].opts), (yyvsp[0].obj)); } + break; + + case 38: +#line 196 "sketch.y" + { (yyval.obj) = new_line((yyvsp[-1].opts), (yyvsp[0].obj)); } + break; + + case 39: +#line 197 "sketch.y" + { (yyval.obj) = new_curve((yyvsp[-1].opts), (yyvsp[0].obj)); } + break; + + case 40: +#line 198 "sketch.y" + { (yyval.obj) = new_polygon((yyvsp[-1].opts), (yyvsp[0].obj)); } + break; + + case 41: +#line 200 "sketch.y" + { + (yyval.obj) = new_sweep((yyvsp[-7].opts), (yyvsp[-5].flt), (yyvsp[-4].bool), (yyvsp[-2].obj), new_point_def((yyvsp[0].pt))); + } + break; + + case 42: +#line 204 "sketch.y" + { + (yyval.obj) = new_sweep((yyvsp[-7].opts), (yyvsp[-5].flt), (yyvsp[-4].bool), (yyvsp[-2].obj), (yyvsp[0].obj)); + } + break; + + case 43: +#line 208 "sketch.y" + { + (yyval.obj) = new_repeat((yyvsp[-4].flt), (yyvsp[-2].obj), (yyvsp[0].obj)); + } + break; + + case 44: +#line 211 "sketch.y" + { (yyval.obj) = new_compound((yyvsp[-2].xf), (yyvsp[0].obj)); } + break; + + case 45: +#line 212 "sketch.y" + { (yyval.obj) = new_special((yyvsp[-2].str), (yyvsp[-1].opts), (yyvsp[0].obj), line); } + break; + + case 46: +#line 213 "sketch.y" + { (yyval.obj) = new_special((yyvsp[-1].str), (yyvsp[0].opts), new_point_def(origin_3d), line); } + break; + + case 47: +#line 214 "sketch.y" + { look_up_drawable(sym_tab, &(yyval.obj), line, (yyvsp[0].name)); } + break; + + case 48: +#line 215 "sketch.y" + { sym_tab = new_scope(sym_tab); } + break; + + case 49: +#line 216 "sketch.y" + { sym_tab = old_scope(sym_tab); } + break; + + case 50: +#line 218 "sketch.y" + { + if ((yyvsp[-2].obj) == NULL) + err(line, "no drawables in compound declaration"); + (yyval.obj) = (yyvsp[-2].obj); + } + break; + + case 51: +#line 225 "sketch.y" + { (yyval.bool) = 1; } + break; + + case 52: +#line 226 "sketch.y" + { (yyval.bool) = 0; } + break; + + case 53: +#line 229 "sketch.y" + { (yyval.opts) = new_opts((yyvsp[0].str), line); } + break; + + case 54: +#line 230 "sketch.y" + { look_up_opts(sym_tab, &(yyval.opts), line, (yyvsp[0].name)); } + break; + + case 55: +#line 232 "sketch.y" + { + look_up_multiple_opts(sym_tab, &(yyval.opts), line, (yyvsp[0].name_list)); + delete_symbol_name_list(&(yyvsp[0].name_list)); + } + break; + + case 56: +#line 236 "sketch.y" + { (yyval.opts) = NULL; } + break; + + case 57: +#line 239 "sketch.y" + { (yyval.obj) = sibling_reverse((yyvsp[0].obj)); } + break; + + case 58: +#line 242 "sketch.y" + { (yyval.obj) = cat_objects(new_point_def((yyvsp[0].pt)), (yyvsp[-1].obj)); } + break; + + case 59: +#line 243 "sketch.y" + { (yyval.obj) = new_point_def((yyvsp[0].pt)); } + break; + + case 60: +#line 246 "sketch.y" + { (yyval.obj) = sibling_reverse((yyvsp[0].obj)); } + break; + + case 61: +#line 249 "sketch.y" + { (yyval.obj) = cat_objects(new_transform_def((yyvsp[0].xf)), (yyvsp[-2].obj)); } + break; + + case 62: +#line 250 "sketch.y" + { (yyval.obj) = new_transform_def((yyvsp[0].xf)); } + break; + + case 63: +#line 253 "sketch.y" + { set_float(&(yyval.exv), (yyvsp[0].flt)); } + break; + + case 64: +#line 254 "sketch.y" + { set_point(&(yyval.exv), (yyvsp[0].pt)); } + break; + + case 65: +#line 255 "sketch.y" + { set_vector(&(yyval.exv), (yyvsp[0].vec)); } + break; + + case 66: +#line 256 "sketch.y" + { set_transform(&(yyval.exv), (yyvsp[0].xf)); } + break; + + case 67: +#line 257 "sketch.y" + { do_add(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 68: +#line 258 "sketch.y" + { do_sub(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 69: +#line 259 "sketch.y" + { do_mul(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 70: +#line 260 "sketch.y" + { do_dvd(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 71: +#line 261 "sketch.y" + { do_dot(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 72: +#line 262 "sketch.y" + { do_thn(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 73: +#line 263 "sketch.y" + { do_mag(&(yyval.exv), &(yyvsp[-1].exv), line); } + break; + + case 74: +#line 264 "sketch.y" + { do_neg(&(yyval.exv), &(yyvsp[0].exv), line); } + break; + + case 75: +#line 265 "sketch.y" + { do_pwr(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); } + break; + + case 76: +#line 266 "sketch.y" + { (yyval.exv) = (yyvsp[-1].exv); } + break; + + case 77: +#line 267 "sketch.y" + { do_unit(&(yyval.exv), &(yyvsp[-1].exv), line); } + break; + + case 78: +#line 268 "sketch.y" + { do_sqrt(&(yyval.exv), &(yyvsp[-1].exv), line); } + break; + + case 79: +#line 269 "sketch.y" + { do_sin(&(yyval.exv), &(yyvsp[-1].exv), line); } + break; + + case 80: +#line 270 "sketch.y" + { do_cos(&(yyval.exv), &(yyvsp[-1].exv), line); } + break; + + case 81: +#line 271 "sketch.y" + { do_atan2(&(yyval.exv), &(yyvsp[-3].exv), &(yyvsp[-1].exv), line); } + break; + + case 82: +#line 272 "sketch.y" + { do_index(&(yyval.exv), &(yyvsp[-1].exv), (yyvsp[0].index), line); } + break; + + case 83: +#line 275 "sketch.y" + { (yyval.flt) = (yyvsp[0].flt); } + break; + + case 84: +#line 276 "sketch.y" + { look_up_scalar(sym_tab, &(yyval.flt), line, (yyvsp[0].name)); } + break; + + case 85: +#line 279 "sketch.y" + { coerce_to_float(&(yyvsp[0].exv), &(yyval.flt), line); } + break; + + case 86: +#line 283 "sketch.y" + { + (yyval.pt)[X] = (yyvsp[-5].flt); (yyval.pt)[Y] = (yyvsp[-3].flt); (yyval.pt)[Z] = (yyvsp[-1].flt); + } + break; + + case 87: +#line 287 "sketch.y" + { + (yyval.pt)[X] = (yyvsp[-3].flt); (yyval.pt)[Y] = (yyvsp[-1].flt); (yyval.pt)[Z] = 0; + } + break; + + case 88: +#line 290 "sketch.y" + { look_up_point(sym_tab, (yyval.pt), line, (yyvsp[0].name)); } + break; + + case 89: +#line 293 "sketch.y" + { coerce_to_point(&(yyvsp[0].exv), (yyval.pt), line); } + break; + + case 90: +#line 297 "sketch.y" + { + (yyval.vec)[X] = (yyvsp[-5].flt); (yyval.vec)[Y] = (yyvsp[-3].flt); (yyval.vec)[Z] = (yyvsp[-1].flt); + } + break; + + case 91: +#line 301 "sketch.y" + { + (yyval.vec)[X] = (yyvsp[-3].flt); (yyval.vec)[Y] = (yyvsp[-1].flt); (yyval.vec)[Z] = 0; + } + break; + + case 92: +#line 304 "sketch.y" + { look_up_vector(sym_tab, (yyval.vec), line, (yyvsp[0].name)); } + break; + + case 93: +#line 306 "sketch.y" + { coerce_to_vector(&(yyvsp[0].exv), (yyval.vec), line); } + break; + + case 94: +#line 315 "sketch.y" + { // transform is column major while elements are row major + (yyval.xf)[0] = (yyvsp[-35].flt); (yyval.xf)[4] = (yyvsp[-33].flt); (yyval.xf)[8] = (yyvsp[-31].flt); (yyval.xf)[12] = (yyvsp[-29].flt); + (yyval.xf)[1] = (yyvsp[-26].flt); (yyval.xf)[5] = (yyvsp[-24].flt); (yyval.xf)[9] = (yyvsp[-22].flt); (yyval.xf)[13] = (yyvsp[-20].flt); + (yyval.xf)[2] = (yyvsp[-17].flt); (yyval.xf)[6] = (yyvsp[-15].flt); (yyval.xf)[10] = (yyvsp[-13].flt); (yyval.xf)[14] = (yyvsp[-11].flt); + (yyval.xf)[3] = (yyvsp[-8].flt); (yyval.xf)[7] = (yyvsp[-6].flt); (yyval.xf)[11] = (yyvsp[-4].flt); (yyval.xf)[15] = (yyvsp[-2].flt); + } + break; + + case 95: +#line 322 "sketch.y" + { + set_angle_axis_rot_about_point((yyval.xf), (yyvsp[-1].flt) * (PI/180), 0, 0); + } + break; + + case 96: +#line 326 "sketch.y" + { + if (EXPR_TYPE_IS(&(yyvsp[-1].exv), E_POINT)) + set_angle_axis_rot_about_point((yyval.xf), (yyvsp[-3].flt) * (PI/180), (yyvsp[-1].exv).val.pt, 0); + else if (EXPR_TYPE_IS(&(yyvsp[-1].exv), E_VECTOR)) + set_angle_axis_rot_about_point((yyval.xf), (yyvsp[-3].flt) * (PI/180), 0, (yyvsp[-1].exv).val.vec); + else + err(line, "expected point or vector rotation parameter, and it's a %s", + expr_val_type_str[(yyvsp[-1].exv).tag]); + } + break; + + case 97: +#line 336 "sketch.y" + { + set_angle_axis_rot_about_point((yyval.xf), (yyvsp[-5].flt) * (PI/180), (yyvsp[-3].pt), (yyvsp[-1].vec)); + } + break; + + case 98: +#line 340 "sketch.y" + { + set_translation((yyval.xf), (yyvsp[-1].vec)[X], (yyvsp[-1].vec)[Y], (yyvsp[-1].vec)[Z]); + } + break; + + case 99: +#line 344 "sketch.y" + { + if ((yyvsp[-1].exv).tag == E_FLOAT) { + FLOAT s = (yyvsp[-1].exv).val.flt; + set_scale((yyval.xf), s, s, s); + } + else if ((yyvsp[-1].exv).tag == E_VECTOR) { + VECTOR v = (yyvsp[-1].exv).val.vec; + set_scale((yyval.xf), v[X], v[Y], v[Z]); + } + else { + err(line, + "expected scalar or vector scale parameter, and it's a %s", + expr_val_type_str[(yyvsp[-1].exv).tag]); + set_ident((yyval.xf)); + } + } + break; + + case 100: +#line 360 "sketch.y" + { set_parallel_projection((yyval.xf)); } + break; + + case 101: +#line 361 "sketch.y" + { set_perspective_projection((yyval.xf), (yyvsp[-1].flt)); } + break; + + case 102: +#line 362 "sketch.y" + { set_perspective_transform((yyval.xf), (yyvsp[-1].flt)); } + break; + + case 103: +#line 364 "sketch.y" + { + if ((yyvsp[-3].exv).tag == E_VECTOR) + set_view_transform((yyval.xf), (yyvsp[-5].pt), (yyvsp[-3].exv).val.vec, (yyvsp[-1].vec)); + else if ((yyvsp[-3].exv).tag == E_POINT) + set_view_transform_with_look_at((yyval.xf), (yyvsp[-5].pt), (yyvsp[-3].exv).val.pt, (yyvsp[-1].vec)); + else + err(line, "expected point or vector view parameter, and it's a %s", + expr_val_type_str[(yyvsp[-3].exv).tag]); + } + break; + + case 104: +#line 374 "sketch.y" + { + if ((yyvsp[-1].exv).tag == E_VECTOR) + set_view_transform((yyval.xf), (yyvsp[-3].pt), (yyvsp[-1].exv).val.vec, NULL); + else if ((yyvsp[-1].exv).tag == E_POINT) + set_view_transform_with_look_at((yyval.xf), (yyvsp[-3].pt), (yyvsp[-1].exv).val.pt, NULL); + else + err(line, "expected point or vector view parameter, and it's a %s", + expr_val_type_str[(yyvsp[-1].exv).tag]); + } + break; + + case 105: +#line 384 "sketch.y" + { + set_view_transform((yyval.xf), (yyvsp[-1].pt), NULL, NULL); + } + break; + + case 106: +#line 388 "sketch.y" + { do_inverse((yyval.xf), (yyvsp[-1].xf), line); } + break; + + case 107: +#line 389 "sketch.y" + { look_up_transform(sym_tab, (yyval.xf), line, (yyvsp[0].name)); } + break; + + case 108: +#line 392 "sketch.y" + { coerce_to_transform(&(yyvsp[0].exv), (yyval.xf), line); } + break; + + + default: break; + } + +/* Line 1126 of yacc.c. */ +#line 2109 "y.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + { + yyerror (YY_("syntax error")); + goto yyexhaustedlab; + } + } + else +#endif /* YYERROR_VERBOSE */ + yyerror (YY_("syntax error")); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (0) + goto yyerrorlab; + +yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK; + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} + + +#line 395 "sketch.y" + + +int parse(SYMBOL_TABLE *st) +{ + int ret; + + objects = NULL; + sym_tab = st; + ret = yyparse(); + + // should set sym_tab back to NULL + sym_tab = old_scope(sym_tab); + if (sym_tab) + die(no_line, "zombie symbol table"); + + return ret; +} + +OBJECT *parsed_objects(void) +{ + return objects; +} + |