1 #define yy_create_buffer swf4_create_buffer
2 #define yy_delete_buffer swf4_delete_buffer
3 #define yy_scan_buffer swf4_scan_buffer
4 #define yy_scan_string swf4_scan_string
5 #define yy_scan_bytes swf4_scan_bytes
6 #define yy_flex_debug swf4_flex_debug
7 #define yy_init_buffer swf4_init_buffer
8 #define yy_flush_buffer swf4_flush_buffer
9 #define yy_load_buffer_state swf4_load_buffer_state
10 #define yy_switch_to_buffer swf4_switch_to_buffer
12 #define yyleng swf4leng
15 #define yyrestart swf4restart
16 #define yytext swf4text
17 #define yywrap swf4wrap
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
22 * $Header: /cvsroot/swftools/swftools/lib/action/lex.swf4.c,v 1.1 2008/05/24 17:09:25 kramm Exp $
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
33 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
45 /* Use prototypes in function declarations. */
48 /* The "const" storage-class-modifier is valid. */
51 #else /* ! __cplusplus */
59 #endif /* ! __cplusplus */
78 #define YY_PROTO(proto) proto
80 #define YY_PROTO(proto) ()
83 /* Returned upon end-of-file. */
86 /* Promotes a possibly negative, possibly signed char to an unsigned
87 * integer for use as an array index. If the signed char is negative,
88 * we want to instead treat it as an 8-bit unsigned char, hence the
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
93 /* Enter a start condition. This macro really ought to take a parameter,
94 * but we do it the disgusting crufty way forced on us by the ()-less
95 * definition of BEGIN.
97 #define BEGIN yy_start = 1 + 2 *
99 /* Translate the current start state into a value that can be later handed
100 * to BEGIN to return to the state. The YYSTATE alias is for lex
103 #define YY_START ((yy_start - 1) / 2)
104 #define YYSTATE YY_START
106 /* Action number for EOF rule of a given start state. */
107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
109 /* Special action meaning "start processing a new file". */
110 #define YY_NEW_FILE yyrestart( yyin )
112 #define YY_END_OF_BUFFER_CHAR 0
114 /* Size of default input buffer. */
115 #define YY_BUF_SIZE 16384
117 typedef struct yy_buffer_state *YY_BUFFER_STATE;
120 extern FILE *yyin, *yyout;
122 #define EOB_ACT_CONTINUE_SCAN 0
123 #define EOB_ACT_END_OF_FILE 1
124 #define EOB_ACT_LAST_MATCH 2
126 /* The funky do-while in the following #define is used to turn the definition
127 * int a single C statement (which needs a semi-colon terminator). This
128 * avoids problems with code like:
130 * if ( condition_holds )
133 * do_something_else();
135 * Prior to using the do-while the compiler would get upset at the
136 * "else" because it interpreted the "if" statement as being all
137 * done when it reached the ';' after the yyless() call.
140 /* Return all but the first 'n' matched characters back to the input stream. */
145 /* Undo effects of setting up yytext. */ \
146 *yy_cp = yy_hold_char; \
147 YY_RESTORE_YY_MORE_OFFSET \
148 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
153 #define unput(c) yyunput( c, yytext_ptr )
155 /* The following is because we cannot portably get our hands on size_t
156 * (without autoconf's help, which isn't available because we want
157 * flex-generated scanners to compile on their own).
159 typedef unsigned int yy_size_t;
162 struct yy_buffer_state
166 char *yy_ch_buf; /* input buffer */
167 char *yy_buf_pos; /* current position in input buffer */
169 /* Size of input buffer in bytes, not including room for EOB
172 yy_size_t yy_buf_size;
174 /* Number of characters read into yy_ch_buf, not including EOB
179 /* Whether we "own" the buffer - i.e., we know we created it,
180 * and can realloc() it to grow it, and should free() it to
183 int yy_is_our_buffer;
185 /* Whether this is an "interactive" input source; if so, and
186 * if we're using stdio for input, then we want to use getc()
187 * instead of fread(), to make sure we stop fetching input after
190 int yy_is_interactive;
192 /* Whether we're considered to be at the beginning of a line.
193 * If so, '^' rules will be active on the next match, otherwise
198 /* Whether to try to fill the input buffer when we reach the
203 int yy_buffer_status;
204 #define YY_BUFFER_NEW 0
205 #define YY_BUFFER_NORMAL 1
206 /* When an EOF's been seen but there's still some text to process
207 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
208 * shouldn't try reading from the input source any more. We might
209 * still have a bunch of tokens to match, though, because of
210 * possible backing-up.
212 * When we actually see the EOF, we change the status to "new"
213 * (via yyrestart()), so that the user can continue scanning by
214 * just pointing yyin at a new input file.
216 #define YY_BUFFER_EOF_PENDING 2
219 static YY_BUFFER_STATE yy_current_buffer = 0;
221 /* We provide macros for accessing buffer states in case in the
222 * future we want to put the buffer states in a more general
225 #define YY_CURRENT_BUFFER yy_current_buffer
228 /* yy_hold_char holds the character lost when yytext is formed. */
229 static char yy_hold_char;
231 static int yy_n_chars; /* number of characters read into yy_ch_buf */
236 /* Points to current character in buffer. */
237 static char *yy_c_buf_p = (char *) 0;
238 static int yy_init = 1; /* whether we need to initialize */
239 static int yy_start = 0; /* start state number */
241 /* Flag which is used to allow yywrap()'s to do buffer switches
242 * instead of setting up a fresh yyin. A bit of a hack ...
244 static int yy_did_buffer_switch_on_eof;
246 void yyrestart YY_PROTO(( FILE *input_file ));
248 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
249 void yy_load_buffer_state YY_PROTO(( void ));
250 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
251 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
252 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
253 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
256 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
257 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
258 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
260 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
261 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
262 static void yy_flex_free YY_PROTO(( void * ));
264 #define yy_new_buffer yy_create_buffer
266 #define yy_set_interactive(is_interactive) \
268 if ( ! yy_current_buffer ) \
269 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270 yy_current_buffer->yy_is_interactive = is_interactive; \
273 #define yy_set_bol(at_bol) \
275 if ( ! yy_current_buffer ) \
276 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277 yy_current_buffer->yy_at_bol = at_bol; \
280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
282 typedef unsigned char YY_CHAR;
283 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
284 typedef int yy_state_type;
286 #define yytext_ptr yytext
288 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
289 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
290 static int yy_get_next_buffer YY_PROTO(( void ));
291 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
293 /* Done after the current pattern has been matched and before the
294 * corresponding action - sets up yytext.
296 #define YY_DO_BEFORE_ACTION \
297 yytext_ptr = yy_bp; \
298 yyleng = (int) (yy_cp - yy_bp); \
299 yy_hold_char = *yy_cp; \
303 #define YY_NUM_RULES 95
304 #define YY_END_OF_BUFFER 96
305 static yyconst short int yy_accept[320] =
307 0, 0, 96, 94, 56, 93, 94, 82, 94, 79,
308 94, 83, 84, 80, 77, 89, 78, 90, 81, 1,
309 92, 75, 59, 76, 60, 91, 85, 86, 47, 47,
310 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
311 47, 47, 47, 47, 47, 87, 94, 88, 93, 64,
312 0, 52, 50, 0, 65, 0, 53, 51, 0, 67,
313 57, 69, 58, 70, 74, 0, 54, 48, 55, 68,
314 48, 2, 1, 61, 63, 62, 0, 47, 47, 47,
315 47, 47, 11, 47, 47, 47, 47, 47, 47, 47,
316 9, 47, 47, 47, 47, 47, 47, 47, 47, 47,
318 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
319 47, 47, 66, 72, 48, 48, 2, 73, 71, 49,
320 49, 47, 47, 24, 47, 47, 47, 47, 8, 47,
321 33, 47, 16, 47, 47, 47, 47, 23, 47, 47,
322 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
323 47, 47, 47, 47, 47, 49, 49, 47, 47, 47,
324 47, 47, 7, 47, 47, 47, 47, 47, 47, 47,
325 47, 47, 37, 32, 47, 47, 47, 47, 47, 38,
326 47, 47, 46, 14, 47, 47, 3, 47, 47, 5,
327 47, 47, 47, 47, 4, 47, 47, 47, 47, 47,
329 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
330 47, 47, 47, 47, 47, 20, 47, 10, 47, 17,
331 47, 47, 47, 47, 26, 47, 47, 15, 47, 47,
332 47, 34, 47, 13, 47, 47, 47, 47, 47, 30,
333 47, 47, 47, 47, 47, 47, 47, 47, 27, 47,
334 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
335 47, 47, 12, 47, 6, 47, 47, 47, 47, 47,
336 47, 47, 47, 47, 47, 47, 47, 22, 47, 47,
337 47, 25, 47, 47, 47, 47, 41, 28, 47, 35,
338 36, 47, 44, 21, 47, 47, 47, 47, 47, 47,
340 47, 47, 19, 40, 45, 47, 47, 43, 31, 42,
341 47, 47, 47, 47, 47, 18, 29, 39, 0
344 static yyconst int yy_ec[256] =
346 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
347 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 2, 5, 6, 1, 1, 1, 7, 8, 9,
350 10, 11, 12, 13, 14, 15, 16, 17, 18, 17,
351 17, 17, 17, 17, 17, 17, 17, 19, 20, 21,
352 22, 23, 24, 1, 29, 30, 31, 32, 33, 34,
353 35, 36, 37, 28, 38, 39, 40, 41, 42, 43,
354 44, 45, 46, 47, 48, 49, 50, 51, 52, 28,
355 25, 26, 27, 1, 28, 1, 29, 30, 31, 32,
357 33, 34, 35, 36, 37, 28, 38, 39, 40, 41,
358 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
359 52, 28, 53, 54, 55, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 static yyconst int yy_meta[56] =
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 2, 1, 1, 1, 3, 4, 5, 5, 1, 1,
380 1, 2, 1, 1, 1, 1, 1, 6, 6, 6,
381 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
382 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
386 static yyconst short int yy_base[327] =
388 0, 0, 626, 627, 627, 627, 622, 602, 53, 616,
389 54, 627, 627, 600, 46, 627, 47, 48, 55, 57,
390 627, 627, 599, 598, 597, 627, 627, 627, 602, 44,
391 49, 51, 57, 65, 67, 70, 72, 79, 68, 81,
392 86, 85, 92, 74, 100, 627, 563, 627, 627, 594,
393 121, 132, 627, 612, 627, 114, 136, 627, 611, 627,
394 627, 627, 627, 627, 597, 130, 627, 115, 627, 627,
395 596, 125, 133, 588, 588, 627, 594, 592, 133, 137,
396 138, 139, 591, 141, 60, 140, 143, 144, 145, 147,
397 590, 148, 149, 152, 151, 153, 66, 156, 154, 158,
399 155, 161, 159, 181, 173, 166, 170, 171, 177, 188,
400 182, 192, 627, 627, 589, 588, 196, 627, 627, 200,
401 587, 193, 202, 586, 203, 204, 209, 208, 585, 211,
402 210, 214, 584, 212, 216, 215, 219, 583, 217, 221,
403 222, 223, 224, 228, 229, 230, 233, 241, 243, 244,
404 247, 245, 248, 249, 251, 582, 581, 254, 262, 256,
405 267, 268, 580, 270, 275, 271, 272, 277, 278, 279,
406 284, 282, 579, 578, 286, 285, 283, 293, 291, 294,
407 296, 297, 577, 576, 298, 308, 575, 313, 314, 574,
408 305, 315, 317, 318, 573, 320, 319, 326, 323, 329,
410 332, 335, 337, 336, 338, 339, 340, 353, 344, 341,
411 347, 351, 355, 356, 362, 572, 359, 571, 367, 566,
412 360, 374, 363, 366, 381, 372, 378, 565, 371, 382,
413 386, 556, 390, 539, 394, 395, 396, 397, 375, 538,
414 398, 400, 401, 402, 405, 406, 408, 412, 537, 413,
415 415, 417, 420, 418, 423, 430, 416, 431, 424, 432,
416 435, 434, 535, 445, 533, 446, 436, 448, 449, 450,
417 451, 456, 458, 459, 460, 455, 461, 530, 471, 465,
418 470, 529, 464, 473, 474, 478, 527, 526, 484, 525,
419 524, 485, 519, 517, 488, 489, 492, 493, 494, 495,
421 496, 499, 513, 511, 509, 500, 502, 508, 507, 299,
422 497, 503, 501, 506, 504, 162, 76, 71, 627, 556,
423 562, 567, 570, 573, 577, 580
426 static yyconst short int yy_def[327] =
428 319, 1, 319, 319, 319, 319, 319, 319, 320, 319,
429 321, 319, 319, 319, 319, 319, 319, 319, 322, 319,
430 319, 319, 319, 319, 319, 319, 319, 319, 323, 323,
431 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
432 323, 323, 323, 323, 323, 319, 319, 319, 319, 319,
433 320, 320, 319, 320, 319, 321, 321, 319, 321, 319,
434 319, 319, 319, 319, 319, 322, 319, 319, 319, 319,
435 324, 319, 319, 319, 319, 319, 325, 323, 323, 323,
436 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
437 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
439 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
440 323, 323, 319, 319, 319, 324, 319, 319, 319, 319,
441 326, 323, 323, 323, 323, 323, 323, 323, 323, 323,
442 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
443 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
444 323, 323, 323, 323, 323, 319, 326, 323, 323, 323,
445 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
446 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
447 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
448 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
450 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
451 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
452 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
453 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
454 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
455 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
456 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
457 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
458 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
459 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
461 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
462 323, 323, 323, 323, 323, 323, 323, 323, 0, 319,
463 319, 319, 319, 319, 319, 319
466 static yyconst short int yy_nxt[683] =
468 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
469 14, 15, 16, 17, 18, 19, 20, 20, 21, 22,
470 23, 24, 25, 26, 27, 4, 28, 29, 29, 30,
471 31, 32, 33, 34, 35, 29, 36, 29, 37, 29,
472 38, 39, 40, 29, 41, 42, 43, 29, 44, 45,
473 29, 29, 46, 47, 48, 52, 57, 61, 53, 77,
474 63, 58, 65, 66, 77, 67, 77, 62, 64, 68,
475 69, 72, 77, 73, 73, 77, 70, 80, 54, 59,
476 77, 77, 77, 77, 81, 77, 77, 77, 79, 77,
477 82, 77, 83, 86, 77, 85, 77, 138, 84, 89,
479 77, 77, 111, 91, 93, 127, 87, 77, 90, 88,
480 92, 95, 97, 94, 101, 77, 57, 103, 102, 98,
481 96, 58, 99, 52, 106, 100, 53, 107, 108, 115,
482 66, 104, 105, 109, 52, 112, 110, 53, 57, 59,
483 319, 117, 117, 58, 68, 319, 54, 72, 77, 73,
484 73, 319, 77, 77, 77, 77, 77, 54, 77, 77,
485 77, 59, 77, 77, 77, 122, 77, 77, 77, 77,
486 77, 77, 130, 77, 77, 123, 77, 77, 128, 125,
487 135, 77, 124, 126, 139, 77, 77, 129, 77, 134,
488 141, 131, 77, 132, 133, 142, 77, 77, 137, 140,
490 143, 136, 147, 77, 148, 144, 149, 77, 77, 145,
491 150, 151, 117, 117, 156, 77, 152, 77, 77, 77,
492 154, 158, 146, 77, 77, 77, 77, 77, 155, 77,
493 77, 77, 77, 160, 77, 153, 77, 77, 77, 77,
494 159, 163, 162, 77, 77, 77, 169, 170, 77, 161,
495 165, 172, 166, 164, 176, 168, 77, 167, 77, 77,
496 77, 171, 77, 77, 77, 177, 77, 174, 173, 77,
497 175, 77, 180, 179, 178, 186, 184, 77, 181, 182,
498 187, 185, 77, 77, 192, 77, 77, 77, 183, 189,
499 77, 190, 77, 77, 77, 191, 188, 77, 77, 77,
501 77, 77, 195, 193, 194, 199, 77, 196, 77, 77,
502 200, 77, 77, 77, 77, 197, 198, 204, 202, 206,
503 77, 209, 205, 77, 201, 211, 207, 203, 77, 77,
504 77, 208, 77, 77, 77, 77, 215, 210, 77, 212,
505 216, 77, 213, 214, 77, 217, 218, 77, 222, 219,
506 77, 77, 77, 77, 77, 77, 77, 221, 223, 77,
507 224, 220, 77, 226, 225, 230, 77, 228, 77, 232,
508 77, 77, 237, 227, 77, 77, 229, 77, 77, 234,
509 231, 77, 77, 233, 241, 235, 77, 77, 236, 77,
510 77, 238, 239, 77, 242, 244, 77, 77, 249, 240,
512 243, 77, 246, 250, 247, 77, 251, 245, 248, 77,
513 77, 77, 77, 77, 254, 77, 77, 77, 255, 252,
514 77, 77, 260, 77, 256, 259, 253, 77, 77, 257,
515 77, 77, 77, 77, 263, 77, 267, 265, 77, 77,
516 258, 264, 261, 262, 268, 77, 77, 77, 276, 77,
517 77, 77, 266, 271, 270, 269, 272, 273, 278, 277,
518 77, 77, 274, 77, 77, 77, 77, 284, 275, 280,
519 77, 77, 279, 77, 77, 77, 77, 282, 283, 77,
520 77, 281, 287, 288, 289, 77, 77, 286, 77, 77,
521 290, 291, 285, 77, 298, 294, 292, 296, 297, 77,
523 77, 293, 295, 77, 77, 299, 301, 77, 77, 77,
524 77, 77, 77, 302, 77, 77, 77, 77, 77, 77,
525 300, 77, 77, 77, 77, 308, 77, 303, 77, 314,
526 306, 307, 77, 304, 77, 305, 312, 311, 313, 77,
527 77, 77, 77, 316, 77, 77, 309, 310, 77, 315,
528 77, 317, 77, 77, 77, 318, 51, 51, 51, 51,
529 51, 51, 56, 56, 56, 56, 56, 56, 71, 71,
530 71, 77, 71, 78, 78, 78, 116, 116, 116, 121,
531 77, 77, 121, 157, 157, 157, 77, 77, 77, 77,
532 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
534 77, 77, 77, 66, 66, 77, 77, 77, 120, 119,
535 118, 66, 66, 319, 319, 114, 113, 77, 76, 75,
536 74, 60, 55, 50, 49, 319, 3, 319, 319, 319,
537 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
538 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
539 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
540 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
541 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
545 static yyconst short int yy_chk[683] =
547 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
548 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
549 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
550 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
551 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
552 1, 1, 1, 1, 1, 9, 11, 15, 9, 30,
553 17, 11, 18, 18, 31, 19, 32, 15, 17, 19,
554 19, 20, 33, 20, 20, 85, 19, 31, 9, 11,
555 34, 97, 35, 39, 31, 36, 318, 37, 30, 44,
556 31, 317, 32, 34, 38, 33, 40, 97, 32, 35,
558 42, 41, 44, 36, 37, 85, 34, 43, 35, 34,
559 36, 38, 39, 37, 41, 45, 56, 42, 41, 40,
560 38, 56, 40, 51, 43, 40, 51, 43, 43, 68,
561 68, 42, 42, 43, 52, 45, 43, 52, 57, 56,
562 66, 72, 72, 57, 66, 66, 51, 73, 79, 73,
563 73, 66, 80, 81, 82, 86, 84, 52, 87, 88,
564 89, 57, 90, 92, 93, 79, 95, 94, 96, 99,
565 101, 98, 88, 100, 103, 80, 102, 316, 86, 82,
566 94, 106, 81, 84, 98, 107, 108, 87, 105, 93,
567 100, 89, 109, 90, 92, 101, 104, 111, 96, 99,
569 102, 95, 105, 110, 106, 103, 107, 112, 122, 104,
570 108, 109, 117, 117, 120, 120, 110, 123, 125, 126,
571 111, 122, 104, 128, 127, 131, 130, 134, 112, 132,
572 136, 135, 139, 125, 137, 110, 140, 141, 142, 143,
573 123, 127, 126, 144, 145, 146, 134, 135, 147, 125,
574 130, 137, 131, 128, 142, 132, 148, 131, 149, 150,
575 152, 136, 151, 153, 154, 143, 155, 140, 139, 158,
576 141, 160, 146, 145, 144, 152, 150, 159, 147, 148,
577 153, 151, 161, 162, 160, 164, 166, 167, 149, 155,
578 165, 158, 168, 169, 170, 159, 154, 172, 177, 171,
580 176, 175, 164, 161, 162, 168, 179, 165, 178, 180,
581 168, 181, 182, 185, 310, 166, 167, 171, 170, 175,
582 191, 178, 172, 186, 169, 180, 176, 170, 188, 189,
583 192, 177, 193, 194, 197, 196, 185, 179, 199, 180,
584 186, 198, 181, 182, 200, 188, 189, 201, 194, 191,
585 202, 204, 203, 205, 206, 207, 210, 193, 196, 209,
586 197, 192, 211, 199, 198, 203, 212, 201, 208, 205,
587 213, 214, 210, 200, 217, 221, 202, 215, 223, 207,
588 204, 224, 219, 206, 214, 208, 229, 226, 209, 222,
589 239, 211, 212, 227, 215, 219, 225, 230, 225, 213,
591 217, 231, 222, 226, 223, 233, 227, 221, 224, 235,
592 236, 237, 238, 241, 231, 242, 243, 244, 233, 229,
593 245, 246, 239, 247, 235, 238, 230, 248, 250, 236,
594 251, 257, 252, 254, 243, 253, 247, 245, 255, 259,
595 237, 244, 241, 242, 248, 256, 258, 260, 257, 262,
596 261, 267, 246, 252, 251, 250, 253, 254, 259, 258,
597 264, 266, 255, 268, 269, 270, 271, 267, 256, 261,
598 276, 272, 260, 273, 274, 275, 277, 264, 266, 283,
599 280, 262, 270, 271, 272, 281, 279, 269, 284, 285,
600 273, 274, 268, 286, 283, 277, 275, 280, 281, 289,
602 292, 276, 279, 295, 296, 284, 286, 297, 298, 299,
603 300, 301, 311, 289, 302, 306, 313, 307, 312, 315,
604 285, 314, 309, 308, 305, 299, 304, 292, 303, 311,
605 297, 298, 294, 295, 293, 296, 306, 302, 307, 291,
606 290, 288, 287, 313, 282, 278, 300, 301, 265, 312,
607 263, 314, 249, 240, 234, 315, 320, 320, 320, 320,
608 320, 320, 321, 321, 321, 321, 321, 321, 322, 322,
609 322, 232, 322, 323, 323, 323, 324, 324, 324, 325,
610 228, 220, 325, 326, 326, 326, 218, 216, 195, 190,
611 187, 184, 183, 174, 173, 163, 157, 156, 138, 133,
613 129, 124, 121, 116, 115, 91, 83, 78, 77, 75,
614 74, 71, 65, 59, 54, 50, 47, 29, 25, 24,
615 23, 14, 10, 8, 7, 3, 319, 319, 319, 319,
616 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
617 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
618 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
619 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
620 319, 319, 319, 319, 319, 319, 319, 319, 319, 319,
624 static yy_state_type yy_last_accepting_state;
625 static char *yy_last_accepting_cpos;
627 /* The intent behind this definition is that it'll catch
628 * any uses of REJECT which flex missed.
630 #define REJECT reject_used_but_not_detected
631 #define yymore() yymore_used_but_not_detected
632 #define YY_MORE_ADJ 0
633 #define YY_RESTORE_YY_MORE_OFFSET
635 #line 1 "swf4compiler.flex"
637 #line 2 "swf4compiler.flex"
644 #include "blocks/error.h"
645 #include "swf4compiler.tab.h" /* defines token types */
647 static int swf4debug;
649 static const char *lexBuffer = NULL;
650 static int lexBufferLen = 0;
652 static int sLineNumber = 0;
653 static char szLine[1024];
654 static char msgbufs[2][1024] = { {0}, {0} }, *msgline = {0};
655 static int column = 0;
657 static void comment();
658 static void comment1();
660 static void warning(char *msg);
662 #define YY_INPUT(buf,result,max_size) result=lexBufferInput(buf, max_size)
664 /* thanks to the prolific and brilliant Raff: */
665 static int lexBufferInput(char *buf, int max_size)
667 int l = lexBufferLen > max_size ? max_size : lexBufferLen;
669 if (lexBufferLen <= 0)
672 memcpy(buf, lexBuffer, l);
678 /* very inefficient method of unescaping strings */
679 static void unescape(char *buf)
683 for (p1=buf; (p=strchr(p1, '\\')) != 0; p1 = p+1) {
686 case 'b' : p[1] = '\b'; break;
687 case 'f' : p[1] = '\f'; break;
688 case 'n' : p[1] = '\n'; break;
689 case 'r' : p[1] = '\r'; break;
690 case 't' : p[1] = '\t'; break;
692 case 'u' : warning("unsupported escape sequence");
698 void swf4ParseInit(const char *script, int debug)
706 lexBufferLen = strlen(script);
709 msgline = msgbufs[0];
712 #line 79 "swf4compiler.flex"
713 // forward declaration needed by the following function
716 #define YY_PROTO(proto) proto
718 #define YY_PROTO(proto) ()
721 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
723 void do_unput4(const char c) { unput(c); }
724 #line 725 "lex.swf4.c"
726 /* Macros after this point can all be overridden by user definitions in
730 #ifndef YY_SKIP_YYWRAP
732 extern "C" int yywrap YY_PROTO(( void ));
734 extern int yywrap YY_PROTO(( void ));
739 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
743 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
746 #ifdef YY_NEED_STRLEN
747 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
752 static int yyinput YY_PROTO(( void ));
754 static int input YY_PROTO(( void ));
759 static int yy_start_stack_ptr = 0;
760 static int yy_start_stack_depth = 0;
761 static int *yy_start_stack = 0;
762 #ifndef YY_NO_PUSH_STATE
763 static void yy_push_state YY_PROTO(( int new_state ));
765 #ifndef YY_NO_POP_STATE
766 static void yy_pop_state YY_PROTO(( void ));
768 #ifndef YY_NO_TOP_STATE
769 static int yy_top_state YY_PROTO(( void ));
773 #define YY_NO_PUSH_STATE 1
774 #define YY_NO_POP_STATE 1
775 #define YY_NO_TOP_STATE 1
778 #ifdef YY_MALLOC_DECL
786 /* Just try to get by without declaring the routines. This will fail
787 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
788 * or sizeof(void*) != sizeof(int).
793 /* Amount of stuff to slurp up with each read. */
794 #ifndef YY_READ_BUF_SIZE
795 #define YY_READ_BUF_SIZE 8192
798 /* Copy whatever the last rule matched to the standard output. */
801 /* This used to be an fputs(), but since the string might contain NUL's,
802 * we now use fwrite().
804 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
807 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
808 * is returned in "result".
811 #define YY_INPUT(buf,result,max_size) \
812 if ( yy_current_buffer->yy_is_interactive ) \
815 for ( n = 0; n < max_size && \
816 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
819 buf[n++] = (char) c; \
820 if ( c == EOF && ferror( yyin ) ) \
821 YY_FATAL_ERROR( "input in flex scanner failed" ); \
824 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
825 && ferror( yyin ) ) \
826 YY_FATAL_ERROR( "input in flex scanner failed" );
829 /* No semi-colon after return; correct usage is to write "yyterminate();" -
830 * we don't want an extra ';' after the "return" because that will cause
831 * some compilers to complain about unreachable statements.
834 #define yyterminate() return YY_NULL
837 /* Number of entries by which start-condition stack grows. */
838 #ifndef YY_START_STACK_INCR
839 #define YY_START_STACK_INCR 25
842 /* Report a fatal error. */
843 #ifndef YY_FATAL_ERROR
844 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
847 /* Default declaration of generated scanner - a define so the user can
848 * easily add parameters.
851 #define YY_DECL int yylex YY_PROTO(( void ))
854 /* Code executed at the beginning of each rule, after yytext and yyleng
857 #ifndef YY_USER_ACTION
858 #define YY_USER_ACTION
861 /* Code executed at the end of each rule. */
863 #define YY_BREAK break;
866 #define YY_RULE_SETUP \
871 register yy_state_type yy_current_state;
872 register char *yy_cp = NULL, *yy_bp = NULL;
875 #line 96 "swf4compiler.flex"
878 #line 879 "lex.swf4.c"
889 yy_start = 1; /* first start state */
897 if ( ! yy_current_buffer )
899 yy_create_buffer( yyin, YY_BUF_SIZE );
901 yy_load_buffer_state();
904 while ( 1 ) /* loops until end-of-file is reached */
908 /* Support of yytext. */
909 *yy_cp = yy_hold_char;
911 /* yy_bp points to the position in yy_ch_buf of the start of
916 yy_current_state = yy_start;
920 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
921 if ( yy_accept[yy_current_state] )
923 yy_last_accepting_state = yy_current_state;
924 yy_last_accepting_cpos = yy_cp;
926 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
928 yy_current_state = (int) yy_def[yy_current_state];
929 if ( yy_current_state >= 320 )
930 yy_c = yy_meta[(unsigned int) yy_c];
932 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
935 while ( yy_base[yy_current_state] != 627 );
938 yy_act = yy_accept[yy_current_state];
940 { /* have to back up */
941 yy_cp = yy_last_accepting_cpos;
942 yy_current_state = yy_last_accepting_state;
943 yy_act = yy_accept[yy_current_state];
949 do_action: /* This label is used only to access EOF actions. */
953 { /* beginning of action switch */
954 case 0: /* must back up */
955 /* undo the effects of YY_DO_BEFORE_ACTION */
956 *yy_cp = yy_hold_char;
957 yy_cp = yy_last_accepting_cpos;
958 yy_current_state = yy_last_accepting_state;
963 #line 98 "swf4compiler.flex"
964 { count(); swf4lval.str = strdup(yytext);
969 #line 100 "swf4compiler.flex"
970 { count(); swf4lval.str = strdup(yytext);
975 #line 102 "swf4compiler.flex"
976 { count(); swf4lval.str = strdup("1");
981 #line 104 "swf4compiler.flex"
982 { count(); swf4lval.str = strdup("0");
987 #line 106 "swf4compiler.flex"
988 { count(); return BREAK; }
992 #line 107 "swf4compiler.flex"
993 { count(); return CONTINUE; }
997 #line 108 "swf4compiler.flex"
998 { count(); return ELSE; }
1002 #line 109 "swf4compiler.flex"
1003 { count(); return FOR; }
1007 #line 110 "swf4compiler.flex"
1008 { count(); return IF; }
1012 #line 111 "swf4compiler.flex"
1013 { count(); return WHILE; }
1017 #line 112 "swf4compiler.flex"
1018 { count(); return DO; }
1022 #line 113 "swf4compiler.flex"
1023 { count(); return EVAL; }
1028 #line 116 "swf4compiler.flex"
1029 { count(); return RANDOM; }
1033 #line 117 "swf4compiler.flex"
1034 { count(); return TIME; }
1038 #line 118 "swf4compiler.flex"
1039 { count(); return LENGTH; }
1043 #line 119 "swf4compiler.flex"
1044 { count(); return INT; }
1048 #line 120 "swf4compiler.flex"
1049 { count(); return CONCAT; }
1053 #line 121 "swf4compiler.flex"
1054 { count(); return DUPLICATECLIP; }
1058 #line 122 "swf4compiler.flex"
1059 { count(); return REMOVECLIP; }
1063 #line 123 "swf4compiler.flex"
1064 { count(); return TRACE; }
1068 #line 124 "swf4compiler.flex"
1069 { count(); return STARTDRAG; }
1073 #line 125 "swf4compiler.flex"
1074 { count(); return STOPDRAG; }
1078 #line 126 "swf4compiler.flex"
1079 { count(); return ORD; }
1083 #line 127 "swf4compiler.flex"
1084 { count(); return CHR; }
1088 #line 128 "swf4compiler.flex"
1089 { count(); return CALLFRAME; }
1093 #line 129 "swf4compiler.flex"
1094 { count(); return GETURL; }
1098 #line 130 "swf4compiler.flex"
1099 { count(); return GETURL1; }
1103 #line 131 "swf4compiler.flex"
1104 { count(); return LOADMOVIE; }
1108 #line 132 "swf4compiler.flex"
1109 { count(); return LOADVARIABLES; }
1113 #line 133 "swf4compiler.flex"
1114 { count(); return SUBSTR; }
1118 #line 135 "swf4compiler.flex"
1119 { count(); return GETPROPERTY; }
1121 /* getURL2 methods */
1124 #line 138 "swf4compiler.flex"
1125 { count(); swf4lval.getURLMethod = GETURL_METHOD_POST;
1126 return GETURL_METHOD; }
1130 #line 140 "swf4compiler.flex"
1131 { count(); swf4lval.getURLMethod = GETURL_METHOD_GET;
1132 return GETURL_METHOD; }
1136 #line 142 "swf4compiler.flex"
1137 { count(); swf4lval.getURLMethod = GETURL_METHOD_NOSEND;
1138 return GETURL_METHOD; }
1143 #line 147 "swf4compiler.flex"
1144 { count(); return NEXTFRAME; }
1148 #line 148 "swf4compiler.flex"
1149 { count(); return PREVFRAME; }
1153 #line 149 "swf4compiler.flex"
1154 { count(); return PLAY; }
1158 #line 150 "swf4compiler.flex"
1159 { count(); return STOP; }
1163 #line 151 "swf4compiler.flex"
1164 { count(); return TOGGLEQUALITY; }
1168 #line 152 "swf4compiler.flex"
1169 { count(); return STOPSOUNDS; }
1173 #line 153 "swf4compiler.flex"
1174 { count(); return GOTOFRAME; }
1178 #line 154 "swf4compiler.flex"
1179 { count(); return GOTOANDPLAY; }
1183 #line 155 "swf4compiler.flex"
1184 { count(); return FRAMELOADED; }
1188 #line 156 "swf4compiler.flex"
1189 { count(); return SETTARGET; }
1191 /* high level functions */
1194 #line 159 "swf4compiler.flex"
1195 { count(); return TELLTARGET; }
1199 #line 162 "swf4compiler.flex"
1200 { count(); return THIS; }
1204 #line 164 "swf4compiler.flex"
1205 { count(); swf4lval.str = strdup(yytext);
1206 return IDENTIFIER; }
1210 #line 167 "swf4compiler.flex"
1211 { count(); swf4lval.str = strdup(yytext);
1216 #line 170 "swf4compiler.flex"
1217 { count(); swf4lval.str = strdup(yytext);
1222 #line 173 "swf4compiler.flex"
1223 { count(); swf4lval.str = strdup(yytext+1);
1224 swf4lval.str[strlen(swf4lval.str)-1]=0;
1225 unescape(swf4lval.str);
1230 #line 178 "swf4compiler.flex"
1231 { count(); swf4lval.str = strdup(yytext+1);
1232 swf4lval.str[strlen(swf4lval.str)-1]=0;
1233 unescape(swf4lval.str);
1237 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
1238 yy_c_buf_p = yy_cp -= 1;
1239 YY_DO_BEFORE_ACTION; /* set up yytext again */
1241 #line 183 "swf4compiler.flex"
1242 { count(); swf4lval.str = strdup("");
1243 warning("Unterminated string!");
1247 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
1248 yy_c_buf_p = yy_cp -= 1;
1249 YY_DO_BEFORE_ACTION; /* set up yytext again */
1251 #line 187 "swf4compiler.flex"
1252 { count(); swf4lval.str = strdup("");
1253 warning("Unterminated string!");
1258 #line 191 "swf4compiler.flex"
1259 { count(); comment(); }
1263 #line 192 "swf4compiler.flex"
1264 { count(); comment1(); }
1268 #line 193 "swf4compiler.flex"
1273 #line 195 "swf4compiler.flex"
1274 { count(); return INC; }
1278 #line 196 "swf4compiler.flex"
1279 { count(); return DEC; }
1283 #line 197 "swf4compiler.flex"
1284 { count(); return '<'; }
1288 #line 198 "swf4compiler.flex"
1289 { count(); return '>'; }
1293 #line 199 "swf4compiler.flex"
1294 { count(); return LE; }
1298 #line 200 "swf4compiler.flex"
1299 { count(); return GE; }
1303 #line 201 "swf4compiler.flex"
1304 { count(); return EQ; }
1308 #line 202 "swf4compiler.flex"
1309 { count(); return NE; }
1313 #line 203 "swf4compiler.flex"
1314 { count(); return LAN; }
1318 #line 204 "swf4compiler.flex"
1319 { count(); return LOR; }
1323 #line 205 "swf4compiler.flex"
1324 { count(); return MEQ; }
1328 #line 206 "swf4compiler.flex"
1329 { count(); return DEQ; }
1333 #line 207 "swf4compiler.flex"
1334 { count(); return IEQ; }
1338 #line 208 "swf4compiler.flex"
1339 { count(); return SEQ; }
1343 #line 209 "swf4compiler.flex"
1344 { count(); return STREQ; }
1348 #line 210 "swf4compiler.flex"
1349 { count(); return STRNE; }
1353 #line 211 "swf4compiler.flex"
1354 { count(); return STRCMP; }
1358 #line 212 "swf4compiler.flex"
1359 { count(); return PARENT; }
1363 #line 214 "swf4compiler.flex"
1364 { count(); return ';'; }
1368 #line 215 "swf4compiler.flex"
1369 { count(); return '='; }
1373 #line 216 "swf4compiler.flex"
1374 { count(); return '+'; }
1378 #line 217 "swf4compiler.flex"
1379 { count(); return '-'; }
1383 #line 218 "swf4compiler.flex"
1384 { count(); return '&'; }
1388 #line 219 "swf4compiler.flex"
1389 { count(); return '*'; }
1393 #line 220 "swf4compiler.flex"
1394 { count(); return '/'; }
1398 #line 221 "swf4compiler.flex"
1399 { count(); return '!'; }
1403 #line 222 "swf4compiler.flex"
1404 { count(); return '('; }
1408 #line 223 "swf4compiler.flex"
1409 { count(); return ')'; }
1413 #line 224 "swf4compiler.flex"
1414 { count(); return '['; }
1418 #line 225 "swf4compiler.flex"
1419 { count(); return ']'; }
1423 #line 226 "swf4compiler.flex"
1424 { count(); return '{'; }
1428 #line 227 "swf4compiler.flex"
1429 { count(); return '}'; }
1433 #line 228 "swf4compiler.flex"
1434 { count(); return ','; }
1438 #line 229 "swf4compiler.flex"
1439 { count(); return '.'; }
1443 #line 230 "swf4compiler.flex"
1444 { count(); return '?'; }
1448 #line 231 "swf4compiler.flex"
1449 { count(); return ':'; }
1453 #line 233 "swf4compiler.flex"
1454 { count(); column = 0;
1455 strcpy(szLine, yytext + 1);
1456 ++sLineNumber; yyless(1); }
1460 #line 237 "swf4compiler.flex"
1461 printf( "Unrecognized character: %s\n", yytext );
1465 #line 239 "swf4compiler.flex"
1468 #line 1469 "lex.swf4.c"
1469 case YY_STATE_EOF(INITIAL):
1472 case YY_END_OF_BUFFER:
1474 /* Amount of text matched not including the EOB char. */
1475 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1477 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1478 *yy_cp = yy_hold_char;
1479 YY_RESTORE_YY_MORE_OFFSET
1481 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1483 /* We're scanning a new file or input source. It's
1484 * possible that this happened because the user
1485 * just pointed yyin at a new source and called
1486 * yylex(). If so, then we have to assure
1487 * consistency between yy_current_buffer and our
1488 * globals. Here is the right place to do so, because
1489 * this is the first action (other than possibly a
1490 * back-up) that will match for the new input source.
1492 yy_n_chars = yy_current_buffer->yy_n_chars;
1493 yy_current_buffer->yy_input_file = yyin;
1494 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1497 /* Note that here we test for yy_c_buf_p "<=" to the position
1498 * of the first EOB in the buffer, since yy_c_buf_p will
1499 * already have been incremented past the NUL character
1500 * (since all states make transitions on EOB to the
1501 * end-of-buffer state). Contrast this with the test
1504 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1505 { /* This was really a NUL. */
1506 yy_state_type yy_next_state;
1508 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1510 yy_current_state = yy_get_previous_state();
1512 /* Okay, we're now positioned to make the NUL
1513 * transition. We couldn't have
1514 * yy_get_previous_state() go ahead and do it
1515 * for us because it doesn't know how to deal
1516 * with the possibility of jamming (and we don't
1517 * want to build jamming into it because then it
1518 * will run more slowly).
1521 yy_next_state = yy_try_NUL_trans( yy_current_state );
1523 yy_bp = yytext_ptr + YY_MORE_ADJ;
1525 if ( yy_next_state )
1527 /* Consume the NUL. */
1528 yy_cp = ++yy_c_buf_p;
1529 yy_current_state = yy_next_state;
1536 goto yy_find_action;
1540 else switch ( yy_get_next_buffer() )
1542 case EOB_ACT_END_OF_FILE:
1544 yy_did_buffer_switch_on_eof = 0;
1548 /* Note: because we've taken care in
1549 * yy_get_next_buffer() to have set up
1550 * yytext, we can now set up
1551 * yy_c_buf_p so that if some total
1552 * hoser (like flex itself) wants to
1553 * call the scanner after we return the
1554 * YY_NULL, it'll still work - another
1555 * YY_NULL will get returned.
1557 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1559 yy_act = YY_STATE_EOF(YY_START);
1565 if ( ! yy_did_buffer_switch_on_eof )
1571 case EOB_ACT_CONTINUE_SCAN:
1573 yytext_ptr + yy_amount_of_matched_text;
1575 yy_current_state = yy_get_previous_state();
1578 yy_bp = yytext_ptr + YY_MORE_ADJ;
1581 case EOB_ACT_LAST_MATCH:
1583 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1585 yy_current_state = yy_get_previous_state();
1588 yy_bp = yytext_ptr + YY_MORE_ADJ;
1589 goto yy_find_action;
1596 "fatal flex scanner internal error--no action found" );
1597 } /* end of action switch */
1598 } /* end of scanning one token */
1599 } /* end of yylex */
1602 /* yy_get_next_buffer - try to read in a new buffer
1604 * Returns a code representing an action:
1605 * EOB_ACT_LAST_MATCH -
1606 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1607 * EOB_ACT_END_OF_FILE - end of file
1610 static int yy_get_next_buffer()
1612 register char *dest = yy_current_buffer->yy_ch_buf;
1613 register char *source = yytext_ptr;
1614 register int number_to_move, i;
1617 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1619 "fatal flex scanner internal error--end of buffer missed" );
1621 if ( yy_current_buffer->yy_fill_buffer == 0 )
1622 { /* Don't try to fill the buffer, so this is an EOF. */
1623 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1625 /* We matched a single character, the EOB, so
1626 * treat this as a final EOF.
1628 return EOB_ACT_END_OF_FILE;
1633 /* We matched some text prior to the EOB, first
1636 return EOB_ACT_LAST_MATCH;
1640 /* Try to read more data. */
1642 /* First move last chars to start of buffer. */
1643 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1645 for ( i = 0; i < number_to_move; ++i )
1646 *(dest++) = *(source++);
1648 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1649 /* don't do the read, it's not guaranteed to return an EOF,
1652 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1657 yy_current_buffer->yy_buf_size - number_to_move - 1;
1659 while ( num_to_read <= 0 )
1660 { /* Not enough room in the buffer - grow it. */
1661 #ifdef YY_USES_REJECT
1663 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1666 /* just a shorter name for the current buffer */
1667 YY_BUFFER_STATE b = yy_current_buffer;
1669 int yy_c_buf_p_offset =
1670 (int) (yy_c_buf_p - b->yy_ch_buf);
1672 if ( b->yy_is_our_buffer )
1674 int new_size = b->yy_buf_size * 2;
1676 if ( new_size <= 0 )
1677 b->yy_buf_size += b->yy_buf_size / 8;
1679 b->yy_buf_size *= 2;
1681 b->yy_ch_buf = (char *)
1682 /* Include room in for 2 EOB chars. */
1683 yy_flex_realloc( (void *) b->yy_ch_buf,
1684 b->yy_buf_size + 2 );
1687 /* Can't grow it, we don't own it. */
1690 if ( ! b->yy_ch_buf )
1692 "fatal error - scanner input buffer overflow" );
1694 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1696 num_to_read = yy_current_buffer->yy_buf_size -
1701 if ( num_to_read > YY_READ_BUF_SIZE )
1702 num_to_read = YY_READ_BUF_SIZE;
1704 /* Read in more data. */
1705 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1706 yy_n_chars, num_to_read );
1708 yy_current_buffer->yy_n_chars = yy_n_chars;
1711 if ( yy_n_chars == 0 )
1713 if ( number_to_move == YY_MORE_ADJ )
1715 ret_val = EOB_ACT_END_OF_FILE;
1721 ret_val = EOB_ACT_LAST_MATCH;
1722 yy_current_buffer->yy_buffer_status =
1723 YY_BUFFER_EOF_PENDING;
1728 ret_val = EOB_ACT_CONTINUE_SCAN;
1730 yy_n_chars += number_to_move;
1731 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1732 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1734 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1740 /* yy_get_previous_state - get the state just before the EOB char was reached */
1742 static yy_state_type yy_get_previous_state()
1744 register yy_state_type yy_current_state;
1745 register char *yy_cp;
1747 yy_current_state = yy_start;
1749 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1751 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1752 if ( yy_accept[yy_current_state] )
1754 yy_last_accepting_state = yy_current_state;
1755 yy_last_accepting_cpos = yy_cp;
1757 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1759 yy_current_state = (int) yy_def[yy_current_state];
1760 if ( yy_current_state >= 320 )
1761 yy_c = yy_meta[(unsigned int) yy_c];
1763 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1766 return yy_current_state;
1770 /* yy_try_NUL_trans - try to make a transition on the NUL character
1773 * next_state = yy_try_NUL_trans( current_state );
1776 #ifdef YY_USE_PROTOS
1777 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1779 static yy_state_type yy_try_NUL_trans( yy_current_state )
1780 yy_state_type yy_current_state;
1783 register int yy_is_jam;
1784 register char *yy_cp = yy_c_buf_p;
1786 register YY_CHAR yy_c = 1;
1787 if ( yy_accept[yy_current_state] )
1789 yy_last_accepting_state = yy_current_state;
1790 yy_last_accepting_cpos = yy_cp;
1792 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1794 yy_current_state = (int) yy_def[yy_current_state];
1795 if ( yy_current_state >= 320 )
1796 yy_c = yy_meta[(unsigned int) yy_c];
1798 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1799 yy_is_jam = (yy_current_state == 319);
1801 return yy_is_jam ? 0 : yy_current_state;
1806 #ifdef YY_USE_PROTOS
1807 static void yyunput( int c, register char *yy_bp )
1809 static void yyunput( c, yy_bp )
1811 register char *yy_bp;
1814 register char *yy_cp = yy_c_buf_p;
1816 /* undo effects of setting up yytext */
1817 *yy_cp = yy_hold_char;
1819 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1820 { /* need to shift things up to make room */
1821 /* +2 for EOB chars. */
1822 register int number_to_move = yy_n_chars + 2;
1823 register char *dest = &yy_current_buffer->yy_ch_buf[
1824 yy_current_buffer->yy_buf_size + 2];
1825 register char *source =
1826 &yy_current_buffer->yy_ch_buf[number_to_move];
1828 while ( source > yy_current_buffer->yy_ch_buf )
1829 *--dest = *--source;
1831 yy_cp += (int) (dest - source);
1832 yy_bp += (int) (dest - source);
1833 yy_current_buffer->yy_n_chars =
1834 yy_n_chars = yy_current_buffer->yy_buf_size;
1836 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1837 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1840 *--yy_cp = (char) c;
1844 yy_hold_char = *yy_cp;
1847 #endif /* ifndef YY_NO_UNPUT */
1851 static int yyinput()
1858 *yy_c_buf_p = yy_hold_char;
1860 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1862 /* yy_c_buf_p now points to the character we want to return.
1863 * If this occurs *before* the EOB characters, then it's a
1864 * valid NUL; if not, then we've hit the end of the buffer.
1866 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1867 /* This was really a NUL. */
1871 { /* need more input */
1872 int offset = yy_c_buf_p - yytext_ptr;
1875 switch ( yy_get_next_buffer() )
1877 case EOB_ACT_LAST_MATCH:
1878 /* This happens because yy_g_n_b()
1879 * sees that we've accumulated a
1880 * token and flags that we need to
1881 * try matching the token before
1882 * proceeding. But for input(),
1883 * there's no matching to consider.
1884 * So convert the EOB_ACT_LAST_MATCH
1885 * to EOB_ACT_END_OF_FILE.
1888 /* Reset buffer status. */
1893 case EOB_ACT_END_OF_FILE:
1898 if ( ! yy_did_buffer_switch_on_eof )
1907 case EOB_ACT_CONTINUE_SCAN:
1908 yy_c_buf_p = yytext_ptr + offset;
1914 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1915 *yy_c_buf_p = '\0'; /* preserve yytext */
1916 yy_hold_char = *++yy_c_buf_p;
1923 #ifdef YY_USE_PROTOS
1924 void yyrestart( FILE *input_file )
1926 void yyrestart( input_file )
1930 if ( ! yy_current_buffer )
1931 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1933 yy_init_buffer( yy_current_buffer, input_file );
1934 yy_load_buffer_state();
1938 #ifdef YY_USE_PROTOS
1939 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1941 void yy_switch_to_buffer( new_buffer )
1942 YY_BUFFER_STATE new_buffer;
1945 if ( yy_current_buffer == new_buffer )
1948 if ( yy_current_buffer )
1950 /* Flush out information for old buffer. */
1951 *yy_c_buf_p = yy_hold_char;
1952 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1953 yy_current_buffer->yy_n_chars = yy_n_chars;
1956 yy_current_buffer = new_buffer;
1957 yy_load_buffer_state();
1959 /* We don't actually know whether we did this switch during
1960 * EOF (yywrap()) processing, but the only time this flag
1961 * is looked at is after yywrap() is called, so it's safe
1962 * to go ahead and always set it.
1964 yy_did_buffer_switch_on_eof = 1;
1968 #ifdef YY_USE_PROTOS
1969 void yy_load_buffer_state( void )
1971 void yy_load_buffer_state()
1974 yy_n_chars = yy_current_buffer->yy_n_chars;
1975 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1976 yyin = yy_current_buffer->yy_input_file;
1977 yy_hold_char = *yy_c_buf_p;
1981 #ifdef YY_USE_PROTOS
1982 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1984 YY_BUFFER_STATE yy_create_buffer( file, size )
1991 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1993 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1995 b->yy_buf_size = size;
1997 /* yy_ch_buf has to be 2 characters longer than the size given because
1998 * we need to put in 2 end-of-buffer characters.
2000 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2001 if ( ! b->yy_ch_buf )
2002 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2004 b->yy_is_our_buffer = 1;
2006 yy_init_buffer( b, file );
2012 #ifdef YY_USE_PROTOS
2013 void yy_delete_buffer( YY_BUFFER_STATE b )
2015 void yy_delete_buffer( b )
2022 if ( b == yy_current_buffer )
2023 yy_current_buffer = (YY_BUFFER_STATE) 0;
2025 if ( b->yy_is_our_buffer )
2026 yy_flex_free( (void *) b->yy_ch_buf );
2028 yy_flex_free( (void *) b );
2033 #ifdef YY_USE_PROTOS
2034 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2036 void yy_init_buffer( b, file )
2043 yy_flush_buffer( b );
2045 b->yy_input_file = file;
2046 b->yy_fill_buffer = 1;
2048 #if YY_ALWAYS_INTERACTIVE
2049 b->yy_is_interactive = 1;
2051 #if YY_NEVER_INTERACTIVE
2052 b->yy_is_interactive = 0;
2054 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2060 #ifdef YY_USE_PROTOS
2061 void yy_flush_buffer( YY_BUFFER_STATE b )
2063 void yy_flush_buffer( b )
2073 /* We always need two end-of-buffer characters. The first causes
2074 * a transition to the end-of-buffer state. The second causes
2075 * a jam in that state.
2077 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2078 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2080 b->yy_buf_pos = &b->yy_ch_buf[0];
2083 b->yy_buffer_status = YY_BUFFER_NEW;
2085 if ( b == yy_current_buffer )
2086 yy_load_buffer_state();
2090 #ifndef YY_NO_SCAN_BUFFER
2091 #ifdef YY_USE_PROTOS
2092 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2094 YY_BUFFER_STATE yy_scan_buffer( base, size )
2102 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2103 base[size-1] != YY_END_OF_BUFFER_CHAR )
2104 /* They forgot to leave room for the EOB's. */
2107 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2109 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2111 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2112 b->yy_buf_pos = b->yy_ch_buf = base;
2113 b->yy_is_our_buffer = 0;
2114 b->yy_input_file = 0;
2115 b->yy_n_chars = b->yy_buf_size;
2116 b->yy_is_interactive = 0;
2118 b->yy_fill_buffer = 0;
2119 b->yy_buffer_status = YY_BUFFER_NEW;
2121 yy_switch_to_buffer( b );
2128 #ifndef YY_NO_SCAN_STRING
2129 #ifdef YY_USE_PROTOS
2130 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2132 YY_BUFFER_STATE yy_scan_string( yy_str )
2133 yyconst char *yy_str;
2137 for ( len = 0; yy_str[len]; ++len )
2140 return yy_scan_bytes( yy_str, len );
2145 #ifndef YY_NO_SCAN_BYTES
2146 #ifdef YY_USE_PROTOS
2147 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2149 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2150 yyconst char *bytes;
2159 /* Get memory for full buffer, including space for trailing EOB's. */
2161 buf = (char *) yy_flex_alloc( n );
2163 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2165 for ( i = 0; i < len; ++i )
2168 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2170 b = yy_scan_buffer( buf, n );
2172 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2174 /* It's okay to grow etc. this buffer, and we should throw it
2175 * away when we're done.
2177 b->yy_is_our_buffer = 1;
2184 #ifndef YY_NO_PUSH_STATE
2185 #ifdef YY_USE_PROTOS
2186 static void yy_push_state( int new_state )
2188 static void yy_push_state( new_state )
2192 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2196 yy_start_stack_depth += YY_START_STACK_INCR;
2197 new_size = yy_start_stack_depth * sizeof( int );
2199 if ( ! yy_start_stack )
2200 yy_start_stack = (int *) yy_flex_alloc( new_size );
2203 yy_start_stack = (int *) yy_flex_realloc(
2204 (void *) yy_start_stack, new_size );
2206 if ( ! yy_start_stack )
2208 "out of memory expanding start-condition stack" );
2211 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2218 #ifndef YY_NO_POP_STATE
2219 static void yy_pop_state()
2221 if ( --yy_start_stack_ptr < 0 )
2222 YY_FATAL_ERROR( "start-condition stack underflow" );
2224 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2229 #ifndef YY_NO_TOP_STATE
2230 static int yy_top_state()
2232 return yy_start_stack[yy_start_stack_ptr - 1];
2236 #ifndef YY_EXIT_FAILURE
2237 #define YY_EXIT_FAILURE 2
2240 #ifdef YY_USE_PROTOS
2241 static void yy_fatal_error( yyconst char msg[] )
2243 static void yy_fatal_error( msg )
2247 (void) fprintf( stderr, "%s\n", msg );
2248 exit( YY_EXIT_FAILURE );
2253 /* Redefine yyless() so it works in section 3 code. */
2259 /* Undo effects of setting up yytext. */ \
2260 yytext[yyleng] = yy_hold_char; \
2261 yy_c_buf_p = yytext + n; \
2262 yy_hold_char = *yy_c_buf_p; \
2263 *yy_c_buf_p = '\0'; \
2269 /* Internal utility routines. */
2272 #ifdef YY_USE_PROTOS
2273 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2275 static void yy_flex_strncpy( s1, s2, n )
2282 for ( i = 0; i < n; ++i )
2287 #ifdef YY_NEED_STRLEN
2288 #ifdef YY_USE_PROTOS
2289 static int yy_flex_strlen( yyconst char *s )
2291 static int yy_flex_strlen( s )
2296 for ( n = 0; s[n]; ++n )
2304 #ifdef YY_USE_PROTOS
2305 static void *yy_flex_alloc( yy_size_t size )
2307 static void *yy_flex_alloc( size )
2311 return (void *) malloc( size );
2314 #ifdef YY_USE_PROTOS
2315 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2317 static void *yy_flex_realloc( ptr, size )
2322 /* The cast to (char *) in the following accommodates both
2323 * implementations that use char* generic pointers, and those
2324 * that use void* generic pointers. It works with the latter
2325 * because both ANSI C and C++ allow castless assignment from
2326 * any pointer type to void*, and deal with argument conversions
2327 * as though doing an assignment.
2329 return (void *) realloc( (char *) ptr, size );
2332 #ifdef YY_USE_PROTOS
2333 static void yy_flex_free( void *ptr )
2335 static void yy_flex_free( ptr )
2349 #line 239 "swf4compiler.flex"
2351 static int getinput() {
2364 static void countline()
2366 if(sLineNumber != 0)
2367 msgline[column] = 0;
2371 msgline = msgbufs[sLineNumber & 1];
2374 static int LineNumber(void)
2376 return (sLineNumber + 1);
2379 static int ColumnNumber(void)
2384 static char *LineText(void)
2386 msgline[column] = 0;
2390 static void comment(void)
2392 // Handle block comments
2397 // We have the start of a comment so look skip everything up to the
2398 // end of the comment character
2399 while ((c = getinput()) != '*' && c != EOF)
2402 msgline[column] = c;
2406 // keep the line number in synch
2409 // start the output (matches the algorithim in the lexx above)
2413 if (swf4debug) putchar(c);
2416 // is this the end of comment character
2417 if ((c1 = getinput()) != '/' && c != EOF)
2419 // false start as this was no end of comment
2424 // write out the start of the end of comment
2426 if (swf4debug) putchar(c);
2428 // write out the end of the end of comment
2430 if (swf4debug) putchar(c1);
2433 static void comment1(void)
2435 // Handle comment of type 1 (ie '//')
2439 // this is a line comment
2440 while ((c = getinput()) != '\n' && c != EOF)
2442 if (swf4debug) putchar(c);
2445 msgline[column] = c;
2450 // keep the line number in synch
2453 if (swf4debug) putchar(c);
2459 static void count(void)
2463 // Count the characters to maintain the current column position
2464 if (yytext[0] == '\n')
2466 if (swf4debug) printf("\n");
2470 if (swf4debug) printf("%s", yytext);
2472 for(n=0; n<yyleng; ++n, ++column)
2475 msgline[column] = yytext[n];
2478 //-- keep writing the stuff to standard output
2483 static void printprog()
2486 SWF_warn("\n%s", msgbufs[(sLineNumber-1)&1]);
2489 msgline[column] = 0;
2491 SWF_warn("\n%s", msgline);
2494 static void warning(char *msg)
2496 // print a warning message
2498 SWF_warn("\n%*s", ColumnNumber(), "^");
2499 SWF_warn("\nLine %4.4d: Reason: '%s' \n", LineNumber(), msg);
2502 void swf4error(char *msg)
2507 SWF_error("\n%s\n%*s\nLine %i: Reason: '%s'\n",
2508 LineText(), ColumnNumber(), "^", LineNumber(), msg);
2512 SWF_error("\nLine %d: Reason: 'Unexpected EOF found while looking for input.'\n", LineNumber());