4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 33
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
87 #endif /* ! FLEXINT_H */
91 /* The "const" storage-class-modifier is valid. */
94 #else /* ! __cplusplus */
100 #endif /* __STDC__ */
101 #endif /* ! __cplusplus */
104 #define yyconst const
109 /* Returned upon end-of-file. */
112 /* Promotes a possibly negative, possibly signed char to an unsigned
113 * integer for use as an array index. If the signed char is negative,
114 * we want to instead treat it as an 8-bit unsigned char, hence the
117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119 /* Enter a start condition. This macro really ought to take a parameter,
120 * but we do it the disgusting crufty way forced on us by the ()-less
121 * definition of BEGIN.
123 #define BEGIN (yy_start) = 1 + 2 *
125 /* Translate the current start state into a value that can be later handed
126 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 #define YY_START (((yy_start) - 1) / 2)
130 #define YYSTATE YY_START
132 /* Action number for EOF rule of a given start state. */
133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135 /* Special action meaning "start processing a new file". */
136 #define YY_NEW_FILE swf4restart(swf4in )
138 #define YY_END_OF_BUFFER_CHAR 0
140 /* Size of default input buffer. */
142 #define YY_BUF_SIZE 16384
145 /* The state buf must be large enough to hold one state per character in the main buffer.
147 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
150 #define YY_TYPEDEF_YY_BUFFER_STATE
151 typedef struct yy_buffer_state *YY_BUFFER_STATE;
156 extern FILE *swf4in, *swf4out;
158 #define EOB_ACT_CONTINUE_SCAN 0
159 #define EOB_ACT_END_OF_FILE 1
160 #define EOB_ACT_LAST_MATCH 2
162 #define YY_LESS_LINENO(n)
164 /* Return all but the first "n" matched characters back to the input stream. */
168 /* Undo effects of setting up swf4text. */ \
169 int yyless_macro_arg = (n); \
170 YY_LESS_LINENO(yyless_macro_arg);\
171 *yy_cp = (yy_hold_char); \
172 YY_RESTORE_YY_MORE_OFFSET \
173 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
174 YY_DO_BEFORE_ACTION; /* set up swf4text again */ \
178 #define unput(c) yyunput( c, (yytext_ptr) )
180 /* The following is because we cannot portably get our hands on size_t
181 * (without autoconf's help, which isn't available because we want
182 * flex-generated scanners to compile on their own).
185 #ifndef YY_TYPEDEF_YY_SIZE_T
186 #define YY_TYPEDEF_YY_SIZE_T
187 typedef unsigned int yy_size_t;
190 #ifndef YY_STRUCT_YY_BUFFER_STATE
191 #define YY_STRUCT_YY_BUFFER_STATE
192 struct yy_buffer_state
196 char *yy_ch_buf; /* input buffer */
197 char *yy_buf_pos; /* current position in input buffer */
199 /* Size of input buffer in bytes, not including room for EOB
202 yy_size_t yy_buf_size;
204 /* Number of characters read into yy_ch_buf, not including EOB
209 /* Whether we "own" the buffer - i.e., we know we created it,
210 * and can realloc() it to grow it, and should free() it to
213 int yy_is_our_buffer;
215 /* Whether this is an "interactive" input source; if so, and
216 * if we're using stdio for input, then we want to use getc()
217 * instead of fread(), to make sure we stop fetching input after
220 int yy_is_interactive;
222 /* Whether we're considered to be at the beginning of a line.
223 * If so, '^' rules will be active on the next match, otherwise
228 int yy_bs_lineno; /**< The line count. */
229 int yy_bs_column; /**< The column count. */
231 /* Whether to try to fill the input buffer when we reach the
236 int yy_buffer_status;
238 #define YY_BUFFER_NEW 0
239 #define YY_BUFFER_NORMAL 1
240 /* When an EOF's been seen but there's still some text to process
241 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
242 * shouldn't try reading from the input source any more. We might
243 * still have a bunch of tokens to match, though, because of
244 * possible backing-up.
246 * When we actually see the EOF, we change the status to "new"
247 * (via swf4restart()), so that the user can continue scanning by
248 * just pointing swf4in at a new input file.
250 #define YY_BUFFER_EOF_PENDING 2
253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
255 /* Stack of input buffers. */
256 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
257 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
258 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
260 /* We provide macros for accessing buffer states in case in the
261 * future we want to put the buffer states in a more general
264 * Returns the top of the stack, or NULL.
266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
267 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
270 /* Same as previous macro, but useful when we know that the buffer stack is not
271 * NULL or when we need an lvalue. For internal use only.
273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
275 /* yy_hold_char holds the character lost when swf4text is formed. */
276 static char yy_hold_char;
277 static int yy_n_chars; /* number of characters read into yy_ch_buf */
280 /* Points to current character in buffer. */
281 static char *yy_c_buf_p = (char *) 0;
282 static int yy_init = 0; /* whether we need to initialize */
283 static int yy_start = 0; /* start state number */
285 /* Flag which is used to allow swf4wrap()'s to do buffer switches
286 * instead of setting up a fresh swf4in. A bit of a hack ...
288 static int yy_did_buffer_switch_on_eof;
290 void swf4restart (FILE *input_file );
291 void swf4_switch_to_buffer (YY_BUFFER_STATE new_buffer );
292 YY_BUFFER_STATE swf4_create_buffer (FILE *file,int size );
293 void swf4_delete_buffer (YY_BUFFER_STATE b );
294 void swf4_flush_buffer (YY_BUFFER_STATE b );
295 void swf4push_buffer_state (YY_BUFFER_STATE new_buffer );
296 void swf4pop_buffer_state (void );
298 static void swf4ensure_buffer_stack (void );
299 static void swf4_load_buffer_state (void );
300 static void swf4_init_buffer (YY_BUFFER_STATE b,FILE *file );
302 #define YY_FLUSH_BUFFER swf4_flush_buffer(YY_CURRENT_BUFFER )
304 YY_BUFFER_STATE swf4_scan_buffer (char *base,yy_size_t size );
305 YY_BUFFER_STATE swf4_scan_string (yyconst char *yy_str );
306 YY_BUFFER_STATE swf4_scan_bytes (yyconst char *bytes,int len );
308 void *swf4alloc (yy_size_t );
309 void *swf4realloc (void *,yy_size_t );
310 void swf4free (void * );
312 #define yy_new_buffer swf4_create_buffer
314 #define yy_set_interactive(is_interactive) \
316 if ( ! YY_CURRENT_BUFFER ){ \
317 swf4ensure_buffer_stack (); \
318 YY_CURRENT_BUFFER_LVALUE = \
319 swf4_create_buffer(swf4in,YY_BUF_SIZE ); \
321 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
324 #define yy_set_bol(at_bol) \
326 if ( ! YY_CURRENT_BUFFER ){\
327 swf4ensure_buffer_stack (); \
328 YY_CURRENT_BUFFER_LVALUE = \
329 swf4_create_buffer(swf4in,YY_BUF_SIZE ); \
331 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
336 /* Begin user sect3 */
338 typedef unsigned char YY_CHAR;
340 FILE *swf4in = (FILE *) 0, *swf4out = (FILE *) 0;
342 typedef int yy_state_type;
344 extern int swf4lineno;
348 extern char *swf4text;
349 #define yytext_ptr swf4text
351 static yy_state_type yy_get_previous_state (void );
352 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
353 static int yy_get_next_buffer (void );
354 static void yy_fatal_error (yyconst char msg[] );
356 /* Done after the current pattern has been matched and before the
357 * corresponding action - sets up swf4text.
359 #define YY_DO_BEFORE_ACTION \
360 (yytext_ptr) = yy_bp; \
361 swf4leng = (size_t) (yy_cp - yy_bp); \
362 (yy_hold_char) = *yy_cp; \
364 (yy_c_buf_p) = yy_cp;
366 #define YY_NUM_RULES 95
367 #define YY_END_OF_BUFFER 96
368 /* This struct is not used in this scanner,
369 but its presence is necessary. */
372 flex_int32_t yy_verify;
375 static yyconst flex_int16_t yy_accept[320] =
377 0, 0, 96, 94, 56, 93, 94, 82, 94, 79,
378 94, 83, 84, 80, 77, 89, 78, 90, 81, 1,
379 92, 75, 59, 76, 60, 91, 85, 86, 47, 47,
380 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
381 47, 47, 47, 47, 47, 87, 94, 88, 93, 64,
382 0, 52, 50, 0, 65, 0, 53, 51, 0, 67,
383 57, 69, 58, 70, 74, 0, 54, 48, 55, 68,
384 48, 2, 1, 61, 63, 62, 0, 47, 47, 47,
385 47, 47, 11, 47, 47, 47, 47, 47, 47, 47,
386 9, 47, 47, 47, 47, 47, 47, 47, 47, 47,
388 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
389 47, 47, 66, 72, 48, 48, 2, 73, 71, 49,
390 49, 47, 47, 24, 47, 47, 47, 47, 8, 47,
391 33, 47, 16, 47, 47, 47, 47, 23, 47, 47,
392 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
393 47, 47, 47, 47, 47, 49, 49, 47, 47, 47,
394 47, 47, 7, 47, 47, 47, 47, 47, 47, 47,
395 47, 47, 37, 32, 47, 47, 47, 47, 47, 38,
396 47, 47, 46, 14, 47, 47, 3, 47, 47, 5,
397 47, 47, 47, 47, 4, 47, 47, 47, 47, 47,
399 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
400 47, 47, 47, 47, 47, 20, 47, 10, 47, 17,
401 47, 47, 47, 47, 26, 47, 47, 15, 47, 47,
402 47, 34, 47, 13, 47, 47, 47, 47, 47, 30,
403 47, 47, 47, 47, 47, 47, 47, 47, 27, 47,
404 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
405 47, 47, 12, 47, 6, 47, 47, 47, 47, 47,
406 47, 47, 47, 47, 47, 47, 47, 22, 47, 47,
407 47, 25, 47, 47, 47, 47, 41, 28, 47, 35,
408 36, 47, 44, 21, 47, 47, 47, 47, 47, 47,
410 47, 47, 19, 40, 45, 47, 47, 43, 31, 42,
411 47, 47, 47, 47, 47, 18, 29, 39, 0
414 static yyconst flex_int32_t yy_ec[256] =
416 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
417 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 2, 5, 6, 1, 1, 1, 7, 8, 9,
420 10, 11, 12, 13, 14, 15, 16, 17, 18, 17,
421 17, 17, 17, 17, 17, 17, 17, 19, 20, 21,
422 22, 23, 24, 1, 29, 30, 31, 32, 33, 34,
423 35, 36, 37, 28, 38, 39, 40, 41, 42, 43,
424 44, 45, 46, 47, 48, 49, 50, 51, 52, 28,
425 25, 26, 27, 1, 28, 1, 29, 30, 31, 32,
427 33, 34, 35, 36, 37, 28, 38, 39, 40, 41,
428 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
429 52, 28, 53, 54, 55, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 static yyconst flex_int32_t yy_meta[56] =
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 2, 1, 1, 1, 3, 4, 5, 5, 1, 1,
450 1, 2, 1, 1, 1, 1, 1, 6, 6, 6,
451 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
452 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
456 static yyconst flex_int16_t yy_base[327] =
458 0, 0, 626, 627, 627, 627, 622, 602, 53, 616,
459 54, 627, 627, 600, 46, 627, 47, 48, 55, 57,
460 627, 627, 599, 598, 597, 627, 627, 627, 602, 44,
461 49, 51, 57, 65, 67, 70, 72, 79, 68, 81,
462 86, 85, 92, 74, 100, 627, 563, 627, 627, 594,
463 121, 132, 627, 612, 627, 114, 136, 627, 611, 627,
464 627, 627, 627, 627, 597, 130, 627, 115, 627, 627,
465 596, 125, 133, 588, 588, 627, 594, 592, 133, 137,
466 138, 139, 591, 141, 60, 140, 143, 144, 145, 147,
467 590, 148, 149, 152, 151, 153, 66, 156, 154, 158,
469 155, 161, 159, 181, 173, 166, 170, 171, 177, 188,
470 182, 192, 627, 627, 589, 588, 196, 627, 627, 200,
471 587, 193, 202, 586, 203, 204, 209, 208, 585, 211,
472 210, 214, 584, 212, 216, 215, 219, 583, 217, 221,
473 222, 223, 224, 228, 229, 230, 233, 241, 243, 244,
474 247, 245, 248, 249, 251, 582, 581, 254, 262, 256,
475 267, 268, 580, 270, 275, 271, 272, 277, 278, 279,
476 284, 282, 579, 578, 286, 285, 283, 293, 291, 294,
477 296, 297, 577, 576, 298, 308, 575, 313, 314, 574,
478 305, 315, 317, 318, 573, 320, 319, 326, 323, 329,
480 332, 335, 337, 336, 338, 339, 340, 353, 344, 341,
481 347, 351, 355, 356, 362, 572, 359, 571, 367, 566,
482 360, 374, 363, 366, 381, 372, 378, 565, 371, 382,
483 386, 556, 390, 539, 394, 395, 396, 397, 375, 538,
484 398, 400, 401, 402, 405, 406, 408, 412, 537, 413,
485 415, 417, 420, 418, 423, 430, 416, 431, 424, 432,
486 435, 434, 535, 445, 533, 446, 436, 448, 449, 450,
487 451, 456, 458, 459, 460, 455, 461, 530, 471, 465,
488 470, 529, 464, 473, 474, 478, 527, 526, 484, 525,
489 524, 485, 519, 517, 488, 489, 492, 493, 494, 495,
491 496, 499, 513, 511, 509, 500, 502, 508, 507, 299,
492 497, 503, 501, 506, 504, 162, 76, 71, 627, 556,
493 562, 567, 570, 573, 577, 580
496 static yyconst flex_int16_t yy_def[327] =
498 319, 1, 319, 319, 319, 319, 319, 319, 320, 319,
499 321, 319, 319, 319, 319, 319, 319, 319, 322, 319,
500 319, 319, 319, 319, 319, 319, 319, 319, 323, 323,
501 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
502 323, 323, 323, 323, 323, 319, 319, 319, 319, 319,
503 320, 320, 319, 320, 319, 321, 321, 319, 321, 319,
504 319, 319, 319, 319, 319, 322, 319, 319, 319, 319,
505 324, 319, 319, 319, 319, 319, 325, 323, 323, 323,
506 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
507 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
509 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
510 323, 323, 319, 319, 319, 324, 319, 319, 319, 319,
511 326, 323, 323, 323, 323, 323, 323, 323, 323, 323,
512 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
513 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
514 323, 323, 323, 323, 323, 319, 326, 323, 323, 323,
515 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
516 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
517 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
518 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
520 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
521 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
522 323, 323, 323, 323, 323, 323, 323, 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,
525 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
526 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
527 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
528 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
529 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
531 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
532 323, 323, 323, 323, 323, 323, 323, 323, 0, 319,
533 319, 319, 319, 319, 319, 319
536 static yyconst flex_int16_t yy_nxt[683] =
538 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
539 14, 15, 16, 17, 18, 19, 20, 20, 21, 22,
540 23, 24, 25, 26, 27, 4, 28, 29, 29, 30,
541 31, 32, 33, 34, 35, 29, 36, 29, 37, 29,
542 38, 39, 40, 29, 41, 42, 43, 29, 44, 45,
543 29, 29, 46, 47, 48, 52, 57, 61, 53, 77,
544 63, 58, 65, 66, 77, 67, 77, 62, 64, 68,
545 69, 72, 77, 73, 73, 77, 70, 80, 54, 59,
546 77, 77, 77, 77, 81, 77, 77, 77, 79, 77,
547 82, 77, 83, 86, 77, 85, 77, 138, 84, 89,
549 77, 77, 111, 91, 93, 127, 87, 77, 90, 88,
550 92, 95, 97, 94, 101, 77, 57, 103, 102, 98,
551 96, 58, 99, 52, 106, 100, 53, 107, 108, 115,
552 66, 104, 105, 109, 52, 112, 110, 53, 57, 59,
553 319, 117, 117, 58, 68, 319, 54, 72, 77, 73,
554 73, 319, 77, 77, 77, 77, 77, 54, 77, 77,
555 77, 59, 77, 77, 77, 122, 77, 77, 77, 77,
556 77, 77, 130, 77, 77, 123, 77, 77, 128, 125,
557 135, 77, 124, 126, 139, 77, 77, 129, 77, 134,
558 141, 131, 77, 132, 133, 142, 77, 77, 137, 140,
560 143, 136, 147, 77, 148, 144, 149, 77, 77, 145,
561 150, 151, 117, 117, 156, 77, 152, 77, 77, 77,
562 154, 158, 146, 77, 77, 77, 77, 77, 155, 77,
563 77, 77, 77, 160, 77, 153, 77, 77, 77, 77,
564 159, 163, 162, 77, 77, 77, 169, 170, 77, 161,
565 165, 172, 166, 164, 176, 168, 77, 167, 77, 77,
566 77, 171, 77, 77, 77, 177, 77, 174, 173, 77,
567 175, 77, 180, 179, 178, 186, 184, 77, 181, 182,
568 187, 185, 77, 77, 192, 77, 77, 77, 183, 189,
569 77, 190, 77, 77, 77, 191, 188, 77, 77, 77,
571 77, 77, 195, 193, 194, 199, 77, 196, 77, 77,
572 200, 77, 77, 77, 77, 197, 198, 204, 202, 206,
573 77, 209, 205, 77, 201, 211, 207, 203, 77, 77,
574 77, 208, 77, 77, 77, 77, 215, 210, 77, 212,
575 216, 77, 213, 214, 77, 217, 218, 77, 222, 219,
576 77, 77, 77, 77, 77, 77, 77, 221, 223, 77,
577 224, 220, 77, 226, 225, 230, 77, 228, 77, 232,
578 77, 77, 237, 227, 77, 77, 229, 77, 77, 234,
579 231, 77, 77, 233, 241, 235, 77, 77, 236, 77,
580 77, 238, 239, 77, 242, 244, 77, 77, 249, 240,
582 243, 77, 246, 250, 247, 77, 251, 245, 248, 77,
583 77, 77, 77, 77, 254, 77, 77, 77, 255, 252,
584 77, 77, 260, 77, 256, 259, 253, 77, 77, 257,
585 77, 77, 77, 77, 263, 77, 267, 265, 77, 77,
586 258, 264, 261, 262, 268, 77, 77, 77, 276, 77,
587 77, 77, 266, 271, 270, 269, 272, 273, 278, 277,
588 77, 77, 274, 77, 77, 77, 77, 284, 275, 280,
589 77, 77, 279, 77, 77, 77, 77, 282, 283, 77,
590 77, 281, 287, 288, 289, 77, 77, 286, 77, 77,
591 290, 291, 285, 77, 298, 294, 292, 296, 297, 77,
593 77, 293, 295, 77, 77, 299, 301, 77, 77, 77,
594 77, 77, 77, 302, 77, 77, 77, 77, 77, 77,
595 300, 77, 77, 77, 77, 308, 77, 303, 77, 314,
596 306, 307, 77, 304, 77, 305, 312, 311, 313, 77,
597 77, 77, 77, 316, 77, 77, 309, 310, 77, 315,
598 77, 317, 77, 77, 77, 318, 51, 51, 51, 51,
599 51, 51, 56, 56, 56, 56, 56, 56, 71, 71,
600 71, 77, 71, 78, 78, 78, 116, 116, 116, 121,
601 77, 77, 121, 157, 157, 157, 77, 77, 77, 77,
602 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
604 77, 77, 77, 66, 66, 77, 77, 77, 120, 119,
605 118, 66, 66, 319, 319, 114, 113, 77, 76, 75,
606 74, 60, 55, 50, 49, 319, 3, 319, 319, 319,
607 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
608 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
609 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
610 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
611 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
615 static yyconst flex_int16_t yy_chk[683] =
617 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
618 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
622 1, 1, 1, 1, 1, 9, 11, 15, 9, 30,
623 17, 11, 18, 18, 31, 19, 32, 15, 17, 19,
624 19, 20, 33, 20, 20, 85, 19, 31, 9, 11,
625 34, 97, 35, 39, 31, 36, 318, 37, 30, 44,
626 31, 317, 32, 34, 38, 33, 40, 97, 32, 35,
628 42, 41, 44, 36, 37, 85, 34, 43, 35, 34,
629 36, 38, 39, 37, 41, 45, 56, 42, 41, 40,
630 38, 56, 40, 51, 43, 40, 51, 43, 43, 68,
631 68, 42, 42, 43, 52, 45, 43, 52, 57, 56,
632 66, 72, 72, 57, 66, 66, 51, 73, 79, 73,
633 73, 66, 80, 81, 82, 86, 84, 52, 87, 88,
634 89, 57, 90, 92, 93, 79, 95, 94, 96, 99,
635 101, 98, 88, 100, 103, 80, 102, 316, 86, 82,
636 94, 106, 81, 84, 98, 107, 108, 87, 105, 93,
637 100, 89, 109, 90, 92, 101, 104, 111, 96, 99,
639 102, 95, 105, 110, 106, 103, 107, 112, 122, 104,
640 108, 109, 117, 117, 120, 120, 110, 123, 125, 126,
641 111, 122, 104, 128, 127, 131, 130, 134, 112, 132,
642 136, 135, 139, 125, 137, 110, 140, 141, 142, 143,
643 123, 127, 126, 144, 145, 146, 134, 135, 147, 125,
644 130, 137, 131, 128, 142, 132, 148, 131, 149, 150,
645 152, 136, 151, 153, 154, 143, 155, 140, 139, 158,
646 141, 160, 146, 145, 144, 152, 150, 159, 147, 148,
647 153, 151, 161, 162, 160, 164, 166, 167, 149, 155,
648 165, 158, 168, 169, 170, 159, 154, 172, 177, 171,
650 176, 175, 164, 161, 162, 168, 179, 165, 178, 180,
651 168, 181, 182, 185, 310, 166, 167, 171, 170, 175,
652 191, 178, 172, 186, 169, 180, 176, 170, 188, 189,
653 192, 177, 193, 194, 197, 196, 185, 179, 199, 180,
654 186, 198, 181, 182, 200, 188, 189, 201, 194, 191,
655 202, 204, 203, 205, 206, 207, 210, 193, 196, 209,
656 197, 192, 211, 199, 198, 203, 212, 201, 208, 205,
657 213, 214, 210, 200, 217, 221, 202, 215, 223, 207,
658 204, 224, 219, 206, 214, 208, 229, 226, 209, 222,
659 239, 211, 212, 227, 215, 219, 225, 230, 225, 213,
661 217, 231, 222, 226, 223, 233, 227, 221, 224, 235,
662 236, 237, 238, 241, 231, 242, 243, 244, 233, 229,
663 245, 246, 239, 247, 235, 238, 230, 248, 250, 236,
664 251, 257, 252, 254, 243, 253, 247, 245, 255, 259,
665 237, 244, 241, 242, 248, 256, 258, 260, 257, 262,
666 261, 267, 246, 252, 251, 250, 253, 254, 259, 258,
667 264, 266, 255, 268, 269, 270, 271, 267, 256, 261,
668 276, 272, 260, 273, 274, 275, 277, 264, 266, 283,
669 280, 262, 270, 271, 272, 281, 279, 269, 284, 285,
670 273, 274, 268, 286, 283, 277, 275, 280, 281, 289,
672 292, 276, 279, 295, 296, 284, 286, 297, 298, 299,
673 300, 301, 311, 289, 302, 306, 313, 307, 312, 315,
674 285, 314, 309, 308, 305, 299, 304, 292, 303, 311,
675 297, 298, 294, 295, 293, 296, 306, 302, 307, 291,
676 290, 288, 287, 313, 282, 278, 300, 301, 265, 312,
677 263, 314, 249, 240, 234, 315, 320, 320, 320, 320,
678 320, 320, 321, 321, 321, 321, 321, 321, 322, 322,
679 322, 232, 322, 323, 323, 323, 324, 324, 324, 325,
680 228, 220, 325, 326, 326, 326, 218, 216, 195, 190,
681 187, 184, 183, 174, 173, 163, 157, 156, 138, 133,
683 129, 124, 121, 116, 115, 91, 83, 78, 77, 75,
684 74, 71, 65, 59, 54, 50, 47, 29, 25, 24,
685 23, 14, 10, 8, 7, 3, 319, 319, 319, 319,
686 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
687 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
688 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
689 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
690 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
694 static yy_state_type yy_last_accepting_state;
695 static char *yy_last_accepting_cpos;
697 extern int swf4_flex_debug;
698 int swf4_flex_debug = 0;
700 /* The intent behind this definition is that it'll catch
701 * any uses of REJECT which flex missed.
703 #define REJECT reject_used_but_not_detected
704 #define yymore() yymore_used_but_not_detected
705 #define YY_MORE_ADJ 0
706 #define YY_RESTORE_YY_MORE_OFFSET
708 #line 1 "swf4compiler.flex"
709 #line 2 "swf4compiler.flex"
716 #include "blocks/error.h"
717 #include "swf4compiler.tab.h" /* defines token types */
719 static int swf4debug;
721 static const char *lexBuffer = NULL;
722 static int lexBufferLen = 0;
724 static int sLineNumber = 0;
725 static char szLine[1024];
726 static char msgbufs[2][1024] = { {0}, {0} }, *msgline = {0};
727 static int column = 0;
729 static void comment();
730 static void comment1();
732 static void warning(char *msg);
734 #define YY_INPUT(buf,result,max_size) result=lexBufferInput(buf, max_size)
736 /* thanks to the prolific and brilliant Raff: */
737 static int lexBufferInput(char *buf, int max_size)
739 int l = lexBufferLen > max_size ? max_size : lexBufferLen;
741 if (lexBufferLen <= 0)
744 memcpy(buf, lexBuffer, l);
750 /* very inefficient method of unescaping strings */
751 static void unescape(char *buf)
755 for (p1=buf; (p=strchr(p1, '\\')) != 0; p1 = p+1) {
758 case 'b' : p[1] = '\b'; break;
759 case 'f' : p[1] = '\f'; break;
760 case 'n' : p[1] = '\n'; break;
761 case 'r' : p[1] = '\r'; break;
762 case 't' : p[1] = '\t'; break;
764 case 'u' : warning("unsupported escape sequence");
770 void swf4ParseInit(const char *script, int debug)
778 lexBufferLen = strlen(script);
781 msgline = msgbufs[0];
784 #line 79 "swf4compiler.flex"
785 // forward declaration needed by the following function
788 #define YY_PROTO(proto) proto
790 #define YY_PROTO(proto) ()
793 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
795 void do_unput4(const char c) { unput(c); }
796 #line 797 "lex.swf4.c"
800 #ifndef YY_NO_UNISTD_H
801 /* Special case for "unistd.h", since it is non-ANSI. We include it way
802 * down here because we want the user's section 1 to have been scanned first.
803 * The user has a chance to override it with an option.
808 #ifndef YY_EXTRA_TYPE
809 #define YY_EXTRA_TYPE void *
812 static int yy_init_globals (void );
814 /* Macros after this point can all be overridden by user definitions in
818 #ifndef YY_SKIP_YYWRAP
820 extern "C" int swf4wrap (void );
822 extern int swf4wrap (void );
826 static void yyunput (int c,char *buf_ptr );
829 static void yy_flex_strncpy (char *,yyconst char *,int );
832 #ifdef YY_NEED_STRLEN
833 static int yy_flex_strlen (yyconst char * );
839 static int yyinput (void );
841 static int input (void );
846 /* Amount of stuff to slurp up with each read. */
847 #ifndef YY_READ_BUF_SIZE
848 #define YY_READ_BUF_SIZE 8192
851 /* Copy whatever the last rule matched to the standard output. */
853 /* This used to be an fputs(), but since the string might contain NUL's,
854 * we now use fwrite().
856 #define ECHO (void) fwrite( swf4text, swf4leng, 1, swf4out )
859 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
860 * is returned in "result".
863 #define YY_INPUT(buf,result,max_size) \
864 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
868 for ( n = 0; n < max_size && \
869 (c = getc( swf4in )) != EOF && c != '\n'; ++n ) \
872 buf[n++] = (char) c; \
873 if ( c == EOF && ferror( swf4in ) ) \
874 YY_FATAL_ERROR( "input in flex scanner failed" ); \
880 while ( (result = fread(buf, 1, max_size, swf4in))==0 && ferror(swf4in)) \
882 if( errno != EINTR) \
884 YY_FATAL_ERROR( "input in flex scanner failed" ); \
895 /* No semi-colon after return; correct usage is to write "yyterminate();" -
896 * we don't want an extra ';' after the "return" because that will cause
897 * some compilers to complain about unreachable statements.
900 #define yyterminate() return YY_NULL
903 /* Number of entries by which start-condition stack grows. */
904 #ifndef YY_START_STACK_INCR
905 #define YY_START_STACK_INCR 25
908 /* Report a fatal error. */
909 #ifndef YY_FATAL_ERROR
910 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
913 /* end tables serialization structures and prototypes */
915 /* Default declaration of generated scanner - a define so the user can
916 * easily add parameters.
919 #define YY_DECL_IS_OURS 1
921 extern int swf4lex (void);
923 #define YY_DECL int swf4lex (void)
924 #endif /* !YY_DECL */
926 /* Code executed at the beginning of each rule, after swf4text and swf4leng
929 #ifndef YY_USER_ACTION
930 #define YY_USER_ACTION
933 /* Code executed at the end of each rule. */
935 #define YY_BREAK break;
938 #define YY_RULE_SETUP \
941 /** The main scanner function which does all the work.
945 register yy_state_type yy_current_state;
946 register char *yy_cp, *yy_bp;
949 #line 96 "swf4compiler.flex"
952 #line 953 "lex.swf4.c"
963 (yy_start) = 1; /* first start state */
971 if ( ! YY_CURRENT_BUFFER ) {
972 swf4ensure_buffer_stack ();
973 YY_CURRENT_BUFFER_LVALUE =
974 swf4_create_buffer(swf4in,YY_BUF_SIZE );
977 swf4_load_buffer_state( );
980 while ( 1 ) /* loops until end-of-file is reached */
982 yy_cp = (yy_c_buf_p);
984 /* Support of swf4text. */
985 *yy_cp = (yy_hold_char);
987 /* yy_bp points to the position in yy_ch_buf of the start of
992 yy_current_state = (yy_start);
996 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
997 if ( yy_accept[yy_current_state] )
999 (yy_last_accepting_state) = yy_current_state;
1000 (yy_last_accepting_cpos) = yy_cp;
1002 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1004 yy_current_state = (int) yy_def[yy_current_state];
1005 if ( yy_current_state >= 320 )
1006 yy_c = yy_meta[(unsigned int) yy_c];
1008 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1011 while ( yy_base[yy_current_state] != 627 );
1014 yy_act = yy_accept[yy_current_state];
1016 { /* have to back up */
1017 yy_cp = (yy_last_accepting_cpos);
1018 yy_current_state = (yy_last_accepting_state);
1019 yy_act = yy_accept[yy_current_state];
1022 YY_DO_BEFORE_ACTION;
1024 do_action: /* This label is used only to access EOF actions. */
1027 { /* beginning of action switch */
1028 case 0: /* must back up */
1029 /* undo the effects of YY_DO_BEFORE_ACTION */
1030 *yy_cp = (yy_hold_char);
1031 yy_cp = (yy_last_accepting_cpos);
1032 yy_current_state = (yy_last_accepting_state);
1033 goto yy_find_action;
1037 #line 98 "swf4compiler.flex"
1038 { count(); swf4lval.str = strdup(swf4text);
1043 #line 100 "swf4compiler.flex"
1044 { count(); swf4lval.str = strdup(swf4text);
1049 #line 102 "swf4compiler.flex"
1050 { count(); swf4lval.str = strdup("1");
1055 #line 104 "swf4compiler.flex"
1056 { count(); swf4lval.str = strdup("0");
1061 #line 106 "swf4compiler.flex"
1062 { count(); return BREAK; }
1066 #line 107 "swf4compiler.flex"
1067 { count(); return CONTINUE; }
1071 #line 108 "swf4compiler.flex"
1072 { count(); return ELSE; }
1076 #line 109 "swf4compiler.flex"
1077 { count(); return FOR; }
1081 #line 110 "swf4compiler.flex"
1082 { count(); return IF; }
1086 #line 111 "swf4compiler.flex"
1087 { count(); return WHILE; }
1091 #line 112 "swf4compiler.flex"
1092 { count(); return DO; }
1096 #line 113 "swf4compiler.flex"
1097 { count(); return EVAL; }
1102 #line 116 "swf4compiler.flex"
1103 { count(); return RANDOM; }
1107 #line 117 "swf4compiler.flex"
1108 { count(); return TIME; }
1112 #line 118 "swf4compiler.flex"
1113 { count(); return LENGTH; }
1117 #line 119 "swf4compiler.flex"
1118 { count(); return INT; }
1122 #line 120 "swf4compiler.flex"
1123 { count(); return CONCAT; }
1127 #line 121 "swf4compiler.flex"
1128 { count(); return DUPLICATECLIP; }
1132 #line 122 "swf4compiler.flex"
1133 { count(); return REMOVECLIP; }
1137 #line 123 "swf4compiler.flex"
1138 { count(); return TRACE; }
1142 #line 124 "swf4compiler.flex"
1143 { count(); return STARTDRAG; }
1147 #line 125 "swf4compiler.flex"
1148 { count(); return STOPDRAG; }
1152 #line 126 "swf4compiler.flex"
1153 { count(); return ORD; }
1157 #line 127 "swf4compiler.flex"
1158 { count(); return CHR; }
1162 #line 128 "swf4compiler.flex"
1163 { count(); return CALLFRAME; }
1167 #line 129 "swf4compiler.flex"
1168 { count(); return GETURL; }
1172 #line 130 "swf4compiler.flex"
1173 { count(); return GETURL1; }
1177 #line 131 "swf4compiler.flex"
1178 { count(); return LOADMOVIE; }
1182 #line 132 "swf4compiler.flex"
1183 { count(); return LOADVARIABLES; }
1187 #line 133 "swf4compiler.flex"
1188 { count(); return SUBSTR; }
1192 #line 135 "swf4compiler.flex"
1193 { count(); return GETPROPERTY; }
1195 /* getURL2 methods */
1198 #line 138 "swf4compiler.flex"
1199 { count(); swf4lval.getURLMethod = GETURL_METHOD_POST;
1200 return GETURL_METHOD; }
1204 #line 140 "swf4compiler.flex"
1205 { count(); swf4lval.getURLMethod = GETURL_METHOD_GET;
1206 return GETURL_METHOD; }
1210 #line 142 "swf4compiler.flex"
1211 { count(); swf4lval.getURLMethod = GETURL_METHOD_NOSEND;
1212 return GETURL_METHOD; }
1217 #line 147 "swf4compiler.flex"
1218 { count(); return NEXTFRAME; }
1222 #line 148 "swf4compiler.flex"
1223 { count(); return PREVFRAME; }
1227 #line 149 "swf4compiler.flex"
1228 { count(); return PLAY; }
1232 #line 150 "swf4compiler.flex"
1233 { count(); return STOP; }
1237 #line 151 "swf4compiler.flex"
1238 { count(); return TOGGLEQUALITY; }
1242 #line 152 "swf4compiler.flex"
1243 { count(); return STOPSOUNDS; }
1247 #line 153 "swf4compiler.flex"
1248 { count(); return GOTOFRAME; }
1252 #line 154 "swf4compiler.flex"
1253 { count(); return GOTOANDPLAY; }
1257 #line 155 "swf4compiler.flex"
1258 { count(); return FRAMELOADED; }
1262 #line 156 "swf4compiler.flex"
1263 { count(); return SETTARGET; }
1265 /* high level functions */
1268 #line 159 "swf4compiler.flex"
1269 { count(); return TELLTARGET; }
1273 #line 162 "swf4compiler.flex"
1274 { count(); return THIS; }
1278 #line 164 "swf4compiler.flex"
1279 { count(); swf4lval.str = strdup(swf4text);
1280 return IDENTIFIER; }
1284 #line 167 "swf4compiler.flex"
1285 { count(); swf4lval.str = strdup(swf4text);
1290 #line 170 "swf4compiler.flex"
1291 { count(); swf4lval.str = strdup(swf4text);
1295 /* rule 50 can match eol */
1297 #line 173 "swf4compiler.flex"
1298 { count(); swf4lval.str = strdup(swf4text+1);
1299 swf4lval.str[strlen(swf4lval.str)-1]=0;
1300 unescape(swf4lval.str);
1304 /* rule 51 can match eol */
1306 #line 178 "swf4compiler.flex"
1307 { count(); swf4lval.str = strdup(swf4text+1);
1308 swf4lval.str[strlen(swf4lval.str)-1]=0;
1309 unescape(swf4lval.str);
1313 /* rule 52 can match eol */
1314 *yy_cp = (yy_hold_char); /* undo effects of setting up swf4text */
1315 (yy_c_buf_p) = yy_cp -= 1;
1316 YY_DO_BEFORE_ACTION; /* set up swf4text again */
1318 #line 183 "swf4compiler.flex"
1319 { count(); swf4lval.str = strdup("");
1320 warning("Unterminated string!");
1324 /* rule 53 can match eol */
1325 *yy_cp = (yy_hold_char); /* undo effects of setting up swf4text */
1326 (yy_c_buf_p) = yy_cp -= 1;
1327 YY_DO_BEFORE_ACTION; /* set up swf4text again */
1329 #line 187 "swf4compiler.flex"
1330 { count(); swf4lval.str = strdup("");
1331 warning("Unterminated string!");
1336 #line 191 "swf4compiler.flex"
1337 { count(); comment(); }
1341 #line 192 "swf4compiler.flex"
1342 { count(); comment1(); }
1346 #line 193 "swf4compiler.flex"
1351 #line 195 "swf4compiler.flex"
1352 { count(); return INC; }
1356 #line 196 "swf4compiler.flex"
1357 { count(); return DEC; }
1361 #line 197 "swf4compiler.flex"
1362 { count(); return '<'; }
1366 #line 198 "swf4compiler.flex"
1367 { count(); return '>'; }
1371 #line 199 "swf4compiler.flex"
1372 { count(); return LE; }
1376 #line 200 "swf4compiler.flex"
1377 { count(); return GE; }
1381 #line 201 "swf4compiler.flex"
1382 { count(); return EQ; }
1386 #line 202 "swf4compiler.flex"
1387 { count(); return NE; }
1391 #line 203 "swf4compiler.flex"
1392 { count(); return LAN; }
1396 #line 204 "swf4compiler.flex"
1397 { count(); return LOR; }
1401 #line 205 "swf4compiler.flex"
1402 { count(); return MEQ; }
1406 #line 206 "swf4compiler.flex"
1407 { count(); return DEQ; }
1411 #line 207 "swf4compiler.flex"
1412 { count(); return IEQ; }
1416 #line 208 "swf4compiler.flex"
1417 { count(); return SEQ; }
1421 #line 209 "swf4compiler.flex"
1422 { count(); return STREQ; }
1426 #line 210 "swf4compiler.flex"
1427 { count(); return STRNE; }
1431 #line 211 "swf4compiler.flex"
1432 { count(); return STRCMP; }
1436 #line 212 "swf4compiler.flex"
1437 { count(); return PARENT; }
1441 #line 214 "swf4compiler.flex"
1442 { count(); return ';'; }
1446 #line 215 "swf4compiler.flex"
1447 { count(); return '='; }
1451 #line 216 "swf4compiler.flex"
1452 { count(); return '+'; }
1456 #line 217 "swf4compiler.flex"
1457 { count(); return '-'; }
1461 #line 218 "swf4compiler.flex"
1462 { count(); return '&'; }
1466 #line 219 "swf4compiler.flex"
1467 { count(); return '*'; }
1471 #line 220 "swf4compiler.flex"
1472 { count(); return '/'; }
1476 #line 221 "swf4compiler.flex"
1477 { count(); return '!'; }
1481 #line 222 "swf4compiler.flex"
1482 { count(); return '('; }
1486 #line 223 "swf4compiler.flex"
1487 { count(); return ')'; }
1491 #line 224 "swf4compiler.flex"
1492 { count(); return '['; }
1496 #line 225 "swf4compiler.flex"
1497 { count(); return ']'; }
1501 #line 226 "swf4compiler.flex"
1502 { count(); return '{'; }
1506 #line 227 "swf4compiler.flex"
1507 { count(); return '}'; }
1511 #line 228 "swf4compiler.flex"
1512 { count(); return ','; }
1516 #line 229 "swf4compiler.flex"
1517 { count(); return '.'; }
1521 #line 230 "swf4compiler.flex"
1522 { count(); return '?'; }
1526 #line 231 "swf4compiler.flex"
1527 { count(); return ':'; }
1530 /* rule 93 can match eol */
1532 #line 233 "swf4compiler.flex"
1533 { count(); column = 0;
1534 strcpy(szLine, swf4text + 1);
1535 ++sLineNumber; yyless(1); }
1539 #line 237 "swf4compiler.flex"
1540 printf( "Unrecognized character: %s\n", swf4text );
1544 #line 239 "swf4compiler.flex"
1547 #line 1548 "lex.swf4.c"
1548 case YY_STATE_EOF(INITIAL):
1551 case YY_END_OF_BUFFER:
1553 /* Amount of text matched not including the EOB char. */
1554 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1556 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1557 *yy_cp = (yy_hold_char);
1558 YY_RESTORE_YY_MORE_OFFSET
1560 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1562 /* We're scanning a new file or input source. It's
1563 * possible that this happened because the user
1564 * just pointed swf4in at a new source and called
1565 * swf4lex(). If so, then we have to assure
1566 * consistency between YY_CURRENT_BUFFER and our
1567 * globals. Here is the right place to do so, because
1568 * this is the first action (other than possibly a
1569 * back-up) that will match for the new input source.
1571 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1572 YY_CURRENT_BUFFER_LVALUE->yy_input_file = swf4in;
1573 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1576 /* Note that here we test for yy_c_buf_p "<=" to the position
1577 * of the first EOB in the buffer, since yy_c_buf_p will
1578 * already have been incremented past the NUL character
1579 * (since all states make transitions on EOB to the
1580 * end-of-buffer state). Contrast this with the test
1583 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1584 { /* This was really a NUL. */
1585 yy_state_type yy_next_state;
1587 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1589 yy_current_state = yy_get_previous_state( );
1591 /* Okay, we're now positioned to make the NUL
1592 * transition. We couldn't have
1593 * yy_get_previous_state() go ahead and do it
1594 * for us because it doesn't know how to deal
1595 * with the possibility of jamming (and we don't
1596 * want to build jamming into it because then it
1597 * will run more slowly).
1600 yy_next_state = yy_try_NUL_trans( yy_current_state );
1602 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1604 if ( yy_next_state )
1606 /* Consume the NUL. */
1607 yy_cp = ++(yy_c_buf_p);
1608 yy_current_state = yy_next_state;
1614 yy_cp = (yy_c_buf_p);
1615 goto yy_find_action;
1619 else switch ( yy_get_next_buffer( ) )
1621 case EOB_ACT_END_OF_FILE:
1623 (yy_did_buffer_switch_on_eof) = 0;
1627 /* Note: because we've taken care in
1628 * yy_get_next_buffer() to have set up
1629 * swf4text, we can now set up
1630 * yy_c_buf_p so that if some total
1631 * hoser (like flex itself) wants to
1632 * call the scanner after we return the
1633 * YY_NULL, it'll still work - another
1634 * YY_NULL will get returned.
1636 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1638 yy_act = YY_STATE_EOF(YY_START);
1644 if ( ! (yy_did_buffer_switch_on_eof) )
1650 case EOB_ACT_CONTINUE_SCAN:
1652 (yytext_ptr) + yy_amount_of_matched_text;
1654 yy_current_state = yy_get_previous_state( );
1656 yy_cp = (yy_c_buf_p);
1657 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1660 case EOB_ACT_LAST_MATCH:
1662 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1664 yy_current_state = yy_get_previous_state( );
1666 yy_cp = (yy_c_buf_p);
1667 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1668 goto yy_find_action;
1675 "fatal flex scanner internal error--no action found" );
1676 } /* end of action switch */
1677 } /* end of scanning one token */
1678 } /* end of swf4lex */
1680 /* yy_get_next_buffer - try to read in a new buffer
1682 * Returns a code representing an action:
1683 * EOB_ACT_LAST_MATCH -
1684 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1685 * EOB_ACT_END_OF_FILE - end of file
1687 static int yy_get_next_buffer (void)
1689 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1690 register char *source = (yytext_ptr);
1691 register int number_to_move, i;
1694 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1696 "fatal flex scanner internal error--end of buffer missed" );
1698 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1699 { /* Don't try to fill the buffer, so this is an EOF. */
1700 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1702 /* We matched a single character, the EOB, so
1703 * treat this as a final EOF.
1705 return EOB_ACT_END_OF_FILE;
1710 /* We matched some text prior to the EOB, first
1713 return EOB_ACT_LAST_MATCH;
1717 /* Try to read more data. */
1719 /* First move last chars to start of buffer. */
1720 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1722 for ( i = 0; i < number_to_move; ++i )
1723 *(dest++) = *(source++);
1725 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1726 /* don't do the read, it's not guaranteed to return an EOF,
1729 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1734 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1736 while ( num_to_read <= 0 )
1737 { /* Not enough room in the buffer - grow it. */
1739 /* just a shorter name for the current buffer */
1740 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1742 int yy_c_buf_p_offset =
1743 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1745 if ( b->yy_is_our_buffer )
1747 int new_size = b->yy_buf_size * 2;
1749 if ( new_size <= 0 )
1750 b->yy_buf_size += b->yy_buf_size / 8;
1752 b->yy_buf_size *= 2;
1754 b->yy_ch_buf = (char *)
1755 /* Include room in for 2 EOB chars. */
1756 swf4realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1759 /* Can't grow it, we don't own it. */
1762 if ( ! b->yy_ch_buf )
1764 "fatal error - scanner input buffer overflow" );
1766 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1768 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1773 if ( num_to_read > YY_READ_BUF_SIZE )
1774 num_to_read = YY_READ_BUF_SIZE;
1776 /* Read in more data. */
1777 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1778 (yy_n_chars), num_to_read );
1780 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1783 if ( (yy_n_chars) == 0 )
1785 if ( number_to_move == YY_MORE_ADJ )
1787 ret_val = EOB_ACT_END_OF_FILE;
1788 swf4restart(swf4in );
1793 ret_val = EOB_ACT_LAST_MATCH;
1794 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1795 YY_BUFFER_EOF_PENDING;
1800 ret_val = EOB_ACT_CONTINUE_SCAN;
1802 (yy_n_chars) += number_to_move;
1803 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1804 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1806 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1811 /* yy_get_previous_state - get the state just before the EOB char was reached */
1813 static yy_state_type yy_get_previous_state (void)
1815 register yy_state_type yy_current_state;
1816 register char *yy_cp;
1818 yy_current_state = (yy_start);
1820 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1822 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1823 if ( yy_accept[yy_current_state] )
1825 (yy_last_accepting_state) = yy_current_state;
1826 (yy_last_accepting_cpos) = yy_cp;
1828 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1830 yy_current_state = (int) yy_def[yy_current_state];
1831 if ( yy_current_state >= 320 )
1832 yy_c = yy_meta[(unsigned int) yy_c];
1834 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1837 return yy_current_state;
1840 /* yy_try_NUL_trans - try to make a transition on the NUL character
1843 * next_state = yy_try_NUL_trans( current_state );
1845 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1847 register int yy_is_jam;
1848 register char *yy_cp = (yy_c_buf_p);
1850 register YY_CHAR yy_c = 1;
1851 if ( yy_accept[yy_current_state] )
1853 (yy_last_accepting_state) = yy_current_state;
1854 (yy_last_accepting_cpos) = yy_cp;
1856 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1858 yy_current_state = (int) yy_def[yy_current_state];
1859 if ( yy_current_state >= 320 )
1860 yy_c = yy_meta[(unsigned int) yy_c];
1862 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1863 yy_is_jam = (yy_current_state == 319);
1865 return yy_is_jam ? 0 : yy_current_state;
1868 static void yyunput (int c, register char * yy_bp )
1870 register char *yy_cp;
1872 yy_cp = (yy_c_buf_p);
1874 /* undo effects of setting up swf4text */
1875 *yy_cp = (yy_hold_char);
1877 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1878 { /* need to shift things up to make room */
1879 /* +2 for EOB chars. */
1880 register int number_to_move = (yy_n_chars) + 2;
1881 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1882 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1883 register char *source =
1884 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1886 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1887 *--dest = *--source;
1889 yy_cp += (int) (dest - source);
1890 yy_bp += (int) (dest - source);
1891 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1892 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1894 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1895 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1898 *--yy_cp = (char) c;
1900 (yytext_ptr) = yy_bp;
1901 (yy_hold_char) = *yy_cp;
1902 (yy_c_buf_p) = yy_cp;
1907 static int yyinput (void)
1909 static int input (void)
1915 *(yy_c_buf_p) = (yy_hold_char);
1917 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1919 /* yy_c_buf_p now points to the character we want to return.
1920 * If this occurs *before* the EOB characters, then it's a
1921 * valid NUL; if not, then we've hit the end of the buffer.
1923 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1924 /* This was really a NUL. */
1925 *(yy_c_buf_p) = '\0';
1928 { /* need more input */
1929 int offset = (yy_c_buf_p) - (yytext_ptr);
1932 switch ( yy_get_next_buffer( ) )
1934 case EOB_ACT_LAST_MATCH:
1935 /* This happens because yy_g_n_b()
1936 * sees that we've accumulated a
1937 * token and flags that we need to
1938 * try matching the token before
1939 * proceeding. But for input(),
1940 * there's no matching to consider.
1941 * So convert the EOB_ACT_LAST_MATCH
1942 * to EOB_ACT_END_OF_FILE.
1945 /* Reset buffer status. */
1946 swf4restart(swf4in );
1950 case EOB_ACT_END_OF_FILE:
1955 if ( ! (yy_did_buffer_switch_on_eof) )
1964 case EOB_ACT_CONTINUE_SCAN:
1965 (yy_c_buf_p) = (yytext_ptr) + offset;
1971 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1972 *(yy_c_buf_p) = '\0'; /* preserve swf4text */
1973 (yy_hold_char) = *++(yy_c_buf_p);
1977 #endif /* ifndef YY_NO_INPUT */
1979 /** Immediately switch to a different input stream.
1980 * @param input_file A readable stream.
1982 * @note This function does not reset the start condition to @c INITIAL .
1984 void swf4restart (FILE * input_file )
1987 if ( ! YY_CURRENT_BUFFER ){
1988 swf4ensure_buffer_stack ();
1989 YY_CURRENT_BUFFER_LVALUE =
1990 swf4_create_buffer(swf4in,YY_BUF_SIZE );
1993 swf4_init_buffer(YY_CURRENT_BUFFER,input_file );
1994 swf4_load_buffer_state( );
1997 /** Switch to a different input buffer.
1998 * @param new_buffer The new input buffer.
2001 void swf4_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2004 /* TODO. We should be able to replace this entire function body
2006 * swf4pop_buffer_state();
2007 * swf4push_buffer_state(new_buffer);
2009 swf4ensure_buffer_stack ();
2010 if ( YY_CURRENT_BUFFER == new_buffer )
2013 if ( YY_CURRENT_BUFFER )
2015 /* Flush out information for old buffer. */
2016 *(yy_c_buf_p) = (yy_hold_char);
2017 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2018 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2021 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2022 swf4_load_buffer_state( );
2024 /* We don't actually know whether we did this switch during
2025 * EOF (swf4wrap()) processing, but the only time this flag
2026 * is looked at is after swf4wrap() is called, so it's safe
2027 * to go ahead and always set it.
2029 (yy_did_buffer_switch_on_eof) = 1;
2032 static void swf4_load_buffer_state (void)
2034 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2035 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2036 swf4in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2037 (yy_hold_char) = *(yy_c_buf_p);
2040 /** Allocate and initialize an input buffer state.
2041 * @param file A readable stream.
2042 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2044 * @return the allocated buffer state.
2046 YY_BUFFER_STATE swf4_create_buffer (FILE * file, int size )
2050 b = (YY_BUFFER_STATE) swf4alloc(sizeof( struct yy_buffer_state ) );
2052 YY_FATAL_ERROR( "out of dynamic memory in swf4_create_buffer()" );
2054 b->yy_buf_size = size;
2056 /* yy_ch_buf has to be 2 characters longer than the size given because
2057 * we need to put in 2 end-of-buffer characters.
2059 b->yy_ch_buf = (char *) swf4alloc(b->yy_buf_size + 2 );
2060 if ( ! b->yy_ch_buf )
2061 YY_FATAL_ERROR( "out of dynamic memory in swf4_create_buffer()" );
2063 b->yy_is_our_buffer = 1;
2065 swf4_init_buffer(b,file );
2070 /** Destroy the buffer.
2071 * @param b a buffer created with swf4_create_buffer()
2074 void swf4_delete_buffer (YY_BUFFER_STATE b )
2080 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2081 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2083 if ( b->yy_is_our_buffer )
2084 swf4free((void *) b->yy_ch_buf );
2086 swf4free((void *) b );
2089 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
2093 #ifdef __THROW /* this is a gnuism */
2094 extern int isatty (int ) __THROW;
2096 extern int isatty (int );
2103 /* Initializes or reinitializes a buffer.
2104 * This function is sometimes called more than once on the same buffer,
2105 * such as during a swf4restart() or at EOF.
2107 static void swf4_init_buffer (YY_BUFFER_STATE b, FILE * file )
2112 swf4_flush_buffer(b );
2114 b->yy_input_file = file;
2115 b->yy_fill_buffer = 1;
2117 /* If b is the current buffer, then swf4_init_buffer was _probably_
2118 * called from swf4restart() or through yy_get_next_buffer.
2119 * In that case, we don't want to reset the lineno or column.
2121 if (b != YY_CURRENT_BUFFER){
2122 b->yy_bs_lineno = 1;
2123 b->yy_bs_column = 0;
2126 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2131 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2132 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2135 void swf4_flush_buffer (YY_BUFFER_STATE b )
2142 /* We always need two end-of-buffer characters. The first causes
2143 * a transition to the end-of-buffer state. The second causes
2144 * a jam in that state.
2146 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2147 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2149 b->yy_buf_pos = &b->yy_ch_buf[0];
2152 b->yy_buffer_status = YY_BUFFER_NEW;
2154 if ( b == YY_CURRENT_BUFFER )
2155 swf4_load_buffer_state( );
2158 /** Pushes the new state onto the stack. The new state becomes
2159 * the current state. This function will allocate the stack
2161 * @param new_buffer The new state.
2164 void swf4push_buffer_state (YY_BUFFER_STATE new_buffer )
2166 if (new_buffer == NULL)
2169 swf4ensure_buffer_stack();
2171 /* This block is copied from swf4_switch_to_buffer. */
2172 if ( YY_CURRENT_BUFFER )
2174 /* Flush out information for old buffer. */
2175 *(yy_c_buf_p) = (yy_hold_char);
2176 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2177 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2180 /* Only push if top exists. Otherwise, replace top. */
2181 if (YY_CURRENT_BUFFER)
2182 (yy_buffer_stack_top)++;
2183 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2185 /* copied from swf4_switch_to_buffer. */
2186 swf4_load_buffer_state( );
2187 (yy_did_buffer_switch_on_eof) = 1;
2190 /** Removes and deletes the top of the stack, if present.
2191 * The next element becomes the new top.
2194 void swf4pop_buffer_state (void)
2196 if (!YY_CURRENT_BUFFER)
2199 swf4_delete_buffer(YY_CURRENT_BUFFER );
2200 YY_CURRENT_BUFFER_LVALUE = NULL;
2201 if ((yy_buffer_stack_top) > 0)
2202 --(yy_buffer_stack_top);
2204 if (YY_CURRENT_BUFFER) {
2205 swf4_load_buffer_state( );
2206 (yy_did_buffer_switch_on_eof) = 1;
2210 /* Allocates the stack if it does not exist.
2211 * Guarantees space for at least one push.
2213 static void swf4ensure_buffer_stack (void)
2217 if (!(yy_buffer_stack)) {
2219 /* First allocation is just for 2 elements, since we don't know if this
2220 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2221 * immediate realloc on the next call.
2224 (yy_buffer_stack) = (struct yy_buffer_state**)swf4alloc
2225 (num_to_alloc * sizeof(struct yy_buffer_state*)
2228 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2230 (yy_buffer_stack_max) = num_to_alloc;
2231 (yy_buffer_stack_top) = 0;
2235 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2237 /* Increase the buffer to prepare for a possible push. */
2238 int grow_size = 8 /* arbitrary grow size */;
2240 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2241 (yy_buffer_stack) = (struct yy_buffer_state**)swf4realloc
2243 num_to_alloc * sizeof(struct yy_buffer_state*)
2246 /* zero only the new slots.*/
2247 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2248 (yy_buffer_stack_max) = num_to_alloc;
2252 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2253 * @param base the character buffer
2254 * @param size the size in bytes of the character buffer
2256 * @return the newly allocated buffer state object.
2258 YY_BUFFER_STATE swf4_scan_buffer (char * base, yy_size_t size )
2263 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2264 base[size-1] != YY_END_OF_BUFFER_CHAR )
2265 /* They forgot to leave room for the EOB's. */
2268 b = (YY_BUFFER_STATE) swf4alloc(sizeof( struct yy_buffer_state ) );
2270 YY_FATAL_ERROR( "out of dynamic memory in swf4_scan_buffer()" );
2272 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2273 b->yy_buf_pos = b->yy_ch_buf = base;
2274 b->yy_is_our_buffer = 0;
2275 b->yy_input_file = 0;
2276 b->yy_n_chars = b->yy_buf_size;
2277 b->yy_is_interactive = 0;
2279 b->yy_fill_buffer = 0;
2280 b->yy_buffer_status = YY_BUFFER_NEW;
2282 swf4_switch_to_buffer(b );
2287 /** Setup the input buffer state to scan a string. The next call to swf4lex() will
2288 * scan from a @e copy of @a str.
2289 * @param str a NUL-terminated string to scan
2291 * @return the newly allocated buffer state object.
2292 * @note If you want to scan bytes that may contain NUL values, then use
2293 * swf4_scan_bytes() instead.
2295 YY_BUFFER_STATE swf4_scan_string (yyconst char * yystr )
2298 return swf4_scan_bytes(yystr,strlen(yystr) );
2301 /** Setup the input buffer state to scan the given bytes. The next call to swf4lex() will
2302 * scan from a @e copy of @a bytes.
2303 * @param bytes the byte buffer to scan
2304 * @param len the number of bytes in the buffer pointed to by @a bytes.
2306 * @return the newly allocated buffer state object.
2308 YY_BUFFER_STATE swf4_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2315 /* Get memory for full buffer, including space for trailing EOB's. */
2316 n = _yybytes_len + 2;
2317 buf = (char *) swf4alloc(n );
2319 YY_FATAL_ERROR( "out of dynamic memory in swf4_scan_bytes()" );
2321 for ( i = 0; i < _yybytes_len; ++i )
2322 buf[i] = yybytes[i];
2324 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2326 b = swf4_scan_buffer(buf,n );
2328 YY_FATAL_ERROR( "bad buffer in swf4_scan_bytes()" );
2330 /* It's okay to grow etc. this buffer, and we should throw it
2331 * away when we're done.
2333 b->yy_is_our_buffer = 1;
2338 #ifndef YY_EXIT_FAILURE
2339 #define YY_EXIT_FAILURE 2
2342 static void yy_fatal_error (yyconst char* msg )
2344 (void) fprintf( stderr, "%s\n", msg );
2345 exit( YY_EXIT_FAILURE );
2348 /* Redefine yyless() so it works in section 3 code. */
2354 /* Undo effects of setting up swf4text. */ \
2355 int yyless_macro_arg = (n); \
2356 YY_LESS_LINENO(yyless_macro_arg);\
2357 swf4text[swf4leng] = (yy_hold_char); \
2358 (yy_c_buf_p) = swf4text + yyless_macro_arg; \
2359 (yy_hold_char) = *(yy_c_buf_p); \
2360 *(yy_c_buf_p) = '\0'; \
2361 swf4leng = yyless_macro_arg; \
2365 /* Accessor methods (get/set functions) to struct members. */
2367 /** Get the current line number.
2370 int swf4get_lineno (void)
2376 /** Get the input stream.
2379 FILE *swf4get_in (void)
2384 /** Get the output stream.
2387 FILE *swf4get_out (void)
2392 /** Get the length of the current token.
2395 int swf4get_leng (void)
2400 /** Get the current token.
2404 char *swf4get_text (void)
2409 /** Set the current line number.
2410 * @param line_number
2413 void swf4set_lineno (int line_number )
2416 swf4lineno = line_number;
2419 /** Set the input stream. This does not discard the current
2421 * @param in_str A readable stream.
2423 * @see swf4_switch_to_buffer
2425 void swf4set_in (FILE * in_str )
2430 void swf4set_out (FILE * out_str )
2435 int swf4get_debug (void)
2437 return swf4_flex_debug;
2440 void swf4set_debug (int bdebug )
2442 swf4_flex_debug = bdebug ;
2445 static int yy_init_globals (void)
2447 /* Initialization is the same as for the non-reentrant scanner.
2448 * This function is called from swf4lex_destroy(), so don't allocate here.
2451 (yy_buffer_stack) = 0;
2452 (yy_buffer_stack_top) = 0;
2453 (yy_buffer_stack_max) = 0;
2454 (yy_c_buf_p) = (char *) 0;
2458 /* Defined in main.c */
2463 swf4in = (FILE *) 0;
2464 swf4out = (FILE *) 0;
2467 /* For future reference: Set errno on error, since we are called by
2473 /* swf4lex_destroy is for both reentrant and non-reentrant scanners. */
2474 int swf4lex_destroy (void)
2477 /* Pop the buffer stack, destroying each element. */
2478 while(YY_CURRENT_BUFFER){
2479 swf4_delete_buffer(YY_CURRENT_BUFFER );
2480 YY_CURRENT_BUFFER_LVALUE = NULL;
2481 swf4pop_buffer_state();
2484 /* Destroy the stack itself. */
2485 swf4free((yy_buffer_stack) );
2486 (yy_buffer_stack) = NULL;
2488 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2489 * swf4lex() is called, initialization will occur. */
2496 * Internal utility routines.
2500 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2503 for ( i = 0; i < n; ++i )
2508 #ifdef YY_NEED_STRLEN
2509 static int yy_flex_strlen (yyconst char * s )
2512 for ( n = 0; s[n]; ++n )
2519 void *swf4alloc (yy_size_t size )
2521 return (void *) malloc( size );
2524 void *swf4realloc (void * ptr, yy_size_t size )
2526 /* The cast to (char *) in the following accommodates both
2527 * implementations that use char* generic pointers, and those
2528 * that use void* generic pointers. It works with the latter
2529 * because both ANSI C and C++ allow castless assignment from
2530 * any pointer type to void*, and deal with argument conversions
2531 * as though doing an assignment.
2533 return (void *) realloc( (char *) ptr, size );
2536 void swf4free (void * ptr )
2538 free( (char *) ptr ); /* see swf4realloc() for (char *) cast */
2541 #define YYTABLES_NAME "yytables"
2543 #line 239 "swf4compiler.flex"
2546 static int getinput() {
2559 static void countline()
2561 if(sLineNumber != 0)
2562 msgline[column] = 0;
2566 msgline = msgbufs[sLineNumber & 1];
2569 static int LineNumber(void)
2571 return (sLineNumber + 1);
2574 static int ColumnNumber(void)
2579 static char *LineText(void)
2581 msgline[column] = 0;
2585 static void comment(void)
2587 // Handle block comments
2592 // We have the start of a comment so look skip everything up to the
2593 // end of the comment character
2594 while ((c = getinput()) != '*' && c != EOF)
2597 msgline[column] = c;
2601 // keep the line number in synch
2604 // start the output (matches the algorithim in the lexx above)
2608 if (swf4debug) putchar(c);
2611 // is this the end of comment character
2612 if ((c1 = getinput()) != '/' && c != EOF)
2614 // false start as this was no end of comment
2619 // write out the start of the end of comment
2621 if (swf4debug) putchar(c);
2623 // write out the end of the end of comment
2625 if (swf4debug) putchar(c1);
2628 static void comment1(void)
2630 // Handle comment of type 1 (ie '//')
2634 // this is a line comment
2635 while ((c = getinput()) != '\n' && c != EOF)
2637 if (swf4debug) putchar(c);
2640 msgline[column] = c;
2645 // keep the line number in synch
2648 if (swf4debug) putchar(c);
2654 static void count(void)
2658 // Count the characters to maintain the current column position
2659 if (swf4text[0] == '\n')
2661 if (swf4debug) printf("\n");
2665 if (swf4debug) printf("%s", swf4text);
2667 for(n=0; n<swf4leng; ++n, ++column)
2670 msgline[column] = swf4text[n];
2673 //-- keep writing the stuff to standard output
2674 //column += swf4leng;
2678 static void printprog()
2681 SWF_warn("\n%s", msgbufs[(sLineNumber-1)&1]);
2684 msgline[column] = 0;
2686 SWF_warn("\n%s", msgline);
2689 static void warning(char *msg)
2691 // print a warning message
2693 SWF_warn("\n%*s", ColumnNumber(), "^");
2694 SWF_warn("\nLine %4.4d: Reason: '%s' \n", LineNumber(), msg);
2697 void swf4error(char *msg)
2700 if(strlen(swf4text))
2702 SWF_error("\n%s\n%*s\nLine %i: Reason: '%s'\n",
2703 LineText(), ColumnNumber(), "^", LineNumber(), msg);
2707 SWF_error("\nLine %d: Reason: 'Unexpected EOF found while looking for input.'\n", LineNumber());