initial setup of thesis repository
[cluster_expansion_thesis.git] / little_helpers / tikz / sketch-0.2.161 / y.tab.c
blob74ed6ffb89524658f985f3d1aad30f60f53d6607
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)
9 any later version.
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. */
37 #define YYBISON 1
39 /* Bison version. */
40 #define YYBISON_VERSION "2.1"
42 /* Skeleton name. */
43 #define YYSKELETON_NAME "yacc.c"
45 /* Pure parsers. */
46 #define YYPURE 0
48 /* Using locations. */
49 #define YYLSP_NEEDED 0
53 /* Tokens. */
54 #ifndef YYTOKENTYPE
55 # define YYTOKENTYPE
56 /* Put the tokens into the symbol table, so that GDB and other debuggers
57 know about them. */
58 enum yytokentype {
59 ID = 258,
60 PAREN_ID = 259,
61 BRACKET_ID = 260,
62 DBL_BRACKET_ID = 261,
63 CURLY_ID = 262,
64 ANGLE_ID = 263,
65 NUM = 264,
66 OPTS_STR = 265,
67 SPECIAL = 266,
68 TICK = 267,
69 THEN = 268,
70 DEF = 269,
71 EMPTY_ANGLE = 270,
72 DOTS = 271,
73 LINE = 272,
74 CURVE = 273,
75 POLYGON = 274,
76 REPEAT = 275,
77 SWEEP = 276,
78 PUT = 277,
79 TRANSLATE = 278,
80 ROTATE = 279,
81 SCALE = 280,
82 PROJECT = 281,
83 PERSPECTIVE = 282,
84 VIEW = 283,
85 SQRT = 284,
86 SIN = 285,
87 COS = 286,
88 ATAN2 = 287,
89 UNIT = 288,
90 INVERSE = 289,
91 GLOBAL = 290,
92 SET = 291,
93 PICTUREBOX = 292,
94 FRAME = 293,
95 CAMERA = 294,
96 LANGUAGE = 295,
97 PSTRICKS = 296,
98 TIKZ = 297,
99 LaTeX = 298,
100 ConTeXt = 299,
101 NEG = 300
103 #endif
104 /* Tokens. */
105 #define ID 258
106 #define PAREN_ID 259
107 #define BRACKET_ID 260
108 #define DBL_BRACKET_ID 261
109 #define CURLY_ID 262
110 #define ANGLE_ID 263
111 #define NUM 264
112 #define OPTS_STR 265
113 #define SPECIAL 266
114 #define TICK 267
115 #define THEN 268
116 #define DEF 269
117 #define EMPTY_ANGLE 270
118 #define DOTS 271
119 #define LINE 272
120 #define CURVE 273
121 #define POLYGON 274
122 #define REPEAT 275
123 #define SWEEP 276
124 #define PUT 277
125 #define TRANSLATE 278
126 #define ROTATE 279
127 #define SCALE 280
128 #define PROJECT 281
129 #define PERSPECTIVE 282
130 #define VIEW 283
131 #define SQRT 284
132 #define SIN 285
133 #define COS 286
134 #define ATAN2 287
135 #define UNIT 288
136 #define INVERSE 289
137 #define GLOBAL 290
138 #define SET 291
139 #define PICTUREBOX 292
140 #define FRAME 293
141 #define CAMERA 294
142 #define LANGUAGE 295
143 #define PSTRICKS 296
144 #define TIKZ 297
145 #define LaTeX 298
146 #define ConTeXt 299
147 #define NEG 300
152 /* Copy the first part of user declarations. */
153 #line 21 "sketch.y"
156 #include <stdio.h>
157 #include <stdlib.h>
159 #if defined(_WIN32)
160 #include <malloc.h>
161 #if !defined(alloca)
162 #define alloca _alloca
163 #endif
164 #define YYSTACK_USE_ALLOCA 1
165 // turn of warning about unused goto label in bison skeleton
166 #pragma warning(disable:4102)
167 #endif
169 #include "parse.h"
170 #include "expr.h"
171 #include "bsp.h"
172 #include "global.h"
174 int yylex(void);
176 void yyerror (char *s) /* Called by yyparse on error */
178 extern SRC_LINE line;
179 err(line, "%s", s);
182 static SYMBOL_TABLE *sym_tab;
183 static BSP_TREE bsp;
184 static FILE *yyout;
186 // exported parse tree and global environment
187 static OBJECT *objects;
191 /* Enabling traces. */
192 #ifndef YYDEBUG
193 # define YYDEBUG 1
194 #endif
196 /* Enabling verbose error messages. */
197 #ifdef YYERROR_VERBOSE
198 # undef YYERROR_VERBOSE
199 # define YYERROR_VERBOSE 1
200 #else
201 # define YYERROR_VERBOSE 0
202 #endif
204 /* Enabling the token table. */
205 #ifndef YYTOKEN_TABLE
206 # define YYTOKEN_TABLE 0
207 #endif
209 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
210 #line 58 "sketch.y"
211 typedef union YYSTYPE {
212 char *str;
213 FLOAT flt;
214 POINT_3D pt;
215 VECTOR_3D vec;
216 TRANSFORM xf;
217 EXPR_VAL exv;
218 SYMBOL_NAME name;
219 OBJECT *obj;
220 OPTS *opts;
221 int bool;
222 int index;
223 } YYSTYPE;
224 /* Line 196 of yacc.c. */
225 #line 226 "y.tab.c"
226 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
227 # define YYSTYPE_IS_DECLARED 1
228 # define YYSTYPE_IS_TRIVIAL 1
229 #endif
233 /* Copy the second part of user declarations. */
236 /* Line 219 of yacc.c. */
237 #line 238 "y.tab.c"
239 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
240 # define YYSIZE_T __SIZE_TYPE__
241 #endif
242 #if ! defined (YYSIZE_T) && defined (size_t)
243 # define YYSIZE_T size_t
244 #endif
245 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
246 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
247 # define YYSIZE_T size_t
248 #endif
249 #if ! defined (YYSIZE_T)
250 # define YYSIZE_T unsigned int
251 #endif
253 #ifndef YY_
254 # if YYENABLE_NLS
255 # if ENABLE_NLS
256 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
257 # define YY_(msgid) dgettext ("bison-runtime", msgid)
258 # endif
259 # endif
260 # ifndef YY_
261 # define YY_(msgid) msgid
262 # endif
263 #endif
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
271 # ifdef __GNUC__
272 # define YYSTACK_ALLOC __builtin_alloca
273 # else
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
278 # endif
279 # endif
280 # endif
281 # endif
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 */
292 # endif
293 # else
294 # define YYSTACK_ALLOC YYMALLOC
295 # define YYSTACK_FREE YYFREE
296 # ifndef YYSTACK_ALLOC_MAXIMUM
297 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
298 # endif
299 # ifdef __cplusplus
300 extern "C" {
301 # endif
302 # ifndef YYMALLOC
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 */
307 # endif
308 # endif
309 # ifndef YYFREE
310 # define YYFREE free
311 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
312 && (defined (__STDC__) || defined (__cplusplus)))
313 void free (void *); /* INFRINGES ON USER NAME SPACE */
314 # endif
315 # endif
316 # ifdef __cplusplus
318 # endif
319 # endif
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. */
328 union yyalloc
330 short int yyss;
331 YYSTYPE yyvs;
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
338 N elements. */
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
344 not overlap. */
345 # ifndef YYCOPY
346 # if defined (__GNUC__) && 1 < __GNUC__
347 # define YYCOPY(To, From, Count) \
348 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
349 # else
350 # define YYCOPY(To, From, Count) \
351 do \
353 YYSIZE_T yyi; \
354 for (yyi = 0; yyi < (Count); yyi++) \
355 (To)[yyi] = (From)[yyi]; \
357 while (0)
358 # endif
359 # endif
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
365 stack. */
366 # define YYSTACK_RELOCATE(Stack) \
367 do \
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); \
375 while (0)
377 #endif
379 #if defined (__STDC__) || defined (__cplusplus)
380 typedef signed char yysigned_char;
381 #else
382 typedef short int yysigned_char;
383 #endif
385 /* YYFINAL -- State number of the termination state. */
386 #define YYFINAL 32
387 /* YYLAST -- Last index in YYTABLE. */
388 #define YYLAST 589
390 /* YYNTOKENS -- Number of terminals. */
391 #define YYNTOKENS 60
392 /* YYNNTS -- Number of nonterminals. */
393 #define YYNNTS 35
394 /* YYNRULES -- Number of rules. */
395 #define YYNRULES 110
396 /* YYNRULES -- Number of states. */
397 #define YYNSTATES 254
399 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
400 #define YYUNDEFTOK 2
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,
442 #if YYDEBUG
443 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
444 YYRHS. */
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,
524 #endif
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
547 #endif
549 # ifdef YYPRINT
550 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
551 token YYLEX-NUM. */
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
561 # endif
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,
627 0, 0, 0, 96
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,
636 101, 73, 94, 74, 162
639 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
640 STATE-NUM. */
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,
669 84, 179, 188, -94
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,
841 56, 88, 55, 55
844 #define yyerrok (yyerrstatus = 0)
845 #define yyclearin (yychar = YYEMPTY)
846 #define YYEMPTY (-2)
847 #define YYEOF 0
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) \
863 do \
864 if (yychar == YYEMPTY && yylen == 1) \
866 yychar = (Token); \
867 yylval = (Value); \
868 yytoken = YYTRANSLATE (yychar); \
869 YYPOPSTACK; \
870 goto yybackup; \
872 else \
874 yyerror (YY_("syntax error: cannot back up")); \
875 YYERROR; \
877 while (0)
880 #define YYTERROR 1
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) \
891 do \
892 if (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; \
899 else \
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; \
906 while (0)
907 #endif
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)
920 # else
921 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
922 # endif
923 #endif
926 /* YYLEX -- calling `yylex' with the right arguments. */
928 #ifdef YYLEX_PARAM
929 # define YYLEX yylex (YYLEX_PARAM)
930 #else
931 # define YYLEX yylex ()
932 #endif
934 /* Enable debugging if requested. */
935 #if YYDEBUG
937 # ifndef YYFPRINTF
938 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
939 # define YYFPRINTF fprintf
940 # endif
942 # define YYDPRINTF(Args) \
943 do { \
944 if (yydebug) \
945 YYFPRINTF Args; \
946 } while (0)
948 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
949 do { \
950 if (yydebug) \
952 YYFPRINTF (stderr, "%s ", Title); \
953 yysymprint (stderr, \
954 Type, Value); \
955 YYFPRINTF (stderr, "\n"); \
957 } while (0)
959 /*------------------------------------------------------------------.
960 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
961 | TOP (included). |
962 `------------------------------------------------------------------*/
964 #if defined (__STDC__) || defined (__cplusplus)
965 static void
966 yy_stack_print (short int *bottom, short int *top)
967 #else
968 static void
969 yy_stack_print (bottom, top)
970 short int *bottom;
971 short int *top;
972 #endif
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) \
981 do { \
982 if (yydebug) \
983 yy_stack_print ((Bottom), (Top)); \
984 } while (0)
987 /*------------------------------------------------.
988 | Report that the YYRULE is going to be reduced. |
989 `------------------------------------------------*/
991 #if defined (__STDC__) || defined (__cplusplus)
992 static void
993 yy_reduce_print (int yyrule)
994 #else
995 static void
996 yy_reduce_print (yyrule)
997 int yyrule;
998 #endif
1000 int yyi;
1001 unsigned long int yylno = yyrline[yyrule];
1002 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
1003 yyrule - 1, yylno);
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) \
1011 do { \
1012 if (yydebug) \
1013 yy_reduce_print (Rule); \
1014 } while (0)
1016 /* Nonzero means print parse trace. It is left uninitialized so that
1017 multiple parsers can coexist. */
1018 int yydebug;
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. */
1028 #ifndef YYINITDEPTH
1029 # define YYINITDEPTH 200
1030 #endif
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. */
1039 #ifndef YYMAXDEPTH
1040 # define YYMAXDEPTH 10000
1041 #endif
1045 #if YYERROR_VERBOSE
1047 # ifndef yystrlen
1048 # if defined (__GLIBC__) && defined (_STRING_H)
1049 # define yystrlen strlen
1050 # else
1051 /* Return the length of YYSTR. */
1052 static YYSIZE_T
1053 # if defined (__STDC__) || defined (__cplusplus)
1054 yystrlen (const char *yystr)
1055 # else
1056 yystrlen (yystr)
1057 const char *yystr;
1058 # endif
1060 const char *yys = yystr;
1062 while (*yys++ != '\0')
1063 continue;
1065 return yys - yystr - 1;
1067 # endif
1068 # endif
1070 # ifndef yystpcpy
1071 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1072 # define yystpcpy stpcpy
1073 # else
1074 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1075 YYDEST. */
1076 static char *
1077 # if defined (__STDC__) || defined (__cplusplus)
1078 yystpcpy (char *yydest, const char *yysrc)
1079 # else
1080 yystpcpy (yydest, yysrc)
1081 char *yydest;
1082 const char *yysrc;
1083 # endif
1085 char *yyd = yydest;
1086 const char *yys = yysrc;
1088 while ((*yyd++ = *yys++) != '\0')
1089 continue;
1091 return yyd - 1;
1093 # endif
1094 # endif
1096 # ifndef yytnamerr
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
1103 would have been. */
1104 static YYSIZE_T
1105 yytnamerr (char *yyres, const char *yystr)
1107 if (*yystr == '"')
1109 size_t yyn = 0;
1110 char const *yyp = yystr;
1112 for (;;)
1113 switch (*++yyp)
1115 case '\'':
1116 case ',':
1117 goto do_not_strip_quotes;
1119 case '\\':
1120 if (*++yyp != '\\')
1121 goto do_not_strip_quotes;
1122 /* Fall through. */
1123 default:
1124 if (yyres)
1125 yyres[yyn] = *yyp;
1126 yyn++;
1127 break;
1129 case '"':
1130 if (yyres)
1131 yyres[yyn] = '\0';
1132 return yyn;
1134 do_not_strip_quotes: ;
1137 if (! yyres)
1138 return yystrlen (yystr);
1140 return yystpcpy (yyres, yystr) - yyres;
1142 # endif
1144 #endif /* YYERROR_VERBOSE */
1148 #if YYDEBUG
1149 /*--------------------------------.
1150 | Print this symbol on YYOUTPUT. |
1151 `--------------------------------*/
1153 #if defined (__STDC__) || defined (__cplusplus)
1154 static void
1155 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1156 #else
1157 static void
1158 yysymprint (yyoutput, yytype, yyvaluep)
1159 FILE *yyoutput;
1160 int yytype;
1161 YYSTYPE *yyvaluep;
1162 #endif
1164 /* Pacify ``unused variable'' warnings. */
1165 (void) yyvaluep;
1167 if (yytype < YYNTOKENS)
1168 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1169 else
1170 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1173 # ifdef YYPRINT
1174 if (yytype < YYNTOKENS)
1175 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1176 # endif
1177 switch (yytype)
1179 default:
1180 break;
1182 YYFPRINTF (yyoutput, ")");
1185 #endif /* ! YYDEBUG */
1186 /*-----------------------------------------------.
1187 | Release the memory associated to this symbol. |
1188 `-----------------------------------------------*/
1190 #if defined (__STDC__) || defined (__cplusplus)
1191 static void
1192 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1193 #else
1194 static void
1195 yydestruct (yymsg, yytype, yyvaluep)
1196 const char *yymsg;
1197 int yytype;
1198 YYSTYPE *yyvaluep;
1199 #endif
1201 /* Pacify ``unused variable'' warnings. */
1202 (void) yyvaluep;
1204 if (!yymsg)
1205 yymsg = "Deleting";
1206 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1208 switch (yytype)
1211 default:
1212 break;
1217 /* Prevent warnings from -Wmissing-prototypes. */
1219 #ifdef YYPARSE_PARAM
1220 # if defined (__STDC__) || defined (__cplusplus)
1221 int yyparse (void *YYPARSE_PARAM);
1222 # else
1223 int yyparse ();
1224 # endif
1225 #else /* ! YYPARSE_PARAM */
1226 #if defined (__STDC__) || defined (__cplusplus)
1227 int yyparse (void);
1228 #else
1229 int yyparse ();
1230 #endif
1231 #endif /* ! YYPARSE_PARAM */
1235 /* The look-ahead symbol. */
1236 int yychar;
1238 /* The semantic value of the look-ahead symbol. */
1239 YYSTYPE yylval;
1241 /* Number of syntax errors so far. */
1242 int yynerrs;
1246 /*----------.
1247 | yyparse. |
1248 `----------*/
1250 #ifdef YYPARSE_PARAM
1251 # if defined (__STDC__) || defined (__cplusplus)
1252 int yyparse (void *YYPARSE_PARAM)
1253 # else
1254 int yyparse (YYPARSE_PARAM)
1255 void *YYPARSE_PARAM;
1256 # endif
1257 #else /* ! YYPARSE_PARAM */
1258 #if defined (__STDC__) || defined (__cplusplus)
1260 yyparse (void)
1261 #else
1263 yyparse ()
1265 #endif
1266 #endif
1269 int yystate;
1270 int yyn;
1271 int yyresult;
1272 /* Number of tokens to shift before error messages enabled. */
1273 int yyerrstatus;
1274 /* Look-ahead token as an internal (translated) token number. */
1275 int yytoken = 0;
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;
1288 short int *yyssp;
1290 /* The semantic value stack. */
1291 YYSTYPE yyvsa[YYINITDEPTH];
1292 YYSTYPE *yyvs = yyvsa;
1293 YYSTYPE *yyvsp;
1297 #define YYPOPSTACK (yyvsp--, yyssp--)
1299 YYSIZE_T yystacksize = YYINITDEPTH;
1301 /* The variables used to return semantic value and location from the
1302 action routines. */
1303 YYSTYPE yyval;
1306 /* When reducing, the number of symbols on the RHS of the reduced
1307 rule. */
1308 int yylen;
1310 YYDPRINTF ((stderr, "Starting parse\n"));
1312 yystate = 0;
1313 yyerrstatus = 0;
1314 yynerrs = 0;
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. */
1322 yyssp = yyss;
1323 yyvsp = yyvs;
1325 goto yysetstate;
1327 /*------------------------------------------------------------.
1328 | yynewstate -- Push a new state, which is found in yystate. |
1329 `------------------------------------------------------------*/
1330 yynewstate:
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.
1334 yyssp++;
1336 yysetstate:
1337 *yyssp = yystate;
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;
1344 #ifdef yyoverflow
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
1348 memory. */
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),
1361 &yystacksize);
1363 yyss = yyss1;
1364 yyvs = yyvs1;
1366 #else /* no yyoverflow */
1367 # ifndef YYSTACK_RELOCATE
1368 goto yyexhaustedlab;
1369 # else
1370 /* Extend the stack our own way. */
1371 if (YYMAXDEPTH <= yystacksize)
1372 goto yyexhaustedlab;
1373 yystacksize *= 2;
1374 if (YYMAXDEPTH < yystacksize)
1375 yystacksize = YYMAXDEPTH;
1378 short int *yyss1 = yyss;
1379 union yyalloc *yyptr =
1380 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1381 if (! yyptr)
1382 goto yyexhaustedlab;
1383 YYSTACK_RELOCATE (yyss);
1384 YYSTACK_RELOCATE (yyvs);
1386 # undef YYSTACK_RELOCATE
1387 if (yyss1 != yyssa)
1388 YYSTACK_FREE (yyss1);
1390 # endif
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)
1401 YYABORT;
1404 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1406 goto yybackup;
1408 /*-----------.
1409 | yybackup. |
1410 `-----------*/
1411 yybackup:
1413 /* Do appropriate processing given the current state. */
1414 /* Read a look-ahead token if we need one and don't already have one. */
1415 /* yyresume: */
1417 /* First try to decide what to do without reference to look-ahead token. */
1419 yyn = yypact[yystate];
1420 if (yyn == YYPACT_NINF)
1421 goto yydefault;
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: "));
1429 yychar = YYLEX;
1432 if (yychar <= YYEOF)
1434 yychar = yytoken = YYEOF;
1435 YYDPRINTF ((stderr, "Now at end of input.\n"));
1437 else
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. */
1445 yyn += yytoken;
1446 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1447 goto yydefault;
1448 yyn = yytable[yyn];
1449 if (yyn <= 0)
1451 if (yyn == 0 || yyn == YYTABLE_NINF)
1452 goto yyerrlab;
1453 yyn = -yyn;
1454 goto yyreduce;
1457 if (yyn == YYFINAL)
1458 YYACCEPT;
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)
1465 yychar = YYEMPTY;
1467 *++yyvsp = yylval;
1470 /* Count tokens shifted since error; after three, turn off error
1471 status. */
1472 if (yyerrstatus)
1473 yyerrstatus--;
1475 yystate = yyn;
1476 goto yynewstate;
1479 /*-----------------------------------------------------------.
1480 | yydefault -- do the default action for the current state. |
1481 `-----------------------------------------------------------*/
1482 yydefault:
1483 yyn = yydefact[yystate];
1484 if (yyn == 0)
1485 goto yyerrlab;
1486 goto yyreduce;
1489 /*-----------------------------.
1490 | yyreduce -- Do a reduction. |
1491 `-----------------------------*/
1492 yyreduce:
1493 /* yyn is the number of a rule to reduce with. */
1494 yylen = yyr2[yyn];
1496 /* If YYLEN is nonzero, implement the default value of the action:
1497 `$$ = $1'.
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);
1508 switch (yyn)
1510 case 2:
1511 #line 105 "sketch.y"
1512 { objects = (yyvsp[-1].obj); }
1513 break;
1515 case 7:
1516 #line 117 "sketch.y"
1518 set_global_env_opts(global_env, (yyvsp[0].str), line);
1520 break;
1522 case 8:
1523 #line 121 "sketch.y"
1525 set_global_baseline(global_env, (yyvsp[-1].flt), line);
1527 break;
1529 case 9:
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);
1535 break;
1537 case 10:
1538 #line 130 "sketch.y"
1540 set_global_env_camera(global_env, (yyvsp[0].xf), line);
1542 break;
1544 case 11:
1545 #line 134 "sketch.y"
1547 set_global_env_frame(global_env, NULL, line);
1549 break;
1551 case 12:
1552 #line 138 "sketch.y"
1554 set_global_env_frame(global_env, (yyvsp[0].str), line);
1556 break;
1558 case 13:
1559 #line 142 "sketch.y"
1561 set_global_output_language(global_env, (yyvsp[0].index), line);
1563 break;
1565 case 15:
1566 #line 148 "sketch.y"
1567 { (yyval.index) = (yyvsp[-1].index) | (yyvsp[0].index); }
1568 break;
1570 case 16:
1571 #line 151 "sketch.y"
1572 { (yyval.index) = GEOL_PSTRICKS; }
1573 break;
1575 case 17:
1576 #line 152 "sketch.y"
1577 { (yyval.index) = GEOL_TIKZ; }
1578 break;
1580 case 18:
1581 #line 155 "sketch.y"
1582 { (yyval.index) = (yyvsp[0].index); }
1583 break;
1585 case 19:
1586 #line 156 "sketch.y"
1587 { (yyval.index) = GEOL_LATEX; }
1588 break;
1590 case 20:
1591 #line 159 "sketch.y"
1592 { (yyval.index) = GEOL_LATEX; }
1593 break;
1595 case 21:
1596 #line 160 "sketch.y"
1597 { (yyval.index) = GEOL_CONTEXT; }
1598 break;
1600 case 22:
1601 #line 163 "sketch.y"
1602 { (yyval.flt) = (yyvsp[-1].flt); }
1603 break;
1605 case 23:
1606 #line 164 "sketch.y"
1607 { (yyval.flt) = NO_BASELINE; }
1608 break;
1610 case 24:
1611 #line 167 "sketch.y"
1612 { (yyval.obj) = sibling_reverse((yyvsp[0].obj)); }
1613 break;
1615 case 25:
1616 #line 170 "sketch.y"
1617 { (yyval.obj) = cat_objects((yyvsp[0].obj), (yyvsp[-1].obj)); }
1618 break;
1620 case 26:
1621 #line 171 "sketch.y"
1622 { (yyval.obj) = (yyvsp[0].obj); }
1623 break;
1625 case 27:
1626 #line 174 "sketch.y"
1627 { (yyval.obj) = NULL; }
1628 break;
1630 case 28:
1631 #line 175 "sketch.y"
1632 { (yyval.obj) = (yyvsp[0].obj); }
1633 break;
1635 case 29:
1636 #line 179 "sketch.y"
1637 { new_symbol(sym_tab, (yyvsp[-1].name), 0, (yyvsp[0].obj), line); }
1638 break;
1640 case 30:
1641 #line 180 "sketch.y"
1642 { new_symbol(sym_tab, (yyvsp[-2].name), 0, (yyvsp[0].obj), line); }
1643 break;
1645 case 31:
1646 #line 181 "sketch.y"
1647 { new_symbol(sym_tab, (yyvsp[-1].name), 0, new_tag_def(), line); }
1648 break;
1650 case 32:
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)); }
1653 break;
1655 case 33:
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)); }
1658 break;
1660 case 34:
1661 #line 188 "sketch.y"
1662 { (yyval.obj) = object_from_expr(&(yyvsp[0].exv)); }
1663 break;
1665 case 35:
1666 #line 189 "sketch.y"
1667 { (yyval.obj) = (yyvsp[0].obj); }
1668 break;
1670 case 36:
1671 #line 190 "sketch.y"
1672 { (yyval.obj) = new_opts_def((yyvsp[0].str), line); }
1673 break;
1675 case 37:
1676 #line 193 "sketch.y"
1677 { (yyval.obj) = new_dots((yyvsp[-1].opts), (yyvsp[0].obj)); }
1678 break;
1680 case 38:
1681 #line 194 "sketch.y"
1682 { (yyval.obj) = new_line((yyvsp[-1].opts), (yyvsp[0].obj)); }
1683 break;
1685 case 39:
1686 #line 195 "sketch.y"
1687 { (yyval.obj) = new_curve((yyvsp[-1].opts), (yyvsp[0].obj)); }
1688 break;
1690 case 40:
1691 #line 196 "sketch.y"
1692 { (yyval.obj) = new_polygon((yyvsp[-1].opts), (yyvsp[0].obj)); }
1693 break;
1695 case 41:
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)));
1700 break;
1702 case 42:
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));
1707 break;
1709 case 43:
1710 #line 206 "sketch.y"
1712 (yyval.obj) = new_repeat((yyvsp[-4].flt), (yyvsp[-2].obj), (yyvsp[0].obj));
1714 break;
1716 case 44:
1717 #line 209 "sketch.y"
1718 { (yyval.obj) = new_compound((yyvsp[-2].xf), (yyvsp[0].obj)); }
1719 break;
1721 case 45:
1722 #line 210 "sketch.y"
1723 { (yyval.obj) = new_special((yyvsp[-2].str), (yyvsp[-1].opts), (yyvsp[0].obj), line); }
1724 break;
1726 case 46:
1727 #line 211 "sketch.y"
1728 { (yyval.obj) = new_special((yyvsp[-1].str), (yyvsp[0].opts), new_point_def(origin_3d), line); }
1729 break;
1731 case 47:
1732 #line 212 "sketch.y"
1733 { look_up_drawable(sym_tab, &(yyval.obj), line, (yyvsp[0].name)); }
1734 break;
1736 case 48:
1737 #line 213 "sketch.y"
1738 { sym_tab = new_scope(sym_tab); }
1739 break;
1741 case 49:
1742 #line 214 "sketch.y"
1743 { sym_tab = old_scope(sym_tab); }
1744 break;
1746 case 50:
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);
1753 break;
1755 case 51:
1756 #line 223 "sketch.y"
1757 { (yyval.bool) = 1; }
1758 break;
1760 case 52:
1761 #line 224 "sketch.y"
1762 { (yyval.bool) = 0; }
1763 break;
1765 case 53:
1766 #line 228 "sketch.y"
1768 (yyval.opts) = look_up_and_append_to_opts(sym_tab, &(yyvsp[-2].opts), line, (yyvsp[0].name));
1770 break;
1772 case 54:
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));
1778 break;
1780 case 55:
1781 #line 238 "sketch.y"
1782 { (yyval.opts) = new_opts((yyvsp[0].str), line); }
1783 break;
1785 case 56:
1786 #line 239 "sketch.y"
1787 { look_up_opts(sym_tab, &(yyval.opts), line, (yyvsp[0].name)); }
1788 break;
1790 case 57:
1791 #line 240 "sketch.y"
1792 { (yyval.opts) = (yyvsp[-1].opts); }
1793 break;
1795 case 58:
1796 #line 241 "sketch.y"
1797 { (yyval.opts) = NULL; }
1798 break;
1800 case 59:
1801 #line 244 "sketch.y"
1802 { (yyval.obj) = sibling_reverse((yyvsp[0].obj)); }
1803 break;
1805 case 60:
1806 #line 247 "sketch.y"
1807 { (yyval.obj) = cat_objects(new_point_def((yyvsp[0].pt)), (yyvsp[-1].obj)); }
1808 break;
1810 case 61:
1811 #line 248 "sketch.y"
1812 { (yyval.obj) = new_point_def((yyvsp[0].pt)); }
1813 break;
1815 case 62:
1816 #line 251 "sketch.y"
1817 { (yyval.obj) = sibling_reverse((yyvsp[0].obj)); }
1818 break;
1820 case 63:
1821 #line 254 "sketch.y"
1822 { (yyval.obj) = cat_objects(new_transform_def((yyvsp[0].xf)), (yyvsp[-2].obj)); }
1823 break;
1825 case 64:
1826 #line 255 "sketch.y"
1827 { (yyval.obj) = new_transform_def((yyvsp[0].xf)); }
1828 break;
1830 case 65:
1831 #line 258 "sketch.y"
1832 { set_float(&(yyval.exv), (yyvsp[0].flt)); }
1833 break;
1835 case 66:
1836 #line 259 "sketch.y"
1837 { set_point(&(yyval.exv), (yyvsp[0].pt)); }
1838 break;
1840 case 67:
1841 #line 260 "sketch.y"
1842 { set_vector(&(yyval.exv), (yyvsp[0].vec)); }
1843 break;
1845 case 68:
1846 #line 261 "sketch.y"
1847 { set_transform(&(yyval.exv), (yyvsp[0].xf)); }
1848 break;
1850 case 69:
1851 #line 262 "sketch.y"
1852 { do_add(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1853 break;
1855 case 70:
1856 #line 263 "sketch.y"
1857 { do_sub(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1858 break;
1860 case 71:
1861 #line 264 "sketch.y"
1862 { do_mul(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1863 break;
1865 case 72:
1866 #line 265 "sketch.y"
1867 { do_dvd(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1868 break;
1870 case 73:
1871 #line 266 "sketch.y"
1872 { do_dot(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1873 break;
1875 case 74:
1876 #line 267 "sketch.y"
1877 { do_thn(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1878 break;
1880 case 75:
1881 #line 268 "sketch.y"
1882 { do_mag(&(yyval.exv), &(yyvsp[-1].exv), line); }
1883 break;
1885 case 76:
1886 #line 269 "sketch.y"
1887 { do_neg(&(yyval.exv), &(yyvsp[0].exv), line); }
1888 break;
1890 case 77:
1891 #line 270 "sketch.y"
1892 { do_pwr(&(yyval.exv), &(yyvsp[-2].exv), &(yyvsp[0].exv), line); }
1893 break;
1895 case 78:
1896 #line 271 "sketch.y"
1897 { (yyval.exv) = (yyvsp[-1].exv); }
1898 break;
1900 case 79:
1901 #line 272 "sketch.y"
1902 { do_unit(&(yyval.exv), &(yyvsp[-1].exv), line); }
1903 break;
1905 case 80:
1906 #line 273 "sketch.y"
1907 { do_sqrt(&(yyval.exv), &(yyvsp[-1].exv), line); }
1908 break;
1910 case 81:
1911 #line 274 "sketch.y"
1912 { do_sin(&(yyval.exv), &(yyvsp[-1].exv), line); }
1913 break;
1915 case 82:
1916 #line 275 "sketch.y"
1917 { do_cos(&(yyval.exv), &(yyvsp[-1].exv), line); }
1918 break;
1920 case 83:
1921 #line 276 "sketch.y"
1922 { do_atan2(&(yyval.exv), &(yyvsp[-3].exv), &(yyvsp[-1].exv), line); }
1923 break;
1925 case 84:
1926 #line 277 "sketch.y"
1927 { do_index(&(yyval.exv), &(yyvsp[-1].exv), (yyvsp[0].index), line); }
1928 break;
1930 case 85:
1931 #line 280 "sketch.y"
1932 { (yyval.flt) = (yyvsp[0].flt); }
1933 break;
1935 case 86:
1936 #line 281 "sketch.y"
1937 { look_up_scalar(sym_tab, &(yyval.flt), line, (yyvsp[0].name)); }
1938 break;
1940 case 87:
1941 #line 284 "sketch.y"
1942 { coerce_to_float(&(yyvsp[0].exv), &(yyval.flt), line); }
1943 break;
1945 case 88:
1946 #line 288 "sketch.y"
1948 (yyval.pt)[X] = (yyvsp[-5].flt); (yyval.pt)[Y] = (yyvsp[-3].flt); (yyval.pt)[Z] = (yyvsp[-1].flt);
1950 break;
1952 case 89:
1953 #line 292 "sketch.y"
1955 (yyval.pt)[X] = (yyvsp[-3].flt); (yyval.pt)[Y] = (yyvsp[-1].flt); (yyval.pt)[Z] = 0;
1957 break;
1959 case 90:
1960 #line 295 "sketch.y"
1961 { look_up_point(sym_tab, (yyval.pt), line, (yyvsp[0].name)); }
1962 break;
1964 case 91:
1965 #line 298 "sketch.y"
1966 { coerce_to_point(&(yyvsp[0].exv), (yyval.pt), line); }
1967 break;
1969 case 92:
1970 #line 302 "sketch.y"
1972 (yyval.vec)[X] = (yyvsp[-5].flt); (yyval.vec)[Y] = (yyvsp[-3].flt); (yyval.vec)[Z] = (yyvsp[-1].flt);
1974 break;
1976 case 93:
1977 #line 306 "sketch.y"
1979 (yyval.vec)[X] = (yyvsp[-3].flt); (yyval.vec)[Y] = (yyvsp[-1].flt); (yyval.vec)[Z] = 0;
1981 break;
1983 case 94:
1984 #line 309 "sketch.y"
1985 { look_up_vector(sym_tab, (yyval.vec), line, (yyvsp[0].name)); }
1986 break;
1988 case 95:
1989 #line 311 "sketch.y"
1990 { coerce_to_vector(&(yyvsp[0].exv), (yyval.vec), line); }
1991 break;
1993 case 96:
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);
2001 break;
2003 case 97:
2004 #line 327 "sketch.y"
2006 set_angle_axis_rot_about_point((yyval.xf), (yyvsp[-1].flt) * (PI/180), 0, 0);
2008 break;
2010 case 98:
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);
2017 else
2018 err(line, "expected point or vector rotation parameter, and it's a %s",
2019 expr_val_type_str[(yyvsp[-1].exv).tag]);
2021 break;
2023 case 99:
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));
2028 break;
2030 case 100:
2031 #line 345 "sketch.y"
2033 set_translation((yyval.xf), (yyvsp[-1].vec)[X], (yyvsp[-1].vec)[Y], (yyvsp[-1].vec)[Z]);
2035 break;
2037 case 101:
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]);
2048 else {
2049 err(line,
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));
2055 break;
2057 case 102:
2058 #line 365 "sketch.y"
2059 { set_parallel_projection((yyval.xf)); }
2060 break;
2062 case 103:
2063 #line 366 "sketch.y"
2064 { set_perspective_projection((yyval.xf), (yyvsp[-1].flt)); }
2065 break;
2067 case 104:
2068 #line 367 "sketch.y"
2069 { set_perspective_transform((yyval.xf), (yyvsp[-1].flt)); }
2070 break;
2072 case 105:
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));
2079 else
2080 err(line, "expected point or vector view parameter, and it's a %s",
2081 expr_val_type_str[(yyvsp[-3].exv).tag]);
2083 break;
2085 case 106:
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);
2092 else
2093 err(line, "expected point or vector view parameter, and it's a %s",
2094 expr_val_type_str[(yyvsp[-1].exv).tag]);
2096 break;
2098 case 107:
2099 #line 389 "sketch.y"
2101 set_view_transform((yyval.xf), (yyvsp[-1].pt), NULL, NULL);
2103 break;
2105 case 108:
2106 #line 393 "sketch.y"
2107 { do_inverse((yyval.xf), (yyvsp[-1].xf), line); }
2108 break;
2110 case 109:
2111 #line 394 "sketch.y"
2112 { look_up_transform(sym_tab, (yyval.xf), line, (yyvsp[0].name)); }
2113 break;
2115 case 110:
2116 #line 397 "sketch.y"
2117 { coerce_to_transform(&(yyvsp[0].exv), (yyval.xf), line); }
2118 break;
2121 default: break;
2124 /* Line 1126 of yacc.c. */
2125 #line 2126 "y.tab.c"
2127 yyvsp -= yylen;
2128 yyssp -= yylen;
2131 YY_STACK_PRINT (yyss, yyssp);
2133 *++yyvsp = yyval;
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. */
2140 yyn = yyr1[yyn];
2142 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2143 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2144 yystate = yytable[yystate];
2145 else
2146 yystate = yydefgoto[yyn - YYNTOKENS];
2148 goto yynewstate;
2151 /*------------------------------------.
2152 | yyerrlab -- here on detecting error |
2153 `------------------------------------*/
2154 yyerrlab:
2155 /* If not already recovering from an error, report this error. */
2156 if (!yyerrstatus)
2158 ++yynerrs;
2159 #if YYERROR_VERBOSE
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;
2167 YYSIZE_T yysize1;
2168 int yysize_overflow = 0;
2169 char *yymsg = 0;
2170 # define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2171 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2172 int yyx;
2174 #if 0
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");
2182 #endif
2183 char *yyfmt;
2184 char const *yyf;
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
2195 YYCHECK. */
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;
2201 int yycount = 1;
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)
2211 yycount = 1;
2212 yysize = yysize0;
2213 yyformat[sizeof yyunexpected - 1] = '\0';
2214 break;
2216 yyarg[yycount++] = yytname[yyx];
2217 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2218 yysize_overflow |= yysize1 < yysize;
2219 yysize = yysize1;
2220 yyfmt = yystpcpy (yyfmt, yyprefix);
2221 yyprefix = yyor;
2224 yyf = YY_(yyformat);
2225 yysize1 = yysize + yystrlen (yyf);
2226 yysize_overflow |= yysize1 < yysize;
2227 yysize = yysize1;
2229 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
2230 yymsg = (char *) YYSTACK_ALLOC (yysize);
2231 if (yymsg)
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. */
2236 char *yyp = yymsg;
2237 int yyi = 0;
2238 while ((*yyp = *yyf))
2240 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2242 yyp += yytnamerr (yyp, yyarg[yyi++]);
2243 yyf += 2;
2245 else
2247 yyp++;
2248 yyf++;
2251 yyerror (yymsg);
2252 YYSTACK_FREE (yymsg);
2254 else
2256 yyerror (YY_("syntax error"));
2257 goto yyexhaustedlab;
2260 else
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)
2276 YYABORT;
2278 else
2280 yydestruct ("Error: discarding", yytoken, &yylval);
2281 yychar = YYEMPTY;
2285 /* Else will try to reuse look-ahead token after shifting the error
2286 token. */
2287 goto yyerrlab1;
2290 /*---------------------------------------------------.
2291 | yyerrorlab -- error raised explicitly by YYERROR. |
2292 `---------------------------------------------------*/
2293 yyerrorlab:
2295 /* Pacify compilers like GCC when the user code never invokes
2296 YYERROR and the label yyerrorlab therefore never appears in user
2297 code. */
2298 if (0)
2299 goto yyerrorlab;
2301 yyvsp -= yylen;
2302 yyssp -= yylen;
2303 yystate = *yyssp;
2304 goto yyerrlab1;
2307 /*-------------------------------------------------------------.
2308 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2309 `-------------------------------------------------------------*/
2310 yyerrlab1:
2311 yyerrstatus = 3; /* Each real token shifted decrements this. */
2313 for (;;)
2315 yyn = yypact[yystate];
2316 if (yyn != YYPACT_NINF)
2318 yyn += YYTERROR;
2319 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2321 yyn = yytable[yyn];
2322 if (0 < yyn)
2323 break;
2327 /* Pop the current state because it cannot handle the error token. */
2328 if (yyssp == yyss)
2329 YYABORT;
2332 yydestruct ("Error: popping", yystos[yystate], yyvsp);
2333 YYPOPSTACK;
2334 yystate = *yyssp;
2335 YY_STACK_PRINT (yyss, yyssp);
2338 if (yyn == YYFINAL)
2339 YYACCEPT;
2341 *++yyvsp = yylval;
2344 /* Shift the error token. */
2345 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2347 yystate = yyn;
2348 goto yynewstate;
2351 /*-------------------------------------.
2352 | yyacceptlab -- YYACCEPT comes here. |
2353 `-------------------------------------*/
2354 yyacceptlab:
2355 yyresult = 0;
2356 goto yyreturn;
2358 /*-----------------------------------.
2359 | yyabortlab -- YYABORT comes here. |
2360 `-----------------------------------*/
2361 yyabortlab:
2362 yyresult = 1;
2363 goto yyreturn;
2365 #ifndef yyoverflow
2366 /*-------------------------------------------------.
2367 | yyexhaustedlab -- memory exhaustion comes here. |
2368 `-------------------------------------------------*/
2369 yyexhaustedlab:
2370 yyerror (YY_("memory exhausted"));
2371 yyresult = 2;
2372 /* Fall through. */
2373 #endif
2375 yyreturn:
2376 if (yychar != YYEOF && yychar != YYEMPTY)
2377 yydestruct ("Cleanup: discarding lookahead",
2378 yytoken, &yylval);
2379 while (yyssp != yyss)
2381 yydestruct ("Cleanup: popping",
2382 yystos[*yyssp], yyvsp);
2383 YYPOPSTACK;
2385 #ifndef yyoverflow
2386 if (yyss != yyssa)
2387 YYSTACK_FREE (yyss);
2388 #endif
2389 return yyresult;
2393 #line 400 "sketch.y"
2396 int parse(SYMBOL_TABLE *st)
2398 int ret;
2400 objects = NULL;
2401 sym_tab = st;
2402 ret = yyparse();
2404 // should set sym_tab back to NULL
2405 sym_tab = old_scope(sym_tab);
2406 if (sym_tab)
2407 die(no_line, "zombie symbol table");
2409 return ret;
2412 OBJECT *parsed_objects(void)
2414 return objects;