4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer swf4_create_buffer
9 #define yy_delete_buffer swf4_delete_buffer
10 #define yy_flex_debug swf4_flex_debug
11 #define yy_init_buffer swf4_init_buffer
12 #define yy_flush_buffer swf4_flush_buffer
13 #define yy_load_buffer_state swf4_load_buffer_state
14 #define yy_switch_to_buffer swf4_switch_to_buffer
16 #define yyleng swf4leng
18 #define yylineno swf4lineno
20 #define yyrestart swf4restart
21 #define yytext swf4text
22 #define yywrap swf4wrap
23 #define yyalloc swf4alloc
24 #define yyrealloc swf4realloc
25 #define yyfree swf4free
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t;
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
77 /* Limits of integral types. */
79 #define INT8_MIN (-128)
82 #define INT16_MIN (-32767-1)
85 #define INT32_MIN (-2147483647-1)
88 #define INT8_MAX (127)
91 #define INT16_MAX (32767)
94 #define INT32_MAX (2147483647)
97 #define UINT8_MAX (255U)
100 #define UINT16_MAX (65535U)
103 #define UINT32_MAX (4294967295U)
106 #endif /* ! FLEXINT_H */
110 /* The "const" storage-class-modifier is valid. */
113 #else /* ! __cplusplus */
115 /* C99 requires __STDC__ to be defined as 1. */
116 #if defined (__STDC__)
120 #endif /* defined (__STDC__) */
121 #endif /* ! __cplusplus */
124 #define yyconst const
129 /* Returned upon end-of-file. */
132 /* Promotes a possibly negative, possibly signed char to an unsigned
133 * integer for use as an array index. If the signed char is negative,
134 * we want to instead treat it as an 8-bit unsigned char, hence the
137 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139 /* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
143 #define BEGIN (yy_start) = 1 + 2 *
145 /* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
149 #define YY_START (((yy_start) - 1) / 2)
150 #define YYSTATE YY_START
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE swf4restart(swf4in )
158 #define YY_END_OF_BUFFER_CHAR 0
160 /* Size of default input buffer. */
162 #define YY_BUF_SIZE 16384
165 /* The state buf must be large enough to hold one state per character in the main buffer.
167 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
170 #define YY_TYPEDEF_YY_BUFFER_STATE
171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
176 extern FILE *swf4in, *swf4out;
178 #define EOB_ACT_CONTINUE_SCAN 0
179 #define EOB_ACT_END_OF_FILE 1
180 #define EOB_ACT_LAST_MATCH 2
182 #define YY_LESS_LINENO(n)
184 /* Return all but the first "n" matched characters back to the input stream. */
188 /* Undo effects of setting up swf4text. */ \
189 int yyless_macro_arg = (n); \
190 YY_LESS_LINENO(yyless_macro_arg);\
191 *yy_cp = (yy_hold_char); \
192 YY_RESTORE_YY_MORE_OFFSET \
193 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
194 YY_DO_BEFORE_ACTION; /* set up swf4text again */ \
198 #define unput(c) yyunput( c, (yytext_ptr) )
200 #ifndef YY_TYPEDEF_YY_SIZE_T
201 #define YY_TYPEDEF_YY_SIZE_T
202 typedef size_t yy_size_t;
205 #ifndef YY_STRUCT_YY_BUFFER_STATE
206 #define YY_STRUCT_YY_BUFFER_STATE
207 struct yy_buffer_state
211 char *yy_ch_buf; /* input buffer */
212 char *yy_buf_pos; /* current position in input buffer */
214 /* Size of input buffer in bytes, not including room for EOB
217 yy_size_t yy_buf_size;
219 /* Number of characters read into yy_ch_buf, not including EOB
224 /* Whether we "own" the buffer - i.e., we know we created it,
225 * and can realloc() it to grow it, and should free() it to
228 int yy_is_our_buffer;
230 /* Whether this is an "interactive" input source; if so, and
231 * if we're using stdio for input, then we want to use getc()
232 * instead of fread(), to make sure we stop fetching input after
235 int yy_is_interactive;
237 /* Whether we're considered to be at the beginning of a line.
238 * If so, '^' rules will be active on the next match, otherwise
243 int yy_bs_lineno; /**< The line count. */
244 int yy_bs_column; /**< The column count. */
246 /* Whether to try to fill the input buffer when we reach the
251 int yy_buffer_status;
253 #define YY_BUFFER_NEW 0
254 #define YY_BUFFER_NORMAL 1
255 /* When an EOF's been seen but there's still some text to process
256 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257 * shouldn't try reading from the input source any more. We might
258 * still have a bunch of tokens to match, though, because of
259 * possible backing-up.
261 * When we actually see the EOF, we change the status to "new"
262 * (via swf4restart()), so that the user can continue scanning by
263 * just pointing swf4in at a new input file.
265 #define YY_BUFFER_EOF_PENDING 2
268 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
270 /* Stack of input buffers. */
271 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
275 /* We provide macros for accessing buffer states in case in the
276 * future we want to put the buffer states in a more general
279 * Returns the top of the stack, or NULL.
281 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
285 /* Same as previous macro, but useful when we know that the buffer stack is not
286 * NULL or when we need an lvalue. For internal use only.
288 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
290 /* yy_hold_char holds the character lost when swf4text is formed. */
291 static char yy_hold_char;
292 static int yy_n_chars; /* number of characters read into yy_ch_buf */
295 /* Points to current character in buffer. */
296 static char *yy_c_buf_p = (char *) 0;
297 static int yy_init = 0; /* whether we need to initialize */
298 static int yy_start = 0; /* start state number */
300 /* Flag which is used to allow swf4wrap()'s to do buffer switches
301 * instead of setting up a fresh swf4in. A bit of a hack ...
303 static int yy_did_buffer_switch_on_eof;
305 void swf4restart (FILE *input_file );
306 void swf4_switch_to_buffer (YY_BUFFER_STATE new_buffer );
307 YY_BUFFER_STATE swf4_create_buffer (FILE *file,int size );
308 void swf4_delete_buffer (YY_BUFFER_STATE b );
309 void swf4_flush_buffer (YY_BUFFER_STATE b );
310 void swf4push_buffer_state (YY_BUFFER_STATE new_buffer );
311 void swf4pop_buffer_state (void );
313 static void swf4ensure_buffer_stack (void );
314 static void swf4_load_buffer_state (void );
315 static void swf4_init_buffer (YY_BUFFER_STATE b,FILE *file );
317 #define YY_FLUSH_BUFFER swf4_flush_buffer(YY_CURRENT_BUFFER )
319 YY_BUFFER_STATE swf4_scan_buffer (char *base,yy_size_t size );
320 YY_BUFFER_STATE swf4_scan_string (yyconst char *yy_str );
321 YY_BUFFER_STATE swf4_scan_bytes (yyconst char *bytes,int len );
323 void *swf4alloc (yy_size_t );
324 void *swf4realloc (void *,yy_size_t );
325 void swf4free (void * );
327 #define yy_new_buffer swf4_create_buffer
329 #define yy_set_interactive(is_interactive) \
331 if ( ! YY_CURRENT_BUFFER ){ \
332 swf4ensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 swf4_create_buffer(swf4in,YY_BUF_SIZE ); \
336 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
339 #define yy_set_bol(at_bol) \
341 if ( ! YY_CURRENT_BUFFER ){\
342 swf4ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 swf4_create_buffer(swf4in,YY_BUF_SIZE ); \
346 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
349 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
351 /* Begin user sect3 */
353 typedef unsigned char YY_CHAR;
355 FILE *swf4in = (FILE *) 0, *swf4out = (FILE *) 0;
357 typedef int yy_state_type;
359 extern int swf4lineno;
363 extern char *swf4text;
364 #define yytext_ptr swf4text
366 static yy_state_type yy_get_previous_state (void );
367 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
368 static int yy_get_next_buffer (void );
369 static void yy_fatal_error (yyconst char msg[] );
371 /* Done after the current pattern has been matched and before the
372 * corresponding action - sets up swf4text.
374 #define YY_DO_BEFORE_ACTION \
375 (yytext_ptr) = yy_bp; \
376 swf4leng = (size_t) (yy_cp - yy_bp); \
377 (yy_hold_char) = *yy_cp; \
379 (yy_c_buf_p) = yy_cp;
381 #define YY_NUM_RULES 95
382 #define YY_END_OF_BUFFER 96
383 /* This struct is not used in this scanner,
384 but its presence is necessary. */
387 flex_int32_t yy_verify;
390 static yyconst flex_int16_t yy_accept[320] =
392 0, 0, 96, 94, 56, 93, 94, 82, 94, 79,
393 94, 83, 84, 80, 77, 89, 78, 90, 81, 1,
394 92, 75, 59, 76, 60, 91, 47, 47, 47, 47,
395 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
396 47, 47, 47, 85, 86, 87, 94, 88, 93, 64,
397 0, 52, 50, 0, 65, 0, 53, 51, 0, 67,
398 57, 69, 58, 70, 74, 0, 54, 48, 55, 68,
399 48, 2, 1, 61, 63, 62, 0, 47, 47, 47,
400 47, 47, 11, 47, 47, 47, 47, 47, 47, 47,
401 9, 47, 47, 47, 47, 47, 47, 47, 47, 47,
403 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
404 47, 47, 66, 72, 48, 48, 2, 73, 71, 49,
405 49, 47, 47, 24, 47, 47, 47, 47, 8, 47,
406 33, 47, 16, 47, 47, 47, 47, 23, 47, 47,
407 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
408 47, 47, 47, 47, 47, 49, 49, 47, 47, 47,
409 47, 47, 7, 47, 47, 47, 47, 47, 47, 47,
410 47, 47, 37, 32, 47, 47, 47, 47, 47, 38,
411 47, 47, 46, 14, 47, 47, 3, 47, 47, 5,
412 47, 47, 47, 47, 4, 47, 47, 47, 47, 47,
414 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
415 47, 47, 47, 47, 47, 20, 47, 10, 47, 17,
416 47, 47, 47, 47, 26, 47, 47, 15, 47, 47,
417 47, 34, 47, 13, 47, 47, 47, 47, 47, 30,
418 47, 47, 47, 47, 47, 47, 47, 47, 27, 47,
419 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
420 47, 47, 12, 47, 6, 47, 47, 47, 47, 47,
421 47, 47, 47, 47, 47, 47, 47, 22, 47, 47,
422 47, 25, 47, 47, 47, 47, 41, 28, 47, 35,
423 36, 47, 44, 21, 47, 47, 47, 47, 47, 47,
425 47, 47, 19, 40, 45, 47, 47, 43, 31, 42,
426 47, 47, 47, 47, 47, 18, 29, 39, 0
429 static yyconst flex_int32_t yy_ec[256] =
431 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
432 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 2, 5, 6, 1, 1, 1, 7, 8, 9,
435 10, 11, 12, 13, 14, 15, 16, 17, 18, 17,
436 17, 17, 17, 17, 17, 17, 17, 19, 20, 21,
437 22, 23, 24, 1, 25, 26, 27, 28, 29, 30,
438 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
439 41, 42, 43, 44, 45, 46, 47, 48, 49, 34,
440 50, 51, 52, 1, 34, 1, 53, 54, 55, 56,
442 57, 58, 59, 60, 61, 34, 62, 63, 64, 65,
443 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
444 76, 34, 77, 78, 79, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 static yyconst flex_int32_t yy_meta[80] =
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 2, 1, 1, 1, 3, 4, 5, 5, 1, 1,
465 1, 2, 1, 1, 6, 6, 6, 6, 6, 6,
466 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
467 6, 6, 6, 6, 6, 6, 6, 6, 6, 1,
468 1, 1, 6, 6, 6, 6, 6, 6, 6, 6,
469 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
470 6, 6, 6, 6, 6, 6, 1, 1, 1
473 static yyconst flex_int16_t yy_base[327] =
475 0, 0, 878, 879, 879, 879, 874, 854, 77, 868,
476 78, 879, 879, 852, 70, 879, 71, 72, 79, 81,
477 879, 879, 851, 850, 849, 879, 854, 68, 81, 73,
478 75, 91, 86, 84, 107, 111, 89, 139, 137, 138,
479 164, 110, 116, 879, 879, 879, 791, 879, 879, 846,
480 118, 153, 879, 864, 879, 100, 162, 879, 863, 879,
481 879, 879, 879, 879, 849, 176, 879, 156, 879, 879,
482 844, 167, 171, 836, 828, 879, 817, 815, 183, 184,
483 185, 191, 814, 195, 198, 200, 201, 206, 202, 207,
484 811, 216, 199, 223, 210, 212, 233, 228, 222, 250,
486 229, 234, 253, 261, 226, 259, 241, 256, 272, 280,
487 274, 268, 879, 879, 809, 807, 291, 879, 879, 296,
488 806, 288, 283, 805, 290, 299, 307, 300, 803, 302,
489 310, 305, 800, 316, 312, 314, 322, 798, 332, 340,
490 326, 337, 341, 343, 344, 333, 347, 338, 351, 362,
491 367, 376, 373, 360, 379, 797, 796, 381, 380, 393,
492 390, 396, 795, 404, 406, 408, 411, 409, 412, 428,
493 424, 420, 794, 793, 429, 425, 432, 444, 431, 456,
494 450, 452, 788, 779, 454, 457, 778, 477, 479, 776,
495 473, 460, 433, 484, 773, 491, 493, 494, 487, 502,
497 503, 504, 463, 506, 512, 508, 521, 517, 513, 525,
498 522, 533, 531, 535, 540, 769, 545, 753, 551, 712,
499 549, 562, 550, 546, 101, 564, 577, 676, 563, 580,
500 582, 675, 585, 670, 579, 574, 587, 592, 567, 648,
501 598, 602, 607, 609, 603, 608, 625, 615, 645, 626,
502 610, 635, 638, 611, 639, 641, 653, 637, 664, 643,
503 667, 642, 612, 668, 529, 672, 678, 647, 669, 684,
504 686, 693, 691, 695, 703, 696, 706, 497, 705, 701,
505 719, 465, 711, 726, 715, 729, 439, 436, 723, 421,
506 388, 731, 372, 353, 735, 737, 734, 740, 746, 741,
508 744, 752, 275, 267, 218, 763, 768, 203, 163, 158,
509 771, 747, 759, 764, 757, 145, 93, 88, 879, 834,
510 840, 845, 848, 851, 855, 858
513 static yyconst flex_int16_t yy_def[327] =
515 319, 1, 319, 319, 319, 319, 319, 319, 320, 319,
516 321, 319, 319, 319, 319, 319, 319, 319, 322, 319,
517 319, 319, 319, 319, 319, 319, 323, 323, 323, 323,
518 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
519 323, 323, 323, 319, 319, 319, 319, 319, 319, 319,
520 320, 320, 319, 320, 319, 321, 321, 319, 321, 319,
521 319, 319, 319, 319, 319, 322, 319, 319, 319, 319,
522 324, 319, 319, 319, 319, 319, 325, 323, 323, 323,
523 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
524 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
526 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
527 323, 323, 319, 319, 319, 324, 319, 319, 319, 319,
528 326, 323, 323, 323, 323, 323, 323, 323, 323, 323,
529 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
530 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
531 323, 323, 323, 323, 323, 319, 326, 323, 323, 323,
532 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
533 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
534 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
535 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
537 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
538 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
539 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
540 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
541 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
542 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
543 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
544 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
545 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
546 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
548 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
549 323, 323, 323, 323, 323, 323, 323, 323, 0, 319,
550 319, 319, 319, 319, 319, 319
553 static yyconst flex_int16_t yy_nxt[959] =
555 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
556 14, 15, 16, 17, 18, 19, 20, 20, 21, 22,
557 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
558 33, 27, 34, 27, 27, 35, 27, 36, 37, 38,
559 27, 39, 40, 41, 27, 42, 43, 27, 27, 44,
560 4, 45, 27, 28, 29, 30, 31, 32, 33, 27,
561 34, 27, 35, 27, 36, 37, 38, 27, 39, 40,
562 41, 27, 42, 43, 27, 27, 46, 47, 48, 52,
563 57, 61, 53, 77, 63, 58, 65, 66, 77, 67,
564 77, 62, 64, 68, 69, 72, 77, 73, 73, 77,
566 70, 77, 57, 77, 77, 80, 77, 58, 77, 79,
567 85, 83, 81, 91, 89, 86, 77, 84, 249, 82,
568 52, 92, 77, 53, 90, 77, 77, 54, 59, 87,
569 97, 77, 88, 80, 111, 93, 79, 85, 83, 95,
570 81, 91, 89, 86, 84, 94, 82, 112, 92, 96,
571 59, 90, 77, 77, 77, 52, 87, 97, 53, 88,
572 77, 101, 111, 93, 57, 102, 103, 95, 54, 58,
573 115, 66, 94, 77, 98, 112, 96, 99, 77, 77,
574 100, 104, 105, 117, 117, 72, 319, 73, 73, 101,
575 68, 319, 106, 102, 103, 107, 108, 319, 77, 77,
577 77, 98, 109, 54, 99, 110, 77, 100, 104, 105,
578 77, 122, 59, 77, 77, 77, 77, 77, 77, 123,
579 106, 77, 77, 107, 108, 77, 124, 77, 125, 109,
580 130, 77, 110, 77, 126, 128, 134, 77, 77, 122,
581 127, 77, 129, 77, 77, 131, 123, 135, 77, 77,
582 132, 147, 139, 124, 137, 125, 77, 136, 130, 133,
583 138, 126, 128, 134, 140, 77, 142, 127, 77, 129,
584 143, 77, 131, 149, 77, 135, 77, 132, 141, 147,
585 139, 137, 77, 77, 136, 145, 133, 77, 138, 77,
586 77, 140, 150, 142, 148, 77, 144, 143, 77, 146,
588 155, 149, 151, 77, 152, 77, 141, 117, 117, 154,
589 156, 77, 158, 145, 77, 77, 160, 77, 159, 150,
590 77, 148, 77, 144, 153, 77, 146, 77, 155, 77,
591 151, 77, 152, 161, 162, 163, 154, 77, 165, 170,
592 158, 77, 164, 168, 160, 159, 169, 77, 77, 166,
593 172, 153, 77, 77, 167, 77, 77, 171, 77, 77,
594 161, 162, 77, 163, 176, 165, 77, 170, 77, 164,
595 168, 175, 180, 182, 169, 77, 166, 77, 172, 177,
596 173, 167, 77, 174, 171, 179, 178, 77, 77, 181,
597 184, 77, 176, 183, 77, 77, 77, 185, 175, 180,
599 182, 187, 186, 77, 188, 77, 177, 173, 77, 191,
600 174, 77, 179, 178, 189, 190, 181, 192, 184, 77,
601 183, 77, 193, 77, 77, 185, 77, 77, 194, 187,
602 186, 188, 195, 199, 196, 77, 77, 191, 200, 77,
603 77, 189, 190, 77, 77, 192, 77, 77, 77, 197,
604 193, 77, 198, 204, 77, 201, 194, 205, 206, 77,
605 195, 199, 196, 207, 202, 77, 200, 77, 209, 77,
606 221, 77, 77, 203, 210, 77, 197, 208, 77, 198,
607 77, 204, 201, 211, 205, 216, 206, 230, 77, 215,
608 207, 202, 77, 213, 77, 214, 209, 221, 212, 77,
610 203, 210, 77, 220, 208, 217, 77, 218, 77, 77,
611 222, 211, 77, 216, 219, 230, 215, 77, 77, 77,
612 213, 77, 214, 77, 226, 212, 223, 77, 77, 225,
613 220, 224, 77, 217, 228, 218, 77, 77, 222, 232,
614 77, 219, 229, 227, 77, 235, 77, 231, 77, 233,
615 77, 226, 237, 223, 236, 77, 225, 234, 224, 241,
616 77, 77, 228, 238, 77, 77, 77, 232, 242, 229,
617 227, 239, 240, 235, 231, 244, 233, 77, 77, 77,
618 237, 236, 77, 243, 234, 248, 246, 241, 247, 77,
619 238, 250, 77, 245, 77, 77, 242, 77, 239, 240,
621 77, 251, 77, 244, 257, 256, 254, 77, 252, 255,
622 243, 260, 248, 77, 246, 247, 259, 77, 77, 250,
623 245, 253, 77, 77, 77, 77, 77, 77, 258, 251,
624 77, 265, 257, 256, 254, 252, 263, 255, 260, 261,
625 77, 77, 262, 268, 259, 264, 270, 273, 253, 267,
626 77, 266, 77, 77, 77, 258, 77, 77, 77, 265,
627 77, 277, 77, 77, 263, 269, 261, 271, 77, 262,
628 272, 268, 264, 270, 273, 274, 275, 267, 266, 77,
629 279, 276, 77, 77, 77, 77, 281, 77, 285, 277,
630 77, 77, 269, 77, 278, 271, 282, 280, 272, 77,
632 283, 77, 274, 275, 286, 284, 77, 279, 77, 276,
633 77, 77, 287, 281, 288, 285, 77, 289, 77, 290,
634 77, 77, 278, 291, 282, 280, 77, 77, 283, 296,
635 77, 286, 295, 284, 77, 292, 294, 298, 77, 293,
636 287, 77, 288, 297, 77, 289, 77, 290, 302, 77,
637 77, 291, 77, 301, 299, 77, 77, 296, 300, 77,
638 295, 77, 77, 292, 294, 298, 293, 77, 77, 306,
639 303, 297, 77, 308, 77, 307, 302, 304, 77, 77,
640 305, 301, 299, 77, 77, 300, 77, 311, 77, 309,
641 315, 77, 310, 77, 77, 312, 306, 303, 316, 314,
643 313, 308, 307, 77, 304, 318, 317, 305, 77, 77,
644 77, 77, 77, 77, 311, 77, 309, 315, 77, 310,
645 77, 77, 66, 312, 66, 316, 77, 314, 313, 77,
646 77, 120, 318, 317, 51, 51, 51, 51, 51, 51,
647 56, 56, 56, 56, 56, 56, 71, 71, 71, 119,
648 71, 78, 78, 78, 116, 116, 116, 121, 118, 66,
649 121, 157, 157, 157, 66, 319, 319, 114, 113, 77,
650 76, 75, 74, 60, 55, 50, 49, 319, 3, 319,
651 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
652 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
654 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
655 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
656 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
657 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
658 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
659 319, 319, 319, 319, 319, 319, 319, 319
662 static yyconst flex_int16_t yy_chk[959] =
664 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
665 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
666 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
667 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
668 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
669 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
670 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
671 1, 1, 1, 1, 1, 1, 1, 1, 1, 9,
672 11, 15, 9, 28, 17, 11, 18, 18, 30, 19,
673 31, 15, 17, 19, 19, 20, 29, 20, 20, 34,
675 19, 33, 56, 318, 37, 29, 32, 56, 317, 28,
676 31, 30, 29, 34, 33, 32, 225, 30, 225, 29,
677 51, 34, 35, 51, 33, 42, 36, 9, 11, 32,
678 37, 43, 32, 29, 42, 35, 28, 31, 30, 36,
679 29, 34, 33, 32, 30, 35, 29, 43, 34, 36,
680 56, 33, 39, 40, 38, 52, 32, 37, 52, 32,
681 316, 39, 42, 35, 57, 39, 40, 36, 51, 57,
682 68, 68, 35, 310, 38, 43, 36, 38, 309, 41,
683 38, 40, 40, 72, 72, 73, 66, 73, 73, 39,
684 66, 66, 41, 39, 40, 41, 41, 66, 79, 80,
686 81, 38, 41, 52, 38, 41, 82, 38, 40, 40,
687 84, 79, 57, 85, 93, 86, 87, 89, 308, 80,
688 41, 88, 90, 41, 41, 95, 81, 96, 82, 41,
689 88, 92, 41, 305, 84, 86, 93, 99, 94, 79,
690 85, 105, 87, 98, 101, 89, 80, 94, 97, 102,
691 90, 105, 98, 81, 96, 82, 107, 95, 88, 92,
692 97, 84, 86, 93, 99, 100, 101, 85, 103, 87,
693 102, 108, 89, 107, 106, 94, 104, 90, 100, 105,
694 98, 96, 304, 112, 95, 104, 92, 109, 97, 111,
695 303, 99, 108, 101, 106, 110, 103, 102, 123, 104,
697 112, 107, 109, 122, 110, 125, 100, 117, 117, 111,
698 120, 120, 122, 104, 126, 128, 125, 130, 123, 108,
699 132, 106, 127, 103, 110, 131, 104, 135, 112, 136,
700 109, 134, 110, 125, 126, 127, 111, 137, 130, 135,
701 122, 141, 128, 132, 125, 123, 134, 139, 146, 131,
702 137, 110, 142, 148, 131, 140, 143, 136, 144, 145,
703 125, 126, 147, 127, 142, 130, 149, 135, 294, 128,
704 132, 141, 146, 148, 134, 154, 131, 150, 137, 143,
705 139, 131, 151, 140, 136, 145, 144, 293, 153, 147,
706 150, 152, 142, 149, 155, 159, 158, 151, 141, 146,
708 148, 153, 152, 291, 154, 161, 143, 139, 160, 159,
709 140, 162, 145, 144, 155, 158, 147, 160, 150, 164,
710 149, 165, 161, 166, 168, 151, 167, 169, 162, 153,
711 152, 154, 164, 168, 165, 172, 290, 159, 168, 171,
712 176, 155, 158, 170, 175, 160, 179, 177, 193, 166,
713 161, 288, 167, 171, 287, 169, 162, 172, 175, 178,
714 164, 168, 165, 176, 170, 181, 168, 182, 178, 185,
715 193, 180, 186, 170, 179, 192, 166, 177, 203, 167,
716 282, 171, 169, 180, 172, 186, 175, 203, 191, 185,
717 176, 170, 188, 181, 189, 182, 178, 193, 180, 194,
719 170, 179, 199, 192, 177, 188, 196, 189, 197, 198,
720 194, 180, 278, 186, 191, 203, 185, 200, 201, 202,
721 181, 204, 182, 206, 199, 180, 196, 205, 209, 198,
722 192, 197, 208, 188, 201, 189, 207, 211, 194, 205,
723 210, 191, 202, 200, 265, 208, 213, 204, 212, 206,
724 214, 199, 210, 196, 209, 215, 198, 207, 197, 214,
725 217, 224, 201, 211, 221, 223, 219, 205, 215, 202,
726 200, 212, 213, 208, 204, 219, 206, 222, 229, 226,
727 210, 209, 239, 217, 207, 224, 222, 214, 223, 236,
728 211, 226, 227, 221, 235, 230, 215, 231, 212, 213,
730 233, 227, 237, 219, 236, 235, 231, 238, 229, 233,
731 217, 239, 224, 241, 222, 223, 238, 242, 245, 226,
732 221, 230, 243, 246, 244, 251, 254, 263, 237, 227,
733 248, 245, 236, 235, 231, 229, 243, 233, 239, 241,
734 247, 250, 242, 248, 238, 244, 251, 254, 230, 247,
735 252, 246, 258, 253, 255, 237, 256, 262, 260, 245,
736 249, 258, 268, 240, 243, 250, 241, 252, 257, 242,
737 253, 248, 244, 251, 254, 255, 256, 247, 246, 259,
738 260, 257, 261, 264, 269, 234, 262, 266, 268, 258,
739 232, 228, 250, 267, 259, 252, 264, 261, 253, 270,
741 266, 271, 255, 256, 269, 267, 273, 260, 272, 257,
742 274, 276, 270, 262, 271, 268, 280, 272, 275, 273,
743 279, 277, 259, 274, 264, 261, 283, 220, 266, 280,
744 285, 269, 279, 267, 281, 275, 277, 283, 289, 276,
745 270, 284, 271, 281, 286, 272, 292, 273, 289, 297,
746 295, 274, 296, 286, 284, 298, 300, 280, 285, 301,
747 279, 299, 312, 275, 277, 283, 276, 302, 218, 297,
748 292, 281, 315, 299, 313, 298, 289, 295, 306, 314,
749 296, 286, 284, 307, 216, 285, 311, 302, 195, 300,
750 312, 190, 301, 187, 184, 306, 297, 292, 313, 311,
752 307, 299, 298, 183, 295, 315, 314, 296, 174, 173,
753 163, 157, 156, 138, 302, 133, 300, 312, 129, 301,
754 124, 121, 116, 306, 115, 313, 91, 311, 307, 83,
755 78, 77, 315, 314, 320, 320, 320, 320, 320, 320,
756 321, 321, 321, 321, 321, 321, 322, 322, 322, 75,
757 322, 323, 323, 323, 324, 324, 324, 325, 74, 71,
758 325, 326, 326, 326, 65, 59, 54, 50, 47, 27,
759 25, 24, 23, 14, 10, 8, 7, 3, 319, 319,
760 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
761 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
763 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
764 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
765 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
766 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
767 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
768 319, 319, 319, 319, 319, 319, 319, 319
771 static yy_state_type yy_last_accepting_state;
772 static char *yy_last_accepting_cpos;
774 extern int swf4_flex_debug;
775 int swf4_flex_debug = 0;
777 /* The intent behind this definition is that it'll catch
778 * any uses of REJECT which flex missed.
780 #define REJECT reject_used_but_not_detected
781 #define yymore() yymore_used_but_not_detected
782 #define YY_MORE_ADJ 0
783 #define YY_RESTORE_YY_MORE_OFFSET
785 #line 1 "swf4compiler.flex"
786 #line 2 "swf4compiler.flex"
793 #include "blocks/error.h"
794 #include "swf4compiler.tab.h" /* defines token types */
796 static int swf4debug;
798 static const char *lexBuffer = NULL;
799 static int lexBufferLen = 0;
801 static int sLineNumber = 0;
802 static char szLine[1024];
803 static char msgbufs[2][1024] = { {0}, {0} }, *msgline = {0};
804 static int column = 0;
806 static void comment();
807 static void comment1();
809 static void warning(char *msg);
811 #define YY_INPUT(buf,result,max_size) result=lexBufferInput(buf, max_size)
813 /* thanks to the prolific and brilliant Raff: */
814 static int lexBufferInput(char *buf, int max_size)
816 int l = lexBufferLen > max_size ? max_size : lexBufferLen;
818 if (lexBufferLen <= 0)
821 memcpy(buf, lexBuffer, l);
827 /* very inefficient method of unescaping strings */
828 static void unescape(char *buf)
832 for (p1=buf; (p=strchr(p1, '\\')) != 0; p1 = p+1) {
835 case 'b' : p[1] = '\b'; break;
836 case 'f' : p[1] = '\f'; break;
837 case 'n' : p[1] = '\n'; break;
838 case 'r' : p[1] = '\r'; break;
839 case 't' : p[1] = '\t'; break;
841 case 'u' : warning("unsupported escape sequence");
847 void swf4ParseInit(const char *script, int debug)
855 lexBufferLen = strlen(script);
858 msgline = msgbufs[0];
861 #line 79 "swf4compiler.flex"
862 // forward declaration needed by the following function
865 #define YY_PROTO(proto) proto
867 #define YY_PROTO(proto) ()
870 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
872 void do_unput4(const char c) { unput(c); }
873 #line 874 "lex.swf4.c"
877 #ifndef YY_NO_UNISTD_H
878 /* Special case for "unistd.h", since it is non-ANSI. We include it way
879 * down here because we want the user's section 1 to have been scanned first.
880 * The user has a chance to override it with an option.
885 #ifndef YY_EXTRA_TYPE
886 #define YY_EXTRA_TYPE void *
889 static int yy_init_globals (void );
891 /* Accessor methods to globals.
892 These are made visible to non-reentrant scanners for convenience. */
894 int swf4lex_destroy (void );
896 int swf4get_debug (void );
898 void swf4set_debug (int debug_flag );
900 YY_EXTRA_TYPE swf4get_extra (void );
902 void swf4set_extra (YY_EXTRA_TYPE user_defined );
904 FILE *swf4get_in (void );
906 void swf4set_in (FILE * in_str );
908 FILE *swf4get_out (void );
910 void swf4set_out (FILE * out_str );
912 int swf4get_leng (void );
914 char *swf4get_text (void );
916 int swf4get_lineno (void );
918 void swf4set_lineno (int line_number );
920 /* Macros after this point can all be overridden by user definitions in
924 #ifndef YY_SKIP_YYWRAP
926 extern "C" int swf4wrap (void );
928 extern int swf4wrap (void );
932 static void yyunput (int c,char *buf_ptr );
935 static void yy_flex_strncpy (char *,yyconst char *,int );
938 #ifdef YY_NEED_STRLEN
939 static int yy_flex_strlen (yyconst char * );
945 static int yyinput (void );
947 static int input (void );
952 /* Amount of stuff to slurp up with each read. */
953 #ifndef YY_READ_BUF_SIZE
954 #define YY_READ_BUF_SIZE 8192
957 /* Copy whatever the last rule matched to the standard output. */
959 /* This used to be an fputs(), but since the string might contain NUL's,
960 * we now use fwrite().
962 #define ECHO fwrite( swf4text, swf4leng, 1, swf4out )
965 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
966 * is returned in "result".
969 #define YY_INPUT(buf,result,max_size) \
970 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
974 for ( n = 0; n < max_size && \
975 (c = getc( swf4in )) != EOF && c != '\n'; ++n ) \
978 buf[n++] = (char) c; \
979 if ( c == EOF && ferror( swf4in ) ) \
980 YY_FATAL_ERROR( "input in flex scanner failed" ); \
986 while ( (result = fread(buf, 1, max_size, swf4in))==0 && ferror(swf4in)) \
988 if( errno != EINTR) \
990 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1001 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1002 * we don't want an extra ';' after the "return" because that will cause
1003 * some compilers to complain about unreachable statements.
1006 #define yyterminate() return YY_NULL
1009 /* Number of entries by which start-condition stack grows. */
1010 #ifndef YY_START_STACK_INCR
1011 #define YY_START_STACK_INCR 25
1014 /* Report a fatal error. */
1015 #ifndef YY_FATAL_ERROR
1016 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1019 /* end tables serialization structures and prototypes */
1021 /* Default declaration of generated scanner - a define so the user can
1022 * easily add parameters.
1025 #define YY_DECL_IS_OURS 1
1027 extern int swf4lex (void);
1029 #define YY_DECL int swf4lex (void)
1030 #endif /* !YY_DECL */
1032 /* Code executed at the beginning of each rule, after swf4text and swf4leng
1035 #ifndef YY_USER_ACTION
1036 #define YY_USER_ACTION
1039 /* Code executed at the end of each rule. */
1041 #define YY_BREAK break;
1044 #define YY_RULE_SETUP \
1047 /** The main scanner function which does all the work.
1051 register yy_state_type yy_current_state;
1052 register char *yy_cp, *yy_bp;
1053 register int yy_act;
1055 #line 96 "swf4compiler.flex"
1058 #line 1059 "lex.swf4.c"
1069 (yy_start) = 1; /* first start state */
1077 if ( ! YY_CURRENT_BUFFER ) {
1078 swf4ensure_buffer_stack ();
1079 YY_CURRENT_BUFFER_LVALUE =
1080 swf4_create_buffer(swf4in,YY_BUF_SIZE );
1083 swf4_load_buffer_state( );
1086 while ( 1 ) /* loops until end-of-file is reached */
1088 yy_cp = (yy_c_buf_p);
1090 /* Support of swf4text. */
1091 *yy_cp = (yy_hold_char);
1093 /* yy_bp points to the position in yy_ch_buf of the start of
1098 yy_current_state = (yy_start);
1102 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1103 if ( yy_accept[yy_current_state] )
1105 (yy_last_accepting_state) = yy_current_state;
1106 (yy_last_accepting_cpos) = yy_cp;
1108 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1110 yy_current_state = (int) yy_def[yy_current_state];
1111 if ( yy_current_state >= 320 )
1112 yy_c = yy_meta[(unsigned int) yy_c];
1114 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1117 while ( yy_base[yy_current_state] != 879 );
1120 yy_act = yy_accept[yy_current_state];
1122 { /* have to back up */
1123 yy_cp = (yy_last_accepting_cpos);
1124 yy_current_state = (yy_last_accepting_state);
1125 yy_act = yy_accept[yy_current_state];
1128 YY_DO_BEFORE_ACTION;
1130 do_action: /* This label is used only to access EOF actions. */
1133 { /* beginning of action switch */
1134 case 0: /* must back up */
1135 /* undo the effects of YY_DO_BEFORE_ACTION */
1136 *yy_cp = (yy_hold_char);
1137 yy_cp = (yy_last_accepting_cpos);
1138 yy_current_state = (yy_last_accepting_state);
1139 goto yy_find_action;
1143 #line 98 "swf4compiler.flex"
1144 { count(); swf4lval.str = strdup(swf4text);
1149 #line 100 "swf4compiler.flex"
1150 { count(); swf4lval.str = strdup(swf4text);
1155 #line 102 "swf4compiler.flex"
1156 { count(); swf4lval.str = strdup("1");
1161 #line 104 "swf4compiler.flex"
1162 { count(); swf4lval.str = strdup("0");
1167 #line 106 "swf4compiler.flex"
1168 { count(); return BREAK; }
1172 #line 107 "swf4compiler.flex"
1173 { count(); return CONTINUE; }
1177 #line 108 "swf4compiler.flex"
1178 { count(); return ELSE; }
1182 #line 109 "swf4compiler.flex"
1183 { count(); return FOR; }
1187 #line 110 "swf4compiler.flex"
1188 { count(); return IF; }
1192 #line 111 "swf4compiler.flex"
1193 { count(); return WHILE; }
1197 #line 112 "swf4compiler.flex"
1198 { count(); return DO; }
1202 #line 113 "swf4compiler.flex"
1203 { count(); return EVAL; }
1208 #line 116 "swf4compiler.flex"
1209 { count(); return RANDOM; }
1213 #line 117 "swf4compiler.flex"
1214 { count(); return TIME; }
1218 #line 118 "swf4compiler.flex"
1219 { count(); return LENGTH; }
1223 #line 119 "swf4compiler.flex"
1224 { count(); return INT; }
1228 #line 120 "swf4compiler.flex"
1229 { count(); return CONCAT; }
1233 #line 121 "swf4compiler.flex"
1234 { count(); return DUPLICATECLIP; }
1238 #line 122 "swf4compiler.flex"
1239 { count(); return REMOVECLIP; }
1243 #line 123 "swf4compiler.flex"
1244 { count(); return TRACE; }
1248 #line 124 "swf4compiler.flex"
1249 { count(); return STARTDRAG; }
1253 #line 125 "swf4compiler.flex"
1254 { count(); return STOPDRAG; }
1258 #line 126 "swf4compiler.flex"
1259 { count(); return ORD; }
1263 #line 127 "swf4compiler.flex"
1264 { count(); return CHR; }
1268 #line 128 "swf4compiler.flex"
1269 { count(); return CALLFRAME; }
1273 #line 129 "swf4compiler.flex"
1274 { count(); return GETURL; }
1278 #line 130 "swf4compiler.flex"
1279 { count(); return GETURL1; }
1283 #line 131 "swf4compiler.flex"
1284 { count(); return LOADMOVIE; }
1288 #line 132 "swf4compiler.flex"
1289 { count(); return LOADVARIABLES; }
1293 #line 133 "swf4compiler.flex"
1294 { count(); return SUBSTR; }
1298 #line 135 "swf4compiler.flex"
1299 { count(); return GETPROPERTY; }
1301 /* getURL2 methods */
1304 #line 138 "swf4compiler.flex"
1305 { count(); swf4lval.getURLMethod = GETURL_METHOD_POST;
1306 return GETURL_METHOD; }
1310 #line 140 "swf4compiler.flex"
1311 { count(); swf4lval.getURLMethod = GETURL_METHOD_GET;
1312 return GETURL_METHOD; }
1316 #line 142 "swf4compiler.flex"
1317 { count(); swf4lval.getURLMethod = GETURL_METHOD_NOSEND;
1318 return GETURL_METHOD; }
1323 #line 147 "swf4compiler.flex"
1324 { count(); return NEXTFRAME; }
1328 #line 148 "swf4compiler.flex"
1329 { count(); return PREVFRAME; }
1333 #line 149 "swf4compiler.flex"
1334 { count(); return PLAY; }
1338 #line 150 "swf4compiler.flex"
1339 { count(); return STOP; }
1343 #line 151 "swf4compiler.flex"
1344 { count(); return TOGGLEQUALITY; }
1348 #line 152 "swf4compiler.flex"
1349 { count(); return STOPSOUNDS; }
1353 #line 153 "swf4compiler.flex"
1354 { count(); return GOTOFRAME; }
1358 #line 154 "swf4compiler.flex"
1359 { count(); return GOTOANDPLAY; }
1363 #line 155 "swf4compiler.flex"
1364 { count(); return FRAMELOADED; }
1368 #line 156 "swf4compiler.flex"
1369 { count(); return SETTARGET; }
1371 /* high level functions */
1374 #line 159 "swf4compiler.flex"
1375 { count(); return TELLTARGET; }
1379 #line 162 "swf4compiler.flex"
1380 { count(); return THIS; }
1384 #line 164 "swf4compiler.flex"
1385 { count(); swf4lval.str = strdup(swf4text);
1386 return IDENTIFIER; }
1390 #line 167 "swf4compiler.flex"
1391 { count(); swf4lval.str = strdup(swf4text);
1396 #line 170 "swf4compiler.flex"
1397 { count(); swf4lval.str = strdup(swf4text);
1401 /* rule 50 can match eol */
1403 #line 173 "swf4compiler.flex"
1404 { count(); swf4lval.str = strdup(swf4text+1);
1405 swf4lval.str[strlen(swf4lval.str)-1]=0;
1406 unescape(swf4lval.str);
1410 /* rule 51 can match eol */
1412 #line 178 "swf4compiler.flex"
1413 { count(); swf4lval.str = strdup(swf4text+1);
1414 swf4lval.str[strlen(swf4lval.str)-1]=0;
1415 unescape(swf4lval.str);
1419 /* rule 52 can match eol */
1420 *yy_cp = (yy_hold_char); /* undo effects of setting up swf4text */
1421 (yy_c_buf_p) = yy_cp -= 1;
1422 YY_DO_BEFORE_ACTION; /* set up swf4text again */
1424 #line 183 "swf4compiler.flex"
1425 { count(); swf4lval.str = strdup("");
1426 warning("Unterminated string!");
1430 /* rule 53 can match eol */
1431 *yy_cp = (yy_hold_char); /* undo effects of setting up swf4text */
1432 (yy_c_buf_p) = yy_cp -= 1;
1433 YY_DO_BEFORE_ACTION; /* set up swf4text again */
1435 #line 187 "swf4compiler.flex"
1436 { count(); swf4lval.str = strdup("");
1437 warning("Unterminated string!");
1442 #line 191 "swf4compiler.flex"
1443 { count(); comment(); }
1447 #line 192 "swf4compiler.flex"
1448 { count(); comment1(); }
1452 #line 193 "swf4compiler.flex"
1457 #line 195 "swf4compiler.flex"
1458 { count(); return INC; }
1462 #line 196 "swf4compiler.flex"
1463 { count(); return DEC; }
1467 #line 197 "swf4compiler.flex"
1468 { count(); return '<'; }
1472 #line 198 "swf4compiler.flex"
1473 { count(); return '>'; }
1477 #line 199 "swf4compiler.flex"
1478 { count(); return LE; }
1482 #line 200 "swf4compiler.flex"
1483 { count(); return GE; }
1487 #line 201 "swf4compiler.flex"
1488 { count(); return EQ; }
1492 #line 202 "swf4compiler.flex"
1493 { count(); return NE; }
1497 #line 203 "swf4compiler.flex"
1498 { count(); return LAN; }
1502 #line 204 "swf4compiler.flex"
1503 { count(); return LOR; }
1507 #line 205 "swf4compiler.flex"
1508 { count(); return MEQ; }
1512 #line 206 "swf4compiler.flex"
1513 { count(); return DEQ; }
1517 #line 207 "swf4compiler.flex"
1518 { count(); return IEQ; }
1522 #line 208 "swf4compiler.flex"
1523 { count(); return SEQ; }
1527 #line 209 "swf4compiler.flex"
1528 { count(); return STREQ; }
1532 #line 210 "swf4compiler.flex"
1533 { count(); return STRNE; }
1537 #line 211 "swf4compiler.flex"
1538 { count(); return STRCMP; }
1542 #line 212 "swf4compiler.flex"
1543 { count(); return PARENT; }
1547 #line 214 "swf4compiler.flex"
1548 { count(); return ';'; }
1552 #line 215 "swf4compiler.flex"
1553 { count(); return '='; }
1557 #line 216 "swf4compiler.flex"
1558 { count(); return '+'; }
1562 #line 217 "swf4compiler.flex"
1563 { count(); return '-'; }
1567 #line 218 "swf4compiler.flex"
1568 { count(); return '&'; }
1572 #line 219 "swf4compiler.flex"
1573 { count(); return '*'; }
1577 #line 220 "swf4compiler.flex"
1578 { count(); return '/'; }
1582 #line 221 "swf4compiler.flex"
1583 { count(); return '!'; }
1587 #line 222 "swf4compiler.flex"
1588 { count(); return '('; }
1592 #line 223 "swf4compiler.flex"
1593 { count(); return ')'; }
1597 #line 224 "swf4compiler.flex"
1598 { count(); return '['; }
1602 #line 225 "swf4compiler.flex"
1603 { count(); return ']'; }
1607 #line 226 "swf4compiler.flex"
1608 { count(); return '{'; }
1612 #line 227 "swf4compiler.flex"
1613 { count(); return '}'; }
1617 #line 228 "swf4compiler.flex"
1618 { count(); return ','; }
1622 #line 229 "swf4compiler.flex"
1623 { count(); return '.'; }
1627 #line 230 "swf4compiler.flex"
1628 { count(); return '?'; }
1632 #line 231 "swf4compiler.flex"
1633 { count(); return ':'; }
1636 /* rule 93 can match eol */
1638 #line 233 "swf4compiler.flex"
1639 { count(); column = 0;
1640 strcpy(szLine, swf4text + 1);
1641 ++sLineNumber; yyless(1); }
1645 #line 237 "swf4compiler.flex"
1646 printf( "Unrecognized character: %s\n", swf4text );
1650 #line 239 "swf4compiler.flex"
1653 #line 1654 "lex.swf4.c"
1654 case YY_STATE_EOF(INITIAL):
1657 case YY_END_OF_BUFFER:
1659 /* Amount of text matched not including the EOB char. */
1660 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1662 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1663 *yy_cp = (yy_hold_char);
1664 YY_RESTORE_YY_MORE_OFFSET
1666 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1668 /* We're scanning a new file or input source. It's
1669 * possible that this happened because the user
1670 * just pointed swf4in at a new source and called
1671 * swf4lex(). If so, then we have to assure
1672 * consistency between YY_CURRENT_BUFFER and our
1673 * globals. Here is the right place to do so, because
1674 * this is the first action (other than possibly a
1675 * back-up) that will match for the new input source.
1677 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1678 YY_CURRENT_BUFFER_LVALUE->yy_input_file = swf4in;
1679 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1682 /* Note that here we test for yy_c_buf_p "<=" to the position
1683 * of the first EOB in the buffer, since yy_c_buf_p will
1684 * already have been incremented past the NUL character
1685 * (since all states make transitions on EOB to the
1686 * end-of-buffer state). Contrast this with the test
1689 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1690 { /* This was really a NUL. */
1691 yy_state_type yy_next_state;
1693 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1695 yy_current_state = yy_get_previous_state( );
1697 /* Okay, we're now positioned to make the NUL
1698 * transition. We couldn't have
1699 * yy_get_previous_state() go ahead and do it
1700 * for us because it doesn't know how to deal
1701 * with the possibility of jamming (and we don't
1702 * want to build jamming into it because then it
1703 * will run more slowly).
1706 yy_next_state = yy_try_NUL_trans( yy_current_state );
1708 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1710 if ( yy_next_state )
1712 /* Consume the NUL. */
1713 yy_cp = ++(yy_c_buf_p);
1714 yy_current_state = yy_next_state;
1720 yy_cp = (yy_c_buf_p);
1721 goto yy_find_action;
1725 else switch ( yy_get_next_buffer( ) )
1727 case EOB_ACT_END_OF_FILE:
1729 (yy_did_buffer_switch_on_eof) = 0;
1733 /* Note: because we've taken care in
1734 * yy_get_next_buffer() to have set up
1735 * swf4text, we can now set up
1736 * yy_c_buf_p so that if some total
1737 * hoser (like flex itself) wants to
1738 * call the scanner after we return the
1739 * YY_NULL, it'll still work - another
1740 * YY_NULL will get returned.
1742 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1744 yy_act = YY_STATE_EOF(YY_START);
1750 if ( ! (yy_did_buffer_switch_on_eof) )
1756 case EOB_ACT_CONTINUE_SCAN:
1758 (yytext_ptr) + yy_amount_of_matched_text;
1760 yy_current_state = yy_get_previous_state( );
1762 yy_cp = (yy_c_buf_p);
1763 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1766 case EOB_ACT_LAST_MATCH:
1768 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1770 yy_current_state = yy_get_previous_state( );
1772 yy_cp = (yy_c_buf_p);
1773 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1774 goto yy_find_action;
1781 "fatal flex scanner internal error--no action found" );
1782 } /* end of action switch */
1783 } /* end of scanning one token */
1784 } /* end of swf4lex */
1786 /* yy_get_next_buffer - try to read in a new buffer
1788 * Returns a code representing an action:
1789 * EOB_ACT_LAST_MATCH -
1790 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1791 * EOB_ACT_END_OF_FILE - end of file
1793 static int yy_get_next_buffer (void)
1795 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1796 register char *source = (yytext_ptr);
1797 register int number_to_move, i;
1800 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1802 "fatal flex scanner internal error--end of buffer missed" );
1804 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1805 { /* Don't try to fill the buffer, so this is an EOF. */
1806 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1808 /* We matched a single character, the EOB, so
1809 * treat this as a final EOF.
1811 return EOB_ACT_END_OF_FILE;
1816 /* We matched some text prior to the EOB, first
1819 return EOB_ACT_LAST_MATCH;
1823 /* Try to read more data. */
1825 /* First move last chars to start of buffer. */
1826 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1828 for ( i = 0; i < number_to_move; ++i )
1829 *(dest++) = *(source++);
1831 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1832 /* don't do the read, it's not guaranteed to return an EOF,
1835 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1840 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1842 while ( num_to_read <= 0 )
1843 { /* Not enough room in the buffer - grow it. */
1845 /* just a shorter name for the current buffer */
1846 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1848 int yy_c_buf_p_offset =
1849 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1851 if ( b->yy_is_our_buffer )
1853 int new_size = b->yy_buf_size * 2;
1855 if ( new_size <= 0 )
1856 b->yy_buf_size += b->yy_buf_size / 8;
1858 b->yy_buf_size *= 2;
1860 b->yy_ch_buf = (char *)
1861 /* Include room in for 2 EOB chars. */
1862 swf4realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1865 /* Can't grow it, we don't own it. */
1868 if ( ! b->yy_ch_buf )
1870 "fatal error - scanner input buffer overflow" );
1872 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1874 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1879 if ( num_to_read > YY_READ_BUF_SIZE )
1880 num_to_read = YY_READ_BUF_SIZE;
1882 /* Read in more data. */
1883 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1884 (yy_n_chars), (size_t) num_to_read );
1886 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1889 if ( (yy_n_chars) == 0 )
1891 if ( number_to_move == YY_MORE_ADJ )
1893 ret_val = EOB_ACT_END_OF_FILE;
1894 swf4restart(swf4in );
1899 ret_val = EOB_ACT_LAST_MATCH;
1900 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1901 YY_BUFFER_EOF_PENDING;
1906 ret_val = EOB_ACT_CONTINUE_SCAN;
1908 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1909 /* Extend the array by 50%, plus the number we really need. */
1910 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1911 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) swf4realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1912 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1913 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1916 (yy_n_chars) += number_to_move;
1917 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1918 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1920 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1925 /* yy_get_previous_state - get the state just before the EOB char was reached */
1927 static yy_state_type yy_get_previous_state (void)
1929 register yy_state_type yy_current_state;
1930 register char *yy_cp;
1932 yy_current_state = (yy_start);
1934 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1936 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1937 if ( yy_accept[yy_current_state] )
1939 (yy_last_accepting_state) = yy_current_state;
1940 (yy_last_accepting_cpos) = yy_cp;
1942 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1944 yy_current_state = (int) yy_def[yy_current_state];
1945 if ( yy_current_state >= 320 )
1946 yy_c = yy_meta[(unsigned int) yy_c];
1948 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1951 return yy_current_state;
1954 /* yy_try_NUL_trans - try to make a transition on the NUL character
1957 * next_state = yy_try_NUL_trans( current_state );
1959 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1961 register int yy_is_jam;
1962 register char *yy_cp = (yy_c_buf_p);
1964 register YY_CHAR yy_c = 1;
1965 if ( yy_accept[yy_current_state] )
1967 (yy_last_accepting_state) = yy_current_state;
1968 (yy_last_accepting_cpos) = yy_cp;
1970 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1972 yy_current_state = (int) yy_def[yy_current_state];
1973 if ( yy_current_state >= 320 )
1974 yy_c = yy_meta[(unsigned int) yy_c];
1976 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1977 yy_is_jam = (yy_current_state == 319);
1979 return yy_is_jam ? 0 : yy_current_state;
1982 static void yyunput (int c, register char * yy_bp )
1984 register char *yy_cp;
1986 yy_cp = (yy_c_buf_p);
1988 /* undo effects of setting up swf4text */
1989 *yy_cp = (yy_hold_char);
1991 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1992 { /* need to shift things up to make room */
1993 /* +2 for EOB chars. */
1994 register int number_to_move = (yy_n_chars) + 2;
1995 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1996 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1997 register char *source =
1998 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2000 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2001 *--dest = *--source;
2003 yy_cp += (int) (dest - source);
2004 yy_bp += (int) (dest - source);
2005 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2006 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2008 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2009 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2012 *--yy_cp = (char) c;
2014 (yytext_ptr) = yy_bp;
2015 (yy_hold_char) = *yy_cp;
2016 (yy_c_buf_p) = yy_cp;
2021 static int yyinput (void)
2023 static int input (void)
2029 *(yy_c_buf_p) = (yy_hold_char);
2031 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2033 /* yy_c_buf_p now points to the character we want to return.
2034 * If this occurs *before* the EOB characters, then it's a
2035 * valid NUL; if not, then we've hit the end of the buffer.
2037 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2038 /* This was really a NUL. */
2039 *(yy_c_buf_p) = '\0';
2042 { /* need more input */
2043 int offset = (yy_c_buf_p) - (yytext_ptr);
2046 switch ( yy_get_next_buffer( ) )
2048 case EOB_ACT_LAST_MATCH:
2049 /* This happens because yy_g_n_b()
2050 * sees that we've accumulated a
2051 * token and flags that we need to
2052 * try matching the token before
2053 * proceeding. But for input(),
2054 * there's no matching to consider.
2055 * So convert the EOB_ACT_LAST_MATCH
2056 * to EOB_ACT_END_OF_FILE.
2059 /* Reset buffer status. */
2060 swf4restart(swf4in );
2064 case EOB_ACT_END_OF_FILE:
2069 if ( ! (yy_did_buffer_switch_on_eof) )
2078 case EOB_ACT_CONTINUE_SCAN:
2079 (yy_c_buf_p) = (yytext_ptr) + offset;
2085 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2086 *(yy_c_buf_p) = '\0'; /* preserve swf4text */
2087 (yy_hold_char) = *++(yy_c_buf_p);
2091 #endif /* ifndef YY_NO_INPUT */
2093 /** Immediately switch to a different input stream.
2094 * @param input_file A readable stream.
2096 * @note This function does not reset the start condition to @c INITIAL .
2098 void swf4restart (FILE * input_file )
2101 if ( ! YY_CURRENT_BUFFER ){
2102 swf4ensure_buffer_stack ();
2103 YY_CURRENT_BUFFER_LVALUE =
2104 swf4_create_buffer(swf4in,YY_BUF_SIZE );
2107 swf4_init_buffer(YY_CURRENT_BUFFER,input_file );
2108 swf4_load_buffer_state( );
2111 /** Switch to a different input buffer.
2112 * @param new_buffer The new input buffer.
2115 void swf4_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2118 /* TODO. We should be able to replace this entire function body
2120 * swf4pop_buffer_state();
2121 * swf4push_buffer_state(new_buffer);
2123 swf4ensure_buffer_stack ();
2124 if ( YY_CURRENT_BUFFER == new_buffer )
2127 if ( YY_CURRENT_BUFFER )
2129 /* Flush out information for old buffer. */
2130 *(yy_c_buf_p) = (yy_hold_char);
2131 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2132 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2135 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2136 swf4_load_buffer_state( );
2138 /* We don't actually know whether we did this switch during
2139 * EOF (swf4wrap()) processing, but the only time this flag
2140 * is looked at is after swf4wrap() is called, so it's safe
2141 * to go ahead and always set it.
2143 (yy_did_buffer_switch_on_eof) = 1;
2146 static void swf4_load_buffer_state (void)
2148 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2149 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2150 swf4in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2151 (yy_hold_char) = *(yy_c_buf_p);
2154 /** Allocate and initialize an input buffer state.
2155 * @param file A readable stream.
2156 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2158 * @return the allocated buffer state.
2160 YY_BUFFER_STATE swf4_create_buffer (FILE * file, int size )
2164 b = (YY_BUFFER_STATE) swf4alloc(sizeof( struct yy_buffer_state ) );
2166 YY_FATAL_ERROR( "out of dynamic memory in swf4_create_buffer()" );
2168 b->yy_buf_size = size;
2170 /* yy_ch_buf has to be 2 characters longer than the size given because
2171 * we need to put in 2 end-of-buffer characters.
2173 b->yy_ch_buf = (char *) swf4alloc(b->yy_buf_size + 2 );
2174 if ( ! b->yy_ch_buf )
2175 YY_FATAL_ERROR( "out of dynamic memory in swf4_create_buffer()" );
2177 b->yy_is_our_buffer = 1;
2179 swf4_init_buffer(b,file );
2184 /** Destroy the buffer.
2185 * @param b a buffer created with swf4_create_buffer()
2188 void swf4_delete_buffer (YY_BUFFER_STATE b )
2194 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2195 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2197 if ( b->yy_is_our_buffer )
2198 swf4free((void *) b->yy_ch_buf );
2200 swf4free((void *) b );
2203 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
2207 #ifdef __THROW /* this is a gnuism */
2208 extern int isatty (int ) __THROW;
2210 extern int isatty (int );
2217 /* Initializes or reinitializes a buffer.
2218 * This function is sometimes called more than once on the same buffer,
2219 * such as during a swf4restart() or at EOF.
2221 static void swf4_init_buffer (YY_BUFFER_STATE b, FILE * file )
2226 swf4_flush_buffer(b );
2228 b->yy_input_file = file;
2229 b->yy_fill_buffer = 1;
2231 /* If b is the current buffer, then swf4_init_buffer was _probably_
2232 * called from swf4restart() or through yy_get_next_buffer.
2233 * In that case, we don't want to reset the lineno or column.
2235 if (b != YY_CURRENT_BUFFER){
2236 b->yy_bs_lineno = 1;
2237 b->yy_bs_column = 0;
2240 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2245 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2246 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2249 void swf4_flush_buffer (YY_BUFFER_STATE b )
2256 /* We always need two end-of-buffer characters. The first causes
2257 * a transition to the end-of-buffer state. The second causes
2258 * a jam in that state.
2260 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2261 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2263 b->yy_buf_pos = &b->yy_ch_buf[0];
2266 b->yy_buffer_status = YY_BUFFER_NEW;
2268 if ( b == YY_CURRENT_BUFFER )
2269 swf4_load_buffer_state( );
2272 /** Pushes the new state onto the stack. The new state becomes
2273 * the current state. This function will allocate the stack
2275 * @param new_buffer The new state.
2278 void swf4push_buffer_state (YY_BUFFER_STATE new_buffer )
2280 if (new_buffer == NULL)
2283 swf4ensure_buffer_stack();
2285 /* This block is copied from swf4_switch_to_buffer. */
2286 if ( YY_CURRENT_BUFFER )
2288 /* Flush out information for old buffer. */
2289 *(yy_c_buf_p) = (yy_hold_char);
2290 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2291 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2294 /* Only push if top exists. Otherwise, replace top. */
2295 if (YY_CURRENT_BUFFER)
2296 (yy_buffer_stack_top)++;
2297 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2299 /* copied from swf4_switch_to_buffer. */
2300 swf4_load_buffer_state( );
2301 (yy_did_buffer_switch_on_eof) = 1;
2304 /** Removes and deletes the top of the stack, if present.
2305 * The next element becomes the new top.
2308 void swf4pop_buffer_state (void)
2310 if (!YY_CURRENT_BUFFER)
2313 swf4_delete_buffer(YY_CURRENT_BUFFER );
2314 YY_CURRENT_BUFFER_LVALUE = NULL;
2315 if ((yy_buffer_stack_top) > 0)
2316 --(yy_buffer_stack_top);
2318 if (YY_CURRENT_BUFFER) {
2319 swf4_load_buffer_state( );
2320 (yy_did_buffer_switch_on_eof) = 1;
2324 /* Allocates the stack if it does not exist.
2325 * Guarantees space for at least one push.
2327 static void swf4ensure_buffer_stack (void)
2331 if (!(yy_buffer_stack)) {
2333 /* First allocation is just for 2 elements, since we don't know if this
2334 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2335 * immediate realloc on the next call.
2338 (yy_buffer_stack) = (struct yy_buffer_state**)swf4alloc
2339 (num_to_alloc * sizeof(struct yy_buffer_state*)
2341 if ( ! (yy_buffer_stack) )
2342 YY_FATAL_ERROR( "out of dynamic memory in swf4ensure_buffer_stack()" );
2344 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2346 (yy_buffer_stack_max) = num_to_alloc;
2347 (yy_buffer_stack_top) = 0;
2351 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2353 /* Increase the buffer to prepare for a possible push. */
2354 int grow_size = 8 /* arbitrary grow size */;
2356 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2357 (yy_buffer_stack) = (struct yy_buffer_state**)swf4realloc
2359 num_to_alloc * sizeof(struct yy_buffer_state*)
2361 if ( ! (yy_buffer_stack) )
2362 YY_FATAL_ERROR( "out of dynamic memory in swf4ensure_buffer_stack()" );
2364 /* zero only the new slots.*/
2365 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2366 (yy_buffer_stack_max) = num_to_alloc;
2370 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2371 * @param base the character buffer
2372 * @param size the size in bytes of the character buffer
2374 * @return the newly allocated buffer state object.
2376 YY_BUFFER_STATE swf4_scan_buffer (char * base, yy_size_t size )
2381 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2382 base[size-1] != YY_END_OF_BUFFER_CHAR )
2383 /* They forgot to leave room for the EOB's. */
2386 b = (YY_BUFFER_STATE) swf4alloc(sizeof( struct yy_buffer_state ) );
2388 YY_FATAL_ERROR( "out of dynamic memory in swf4_scan_buffer()" );
2390 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2391 b->yy_buf_pos = b->yy_ch_buf = base;
2392 b->yy_is_our_buffer = 0;
2393 b->yy_input_file = 0;
2394 b->yy_n_chars = b->yy_buf_size;
2395 b->yy_is_interactive = 0;
2397 b->yy_fill_buffer = 0;
2398 b->yy_buffer_status = YY_BUFFER_NEW;
2400 swf4_switch_to_buffer(b );
2405 /** Setup the input buffer state to scan a string. The next call to swf4lex() will
2406 * scan from a @e copy of @a str.
2407 * @param yystr a NUL-terminated string to scan
2409 * @return the newly allocated buffer state object.
2410 * @note If you want to scan bytes that may contain NUL values, then use
2411 * swf4_scan_bytes() instead.
2413 YY_BUFFER_STATE swf4_scan_string (yyconst char * yystr )
2416 return swf4_scan_bytes(yystr,strlen(yystr) );
2419 /** Setup the input buffer state to scan the given bytes. The next call to swf4lex() will
2420 * scan from a @e copy of @a bytes.
2421 * @param bytes the byte buffer to scan
2422 * @param len the number of bytes in the buffer pointed to by @a bytes.
2424 * @return the newly allocated buffer state object.
2426 YY_BUFFER_STATE swf4_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2433 /* Get memory for full buffer, including space for trailing EOB's. */
2434 n = _yybytes_len + 2;
2435 buf = (char *) swf4alloc(n );
2437 YY_FATAL_ERROR( "out of dynamic memory in swf4_scan_bytes()" );
2439 for ( i = 0; i < _yybytes_len; ++i )
2440 buf[i] = yybytes[i];
2442 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2444 b = swf4_scan_buffer(buf,n );
2446 YY_FATAL_ERROR( "bad buffer in swf4_scan_bytes()" );
2448 /* It's okay to grow etc. this buffer, and we should throw it
2449 * away when we're done.
2451 b->yy_is_our_buffer = 1;
2456 #ifndef YY_EXIT_FAILURE
2457 #define YY_EXIT_FAILURE 2
2460 static void yy_fatal_error (yyconst char* msg )
2462 (void) fprintf( stderr, "%s\n", msg );
2463 exit( YY_EXIT_FAILURE );
2466 /* Redefine yyless() so it works in section 3 code. */
2472 /* Undo effects of setting up swf4text. */ \
2473 int yyless_macro_arg = (n); \
2474 YY_LESS_LINENO(yyless_macro_arg);\
2475 swf4text[swf4leng] = (yy_hold_char); \
2476 (yy_c_buf_p) = swf4text + yyless_macro_arg; \
2477 (yy_hold_char) = *(yy_c_buf_p); \
2478 *(yy_c_buf_p) = '\0'; \
2479 swf4leng = yyless_macro_arg; \
2483 /* Accessor methods (get/set functions) to struct members. */
2485 /** Get the current line number.
2488 int swf4get_lineno (void)
2494 /** Get the input stream.
2497 FILE *swf4get_in (void)
2502 /** Get the output stream.
2505 FILE *swf4get_out (void)
2510 /** Get the length of the current token.
2513 int swf4get_leng (void)
2518 /** Get the current token.
2522 char *swf4get_text (void)
2527 /** Set the current line number.
2528 * @param line_number
2531 void swf4set_lineno (int line_number )
2534 swf4lineno = line_number;
2537 /** Set the input stream. This does not discard the current
2539 * @param in_str A readable stream.
2541 * @see swf4_switch_to_buffer
2543 void swf4set_in (FILE * in_str )
2548 void swf4set_out (FILE * out_str )
2553 int swf4get_debug (void)
2555 return swf4_flex_debug;
2558 void swf4set_debug (int bdebug )
2560 swf4_flex_debug = bdebug ;
2563 static int yy_init_globals (void)
2565 /* Initialization is the same as for the non-reentrant scanner.
2566 * This function is called from swf4lex_destroy(), so don't allocate here.
2569 (yy_buffer_stack) = 0;
2570 (yy_buffer_stack_top) = 0;
2571 (yy_buffer_stack_max) = 0;
2572 (yy_c_buf_p) = (char *) 0;
2576 /* Defined in main.c */
2581 swf4in = (FILE *) 0;
2582 swf4out = (FILE *) 0;
2585 /* For future reference: Set errno on error, since we are called by
2591 /* swf4lex_destroy is for both reentrant and non-reentrant scanners. */
2592 int swf4lex_destroy (void)
2595 /* Pop the buffer stack, destroying each element. */
2596 while(YY_CURRENT_BUFFER){
2597 swf4_delete_buffer(YY_CURRENT_BUFFER );
2598 YY_CURRENT_BUFFER_LVALUE = NULL;
2599 swf4pop_buffer_state();
2602 /* Destroy the stack itself. */
2603 swf4free((yy_buffer_stack) );
2604 (yy_buffer_stack) = NULL;
2606 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2607 * swf4lex() is called, initialization will occur. */
2614 * Internal utility routines.
2618 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2621 for ( i = 0; i < n; ++i )
2626 #ifdef YY_NEED_STRLEN
2627 static int yy_flex_strlen (yyconst char * s )
2630 for ( n = 0; s[n]; ++n )
2637 void *swf4alloc (yy_size_t size )
2639 return (void *) malloc( size );
2642 void *swf4realloc (void * ptr, yy_size_t size )
2644 /* The cast to (char *) in the following accommodates both
2645 * implementations that use char* generic pointers, and those
2646 * that use void* generic pointers. It works with the latter
2647 * because both ANSI C and C++ allow castless assignment from
2648 * any pointer type to void*, and deal with argument conversions
2649 * as though doing an assignment.
2651 return (void *) realloc( (char *) ptr, size );
2654 void swf4free (void * ptr )
2656 free( (char *) ptr ); /* see swf4realloc() for (char *) cast */
2659 #define YYTABLES_NAME "yytables"
2661 #line 239 "swf4compiler.flex"
2664 static int getinput() {
2677 static void countline()
2679 if(sLineNumber != 0)
2680 msgline[column] = 0;
2684 msgline = msgbufs[sLineNumber & 1];
2687 static int LineNumber(void)
2689 return (sLineNumber + 1);
2692 static int ColumnNumber(void)
2697 static char *LineText(void)
2699 msgline[column] = 0;
2703 static void comment(void)
2705 // Handle block comments
2710 // We have the start of a comment so look skip everything up to the
2711 // end of the comment character
2712 while ((c = getinput()) != '*' && c != EOF)
2715 msgline[column] = c;
2719 // keep the line number in synch
2722 // start the output (matches the algorithim in the lexx above)
2726 if (swf4debug) putchar(c);
2729 // is this the end of comment character
2730 if ((c1 = getinput()) != '/' && c != EOF)
2732 // false start as this was no end of comment
2737 // write out the start of the end of comment
2739 if (swf4debug) putchar(c);
2741 // write out the end of the end of comment
2743 if (swf4debug) putchar(c1);
2746 static void comment1(void)
2748 // Handle comment of type 1 (ie '//')
2752 // this is a line comment
2753 while ((c = getinput()) != '\n' && c != EOF)
2755 if (swf4debug) putchar(c);
2758 msgline[column] = c;
2763 // keep the line number in synch
2766 if (swf4debug) putchar(c);
2772 static void count(void)
2776 // Count the characters to maintain the current column position
2777 if (swf4text[0] == '\n')
2779 if (swf4debug) printf("\n");
2783 if (swf4debug) printf("%s", swf4text);
2785 for(n=0; n<swf4leng; ++n, ++column)
2788 msgline[column] = swf4text[n];
2791 //-- keep writing the stuff to standard output
2792 //column += swf4leng;
2796 static void printprog()
2799 SWF_warn("\n%s", msgbufs[(sLineNumber-1)&1]);
2802 msgline[column] = 0;
2804 SWF_warn("\n%s", msgline);
2807 static void warning(char *msg)
2809 // print a warning message
2811 SWF_warn("\n%*s", ColumnNumber(), "^");
2812 SWF_warn("\nLine %4.4d: Reason: '%s' \n", LineNumber(), msg);
2815 void swf4error(char *msg)
2818 if(strlen(swf4text))
2820 SWF_error("\n%s\n%*s\nLine %i: Reason: '%s'\n",
2821 LineText(), ColumnNumber(), "^", LineNumber(), msg);
2825 SWF_error("\nLine %d: Reason: 'Unexpected EOF found while looking for input.'\n", LineNumber());