1 /* A Bison parser, made by GNU Bison 2.3. */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
22
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
32
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
35
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
38
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
45
46 /* Identify Bison output. */
47 #define YYBISON 1
48
49 /* Bison version. */
50 #define YYBISON_VERSION "2.3"
51
52 /* Skeleton name. */
53 #define YYSKELETON_NAME "yacc.c"
54
55 /* Pure parsers. */
56 #define YYPURE 0
57
58 /* Using locations. */
59 #define YYLSP_NEEDED 1
60
61
62
63 /* Tokens. */
64 #ifndef YYTOKENTYPE
65 # define YYTOKENTYPE
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
67 know about them. */
68 enum yytokentype {
69 STRING = 258,
70 VALUE = 259,
71 IDENTIFIER = 260,
72 OBJECT = 261,
73 UNIT_ANGLE = 262,
74 UNIT_COLOR = 263,
75 UNIT_RATIO = 264,
76 UNIT_SIZE = 265,
77 UNIT_SPEED = 266,
78 UNIT_TIME = 267,
79 FOR = 268,
80 IF = 269,
81 ACTION_SCRIPT = 270,
82 ELSE = 271,
83 RANGE = 272,
84 LOGICAL_OR = 273,
85 LOGICAL_XOR = 274,
86 LOGICAL_AND = 275,
87 GREATER_EQUAL = 276,
88 LESS_EQUAL = 277,
89 NOT_EQUAL = 278,
90 EQUAL = 279,
91 ROTATE_RIGHT = 280,
92 ROTATE_LEFT = 281,
93 SHIFT_RIGHT_UNSIGNED = 282,
94 SHIFT_RIGHT = 283,
95 SHIFT_LEFT = 284,
96 MAX_OP = 285,
97 MIN_OP = 286,
98 POWER = 287,
99 NEG = 288,
100 POS = 289
101 };
102 #endif
103 /* Tokens. */
104 #define STRING 258
105 #define VALUE 259
106 #define IDENTIFIER 260
107 #define OBJECT 261
108 #define UNIT_ANGLE 262
109 #define UNIT_COLOR 263
110 #define UNIT_RATIO 264
111 #define UNIT_SIZE 265
112 #define UNIT_SPEED 266
113 #define UNIT_TIME 267
114 #define FOR 268
115 #define IF 269
116 #define ACTION_SCRIPT 270
117 #define ELSE 271
118 #define RANGE 272
119 #define LOGICAL_OR 273
120 #define LOGICAL_XOR 274
121 #define LOGICAL_AND 275
122 #define GREATER_EQUAL 276
123 #define LESS_EQUAL 277
124 #define NOT_EQUAL 278
125 #define EQUAL 279
126 #define ROTATE_RIGHT 280
127 #define ROTATE_LEFT 281
128 #define SHIFT_RIGHT_UNSIGNED 282
129 #define SHIFT_RIGHT 283
130 #define SHIFT_LEFT 284
131 #define MAX_OP 285
132 #define MIN_OP 286
133 #define POWER 287
134 #define NEG 288
135 #define POS 289
136
137
138
139
140 /* Copy the first part of user declarations. */
141 #line 1 "src/sswf/sswf_grammar.y"
142 /* sswf_grammar.y -- written by Alexis WILKE for Made to Order Software Corp. (c) 2002-2009 */
143 /* grammar parser for the SWF scripting tool */
144
145 /*
146
147 Copyright (c) 2002-2009 Made to Order Software Corp.
148
149 Permission is hereby granted, free of charge, to any
150 person obtaining a copy of this software and
151 associated documentation files (the "Software"), to
152 deal in the Software without restriction, including
153 without limitation the rights to use, copy, modify,
154 merge, publish, distribute, sublicense, and/or sell
155 copies of the Software, and to permit persons to whom
156 the Software is furnished to do so, subject to the
157 following conditions:
158
159 The above copyright notice and this permission notice
160 shall be included in all copies or substantial
161 portions of the Software.
162
163 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
164 ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
165 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
166 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
167 EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
168 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
169 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
170 ARISING FROM, OUT OF OR IN CONNECTION WITH THE
171 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
172 SOFTWARE.
173
174 */
175
176
177 #include "sswf.h"
178
179 #define YYPARSE_PARAM result
180 static void yyerror(const char *msg);
181
182
183
184
185
186 /* Enabling traces. */
187 #ifndef YYDEBUG
188 # define YYDEBUG 1
189 #endif
190
191 /* Enabling verbose error messages. */
192 #ifdef YYERROR_VERBOSE
193 # undef YYERROR_VERBOSE
194 # define YYERROR_VERBOSE 1
195 #else
196 # define YYERROR_VERBOSE 0
197 #endif
198
199 /* Enabling the token table. */
200 #ifndef YYTOKEN_TABLE
201 # define YYTOKEN_TABLE 0
202 #endif
203
204 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
205 typedef union YYSTYPE
206 #line 48 "src/sswf/sswf_grammar.y"
207 {
208 struct node_t *node;
209 enum node_type_t type; /* for UNIT */
210 int unused;
211 }
212 /* Line 187 of yacc.c. */
213 #line 214 "tmp/object/src/sswf/sswf_grammar.c"
214 YYSTYPE;
215 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
216 # define YYSTYPE_IS_DECLARED 1
217 # define YYSTYPE_IS_TRIVIAL 1
218 #endif
219
220 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
221 typedef struct YYLTYPE
222 {
223 int first_line;
224 int first_column;
225 int last_line;
226 int last_column;
227 } YYLTYPE;
228 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
229 # define YYLTYPE_IS_DECLARED 1
230 # define YYLTYPE_IS_TRIVIAL 1
231 #endif
232
233
234 /* Copy the second part of user declarations. */
235
236
237 /* Line 216 of yacc.c. */
238 #line 239 "tmp/object/src/sswf/sswf_grammar.c"
239
240 #ifdef short
241 # undef short
242 #endif
243
244 #ifdef YYTYPE_UINT8
245 typedef YYTYPE_UINT8 yytype_uint8;
246 #else
247 typedef unsigned char yytype_uint8;
248 #endif
249
250 #ifdef YYTYPE_INT8
251 typedef YYTYPE_INT8 yytype_int8;
252 #elif (defined __STDC__ || defined __C99__FUNC__ \
253 || defined __cplusplus || defined _MSC_VER)
254 typedef signed char yytype_int8;
255 #else
256 typedef short int yytype_int8;
257 #endif
258
259 #ifdef YYTYPE_UINT16
260 typedef YYTYPE_UINT16 yytype_uint16;
261 #else
262 typedef unsigned short int yytype_uint16;
263 #endif
264
265 #ifdef YYTYPE_INT16
266 typedef YYTYPE_INT16 yytype_int16;
267 #else
268 typedef short int yytype_int16;
269 #endif
270
271 #ifndef YYSIZE_T
272 # ifdef __SIZE_TYPE__
273 # define YYSIZE_T __SIZE_TYPE__
274 # elif defined size_t
275 # define YYSIZE_T size_t
276 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
277 || defined __cplusplus || defined _MSC_VER)
278 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
279 # define YYSIZE_T size_t
280 # else
281 # define YYSIZE_T unsigned int
282 # endif
283 #endif
284
285 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
286
287 #ifndef YY_
288 # if YYENABLE_NLS
289 # if ENABLE_NLS
290 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
291 # define YY_(msgid) dgettext ("bison-runtime", msgid)
292 # endif
293 # endif
294 # ifndef YY_
295 # define YY_(msgid) msgid
296 # endif
297 #endif
298
299 /* Suppress unused-variable warnings by "using" E. */
300 #if ! defined lint || defined __GNUC__
301 # define YYUSE(e) ((void) (e))
302 #else
303 # define YYUSE(e) /* empty */
304 #endif
305
306 /* Identity function, used to suppress warnings about constant conditions. */
307 #ifndef lint
308 # define YYID(n) (n)
309 #else
310 #if (defined __STDC__ || defined __C99__FUNC__ \
311 || defined __cplusplus || defined _MSC_VER)
312 static int
YYID(int i)313 YYID (int i)
314 #else
315 static int
316 YYID (i)
317 int i;
318 #endif
319 {
320 return i;
321 }
322 #endif
323
324 #if ! defined yyoverflow || YYERROR_VERBOSE
325
326 /* The parser invokes alloca or malloc; define the necessary symbols. */
327
328 # ifdef YYSTACK_USE_ALLOCA
329 # if YYSTACK_USE_ALLOCA
330 # ifdef __GNUC__
331 # define YYSTACK_ALLOC __builtin_alloca
332 # elif defined __BUILTIN_VA_ARG_INCR
333 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
334 # elif defined _AIX
335 # define YYSTACK_ALLOC __alloca
336 # elif defined _MSC_VER
337 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
338 # define alloca _alloca
339 # else
340 # define YYSTACK_ALLOC alloca
341 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
342 || defined __cplusplus || defined _MSC_VER)
343 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
344 # ifndef _STDLIB_H
345 # define _STDLIB_H 1
346 # endif
347 # endif
348 # endif
349 # endif
350 # endif
351
352 # ifdef YYSTACK_ALLOC
353 /* Pacify GCC's `empty if-body' warning. */
354 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
355 # ifndef YYSTACK_ALLOC_MAXIMUM
356 /* The OS might guarantee only one guard page at the bottom of the stack,
357 and a page size can be as small as 4096 bytes. So we cannot safely
358 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
359 to allow for a few compiler-allocated temporary stack slots. */
360 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
361 # endif
362 # else
363 # define YYSTACK_ALLOC YYMALLOC
364 # define YYSTACK_FREE YYFREE
365 # ifndef YYSTACK_ALLOC_MAXIMUM
366 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
367 # endif
368 # if (defined __cplusplus && ! defined _STDLIB_H \
369 && ! ((defined YYMALLOC || defined malloc) \
370 && (defined YYFREE || defined free)))
371 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
372 # ifndef _STDLIB_H
373 # define _STDLIB_H 1
374 # endif
375 # endif
376 # ifndef YYMALLOC
377 # define YYMALLOC malloc
378 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
379 || defined __cplusplus || defined _MSC_VER)
380 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
381 # endif
382 # endif
383 # ifndef YYFREE
384 # define YYFREE free
385 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
386 || defined __cplusplus || defined _MSC_VER)
387 void free (void *); /* INFRINGES ON USER NAME SPACE */
388 # endif
389 # endif
390 # endif
391 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
392
393
394 #if (! defined yyoverflow \
395 && (! defined __cplusplus \
396 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
397 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
398
399 /* A type that is properly aligned for any stack member. */
400 union yyalloc
401 {
402 yytype_int16 yyss;
403 YYSTYPE yyvs;
404 YYLTYPE yyls;
405 };
406
407 /* The size of the maximum gap between one aligned stack and the next. */
408 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
409
410 /* The size of an array large to enough to hold all stacks, each with
411 N elements. */
412 # define YYSTACK_BYTES(N) \
413 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
414 + 2 * YYSTACK_GAP_MAXIMUM)
415
416 /* Copy COUNT objects from FROM to TO. The source and destination do
417 not overlap. */
418 # ifndef YYCOPY
419 # if defined __GNUC__ && 1 < __GNUC__
420 # define YYCOPY(To, From, Count) \
421 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
422 # else
423 # define YYCOPY(To, From, Count) \
424 do \
425 { \
426 YYSIZE_T yyi; \
427 for (yyi = 0; yyi < (Count); yyi++) \
428 (To)[yyi] = (From)[yyi]; \
429 } \
430 while (YYID (0))
431 # endif
432 # endif
433
434 /* Relocate STACK from its old location to the new one. The
435 local variables YYSIZE and YYSTACKSIZE give the old and new number of
436 elements in the stack, and YYPTR gives the new location of the
437 stack. Advance YYPTR to a properly aligned location for the next
438 stack. */
439 # define YYSTACK_RELOCATE(Stack) \
440 do \
441 { \
442 YYSIZE_T yynewbytes; \
443 YYCOPY (&yyptr->Stack, Stack, yysize); \
444 Stack = &yyptr->Stack; \
445 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
446 yyptr += yynewbytes / sizeof (*yyptr); \
447 } \
448 while (YYID (0))
449
450 #endif
451
452 /* YYFINAL -- State number of the termination state. */
453 #define YYFINAL 34
454 /* YYLAST -- Last index in YYTABLE. */
455 #define YYLAST 946
456
457 /* YYNTOKENS -- Number of terminals. */
458 #define YYNTOKENS 60
459 /* YYNNTS -- Number of nonterminals. */
460 #define YYNNTS 15
461 /* YYNRULES -- Number of rules. */
462 #define YYNRULES 78
463 /* YYNRULES -- Number of states. */
464 #define YYNSTATES 172
465
466 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
467 #define YYUNDEFTOK 2
468 #define YYMAXUTOK 289
469
470 #define YYTRANSLATE(YYX) \
471 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
472
473 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
474 static const yytype_uint8 yytranslate[] =
475 {
476 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 46, 2, 2, 57, 44, 26, 2,
480 58, 59, 42, 40, 55, 41, 51, 43, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 19, 52,
482 27, 17, 28, 18, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 50, 2, 56, 25, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 53, 24, 54, 47, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
502 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
503 15, 16, 20, 21, 22, 23, 29, 30, 31, 32,
504 33, 34, 35, 36, 37, 38, 39, 45, 48, 49
505 };
506
507 #if YYDEBUG
508 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
509 YYRHS. */
510 static const yytype_uint16 yyprhs[] =
511 {
512 0, 0, 3, 6, 7, 9, 11, 14, 16, 20,
513 22, 26, 28, 32, 35, 38, 41, 44, 47, 50,
514 54, 59, 64, 68, 71, 74, 77, 80, 84, 89,
515 93, 97, 101, 105, 109, 113, 117, 121, 125, 129,
516 133, 137, 141, 145, 149, 153, 157, 161, 165, 169,
517 173, 177, 181, 185, 189, 193, 199, 209, 213, 215,
518 217, 219, 221, 222, 228, 239, 246, 252, 255, 256,
519 257, 265, 266, 268, 270, 272, 276, 280, 282
520 };
521
522 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
523 static const yytype_int8 yyrhs[] =
524 {
525 61, 0, -1, 64, 62, -1, -1, 63, -1, 52,
526 -1, 63, 52, -1, 65, -1, 64, 63, 65, -1,
527 67, -1, 53, 64, 54, -1, 67, -1, 66, 55,
528 67, -1, 67, 7, -1, 67, 8, -1, 67, 9,
529 -1, 67, 10, -1, 67, 11, -1, 67, 12, -1,
530 67, 51, 67, -1, 67, 50, 66, 56, -1, 57,
531 58, 66, 59, -1, 58, 66, 59, -1, 40, 67,
532 -1, 41, 67, -1, 46, 67, -1, 47, 67, -1,
533 5, 58, 59, -1, 5, 58, 66, 59, -1, 67,
534 45, 67, -1, 67, 42, 67, -1, 67, 43, 67,
535 -1, 67, 44, 67, -1, 67, 40, 67, -1, 67,
536 41, 67, -1, 67, 39, 67, -1, 67, 38, 67,
537 -1, 67, 37, 67, -1, 67, 36, 67, -1, 67,
538 35, 67, -1, 67, 34, 67, -1, 67, 33, 67,
539 -1, 67, 32, 67, -1, 67, 31, 67, -1, 67,
540 27, 67, -1, 67, 30, 67, -1, 67, 28, 67,
541 -1, 67, 29, 67, -1, 67, 26, 67, -1, 67,
542 25, 67, -1, 67, 24, 67, -1, 67, 23, 67,
543 -1, 67, 22, 67, -1, 67, 21, 67, -1, 67,
544 20, 67, -1, 67, 18, 66, 19, 67, -1, 14,
545 58, 66, 59, 53, 64, 62, 54, 68, -1, 5,
546 17, 67, -1, 69, -1, 5, -1, 4, -1, 3,
547 -1, -1, 16, 53, 64, 62, 54, -1, 16, 14,
548 58, 66, 59, 53, 64, 62, 54, 68, -1, 6,
549 72, 53, 73, 62, 54, -1, 6, 72, 53, 62,
550 54, -1, 6, 72, -1, -1, -1, 15, 72, 53,
551 70, 3, 71, 54, -1, -1, 5, -1, 3, -1,
552 74, -1, 73, 63, 74, -1, 5, 19, 66, -1,
553 66, -1, 13, 58, 5, 17, 67, 52, 67, 52,
554 67, 59, 53, 73, 62, 54, -1
555 };
556
557 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
558 static const yytype_uint16 yyrline[] =
559 {
560 0, 100, 100, 107, 109, 113, 114, 119, 123, 131,
561 135, 146, 150, 158, 163, 168, 173, 178, 183, 188,
562 194, 200, 205, 221, 226, 231, 236, 241, 247, 253,
563 259, 265, 271, 277, 283, 289, 295, 301, 307, 313,
564 319, 325, 331, 337, 343, 349, 355, 361, 367, 373,
565 379, 385, 391, 397, 403, 417, 424, 431, 438, 442,
566 446, 450, 459, 462, 466, 477, 487, 496, 506, 508,
567 505, 532, 535, 539, 551, 555, 564, 570, 576
568 };
569 #endif
570
571 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
572 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
573 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
574 static const char *const yytname[] =
575 {
576 "$end", "error", "$undefined", "STRING", "VALUE", "IDENTIFIER",
577 "OBJECT", "UNIT_ANGLE", "UNIT_COLOR", "UNIT_RATIO", "UNIT_SIZE",
578 "UNIT_SPEED", "UNIT_TIME", "FOR", "IF", "ACTION_SCRIPT", "ELSE", "'='",
579 "'?'", "':'", "RANGE", "LOGICAL_OR", "LOGICAL_XOR", "LOGICAL_AND", "'|'",
580 "'^'", "'&'", "'<'", "'>'", "GREATER_EQUAL", "LESS_EQUAL", "NOT_EQUAL",
581 "EQUAL", "ROTATE_RIGHT", "ROTATE_LEFT", "SHIFT_RIGHT_UNSIGNED",
582 "SHIFT_RIGHT", "SHIFT_LEFT", "MAX_OP", "MIN_OP", "'+'", "'-'", "'*'",
583 "'/'", "'%'", "POWER", "'!'", "'~'", "NEG", "POS", "'['", "'.'", "';'",
584 "'{'", "'}'", "','", "']'", "'$'", "'('", "')'", "$accept", "start",
585 "opt_end", "colons", "expr_list", "block_expr", "group_expr", "expr",
586 "opt_else", "object", "@1", "@2", "opt_name", "object_definition",
587 "definition", 0
588 };
589 #endif
590
591 # ifdef YYPRINT
592 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
593 token YYLEX-NUM. */
594 static const yytype_uint16 yytoknum[] =
595 {
596 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
597 265, 266, 267, 268, 269, 270, 271, 61, 63, 58,
598 272, 273, 274, 275, 124, 94, 38, 60, 62, 276,
599 277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
600 43, 45, 42, 47, 37, 287, 33, 126, 288, 289,
601 91, 46, 59, 123, 125, 44, 93, 36, 40, 41
602 };
603 # endif
604
605 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
606 static const yytype_uint8 yyr1[] =
607 {
608 0, 60, 61, 62, 62, 63, 63, 64, 64, 65,
609 65, 66, 66, 67, 67, 67, 67, 67, 67, 67,
610 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
611 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
612 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
613 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
614 67, 67, 68, 68, 68, 69, 69, 69, 70, 71,
615 69, 72, 72, 72, 73, 73, 74, 74, 74
616 };
617
618 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
619 static const yytype_uint8 yyr2[] =
620 {
621 0, 2, 2, 0, 1, 1, 2, 1, 3, 1,
622 3, 1, 3, 2, 2, 2, 2, 2, 2, 3,
623 4, 4, 3, 2, 2, 2, 2, 3, 4, 3,
624 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
625 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
626 3, 3, 3, 3, 3, 5, 9, 3, 1, 1,
627 1, 1, 0, 5, 10, 6, 5, 2, 0, 0,
628 7, 0, 1, 1, 1, 3, 3, 1, 14
629 };
630
631 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
632 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
633 means the default is an error. */
634 static const yytype_uint8 yydefact[] =
635 {
636 0, 61, 60, 59, 71, 0, 71, 0, 0, 0,
637 0, 0, 0, 0, 0, 3, 7, 9, 58, 0,
638 0, 73, 72, 67, 0, 0, 23, 24, 25, 26,
639 0, 0, 0, 11, 1, 5, 2, 4, 13, 14,
640 15, 16, 17, 18, 0, 0, 0, 0, 0, 0,
641 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
643 0, 0, 0, 57, 27, 0, 3, 0, 68, 10,
644 0, 0, 0, 22, 6, 8, 0, 54, 53, 52,
645 51, 50, 49, 48, 44, 46, 47, 45, 43, 42,
646 41, 40, 39, 38, 37, 36, 35, 33, 34, 30,
647 31, 32, 29, 0, 19, 28, 59, 0, 0, 4,
648 77, 3, 74, 0, 0, 21, 12, 0, 20, 0,
649 0, 66, 0, 4, 0, 69, 55, 76, 0, 65,
650 75, 3, 0, 0, 0, 70, 0, 62, 0, 0,
651 56, 0, 0, 0, 0, 0, 3, 0, 0, 0,
652 0, 0, 63, 0, 0, 3, 3, 0, 0, 78,
653 62, 64
654 };
655
656 /* YYDEFGOTO[NTERM-NUM]. */
657 static const yytype_int16 yydefgoto[] =
658 {
659 -1, 14, 36, 37, 15, 16, 120, 33, 150, 18,
660 124, 142, 23, 121, 122
661 };
662
663 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
664 STATE-NUM. */
665 #define YYPACT_NINF -60
666 static const yytype_int16 yypact[] =
667 {
668 227, -60, -60, 25, 18, -28, 18, 255, 255, 255,
669 255, 227, -17, 255, 15, 26, -60, 433, -60, 255,
670 83, -60, -60, 23, 255, 31, 531, 531, 531, 531,
671 -25, 255, -43, 433, -60, -60, -60, 153, -60, -60,
672 -60, -60, -60, -60, 255, 255, 255, 255, 255, 255,
673 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
674 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
675 255, 255, 255, 433, -60, -42, 167, -41, -60, -60,
676 153, -35, 255, -60, -60, -60, -16, 523, 568, 613,
677 658, 703, 748, 793, 838, 838, 838, 838, 838, 838,
678 838, 838, 838, 838, 838, 850, 850, 895, 895, 761,
679 761, 761, 761, -50, 24, -60, 21, 19, 36, 39,
680 40, 26, -60, 41, 93, -60, 433, 255, -60, 255,
681 94, -60, 46, 182, 227, -60, 478, 40, 84, -60,
682 -60, 26, 48, 255, 49, -60, 341, 88, 255, -10,
683 -60, 387, 51, 227, 255, 255, 26, 296, -33, 52,
684 54, 57, -60, 241, 227, 26, 26, 58, 59, -60,
685 88, -60
686 };
687
688 /* YYPGOTO[NTERM-NUM]. */
689 static const yytype_int8 yypgoto[] =
690 {
691 -60, -60, -48, -5, -9, -36, 61, 0, -59, -60,
692 -60, -60, 108, -44, -18
693 };
694
695 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
696 positive, shift that token. If negative, reduce the rule which
697 number is the opposite. If zero, do what YYDEFACT says.
698 If YYTABLE_NINF, syntax error. */
699 #define YYTABLE_NINF -1
700 static const yytype_uint8 yytable[] =
701 {
702 17, 85, 30, 127, 152, 82, 128, 26, 27, 28,
703 29, 17, 82, 82, 82, 34, 83, 115, 123, 73,
704 82, 21, 82, 22, 125, 80, 161, 35, 118, 79,
705 24, 38, 39, 40, 41, 42, 43, 17, 19, 82,
706 129, 31, 19, 153, 85, 87, 88, 89, 90, 91,
707 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
708 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
709 112, 119, 114, 132, 32, 72, 76, 130, 35, 20,
710 17, 75, 126, 20, 78, 77, 1, 2, 3, 4,
711 131, 84, 81, 144, 134, 82, 135, 5, 6, 138,
712 139, 143, 145, 147, 149, 86, 162, 163, 159, 155,
713 164, 171, 169, 170, 25, 140, 133, 167, 168, 165,
714 0, 0, 0, 7, 8, 141, 0, 136, 0, 9,
715 10, 0, 113, 0, 17, 0, 0, 0, 0, 0,
716 12, 13, 74, 146, 156, 0, 0, 0, 151, 0,
717 0, 0, 0, 17, 157, 166, 1, 2, 3, 4,
718 133, 0, 0, 0, 17, 0, 0, 5, 6, 0,
719 1, 2, 116, 4, 0, 0, 0, 0, 0, 0,
720 117, 5, 6, 0, 0, 1, 2, 116, 4, 0,
721 137, 0, 0, 7, 8, 117, 5, 6, 0, 9,
722 10, 0, 0, 0, 0, 84, 11, 7, 8, 0,
723 12, 13, 0, 9, 10, 0, 158, 0, 0, 35,
724 0, 0, 7, 8, 12, 13, 0, 0, 9, 10,
725 1, 2, 3, 4, 84, 0, 0, 0, 0, 12,
726 13, 5, 6, 0, 1, 2, 116, 4, 0, 0,
727 0, 0, 0, 0, 117, 5, 6, 0, 1, 2,
728 3, 4, 0, 0, 0, 0, 0, 7, 8, 5,
729 6, 0, 0, 9, 10, 0, 0, 0, 0, 0,
730 11, 7, 8, 0, 12, 13, 0, 9, 10, 0,
731 0, 0, 0, 0, 0, 7, 8, 0, 12, 13,
732 0, 9, 10, 38, 39, 40, 41, 42, 43, 0,
733 0, 0, 12, 13, 44, 0, 45, 46, 47, 48,
734 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
735 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
736 69, 70, 0, 0, 0, 0, 71, 72, 38, 39,
737 40, 41, 42, 43, 0, 160, 0, 0, 0, 44,
738 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
739 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
740 64, 65, 66, 67, 68, 69, 70, 0, 0, 0,
741 0, 71, 72, 148, 38, 39, 40, 41, 42, 43,
742 0, 0, 0, 0, 0, 44, 0, 45, 46, 47,
743 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
744 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
745 68, 69, 70, 0, 0, 0, 0, 71, 72, 154,
746 38, 39, 40, 41, 42, 43, 0, 0, 0, 0,
747 0, 44, 0, 45, 46, 47, 48, 49, 50, 51,
748 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
749 62, 63, 64, 65, 66, 67, 68, 69, 70, 0,
750 0, 0, 0, 71, 72, 38, 39, 40, 41, 42,
751 43, 0, 0, 0, 0, 0, 0, 0, 45, 46,
752 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
753 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
754 67, 68, 69, 70, 0, 0, 0, 0, 71, 72,
755 38, 39, 40, 41, 42, 43, 0, 0, 38, 39,
756 40, 41, 42, 43, 46, 47, 48, 49, 50, 51,
757 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
758 62, 63, 64, 65, 66, 67, 68, 69, 70, 0,
759 0, 0, 0, 71, 72, 38, 39, 40, 41, 42,
760 43, 71, 72, 0, 0, 0, 0, 0, 0, 0,
761 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
762 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
763 67, 68, 69, 70, 0, 0, 0, 0, 71, 72,
764 38, 39, 40, 41, 42, 43, 0, 0, 0, 0,
765 0, 0, 0, 0, 0, 0, 48, 49, 50, 51,
766 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
767 62, 63, 64, 65, 66, 67, 68, 69, 70, 0,
768 0, 0, 0, 71, 72, 38, 39, 40, 41, 42,
769 43, 0, 0, 0, 0, 0, 0, 0, 0, 0,
770 0, 0, 49, 50, 51, 52, 53, 54, 55, 56,
771 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
772 67, 68, 69, 70, 0, 0, 0, 0, 71, 72,
773 38, 39, 40, 41, 42, 43, 0, 0, 0, 0,
774 0, 0, 0, 0, 0, 0, 0, 0, 50, 51,
775 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
776 62, 63, 64, 65, 66, 67, 68, 69, 70, 0,
777 0, 0, 0, 71, 72, 38, 39, 40, 41, 42,
778 43, 0, 0, 0, 0, 0, 0, 0, 38, 39,
779 40, 41, 42, 43, 51, 52, 53, 54, 55, 56,
780 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
781 67, 68, 69, 70, 0, 0, 0, 0, 71, 72,
782 38, 39, 40, 41, 42, 43, 70, 0, 0, 0,
783 0, 71, 72, 0, 0, 0, 0, 0, 0, 0,
784 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
785 62, 63, 64, 65, 66, 67, 68, 69, 70, 0,
786 0, 0, 0, 71, 72, 38, 39, 40, 41, 42,
787 43, 0, 0, 0, 0, 0, 0, 38, 39, 40,
788 41, 42, 43, 0, 0, 0, 0, 0, 0, 0,
789 0, 58, 59, 60, 61, 62, 63, 64, 65, 66,
790 67, 68, 69, 70, 0, 0, 0, 0, 71, 72,
791 65, 66, 67, 68, 69, 70, 0, 0, 0, 0,
792 71, 72, 38, 39, 40, 41, 42, 43, 0, 0,
793 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
794 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
795 0, 0, 0, 0, 0, 0, 0, 67, 68, 69,
796 70, 0, 0, 0, 0, 71, 72
797 };
798
799 static const yytype_int16 yycheck[] =
800 {
801 0, 37, 11, 19, 14, 55, 56, 7, 8, 9,
802 10, 11, 55, 55, 55, 0, 59, 59, 59, 19,
803 55, 3, 55, 5, 59, 30, 59, 52, 76, 54,
804 58, 7, 8, 9, 10, 11, 12, 37, 17, 55,
805 19, 58, 17, 53, 80, 45, 46, 47, 48, 49,
806 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
807 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
808 70, 76, 72, 121, 13, 51, 53, 58, 52, 58,
809 80, 20, 82, 58, 53, 24, 3, 4, 5, 6,
810 54, 52, 31, 141, 53, 55, 3, 14, 15, 5,
811 54, 17, 54, 54, 16, 44, 54, 53, 156, 58,
812 53, 170, 54, 54, 6, 133, 121, 165, 166, 163,
813 -1, -1, -1, 40, 41, 134, -1, 127, -1, 46,
814 47, -1, 71, -1, 134, -1, -1, -1, -1, -1,
815 57, 58, 59, 143, 153, -1, -1, -1, 148, -1,
816 -1, -1, -1, 153, 154, 164, 3, 4, 5, 6,
817 165, -1, -1, -1, 164, -1, -1, 14, 15, -1,
818 3, 4, 5, 6, -1, -1, -1, -1, -1, -1,
819 13, 14, 15, -1, -1, 3, 4, 5, 6, -1,
820 129, -1, -1, 40, 41, 13, 14, 15, -1, 46,
821 47, -1, -1, -1, -1, 52, 53, 40, 41, -1,
822 57, 58, -1, 46, 47, -1, 155, -1, -1, 52,
823 -1, -1, 40, 41, 57, 58, -1, -1, 46, 47,
824 3, 4, 5, 6, 52, -1, -1, -1, -1, 57,
825 58, 14, 15, -1, 3, 4, 5, 6, -1, -1,
826 -1, -1, -1, -1, 13, 14, 15, -1, 3, 4,
827 5, 6, -1, -1, -1, -1, -1, 40, 41, 14,
828 15, -1, -1, 46, 47, -1, -1, -1, -1, -1,
829 53, 40, 41, -1, 57, 58, -1, 46, 47, -1,
830 -1, -1, -1, -1, -1, 40, 41, -1, 57, 58,
831 -1, 46, 47, 7, 8, 9, 10, 11, 12, -1,
832 -1, -1, 57, 58, 18, -1, 20, 21, 22, 23,
833 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
834 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
835 44, 45, -1, -1, -1, -1, 50, 51, 7, 8,
836 9, 10, 11, 12, -1, 59, -1, -1, -1, 18,
837 -1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
838 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
839 39, 40, 41, 42, 43, 44, 45, -1, -1, -1,
840 -1, 50, 51, 52, 7, 8, 9, 10, 11, 12,
841 -1, -1, -1, -1, -1, 18, -1, 20, 21, 22,
842 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
843 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
844 43, 44, 45, -1, -1, -1, -1, 50, 51, 52,
845 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
846 -1, 18, -1, 20, 21, 22, 23, 24, 25, 26,
847 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
848 37, 38, 39, 40, 41, 42, 43, 44, 45, -1,
849 -1, -1, -1, 50, 51, 7, 8, 9, 10, 11,
850 12, -1, -1, -1, -1, -1, -1, -1, 20, 21,
851 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
852 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
853 42, 43, 44, 45, -1, -1, -1, -1, 50, 51,
854 7, 8, 9, 10, 11, 12, -1, -1, 7, 8,
855 9, 10, 11, 12, 21, 22, 23, 24, 25, 26,
856 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
857 37, 38, 39, 40, 41, 42, 43, 44, 45, -1,
858 -1, -1, -1, 50, 51, 7, 8, 9, 10, 11,
859 12, 50, 51, -1, -1, -1, -1, -1, -1, -1,
860 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
861 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
862 42, 43, 44, 45, -1, -1, -1, -1, 50, 51,
863 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
864 -1, -1, -1, -1, -1, -1, 23, 24, 25, 26,
865 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
866 37, 38, 39, 40, 41, 42, 43, 44, 45, -1,
867 -1, -1, -1, 50, 51, 7, 8, 9, 10, 11,
868 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
869 -1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
870 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
871 42, 43, 44, 45, -1, -1, -1, -1, 50, 51,
872 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
873 -1, -1, -1, -1, -1, -1, -1, -1, 25, 26,
874 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
875 37, 38, 39, 40, 41, 42, 43, 44, 45, -1,
876 -1, -1, -1, 50, 51, 7, 8, 9, 10, 11,
877 12, -1, -1, -1, -1, -1, -1, -1, 7, 8,
878 9, 10, 11, 12, 26, 27, 28, 29, 30, 31,
879 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
880 42, 43, 44, 45, -1, -1, -1, -1, 50, 51,
881 7, 8, 9, 10, 11, 12, 45, -1, -1, -1,
882 -1, 50, 51, -1, -1, -1, -1, -1, -1, -1,
883 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
884 37, 38, 39, 40, 41, 42, 43, 44, 45, -1,
885 -1, -1, -1, 50, 51, 7, 8, 9, 10, 11,
886 12, -1, -1, -1, -1, -1, -1, 7, 8, 9,
887 10, 11, 12, -1, -1, -1, -1, -1, -1, -1,
888 -1, 33, 34, 35, 36, 37, 38, 39, 40, 41,
889 42, 43, 44, 45, -1, -1, -1, -1, 50, 51,
890 40, 41, 42, 43, 44, 45, -1, -1, -1, -1,
891 50, 51, 7, 8, 9, 10, 11, 12, -1, -1,
892 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
893 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
894 -1, -1, -1, -1, -1, -1, -1, 42, 43, 44,
895 45, -1, -1, -1, -1, 50, 51
896 };
897
898 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
899 symbol of state STATE-NUM. */
900 static const yytype_uint8 yystos[] =
901 {
902 0, 3, 4, 5, 6, 14, 15, 40, 41, 46,
903 47, 53, 57, 58, 61, 64, 65, 67, 69, 17,
904 58, 3, 5, 72, 58, 72, 67, 67, 67, 67,
905 64, 58, 66, 67, 0, 52, 62, 63, 7, 8,
906 9, 10, 11, 12, 18, 20, 21, 22, 23, 24,
907 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
908 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
909 45, 50, 51, 67, 59, 66, 53, 66, 53, 54,
910 63, 66, 55, 59, 52, 65, 66, 67, 67, 67,
911 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
912 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
913 67, 67, 67, 66, 67, 59, 5, 13, 62, 63,
914 66, 73, 74, 59, 70, 59, 67, 19, 56, 19,
915 58, 54, 62, 63, 53, 3, 67, 66, 5, 54,
916 74, 64, 71, 17, 62, 54, 67, 54, 52, 16,
917 68, 67, 14, 53, 52, 58, 64, 67, 66, 62,
918 59, 59, 54, 53, 53, 73, 64, 62, 62, 54,
919 54, 68
920 };
921
922 #define yyerrok (yyerrstatus = 0)
923 #define yyclearin (yychar = YYEMPTY)
924 #define YYEMPTY (-2)
925 #define YYEOF 0
926
927 #define YYACCEPT goto yyacceptlab
928 #define YYABORT goto yyabortlab
929 #define YYERROR goto yyerrorlab
930
931
932 /* Like YYERROR except do call yyerror. This remains here temporarily
933 to ease the transition to the new meaning of YYERROR, for GCC.
934 Once GCC version 2 has supplanted version 1, this can go. */
935
936 #define YYFAIL goto yyerrlab
937
938 #define YYRECOVERING() (!!yyerrstatus)
939
940 #define YYBACKUP(Token, Value) \
941 do \
942 if (yychar == YYEMPTY && yylen == 1) \
943 { \
944 yychar = (Token); \
945 yylval = (Value); \
946 yytoken = YYTRANSLATE (yychar); \
947 YYPOPSTACK (1); \
948 goto yybackup; \
949 } \
950 else \
951 { \
952 yyerror (YY_("syntax error: cannot back up")); \
953 YYERROR; \
954 } \
955 while (YYID (0))
956
957
958 #define YYTERROR 1
959 #define YYERRCODE 256
960
961
962 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
963 If N is 0, then set CURRENT to the empty location which ends
964 the previous symbol: RHS[0] (always defined). */
965
966 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
967 #ifndef YYLLOC_DEFAULT
968 # define YYLLOC_DEFAULT(Current, Rhs, N) \
969 do \
970 if (YYID (N)) \
971 { \
972 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
973 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
974 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
975 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
976 } \
977 else \
978 { \
979 (Current).first_line = (Current).last_line = \
980 YYRHSLOC (Rhs, 0).last_line; \
981 (Current).first_column = (Current).last_column = \
982 YYRHSLOC (Rhs, 0).last_column; \
983 } \
984 while (YYID (0))
985 #endif
986
987
988 /* YY_LOCATION_PRINT -- Print the location on the stream.
989 This macro was not mandated originally: define only if we know
990 we won't break user code: when these are the locations we know. */
991
992 #ifndef YY_LOCATION_PRINT
993 # if YYLTYPE_IS_TRIVIAL
994 # define YY_LOCATION_PRINT(File, Loc) \
995 fprintf (File, "%d.%d-%d.%d", \
996 (Loc).first_line, (Loc).first_column, \
997 (Loc).last_line, (Loc).last_column)
998 # else
999 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1000 # endif
1001 #endif
1002
1003
1004 /* YYLEX -- calling `yylex' with the right arguments. */
1005
1006 #ifdef YYLEX_PARAM
1007 # define YYLEX yylex (YYLEX_PARAM)
1008 #else
1009 # define YYLEX yylex ()
1010 #endif
1011
1012 /* Enable debugging if requested. */
1013 #if YYDEBUG
1014
1015 # ifndef YYFPRINTF
1016 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1017 # define YYFPRINTF fprintf
1018 # endif
1019
1020 # define YYDPRINTF(Args) \
1021 do { \
1022 if (yydebug) \
1023 YYFPRINTF Args; \
1024 } while (YYID (0))
1025
1026 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1027 do { \
1028 if (yydebug) \
1029 { \
1030 YYFPRINTF (stderr, "%s ", Title); \
1031 yy_symbol_print (stderr, \
1032 Type, Value, Location); \
1033 YYFPRINTF (stderr, "\n"); \
1034 } \
1035 } while (YYID (0))
1036
1037
1038 /*--------------------------------.
1039 | Print this symbol on YYOUTPUT. |
1040 `--------------------------------*/
1041
1042 /*ARGSUSED*/
1043 #if (defined __STDC__ || defined __C99__FUNC__ \
1044 || defined __cplusplus || defined _MSC_VER)
1045 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep,YYLTYPE const * const yylocationp)1046 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1047 #else
1048 static void
1049 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
1050 FILE *yyoutput;
1051 int yytype;
1052 YYSTYPE const * const yyvaluep;
1053 YYLTYPE const * const yylocationp;
1054 #endif
1055 {
1056 if (!yyvaluep)
1057 return;
1058 YYUSE (yylocationp);
1059 # ifdef YYPRINT
1060 if (yytype < YYNTOKENS)
1061 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1062 # else
1063 YYUSE (yyoutput);
1064 # endif
1065 switch (yytype)
1066 {
1067 default:
1068 break;
1069 }
1070 }
1071
1072
1073 /*--------------------------------.
1074 | Print this symbol on YYOUTPUT. |
1075 `--------------------------------*/
1076
1077 #if (defined __STDC__ || defined __C99__FUNC__ \
1078 || defined __cplusplus || defined _MSC_VER)
1079 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep,YYLTYPE const * const yylocationp)1080 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
1081 #else
1082 static void
1083 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
1084 FILE *yyoutput;
1085 int yytype;
1086 YYSTYPE const * const yyvaluep;
1087 YYLTYPE const * const yylocationp;
1088 #endif
1089 {
1090 if (yytype < YYNTOKENS)
1091 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1092 else
1093 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1094
1095 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1096 YYFPRINTF (yyoutput, ": ");
1097 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
1098 YYFPRINTF (yyoutput, ")");
1099 }
1100
1101 /*------------------------------------------------------------------.
1102 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1103 | TOP (included). |
1104 `------------------------------------------------------------------*/
1105
1106 #if (defined __STDC__ || defined __C99__FUNC__ \
1107 || defined __cplusplus || defined _MSC_VER)
1108 static void
yy_stack_print(yytype_int16 * bottom,yytype_int16 * top)1109 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1110 #else
1111 static void
1112 yy_stack_print (bottom, top)
1113 yytype_int16 *bottom;
1114 yytype_int16 *top;
1115 #endif
1116 {
1117 YYFPRINTF (stderr, "Stack now");
1118 for (; bottom <= top; ++bottom)
1119 YYFPRINTF (stderr, " %d", *bottom);
1120 YYFPRINTF (stderr, "\n");
1121 }
1122
1123 # define YY_STACK_PRINT(Bottom, Top) \
1124 do { \
1125 if (yydebug) \
1126 yy_stack_print ((Bottom), (Top)); \
1127 } while (YYID (0))
1128
1129
1130 /*------------------------------------------------.
1131 | Report that the YYRULE is going to be reduced. |
1132 `------------------------------------------------*/
1133
1134 #if (defined __STDC__ || defined __C99__FUNC__ \
1135 || defined __cplusplus || defined _MSC_VER)
1136 static void
yy_reduce_print(YYSTYPE * yyvsp,YYLTYPE * yylsp,int yyrule)1137 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
1138 #else
1139 static void
1140 yy_reduce_print (yyvsp, yylsp, yyrule)
1141 YYSTYPE *yyvsp;
1142 YYLTYPE *yylsp;
1143 int yyrule;
1144 #endif
1145 {
1146 int yynrhs = yyr2[yyrule];
1147 int yyi;
1148 unsigned long int yylno = yyrline[yyrule];
1149 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1150 yyrule - 1, yylno);
1151 /* The symbols being reduced. */
1152 for (yyi = 0; yyi < yynrhs; yyi++)
1153 {
1154 fprintf (stderr, " $%d = ", yyi + 1);
1155 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1156 &(yyvsp[(yyi + 1) - (yynrhs)])
1157 , &(yylsp[(yyi + 1) - (yynrhs)]) );
1158 fprintf (stderr, "\n");
1159 }
1160 }
1161
1162 # define YY_REDUCE_PRINT(Rule) \
1163 do { \
1164 if (yydebug) \
1165 yy_reduce_print (yyvsp, yylsp, Rule); \
1166 } while (YYID (0))
1167
1168 /* Nonzero means print parse trace. It is left uninitialized so that
1169 multiple parsers can coexist. */
1170 int yydebug;
1171 #else /* !YYDEBUG */
1172 # define YYDPRINTF(Args)
1173 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1174 # define YY_STACK_PRINT(Bottom, Top)
1175 # define YY_REDUCE_PRINT(Rule)
1176 #endif /* !YYDEBUG */
1177
1178
1179 /* YYINITDEPTH -- initial size of the parser's stacks. */
1180 #ifndef YYINITDEPTH
1181 # define YYINITDEPTH 200
1182 #endif
1183
1184 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1185 if the built-in stack extension method is used).
1186
1187 Do not make this value too large; the results are undefined if
1188 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1189 evaluated with infinite-precision integer arithmetic. */
1190
1191 #ifndef YYMAXDEPTH
1192 # define YYMAXDEPTH 10000
1193 #endif
1194
1195
1196
1197 #if YYERROR_VERBOSE
1198
1199 # ifndef yystrlen
1200 # if defined __GLIBC__ && defined _STRING_H
1201 # define yystrlen strlen
1202 # else
1203 /* Return the length of YYSTR. */
1204 #if (defined __STDC__ || defined __C99__FUNC__ \
1205 || defined __cplusplus || defined _MSC_VER)
1206 static YYSIZE_T
yystrlen(const char * yystr)1207 yystrlen (const char *yystr)
1208 #else
1209 static YYSIZE_T
1210 yystrlen (yystr)
1211 const char *yystr;
1212 #endif
1213 {
1214 YYSIZE_T yylen;
1215 for (yylen = 0; yystr[yylen]; yylen++)
1216 continue;
1217 return yylen;
1218 }
1219 # endif
1220 # endif
1221
1222 # ifndef yystpcpy
1223 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1224 # define yystpcpy stpcpy
1225 # else
1226 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1227 YYDEST. */
1228 #if (defined __STDC__ || defined __C99__FUNC__ \
1229 || defined __cplusplus || defined _MSC_VER)
1230 static char *
yystpcpy(char * yydest,const char * yysrc)1231 yystpcpy (char *yydest, const char *yysrc)
1232 #else
1233 static char *
1234 yystpcpy (yydest, yysrc)
1235 char *yydest;
1236 const char *yysrc;
1237 #endif
1238 {
1239 char *yyd = yydest;
1240 const char *yys = yysrc;
1241
1242 while ((*yyd++ = *yys++) != '\0')
1243 continue;
1244
1245 return yyd - 1;
1246 }
1247 # endif
1248 # endif
1249
1250 # ifndef yytnamerr
1251 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1252 quotes and backslashes, so that it's suitable for yyerror. The
1253 heuristic is that double-quoting is unnecessary unless the string
1254 contains an apostrophe, a comma, or backslash (other than
1255 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1256 null, do not copy; instead, return the length of what the result
1257 would have been. */
1258 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1259 yytnamerr (char *yyres, const char *yystr)
1260 {
1261 if (*yystr == '"')
1262 {
1263 YYSIZE_T yyn = 0;
1264 char const *yyp = yystr;
1265
1266 for (;;)
1267 switch (*++yyp)
1268 {
1269 case '\'':
1270 case ',':
1271 goto do_not_strip_quotes;
1272
1273 case '\\':
1274 if (*++yyp != '\\')
1275 goto do_not_strip_quotes;
1276 /* Fall through. */
1277 default:
1278 if (yyres)
1279 yyres[yyn] = *yyp;
1280 yyn++;
1281 break;
1282
1283 case '"':
1284 if (yyres)
1285 yyres[yyn] = '\0';
1286 return yyn;
1287 }
1288 do_not_strip_quotes: ;
1289 }
1290
1291 if (! yyres)
1292 return yystrlen (yystr);
1293
1294 return yystpcpy (yyres, yystr) - yyres;
1295 }
1296 # endif
1297
1298 /* Copy into YYRESULT an error message about the unexpected token
1299 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1300 including the terminating null byte. If YYRESULT is null, do not
1301 copy anything; just return the number of bytes that would be
1302 copied. As a special case, return 0 if an ordinary "syntax error"
1303 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1304 size calculation. */
1305 static YYSIZE_T
yysyntax_error(char * yyresult,int yystate,int yychar)1306 yysyntax_error (char *yyresult, int yystate, int yychar)
1307 {
1308 int yyn = yypact[yystate];
1309
1310 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1311 return 0;
1312 else
1313 {
1314 int yytype = YYTRANSLATE (yychar);
1315 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1316 YYSIZE_T yysize = yysize0;
1317 YYSIZE_T yysize1;
1318 int yysize_overflow = 0;
1319 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1320 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1321 int yyx;
1322
1323 # if 0
1324 /* This is so xgettext sees the translatable formats that are
1325 constructed on the fly. */
1326 YY_("syntax error, unexpected %s");
1327 YY_("syntax error, unexpected %s, expecting %s");
1328 YY_("syntax error, unexpected %s, expecting %s or %s");
1329 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1330 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1331 # endif
1332 char *yyfmt;
1333 char const *yyf;
1334 static char const yyunexpected[] = "syntax error, unexpected %s";
1335 static char const yyexpecting[] = ", expecting %s";
1336 static char const yyor[] = " or %s";
1337 char yyformat[sizeof yyunexpected
1338 + sizeof yyexpecting - 1
1339 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1340 * (sizeof yyor - 1))];
1341 char const *yyprefix = yyexpecting;
1342
1343 /* Start YYX at -YYN if negative to avoid negative indexes in
1344 YYCHECK. */
1345 int yyxbegin = yyn < 0 ? -yyn : 0;
1346
1347 /* Stay within bounds of both yycheck and yytname. */
1348 int yychecklim = YYLAST - yyn + 1;
1349 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1350 int yycount = 1;
1351
1352 yyarg[0] = yytname[yytype];
1353 yyfmt = yystpcpy (yyformat, yyunexpected);
1354
1355 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1356 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1357 {
1358 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1359 {
1360 yycount = 1;
1361 yysize = yysize0;
1362 yyformat[sizeof yyunexpected - 1] = '\0';
1363 break;
1364 }
1365 yyarg[yycount++] = yytname[yyx];
1366 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1367 yysize_overflow |= (yysize1 < yysize);
1368 yysize = yysize1;
1369 yyfmt = yystpcpy (yyfmt, yyprefix);
1370 yyprefix = yyor;
1371 }
1372
1373 yyf = YY_(yyformat);
1374 yysize1 = yysize + yystrlen (yyf);
1375 yysize_overflow |= (yysize1 < yysize);
1376 yysize = yysize1;
1377
1378 if (yysize_overflow)
1379 return YYSIZE_MAXIMUM;
1380
1381 if (yyresult)
1382 {
1383 /* Avoid sprintf, as that infringes on the user's name space.
1384 Don't have undefined behavior even if the translation
1385 produced a string with the wrong number of "%s"s. */
1386 char *yyp = yyresult;
1387 int yyi = 0;
1388 while ((*yyp = *yyf) != '\0')
1389 {
1390 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1391 {
1392 yyp += yytnamerr (yyp, yyarg[yyi++]);
1393 yyf += 2;
1394 }
1395 else
1396 {
1397 yyp++;
1398 yyf++;
1399 }
1400 }
1401 }
1402 return yysize;
1403 }
1404 }
1405 #endif /* YYERROR_VERBOSE */
1406
1407
1408 /*-----------------------------------------------.
1409 | Release the memory associated to this symbol. |
1410 `-----------------------------------------------*/
1411
1412 /*ARGSUSED*/
1413 #if (defined __STDC__ || defined __C99__FUNC__ \
1414 || defined __cplusplus || defined _MSC_VER)
1415 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep,YYLTYPE * yylocationp)1416 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1417 #else
1418 static void
1419 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1420 const char *yymsg;
1421 int yytype;
1422 YYSTYPE *yyvaluep;
1423 YYLTYPE *yylocationp;
1424 #endif
1425 {
1426 YYUSE (yyvaluep);
1427 YYUSE (yylocationp);
1428
1429 if (!yymsg)
1430 yymsg = "Deleting";
1431 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1432
1433 switch (yytype)
1434 {
1435
1436 default:
1437 break;
1438 }
1439 }
1440
1441
1442 /* Prevent warnings from -Wmissing-prototypes. */
1443
1444 #ifdef YYPARSE_PARAM
1445 #if defined __STDC__ || defined __cplusplus
1446 int yyparse (void *YYPARSE_PARAM);
1447 #else
1448 int yyparse ();
1449 #endif
1450 #else /* ! YYPARSE_PARAM */
1451 #if defined __STDC__ || defined __cplusplus
1452 int yyparse (void);
1453 #else
1454 int yyparse ();
1455 #endif
1456 #endif /* ! YYPARSE_PARAM */
1457
1458
1459
1460 /* The look-ahead symbol. */
1461 int yychar;
1462
1463 /* The semantic value of the look-ahead symbol. */
1464 YYSTYPE yylval;
1465
1466 /* Number of syntax errors so far. */
1467 int yynerrs;
1468 /* Location data for the look-ahead symbol. */
1469 YYLTYPE yylloc;
1470
1471
1472
1473 /*----------.
1474 | yyparse. |
1475 `----------*/
1476
1477 #ifdef YYPARSE_PARAM
1478 #if (defined __STDC__ || defined __C99__FUNC__ \
1479 || defined __cplusplus || defined _MSC_VER)
1480 int
yyparse(void * YYPARSE_PARAM)1481 yyparse (void *YYPARSE_PARAM)
1482 #else
1483 int
1484 yyparse (YYPARSE_PARAM)
1485 void *YYPARSE_PARAM;
1486 #endif
1487 #else /* ! YYPARSE_PARAM */
1488 #if (defined __STDC__ || defined __C99__FUNC__ \
1489 || defined __cplusplus || defined _MSC_VER)
1490 int
1491 yyparse (void)
1492 #else
1493 int
1494 yyparse ()
1495
1496 #endif
1497 #endif
1498 {
1499
1500 int yystate;
1501 int yyn;
1502 int yyresult;
1503 /* Number of tokens to shift before error messages enabled. */
1504 int yyerrstatus;
1505 /* Look-ahead token as an internal (translated) token number. */
1506 int yytoken = 0;
1507 #if YYERROR_VERBOSE
1508 /* Buffer for error messages, and its allocated size. */
1509 char yymsgbuf[128];
1510 char *yymsg = yymsgbuf;
1511 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1512 #endif
1513
1514 /* Three stacks and their tools:
1515 `yyss': related to states,
1516 `yyvs': related to semantic values,
1517 `yyls': related to locations.
1518
1519 Refer to the stacks thru separate pointers, to allow yyoverflow
1520 to reallocate them elsewhere. */
1521
1522 /* The state stack. */
1523 yytype_int16 yyssa[YYINITDEPTH];
1524 yytype_int16 *yyss = yyssa;
1525 yytype_int16 *yyssp;
1526
1527 /* The semantic value stack. */
1528 YYSTYPE yyvsa[YYINITDEPTH];
1529 YYSTYPE *yyvs = yyvsa;
1530 YYSTYPE *yyvsp;
1531
1532 /* The location stack. */
1533 YYLTYPE yylsa[YYINITDEPTH];
1534 YYLTYPE *yyls = yylsa;
1535 YYLTYPE *yylsp;
1536 /* The locations where the error started and ended. */
1537 YYLTYPE yyerror_range[2];
1538
1539 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1540
1541 YYSIZE_T yystacksize = YYINITDEPTH;
1542
1543 /* The variables used to return semantic value and location from the
1544 action routines. */
1545 YYSTYPE yyval;
1546 YYLTYPE yyloc;
1547
1548 /* The number of symbols on the RHS of the reduced rule.
1549 Keep to zero when no symbol should be popped. */
1550 int yylen = 0;
1551
1552 YYDPRINTF ((stderr, "Starting parse\n"));
1553
1554 yystate = 0;
1555 yyerrstatus = 0;
1556 yynerrs = 0;
1557 yychar = YYEMPTY; /* Cause a token to be read. */
1558
1559 /* Initialize stack pointers.
1560 Waste one element of value and location stack
1561 so that they stay on the same level as the state stack.
1562 The wasted elements are never initialized. */
1563
1564 yyssp = yyss;
1565 yyvsp = yyvs;
1566 yylsp = yyls;
1567 #if YYLTYPE_IS_TRIVIAL
1568 /* Initialize the default location before parsing starts. */
1569 yylloc.first_line = yylloc.last_line = 1;
1570 yylloc.first_column = yylloc.last_column = 0;
1571 #endif
1572
1573 goto yysetstate;
1574
1575 /*------------------------------------------------------------.
1576 | yynewstate -- Push a new state, which is found in yystate. |
1577 `------------------------------------------------------------*/
1578 yynewstate:
1579 /* In all cases, when you get here, the value and location stacks
1580 have just been pushed. So pushing a state here evens the stacks. */
1581 yyssp++;
1582
1583 yysetstate:
1584 *yyssp = yystate;
1585
1586 if (yyss + yystacksize - 1 <= yyssp)
1587 {
1588 /* Get the current used size of the three stacks, in elements. */
1589 YYSIZE_T yysize = yyssp - yyss + 1;
1590
1591 #ifdef yyoverflow
1592 {
1593 /* Give user a chance to reallocate the stack. Use copies of
1594 these so that the &'s don't force the real ones into
1595 memory. */
1596 YYSTYPE *yyvs1 = yyvs;
1597 yytype_int16 *yyss1 = yyss;
1598 YYLTYPE *yyls1 = yyls;
1599
1600 /* Each stack pointer address is followed by the size of the
1601 data in use in that stack, in bytes. This used to be a
1602 conditional around just the two extra args, but that might
1603 be undefined if yyoverflow is a macro. */
1604 yyoverflow (YY_("memory exhausted"),
1605 &yyss1, yysize * sizeof (*yyssp),
1606 &yyvs1, yysize * sizeof (*yyvsp),
1607 &yyls1, yysize * sizeof (*yylsp),
1608 &yystacksize);
1609 yyls = yyls1;
1610 yyss = yyss1;
1611 yyvs = yyvs1;
1612 }
1613 #else /* no yyoverflow */
1614 # ifndef YYSTACK_RELOCATE
1615 goto yyexhaustedlab;
1616 # else
1617 /* Extend the stack our own way. */
1618 if (YYMAXDEPTH <= yystacksize)
1619 goto yyexhaustedlab;
1620 yystacksize *= 2;
1621 if (YYMAXDEPTH < yystacksize)
1622 yystacksize = YYMAXDEPTH;
1623
1624 {
1625 yytype_int16 *yyss1 = yyss;
1626 union yyalloc *yyptr =
1627 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1628 if (! yyptr)
1629 goto yyexhaustedlab;
1630 YYSTACK_RELOCATE (yyss);
1631 YYSTACK_RELOCATE (yyvs);
1632 YYSTACK_RELOCATE (yyls);
1633 # undef YYSTACK_RELOCATE
1634 if (yyss1 != yyssa)
1635 YYSTACK_FREE (yyss1);
1636 }
1637 # endif
1638 #endif /* no yyoverflow */
1639
1640 yyssp = yyss + yysize - 1;
1641 yyvsp = yyvs + yysize - 1;
1642 yylsp = yyls + yysize - 1;
1643
1644 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1645 (unsigned long int) yystacksize));
1646
1647 if (yyss + yystacksize - 1 <= yyssp)
1648 YYABORT;
1649 }
1650
1651 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1652
1653 goto yybackup;
1654
1655 /*-----------.
1656 | yybackup. |
1657 `-----------*/
1658 yybackup:
1659
1660 /* Do appropriate processing given the current state. Read a
1661 look-ahead token if we need one and don't already have one. */
1662
1663 /* First try to decide what to do without reference to look-ahead token. */
1664 yyn = yypact[yystate];
1665 if (yyn == YYPACT_NINF)
1666 goto yydefault;
1667
1668 /* Not known => get a look-ahead token if don't already have one. */
1669
1670 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1671 if (yychar == YYEMPTY)
1672 {
1673 YYDPRINTF ((stderr, "Reading a token: "));
1674 yychar = YYLEX;
1675 }
1676
1677 if (yychar <= YYEOF)
1678 {
1679 yychar = yytoken = YYEOF;
1680 YYDPRINTF ((stderr, "Now at end of input.\n"));
1681 }
1682 else
1683 {
1684 yytoken = YYTRANSLATE (yychar);
1685 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1686 }
1687
1688 /* If the proper action on seeing token YYTOKEN is to reduce or to
1689 detect an error, take that action. */
1690 yyn += yytoken;
1691 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1692 goto yydefault;
1693 yyn = yytable[yyn];
1694 if (yyn <= 0)
1695 {
1696 if (yyn == 0 || yyn == YYTABLE_NINF)
1697 goto yyerrlab;
1698 yyn = -yyn;
1699 goto yyreduce;
1700 }
1701
1702 if (yyn == YYFINAL)
1703 YYACCEPT;
1704
1705 /* Count tokens shifted since error; after three, turn off error
1706 status. */
1707 if (yyerrstatus)
1708 yyerrstatus--;
1709
1710 /* Shift the look-ahead token. */
1711 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1712
1713 /* Discard the shifted token unless it is eof. */
1714 if (yychar != YYEOF)
1715 yychar = YYEMPTY;
1716
1717 yystate = yyn;
1718 *++yyvsp = yylval;
1719 *++yylsp = yylloc;
1720 goto yynewstate;
1721
1722
1723 /*-----------------------------------------------------------.
1724 | yydefault -- do the default action for the current state. |
1725 `-----------------------------------------------------------*/
1726 yydefault:
1727 yyn = yydefact[yystate];
1728 if (yyn == 0)
1729 goto yyerrlab;
1730 goto yyreduce;
1731
1732
1733 /*-----------------------------.
1734 | yyreduce -- Do a reduction. |
1735 `-----------------------------*/
1736 yyreduce:
1737 /* yyn is the number of a rule to reduce with. */
1738 yylen = yyr2[yyn];
1739
1740 /* If YYLEN is nonzero, implement the default value of the action:
1741 `$$ = $1'.
1742
1743 Otherwise, the following line sets YYVAL to garbage.
1744 This behavior is undocumented and Bison
1745 users should not rely upon it. Assigning to YYVAL
1746 unconditionally makes the parser a bit smaller, and it avoids a
1747 GCC warning that YYVAL may be used uninitialized. */
1748 yyval = yyvsp[1-yylen];
1749
1750 /* Default location. */
1751 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1752 YY_REDUCE_PRINT (yyn);
1753 switch (yyn)
1754 {
1755 case 2:
1756 #line 101 "src/sswf/sswf_grammar.y"
1757 {
1758 /* the returned value is the result */
1759 * (struct node_t **) result = (yyvsp[(1) - (2)].node);
1760 ;}
1761 break;
1762
1763 case 7:
1764 #line 120 "src/sswf/sswf_grammar.y"
1765 {
1766 (yyval.node) = (yyvsp[(1) - (1)].node);
1767 ;}
1768 break;
1769
1770 case 8:
1771 #line 124 "src/sswf/sswf_grammar.y"
1772 {
1773 (yyval.node) = (yyvsp[(1) - (3)].node);
1774 node_link_tail((yyval.node), (yyvsp[(3) - (3)].node));
1775 ;}
1776 break;
1777
1778 case 9:
1779 #line 132 "src/sswf/sswf_grammar.y"
1780 {
1781 (yyval.node) = (yyvsp[(1) - (1)].node);
1782 ;}
1783 break;
1784
1785 case 10:
1786 #line 136 "src/sswf/sswf_grammar.y"
1787 {
1788 /* this is equivalent to a LIST without a name */
1789 (yyval.node) = node_alloc(NODE_TYPE_OBJECT, NODE_SUBTYPE_BLOCK, (yylsp[(1) - (3)]).first_line);
1790 /* left = NULL -- always unamed object */
1791 node_link_right((yyval.node), (yyvsp[(2) - (3)].node));
1792 node_link_object((yyval.node));
1793 ;}
1794 break;
1795
1796 case 11:
1797 #line 147 "src/sswf/sswf_grammar.y"
1798 {
1799 (yyval.node) = (yyvsp[(1) - (1)].node);
1800 ;}
1801 break;
1802
1803 case 12:
1804 #line 151 "src/sswf/sswf_grammar.y"
1805 {
1806 (yyval.node) = (yyvsp[(1) - (3)].node);
1807 node_link_tail((yyval.node), (yyvsp[(3) - (3)].node));
1808 ;}
1809 break;
1810
1811 case 13:
1812 #line 159 "src/sswf/sswf_grammar.y"
1813 {
1814 (yyval.node) = (yyvsp[(1) - (2)].node);
1815 (yyval.node)->unit[NODE_UNIT_ANGLE] = (yyvsp[(2) - (2)].type);
1816 ;}
1817 break;
1818
1819 case 14:
1820 #line 164 "src/sswf/sswf_grammar.y"
1821 {
1822 (yyval.node) = (yyvsp[(1) - (2)].node);
1823 (yyval.node)->unit[NODE_UNIT_COLOR] = (yyvsp[(2) - (2)].type);
1824 ;}
1825 break;
1826
1827 case 15:
1828 #line 169 "src/sswf/sswf_grammar.y"
1829 {
1830 (yyval.node) = (yyvsp[(1) - (2)].node);
1831 (yyval.node)->unit[NODE_UNIT_RATIO] = (yyvsp[(2) - (2)].type);
1832 ;}
1833 break;
1834
1835 case 16:
1836 #line 174 "src/sswf/sswf_grammar.y"
1837 {
1838 (yyval.node) = (yyvsp[(1) - (2)].node);
1839 (yyval.node)->unit[NODE_UNIT_SIZE] = (yyvsp[(2) - (2)].type);
1840 ;}
1841 break;
1842
1843 case 17:
1844 #line 179 "src/sswf/sswf_grammar.y"
1845 {
1846 (yyval.node) = (yyvsp[(1) - (2)].node);
1847 (yyval.node)->unit[NODE_UNIT_SPEED] = (yyvsp[(2) - (2)].type);
1848 ;}
1849 break;
1850
1851 case 18:
1852 #line 184 "src/sswf/sswf_grammar.y"
1853 {
1854 (yyval.node) = (yyvsp[(1) - (2)].node);
1855 (yyval.node)->unit[NODE_UNIT_TIME] = (yyvsp[(2) - (2)].type);
1856 ;}
1857 break;
1858
1859 case 19:
1860 #line 189 "src/sswf/sswf_grammar.y"
1861 {
1862 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_FIELD, (yylsp[(1) - (3)]).first_line);
1863 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1864 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
1865 ;}
1866 break;
1867
1868 case 20:
1869 #line 195 "src/sswf/sswf_grammar.y"
1870 {
1871 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_SUBSCRIPT, (yylsp[(1) - (4)]).first_line);
1872 node_link_left((yyval.node), (yyvsp[(1) - (4)].node));
1873 node_link_right((yyval.node), (yyvsp[(3) - (4)].node));
1874 ;}
1875 break;
1876
1877 case 21:
1878 #line 201 "src/sswf/sswf_grammar.y"
1879 {
1880 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_EXPAND, (yylsp[(1) - (4)]).first_line);
1881 node_link_left((yyval.node), (yyvsp[(3) - (4)].node));
1882 ;}
1883 break;
1884
1885 case 22:
1886 #line 206 "src/sswf/sswf_grammar.y"
1887 {
1888 if((yyvsp[(2) - (3)].node)->next != NULL) {
1889 /* Check whether the expr returns a list of nodes...
1890 * This happens when a comma is used between multiple expressions.
1891 * We need to have a 'GROUP' node because all the children are affected
1892 * by the following token(s) such as a UNIT.
1893 */
1894 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_GROUP, (yylsp[(1) - (3)]).first_line);
1895 node_link_left((yyval.node), (yyvsp[(2) - (3)].node));
1896 }
1897 else {
1898 /* no worry, we don't need to add another node */
1899 (yyval.node) = (yyvsp[(2) - (3)].node);
1900 }
1901 ;}
1902 break;
1903
1904 case 23:
1905 #line 222 "src/sswf/sswf_grammar.y"
1906 {
1907 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_IDENTITY, (yylsp[(1) - (2)]).first_line);
1908 node_link_left((yyval.node), (yyvsp[(2) - (2)].node));
1909 ;}
1910 break;
1911
1912 case 24:
1913 #line 227 "src/sswf/sswf_grammar.y"
1914 {
1915 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_NEGATE, (yylsp[(1) - (2)]).first_line);
1916 node_link_left((yyval.node), (yyvsp[(2) - (2)].node));
1917 ;}
1918 break;
1919
1920 case 25:
1921 #line 232 "src/sswf/sswf_grammar.y"
1922 {
1923 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_LOGICAL_NOT, (yylsp[(1) - (2)]).first_line);
1924 node_link_left((yyval.node), (yyvsp[(2) - (2)].node));
1925 ;}
1926 break;
1927
1928 case 26:
1929 #line 237 "src/sswf/sswf_grammar.y"
1930 {
1931 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_NOT, (yylsp[(1) - (2)]).first_line);
1932 node_link_left((yyval.node), (yyvsp[(2) - (2)].node));
1933 ;}
1934 break;
1935
1936 case 27:
1937 #line 242 "src/sswf/sswf_grammar.y"
1938 {
1939 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_FUNCTION, (yylsp[(1) - (3)]).first_line);
1940 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1941 /* right = NULL -- no parameters */
1942 ;}
1943 break;
1944
1945 case 28:
1946 #line 248 "src/sswf/sswf_grammar.y"
1947 {
1948 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_FUNCTION, (yylsp[(1) - (4)]).first_line);
1949 node_link_left((yyval.node), (yyvsp[(1) - (4)].node));
1950 node_link_right((yyval.node), (yyvsp[(3) - (4)].node));
1951 ;}
1952 break;
1953
1954 case 29:
1955 #line 254 "src/sswf/sswf_grammar.y"
1956 {
1957 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_POWER, (yylsp[(1) - (3)]).first_line);
1958 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1959 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
1960 ;}
1961 break;
1962
1963 case 30:
1964 #line 260 "src/sswf/sswf_grammar.y"
1965 {
1966 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_MULTIPLY, (yylsp[(1) - (3)]).first_line);
1967 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1968 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
1969 ;}
1970 break;
1971
1972 case 31:
1973 #line 266 "src/sswf/sswf_grammar.y"
1974 {
1975 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_DIVIDE, (yylsp[(1) - (3)]).first_line);
1976 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1977 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
1978 ;}
1979 break;
1980
1981 case 32:
1982 #line 272 "src/sswf/sswf_grammar.y"
1983 {
1984 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_MODULO, (yylsp[(1) - (3)]).first_line);
1985 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1986 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
1987 ;}
1988 break;
1989
1990 case 33:
1991 #line 278 "src/sswf/sswf_grammar.y"
1992 {
1993 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_ADD, (yylsp[(1) - (3)]).first_line);
1994 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
1995 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
1996 ;}
1997 break;
1998
1999 case 34:
2000 #line 284 "src/sswf/sswf_grammar.y"
2001 {
2002 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_SUBTRACT, (yylsp[(1) - (3)]).first_line);
2003 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2004 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2005 ;}
2006 break;
2007
2008 case 35:
2009 #line 290 "src/sswf/sswf_grammar.y"
2010 {
2011 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_MINIMUM, (yylsp[(1) - (3)]).first_line);
2012 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2013 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2014 ;}
2015 break;
2016
2017 case 36:
2018 #line 296 "src/sswf/sswf_grammar.y"
2019 {
2020 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_MAXIMUM, (yylsp[(1) - (3)]).first_line);
2021 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2022 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2023 ;}
2024 break;
2025
2026 case 37:
2027 #line 302 "src/sswf/sswf_grammar.y"
2028 {
2029 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_SHIFT_LEFT, (yylsp[(1) - (3)]).first_line);
2030 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2031 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2032 ;}
2033 break;
2034
2035 case 38:
2036 #line 308 "src/sswf/sswf_grammar.y"
2037 {
2038 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_SHIFT_RIGHT, (yylsp[(1) - (3)]).first_line);
2039 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2040 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2041 ;}
2042 break;
2043
2044 case 39:
2045 #line 314 "src/sswf/sswf_grammar.y"
2046 {
2047 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_SHIFT_RIGHT_UNSIGNED, (yylsp[(1) - (3)]).first_line);
2048 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2049 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2050 ;}
2051 break;
2052
2053 case 40:
2054 #line 320 "src/sswf/sswf_grammar.y"
2055 {
2056 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_ROTATE_LEFT, (yylsp[(1) - (3)]).first_line);
2057 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2058 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2059 ;}
2060 break;
2061
2062 case 41:
2063 #line 326 "src/sswf/sswf_grammar.y"
2064 {
2065 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_ROTATE_RIGHT, (yylsp[(1) - (3)]).first_line);
2066 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2067 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2068 ;}
2069 break;
2070
2071 case 42:
2072 #line 332 "src/sswf/sswf_grammar.y"
2073 {
2074 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_EQUAL, (yylsp[(1) - (3)]).first_line);
2075 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2076 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2077 ;}
2078 break;
2079
2080 case 43:
2081 #line 338 "src/sswf/sswf_grammar.y"
2082 {
2083 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_NOT_EQUAL, (yylsp[(1) - (3)]).first_line);
2084 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2085 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2086 ;}
2087 break;
2088
2089 case 44:
2090 #line 344 "src/sswf/sswf_grammar.y"
2091 {
2092 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_LESS, (yylsp[(1) - (3)]).first_line);
2093 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2094 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2095 ;}
2096 break;
2097
2098 case 45:
2099 #line 350 "src/sswf/sswf_grammar.y"
2100 {
2101 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_LESS_EQUAL, (yylsp[(1) - (3)]).first_line);
2102 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2103 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2104 ;}
2105 break;
2106
2107 case 46:
2108 #line 356 "src/sswf/sswf_grammar.y"
2109 {
2110 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_GREATER, (yylsp[(1) - (3)]).first_line);
2111 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2112 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2113 ;}
2114 break;
2115
2116 case 47:
2117 #line 362 "src/sswf/sswf_grammar.y"
2118 {
2119 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_GREATER_EQUAL, (yylsp[(1) - (3)]).first_line);
2120 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2121 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2122 ;}
2123 break;
2124
2125 case 48:
2126 #line 368 "src/sswf/sswf_grammar.y"
2127 {
2128 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_AND, (yylsp[(1) - (3)]).first_line);
2129 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2130 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2131 ;}
2132 break;
2133
2134 case 49:
2135 #line 374 "src/sswf/sswf_grammar.y"
2136 {
2137 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_XOR, (yylsp[(1) - (3)]).first_line);
2138 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2139 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2140 ;}
2141 break;
2142
2143 case 50:
2144 #line 380 "src/sswf/sswf_grammar.y"
2145 {
2146 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_OR, (yylsp[(1) - (3)]).first_line);
2147 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2148 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2149 ;}
2150 break;
2151
2152 case 51:
2153 #line 386 "src/sswf/sswf_grammar.y"
2154 {
2155 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_LOGICAL_AND, (yylsp[(1) - (3)]).first_line);
2156 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2157 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2158 ;}
2159 break;
2160
2161 case 52:
2162 #line 392 "src/sswf/sswf_grammar.y"
2163 {
2164 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_LOGICAL_XOR, (yylsp[(1) - (3)]).first_line);
2165 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2166 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2167 ;}
2168 break;
2169
2170 case 53:
2171 #line 398 "src/sswf/sswf_grammar.y"
2172 {
2173 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_LOGICAL_OR, (yylsp[(1) - (3)]).first_line);
2174 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2175 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2176 ;}
2177 break;
2178
2179 case 54:
2180 #line 404 "src/sswf/sswf_grammar.y"
2181 {
2182 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_RANGE, (yylsp[(1) - (3)]).first_line);
2183 if((yyvsp[(1) - (3)].node)->type == NODE_TYPE_OPERATOR && (yyvsp[(1) - (3)].node)->sub_type == NODE_SUBTYPE_RANGE) {
2184 fprintf(stderr, "ERROR: at line #%d: can't have two ranges defined one after another.\n", (yylsp[(2) - (3)]).first_line);
2185 return -1;
2186 }
2187 if((yyvsp[(3) - (3)].node)->type == NODE_TYPE_OPERATOR && (yyvsp[(3) - (3)].node)->sub_type == NODE_SUBTYPE_RANGE) {
2188 fprintf(stderr, "ERROR: at line #%d: can't have two ranges defined one after another.\n", (yylsp[(2) - (3)]).first_line);
2189 return -1;
2190 }
2191 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2192 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2193 ;}
2194 break;
2195
2196 case 55:
2197 #line 418 "src/sswf/sswf_grammar.y"
2198 {
2199 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_SELECT, (yylsp[(1) - (5)]).first_line);
2200 node_link_select((yyval.node), (yyvsp[(1) - (5)].node));
2201 node_link_left((yyval.node), (yyvsp[(3) - (5)].node));
2202 node_link_right((yyval.node), (yyvsp[(5) - (5)].node));
2203 ;}
2204 break;
2205
2206 case 56:
2207 #line 425 "src/sswf/sswf_grammar.y"
2208 {
2209 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_IF, (yylsp[(1) - (9)]).first_line);
2210 node_link_select((yyval.node), (yyvsp[(3) - (9)].node));
2211 node_link_left((yyval.node), (yyvsp[(6) - (9)].node));
2212 node_link_right((yyval.node), (yyvsp[(9) - (9)].node)); /* may be a null pointer */
2213 ;}
2214 break;
2215
2216 case 57:
2217 #line 432 "src/sswf/sswf_grammar.y"
2218 {
2219 (yyval.node) = node_alloc(NODE_TYPE_OBJECT, NODE_SUBTYPE_VARIABLE, (yylsp[(1) - (3)]).first_line);
2220 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2221 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2222 node_link_object((yyval.node));
2223 ;}
2224 break;
2225
2226 case 58:
2227 #line 439 "src/sswf/sswf_grammar.y"
2228 {
2229 (yyval.node) = (yyvsp[(1) - (1)].node);
2230 ;}
2231 break;
2232
2233 case 59:
2234 #line 443 "src/sswf/sswf_grammar.y"
2235 {
2236 (yyval.node) = (yyvsp[(1) - (1)].node);
2237 ;}
2238 break;
2239
2240 case 60:
2241 #line 447 "src/sswf/sswf_grammar.y"
2242 {
2243 (yyval.node) = (yyvsp[(1) - (1)].node);
2244 ;}
2245 break;
2246
2247 case 61:
2248 #line 451 "src/sswf/sswf_grammar.y"
2249 {
2250 (yyval.node) = (yyvsp[(1) - (1)].node);
2251 ;}
2252 break;
2253
2254 case 62:
2255 #line 459 "src/sswf/sswf_grammar.y"
2256 {
2257 (yyval.node) = NULL;
2258 ;}
2259 break;
2260
2261 case 63:
2262 #line 463 "src/sswf/sswf_grammar.y"
2263 {
2264 (yyval.node) = (yyvsp[(3) - (5)].node);
2265 ;}
2266 break;
2267
2268 case 64:
2269 #line 467 "src/sswf/sswf_grammar.y"
2270 {
2271 (yyval.node) = node_alloc(NODE_TYPE_OPERATOR, NODE_SUBTYPE_IF, (yylsp[(1) - (10)]).first_line);
2272 node_link_select((yyval.node), (yyvsp[(4) - (10)].node));
2273 node_link_left((yyval.node), (yyvsp[(7) - (10)].node));
2274 node_link_right((yyval.node), (yyvsp[(10) - (10)].node)); /* may be a null pointer */
2275 ;}
2276 break;
2277
2278 case 65:
2279 #line 478 "src/sswf/sswf_grammar.y"
2280 {
2281 (yyval.node) = (yyvsp[(1) - (6)].node);
2282 /* keep only non-empty names, it simplifies some other parts of the code! */
2283 if((yyvsp[(2) - (6)].node) != NULL && (yyvsp[(2) - (6)].node)->string != NULL && *(yyvsp[(2) - (6)].node)->string != '\0') {
2284 node_link_left((yyval.node), (yyvsp[(2) - (6)].node));
2285 }
2286 node_link_right((yyval.node), (yyvsp[(4) - (6)].node));
2287 node_link_object((yyval.node));
2288 ;}
2289 break;
2290
2291 case 66:
2292 #line 488 "src/sswf/sswf_grammar.y"
2293 {
2294 (yyval.node) = (yyvsp[(1) - (5)].node);
2295 if((yyvsp[(2) - (5)].node) != NULL && (yyvsp[(2) - (5)].node)->string != NULL && *(yyvsp[(2) - (5)].node)->string != '\0') {
2296 node_link_left((yyval.node), (yyvsp[(2) - (5)].node));
2297 }
2298 /* right = NULL -- no data for this object */
2299 node_link_object((yyval.node));
2300 ;}
2301 break;
2302
2303 case 67:
2304 #line 497 "src/sswf/sswf_grammar.y"
2305 {
2306 (yyval.node) = (yyvsp[(1) - (2)].node);
2307 if((yyvsp[(2) - (2)].node) != NULL && (yyvsp[(2) - (2)].node)->string != NULL && *(yyvsp[(2) - (2)].node)->string != '\0') {
2308 node_link_left((yyval.node), (yyvsp[(2) - (2)].node));
2309 }
2310 /* right = NULL -- no data for this object */
2311 node_link_object((yyval.node));
2312 ;}
2313 break;
2314
2315 case 68:
2316 #line 506 "src/sswf/sswf_grammar.y"
2317 { sswf_read_actionscript(1); ;}
2318 break;
2319
2320 case 69:
2321 #line 508 "src/sswf/sswf_grammar.y"
2322 { sswf_read_actionscript(0); ;}
2323 break;
2324
2325 case 70:
2326 #line 510 "src/sswf/sswf_grammar.y"
2327 {
2328 struct node_t *n;
2329
2330 /*
2331 * Note: we use the 1st line of the STRING so we can generate
2332 * proper errors in the Javascript compiler.
2333 */
2334 (yyval.node) = node_alloc(NODE_TYPE_OBJECT, NODE_SUBTYPE_ACTION_SCRIPT, (yylsp[(5) - (7)]).first_line);
2335 if((yyvsp[(2) - (7)].node) != NULL && (yyvsp[(2) - (7)].node)->string != NULL && *(yyvsp[(2) - (7)].node)->string != '\0') {
2336 node_link_left((yyval.node), (yyvsp[(2) - (7)].node));
2337 }
2338 n = node_alloc(NODE_TYPE_DEFINITION, NODE_SUBTYPE_UNKNOWN, (yylsp[(1) - (7)]).first_line);
2339 /* left = NULL -- no label */
2340 node_link_right(n, (yyvsp[(5) - (7)].node));
2341 node_link_right((yyval.node), n);
2342 node_link_object((yyval.node));
2343 ;}
2344 break;
2345
2346 case 71:
2347 #line 532 "src/sswf/sswf_grammar.y"
2348 {
2349 (yyval.node) = NULL;
2350 ;}
2351 break;
2352
2353 case 72:
2354 #line 536 "src/sswf/sswf_grammar.y"
2355 {
2356 (yyval.node) = (yyvsp[(1) - (1)].node);
2357 ;}
2358 break;
2359
2360 case 73:
2361 #line 540 "src/sswf/sswf_grammar.y"
2362 {
2363 (yyval.node) = (yyvsp[(1) - (1)].node);
2364 ;}
2365 break;
2366
2367 case 74:
2368 #line 552 "src/sswf/sswf_grammar.y"
2369 {
2370 (yyval.node) = (yyvsp[(1) - (1)].node);
2371 ;}
2372 break;
2373
2374 case 75:
2375 #line 556 "src/sswf/sswf_grammar.y"
2376 {
2377 (yyval.node) = (yyvsp[(1) - (3)].node);
2378 node_link_tail((yyval.node), (yyvsp[(3) - (3)].node));
2379 ;}
2380 break;
2381
2382 case 76:
2383 #line 565 "src/sswf/sswf_grammar.y"
2384 {
2385 (yyval.node) = node_alloc(NODE_TYPE_DEFINITION, NODE_SUBTYPE_UNKNOWN, (yylsp[(1) - (3)]).first_line);
2386 node_link_left((yyval.node), (yyvsp[(1) - (3)].node));
2387 node_link_right((yyval.node), (yyvsp[(3) - (3)].node));
2388 ;}
2389 break;
2390
2391 case 77:
2392 #line 571 "src/sswf/sswf_grammar.y"
2393 {
2394 (yyval.node) = node_alloc(NODE_TYPE_DEFINITION, NODE_SUBTYPE_UNKNOWN, (yylsp[(1) - (1)]).first_line);
2395 /* left = NULL -- no label */
2396 node_link_right((yyval.node), (yyvsp[(1) - (1)].node));
2397 ;}
2398 break;
2399
2400 case 78:
2401 #line 577 "src/sswf/sswf_grammar.y"
2402 {
2403 struct node_t *for_obj, *var, *result, *block;
2404
2405 block = node_alloc(NODE_TYPE_OBJECT, NODE_SUBTYPE_BLOCK, (yylsp[(1) - (14)]).first_line);
2406 /* node_link_left() -- no name/label */
2407 node_link_right(block, (yyvsp[(12) - (14)].node));
2408
2409 var = node_alloc(NODE_TYPE_OBJECT, NODE_SUBTYPE_VARIABLE, (yylsp[(1) - (14)]).first_line);
2410 result = node_alloc(NODE_TYPE_INTEGER, NODE_SUBTYPE_UNKNOWN, (yylsp[(1) - (14)]).first_line);
2411 node_link_left(var, (yyvsp[(3) - (14)].node));
2412 node_link_right(var, result); /* the result of different expr's */
2413 node_link_object(var);
2414
2415 node_link_tail(var, (yyvsp[(5) - (14)].node));
2416 node_link_tail(var, (yyvsp[(7) - (14)].node));
2417 node_link_tail(var, (yyvsp[(9) - (14)].node));
2418 node_link_tail(var, block);
2419
2420 for_obj = node_alloc(NODE_TYPE_OBJECT, NODE_SUBTYPE_FOR, (yylsp[(1) - (14)]).first_line);
2421 /*node_link_left(for_obj, ...) -- no name for a loop - should we use the variable name? */
2422 node_link_right(for_obj, var);
2423 /*node_link_object(for_obj); -- this makes this software crash and it's not necessary (no name!) */
2424
2425 (yyval.node) = node_alloc(NODE_TYPE_DEFINITION, NODE_SUBTYPE_UNKNOWN, (yylsp[(1) - (14)]).first_line);
2426 /* left = NULL -- no label */
2427 node_link_right((yyval.node), for_obj);
2428 ;}
2429 break;
2430
2431
2432 /* Line 1267 of yacc.c. */
2433 #line 2434 "tmp/object/src/sswf/sswf_grammar.c"
2434 default: break;
2435 }
2436 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2437
2438 YYPOPSTACK (yylen);
2439 yylen = 0;
2440 YY_STACK_PRINT (yyss, yyssp);
2441
2442 *++yyvsp = yyval;
2443 *++yylsp = yyloc;
2444
2445 /* Now `shift' the result of the reduction. Determine what state
2446 that goes to, based on the state we popped back to and the rule
2447 number reduced by. */
2448
2449 yyn = yyr1[yyn];
2450
2451 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2452 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2453 yystate = yytable[yystate];
2454 else
2455 yystate = yydefgoto[yyn - YYNTOKENS];
2456
2457 goto yynewstate;
2458
2459
2460 /*------------------------------------.
2461 | yyerrlab -- here on detecting error |
2462 `------------------------------------*/
2463 yyerrlab:
2464 /* If not already recovering from an error, report this error. */
2465 if (!yyerrstatus)
2466 {
2467 ++yynerrs;
2468 #if ! YYERROR_VERBOSE
2469 yyerror (YY_("syntax error"));
2470 #else
2471 {
2472 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2473 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2474 {
2475 YYSIZE_T yyalloc = 2 * yysize;
2476 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2477 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2478 if (yymsg != yymsgbuf)
2479 YYSTACK_FREE (yymsg);
2480 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2481 if (yymsg)
2482 yymsg_alloc = yyalloc;
2483 else
2484 {
2485 yymsg = yymsgbuf;
2486 yymsg_alloc = sizeof yymsgbuf;
2487 }
2488 }
2489
2490 if (0 < yysize && yysize <= yymsg_alloc)
2491 {
2492 (void) yysyntax_error (yymsg, yystate, yychar);
2493 yyerror (yymsg);
2494 }
2495 else
2496 {
2497 yyerror (YY_("syntax error"));
2498 if (yysize != 0)
2499 goto yyexhaustedlab;
2500 }
2501 }
2502 #endif
2503 }
2504
2505 yyerror_range[0] = yylloc;
2506
2507 if (yyerrstatus == 3)
2508 {
2509 /* If just tried and failed to reuse look-ahead token after an
2510 error, discard it. */
2511
2512 if (yychar <= YYEOF)
2513 {
2514 /* Return failure if at end of input. */
2515 if (yychar == YYEOF)
2516 YYABORT;
2517 }
2518 else
2519 {
2520 yydestruct ("Error: discarding",
2521 yytoken, &yylval, &yylloc);
2522 yychar = YYEMPTY;
2523 }
2524 }
2525
2526 /* Else will try to reuse look-ahead token after shifting the error
2527 token. */
2528 goto yyerrlab1;
2529
2530
2531 /*---------------------------------------------------.
2532 | yyerrorlab -- error raised explicitly by YYERROR. |
2533 `---------------------------------------------------*/
2534 yyerrorlab:
2535
2536 /* Pacify compilers like GCC when the user code never invokes
2537 YYERROR and the label yyerrorlab therefore never appears in user
2538 code. */
2539 if (/*CONSTCOND*/ 0)
2540 goto yyerrorlab;
2541
2542 yyerror_range[0] = yylsp[1-yylen];
2543 /* Do not reclaim the symbols of the rule which action triggered
2544 this YYERROR. */
2545 YYPOPSTACK (yylen);
2546 yylen = 0;
2547 YY_STACK_PRINT (yyss, yyssp);
2548 yystate = *yyssp;
2549 goto yyerrlab1;
2550
2551
2552 /*-------------------------------------------------------------.
2553 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2554 `-------------------------------------------------------------*/
2555 yyerrlab1:
2556 yyerrstatus = 3; /* Each real token shifted decrements this. */
2557
2558 for (;;)
2559 {
2560 yyn = yypact[yystate];
2561 if (yyn != YYPACT_NINF)
2562 {
2563 yyn += YYTERROR;
2564 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2565 {
2566 yyn = yytable[yyn];
2567 if (0 < yyn)
2568 break;
2569 }
2570 }
2571
2572 /* Pop the current state because it cannot handle the error token. */
2573 if (yyssp == yyss)
2574 YYABORT;
2575
2576 yyerror_range[0] = *yylsp;
2577 yydestruct ("Error: popping",
2578 yystos[yystate], yyvsp, yylsp);
2579 YYPOPSTACK (1);
2580 yystate = *yyssp;
2581 YY_STACK_PRINT (yyss, yyssp);
2582 }
2583
2584 if (yyn == YYFINAL)
2585 YYACCEPT;
2586
2587 *++yyvsp = yylval;
2588
2589 yyerror_range[1] = yylloc;
2590 /* Using YYLLOC is tempting, but would change the location of
2591 the look-ahead. YYLOC is available though. */
2592 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
2593 *++yylsp = yyloc;
2594
2595 /* Shift the error token. */
2596 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2597
2598 yystate = yyn;
2599 goto yynewstate;
2600
2601
2602 /*-------------------------------------.
2603 | yyacceptlab -- YYACCEPT comes here. |
2604 `-------------------------------------*/
2605 yyacceptlab:
2606 yyresult = 0;
2607 goto yyreturn;
2608
2609 /*-----------------------------------.
2610 | yyabortlab -- YYABORT comes here. |
2611 `-----------------------------------*/
2612 yyabortlab:
2613 yyresult = 1;
2614 goto yyreturn;
2615
2616 #ifndef yyoverflow
2617 /*-------------------------------------------------.
2618 | yyexhaustedlab -- memory exhaustion comes here. |
2619 `-------------------------------------------------*/
2620 yyexhaustedlab:
2621 yyerror (YY_("memory exhausted"));
2622 yyresult = 2;
2623 /* Fall through. */
2624 #endif
2625
2626 yyreturn:
2627 if (yychar != YYEOF && yychar != YYEMPTY)
2628 yydestruct ("Cleanup: discarding lookahead",
2629 yytoken, &yylval, &yylloc);
2630 /* Do not reclaim the symbols of the rule which action triggered
2631 this YYABORT or YYACCEPT. */
2632 YYPOPSTACK (yylen);
2633 YY_STACK_PRINT (yyss, yyssp);
2634 while (yyssp != yyss)
2635 {
2636 yydestruct ("Cleanup: popping",
2637 yystos[*yyssp], yyvsp, yylsp);
2638 YYPOPSTACK (1);
2639 }
2640 #ifndef yyoverflow
2641 if (yyss != yyssa)
2642 YYSTACK_FREE (yyss);
2643 #endif
2644 #if YYERROR_VERBOSE
2645 if (yymsg != yymsgbuf)
2646 YYSTACK_FREE (yymsg);
2647 #endif
2648 /* Make sure YYID is used. */
2649 return YYID (yyresult);
2650 }
2651
2652
2653 #line 607 "src/sswf/sswf_grammar.y"
2654
2655
2656
yyerror(const char * msg)2657 void yyerror(const char *msg)
2658 {
2659 /* TODO: enhance this message! */
2660 printf("YACC ERROR at line #%d in file \"%s\": %s.\n", yylloc.first_line, lex_filename, msg);
2661 }
2662
2663
2664
2665
2666
2667