polygon intersector: added horizontal line reconstruction
[swftools.git] / lib / action / lex.swf4.c
1
2 #line 3 "lex.swf4.c"
3
4 #define  YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define yy_create_buffer swf4_create_buffer
9 #define yy_delete_buffer swf4_delete_buffer
10 #define yy_flex_debug swf4_flex_debug
11 #define yy_init_buffer swf4_init_buffer
12 #define yy_flush_buffer swf4_flush_buffer
13 #define yy_load_buffer_state swf4_load_buffer_state
14 #define yy_switch_to_buffer swf4_switch_to_buffer
15 #define yyin swf4in
16 #define yyleng swf4leng
17 #define yylex swf4lex
18 #define yylineno swf4lineno
19 #define yyout swf4out
20 #define yyrestart swf4restart
21 #define yytext swf4text
22 #define yywrap swf4wrap
23 #define yyalloc swf4alloc
24 #define yyrealloc swf4realloc
25 #define yyfree swf4free
26
27 #define FLEX_SCANNER
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
32 #define FLEX_BETA
33 #endif
34
35 /* First, we deal with  platform-specific or compiler-specific issues. */
36
37 /* begin standard C headers. */
38 #include <stdio.h>
39 #include <string.h>
40 #include <errno.h>
41 #include <stdlib.h>
42
43 /* end standard C headers. */
44
45 /* flex integer type definitions */
46
47 #ifndef FLEXINT_H
48 #define FLEXINT_H
49
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55  * if you want the limit (max/min) macros for int types. 
56  */
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
59 #endif
60
61 #include <inttypes.h>
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 #else
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t; 
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
75 #endif /* ! C99 */
76
77 /* Limits of integral types. */
78 #ifndef INT8_MIN
79 #define INT8_MIN               (-128)
80 #endif
81 #ifndef INT16_MIN
82 #define INT16_MIN              (-32767-1)
83 #endif
84 #ifndef INT32_MIN
85 #define INT32_MIN              (-2147483647-1)
86 #endif
87 #ifndef INT8_MAX
88 #define INT8_MAX               (127)
89 #endif
90 #ifndef INT16_MAX
91 #define INT16_MAX              (32767)
92 #endif
93 #ifndef INT32_MAX
94 #define INT32_MAX              (2147483647)
95 #endif
96 #ifndef UINT8_MAX
97 #define UINT8_MAX              (255U)
98 #endif
99 #ifndef UINT16_MAX
100 #define UINT16_MAX             (65535U)
101 #endif
102 #ifndef UINT32_MAX
103 #define UINT32_MAX             (4294967295U)
104 #endif
105
106 #endif /* ! FLEXINT_H */
107
108 #ifdef __cplusplus
109
110 /* The "const" storage-class-modifier is valid. */
111 #define YY_USE_CONST
112
113 #else   /* ! __cplusplus */
114
115 /* C99 requires __STDC__ to be defined as 1. */
116 #if defined (__STDC__)
117
118 #define YY_USE_CONST
119
120 #endif  /* defined (__STDC__) */
121 #endif  /* ! __cplusplus */
122
123 #ifdef YY_USE_CONST
124 #define yyconst const
125 #else
126 #define yyconst
127 #endif
128
129 /* Returned upon end-of-file. */
130 #define YY_NULL 0
131
132 /* Promotes a possibly negative, possibly signed char to an unsigned
133  * integer for use as an array index.  If the signed char is negative,
134  * we want to instead treat it as an 8-bit unsigned char, hence the
135  * double cast.
136  */
137 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
138
139 /* Enter a start condition.  This macro really ought to take a parameter,
140  * but we do it the disgusting crufty way forced on us by the ()-less
141  * definition of BEGIN.
142  */
143 #define BEGIN (yy_start) = 1 + 2 *
144
145 /* Translate the current start state into a value that can be later handed
146  * to BEGIN to return to the state.  The YYSTATE alias is for lex
147  * compatibility.
148  */
149 #define YY_START (((yy_start) - 1) / 2)
150 #define YYSTATE YY_START
151
152 /* Action number for EOF rule of a given start state. */
153 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155 /* Special action meaning "start processing a new file". */
156 #define YY_NEW_FILE swf4restart(swf4in  )
157
158 #define YY_END_OF_BUFFER_CHAR 0
159
160 /* Size of default input buffer. */
161 #ifndef YY_BUF_SIZE
162 #define YY_BUF_SIZE 16384
163 #endif
164
165 /* The state buf must be large enough to hold one state per character in the main buffer.
166  */
167 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
170 #define YY_TYPEDEF_YY_BUFFER_STATE
171 typedef struct yy_buffer_state *YY_BUFFER_STATE;
172 #endif
173
174 extern int swf4leng;
175
176 extern FILE *swf4in, *swf4out;
177
178 #define EOB_ACT_CONTINUE_SCAN 0
179 #define EOB_ACT_END_OF_FILE 1
180 #define EOB_ACT_LAST_MATCH 2
181
182     #define YY_LESS_LINENO(n)
183     
184 /* Return all but the first "n" matched characters back to the input stream. */
185 #define yyless(n) \
186         do \
187                 { \
188                 /* Undo effects of setting up swf4text. */ \
189         int yyless_macro_arg = (n); \
190         YY_LESS_LINENO(yyless_macro_arg);\
191                 *yy_cp = (yy_hold_char); \
192                 YY_RESTORE_YY_MORE_OFFSET \
193                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
194                 YY_DO_BEFORE_ACTION; /* set up swf4text again */ \
195                 } \
196         while ( 0 )
197
198 #define unput(c) yyunput( c, (yytext_ptr)  )
199
200 #ifndef YY_TYPEDEF_YY_SIZE_T
201 #define YY_TYPEDEF_YY_SIZE_T
202 typedef size_t yy_size_t;
203 #endif
204
205 #ifndef YY_STRUCT_YY_BUFFER_STATE
206 #define YY_STRUCT_YY_BUFFER_STATE
207 struct yy_buffer_state
208         {
209         FILE *yy_input_file;
210
211         char *yy_ch_buf;                /* input buffer */
212         char *yy_buf_pos;               /* current position in input buffer */
213
214         /* Size of input buffer in bytes, not including room for EOB
215          * characters.
216          */
217         yy_size_t yy_buf_size;
218
219         /* Number of characters read into yy_ch_buf, not including EOB
220          * characters.
221          */
222         int yy_n_chars;
223
224         /* Whether we "own" the buffer - i.e., we know we created it,
225          * and can realloc() it to grow it, and should free() it to
226          * delete it.
227          */
228         int yy_is_our_buffer;
229
230         /* Whether this is an "interactive" input source; if so, and
231          * if we're using stdio for input, then we want to use getc()
232          * instead of fread(), to make sure we stop fetching input after
233          * each newline.
234          */
235         int yy_is_interactive;
236
237         /* Whether we're considered to be at the beginning of a line.
238          * If so, '^' rules will be active on the next match, otherwise
239          * not.
240          */
241         int yy_at_bol;
242
243     int yy_bs_lineno; /**< The line count. */
244     int yy_bs_column; /**< The column count. */
245     
246         /* Whether to try to fill the input buffer when we reach the
247          * end of it.
248          */
249         int yy_fill_buffer;
250
251         int yy_buffer_status;
252
253 #define YY_BUFFER_NEW 0
254 #define YY_BUFFER_NORMAL 1
255         /* When an EOF's been seen but there's still some text to process
256          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257          * shouldn't try reading from the input source any more.  We might
258          * still have a bunch of tokens to match, though, because of
259          * possible backing-up.
260          *
261          * When we actually see the EOF, we change the status to "new"
262          * (via swf4restart()), so that the user can continue scanning by
263          * just pointing swf4in at a new input file.
264          */
265 #define YY_BUFFER_EOF_PENDING 2
266
267         };
268 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
269
270 /* Stack of input buffers. */
271 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
274
275 /* We provide macros for accessing buffer states in case in the
276  * future we want to put the buffer states in a more general
277  * "scanner state".
278  *
279  * Returns the top of the stack, or NULL.
280  */
281 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
283                           : NULL)
284
285 /* Same as previous macro, but useful when we know that the buffer stack is not
286  * NULL or when we need an lvalue. For internal use only.
287  */
288 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
289
290 /* yy_hold_char holds the character lost when swf4text is formed. */
291 static char yy_hold_char;
292 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
293 int swf4leng;
294
295 /* Points to current character in buffer. */
296 static char *yy_c_buf_p = (char *) 0;
297 static int yy_init = 0;         /* whether we need to initialize */
298 static int yy_start = 0;        /* start state number */
299
300 /* Flag which is used to allow swf4wrap()'s to do buffer switches
301  * instead of setting up a fresh swf4in.  A bit of a hack ...
302  */
303 static int yy_did_buffer_switch_on_eof;
304
305 void swf4restart (FILE *input_file  );
306 void swf4_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
307 YY_BUFFER_STATE swf4_create_buffer (FILE *file,int size  );
308 void swf4_delete_buffer (YY_BUFFER_STATE b  );
309 void swf4_flush_buffer (YY_BUFFER_STATE b  );
310 void swf4push_buffer_state (YY_BUFFER_STATE new_buffer  );
311 void swf4pop_buffer_state (void );
312
313 static void swf4ensure_buffer_stack (void );
314 static void swf4_load_buffer_state (void );
315 static void swf4_init_buffer (YY_BUFFER_STATE b,FILE *file  );
316
317 #define YY_FLUSH_BUFFER swf4_flush_buffer(YY_CURRENT_BUFFER )
318
319 YY_BUFFER_STATE swf4_scan_buffer (char *base,yy_size_t size  );
320 YY_BUFFER_STATE swf4_scan_string (yyconst char *yy_str  );
321 YY_BUFFER_STATE swf4_scan_bytes (yyconst char *bytes,int len  );
322
323 void *swf4alloc (yy_size_t  );
324 void *swf4realloc (void *,yy_size_t  );
325 void swf4free (void *  );
326
327 #define yy_new_buffer swf4_create_buffer
328
329 #define yy_set_interactive(is_interactive) \
330         { \
331         if ( ! YY_CURRENT_BUFFER ){ \
332         swf4ensure_buffer_stack (); \
333                 YY_CURRENT_BUFFER_LVALUE =    \
334             swf4_create_buffer(swf4in,YY_BUF_SIZE ); \
335         } \
336         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337         }
338
339 #define yy_set_bol(at_bol) \
340         { \
341         if ( ! YY_CURRENT_BUFFER ){\
342         swf4ensure_buffer_stack (); \
343                 YY_CURRENT_BUFFER_LVALUE =    \
344             swf4_create_buffer(swf4in,YY_BUF_SIZE ); \
345         } \
346         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347         }
348
349 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
350
351 /* Begin user sect3 */
352
353 typedef unsigned char YY_CHAR;
354
355 FILE *swf4in = (FILE *) 0, *swf4out = (FILE *) 0;
356
357 typedef int yy_state_type;
358
359 extern int swf4lineno;
360
361 int swf4lineno = 1;
362
363 extern char *swf4text;
364 #define yytext_ptr swf4text
365
366 static yy_state_type yy_get_previous_state (void );
367 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
368 static int yy_get_next_buffer (void );
369 static void yy_fatal_error (yyconst char msg[]  );
370
371 /* Done after the current pattern has been matched and before the
372  * corresponding action - sets up swf4text.
373  */
374 #define YY_DO_BEFORE_ACTION \
375         (yytext_ptr) = yy_bp; \
376         swf4leng = (size_t) (yy_cp - yy_bp); \
377         (yy_hold_char) = *yy_cp; \
378         *yy_cp = '\0'; \
379         (yy_c_buf_p) = yy_cp;
380
381 #define YY_NUM_RULES 95
382 #define YY_END_OF_BUFFER 96
383 /* This struct is not used in this scanner,
384    but its presence is necessary. */
385 struct yy_trans_info
386         {
387         flex_int32_t yy_verify;
388         flex_int32_t yy_nxt;
389         };
390 static yyconst flex_int16_t yy_accept[320] =
391     {   0,
392         0,    0,   96,   94,   56,   93,   94,   82,   94,   79,
393        94,   83,   84,   80,   77,   89,   78,   90,   81,    1,
394        92,   75,   59,   76,   60,   91,   47,   47,   47,   47,
395        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
396        47,   47,   47,   85,   86,   87,   94,   88,   93,   64,
397         0,   52,   50,    0,   65,    0,   53,   51,    0,   67,
398        57,   69,   58,   70,   74,    0,   54,   48,   55,   68,
399        48,    2,    1,   61,   63,   62,    0,   47,   47,   47,
400        47,   47,   11,   47,   47,   47,   47,   47,   47,   47,
401         9,   47,   47,   47,   47,   47,   47,   47,   47,   47,
402
403        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
404        47,   47,   66,   72,   48,   48,    2,   73,   71,   49,
405        49,   47,   47,   24,   47,   47,   47,   47,    8,   47,
406        33,   47,   16,   47,   47,   47,   47,   23,   47,   47,
407        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
408        47,   47,   47,   47,   47,   49,   49,   47,   47,   47,
409        47,   47,    7,   47,   47,   47,   47,   47,   47,   47,
410        47,   47,   37,   32,   47,   47,   47,   47,   47,   38,
411        47,   47,   46,   14,   47,   47,    3,   47,   47,    5,
412        47,   47,   47,   47,    4,   47,   47,   47,   47,   47,
413
414        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
415        47,   47,   47,   47,   47,   20,   47,   10,   47,   17,
416        47,   47,   47,   47,   26,   47,   47,   15,   47,   47,
417        47,   34,   47,   13,   47,   47,   47,   47,   47,   30,
418        47,   47,   47,   47,   47,   47,   47,   47,   27,   47,
419        47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
420        47,   47,   12,   47,    6,   47,   47,   47,   47,   47,
421        47,   47,   47,   47,   47,   47,   47,   22,   47,   47,
422        47,   25,   47,   47,   47,   47,   41,   28,   47,   35,
423        36,   47,   44,   21,   47,   47,   47,   47,   47,   47,
424
425        47,   47,   19,   40,   45,   47,   47,   43,   31,   42,
426        47,   47,   47,   47,   47,   18,   29,   39,    0
427     } ;
428
429 static yyconst flex_int32_t yy_ec[256] =
430     {   0,
431         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
432         2,    2,    4,    1,    1,    1,    1,    1,    1,    1,
433         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
434         1,    2,    5,    6,    1,    1,    1,    7,    8,    9,
435        10,   11,   12,   13,   14,   15,   16,   17,   18,   17,
436        17,   17,   17,   17,   17,   17,   17,   19,   20,   21,
437        22,   23,   24,    1,   25,   26,   27,   28,   29,   30,
438        31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
439        41,   42,   43,   44,   45,   46,   47,   48,   49,   34,
440        50,   51,   52,    1,   34,    1,   53,   54,   55,   56,
441
442        57,   58,   59,   60,   61,   34,   62,   63,   64,   65,
443        66,   67,   68,   69,   70,   71,   72,   73,   74,   75,
444        76,   34,   77,   78,   79,    1,    1,    1,    1,    1,
445         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
446         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
447         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
448         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
449         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
450         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
451         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
452
453         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
454         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
455         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
456         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
457         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
458         1,    1,    1,    1,    1
459     } ;
460
461 static yyconst flex_int32_t yy_meta[80] =
462     {   0,
463         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
464         2,    1,    1,    1,    3,    4,    5,    5,    1,    1,
465         1,    2,    1,    1,    6,    6,    6,    6,    6,    6,
466         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
467         6,    6,    6,    6,    6,    6,    6,    6,    6,    1,
468         1,    1,    6,    6,    6,    6,    6,    6,    6,    6,
469         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
470         6,    6,    6,    6,    6,    6,    1,    1,    1
471     } ;
472
473 static yyconst flex_int16_t yy_base[327] =
474     {   0,
475         0,    0,  878,  879,  879,  879,  874,  854,   77,  868,
476        78,  879,  879,  852,   70,  879,   71,   72,   79,   81,
477       879,  879,  851,  850,  849,  879,  854,   68,   81,   73,
478        75,   91,   86,   84,  107,  111,   89,  139,  137,  138,
479       164,  110,  116,  879,  879,  879,  791,  879,  879,  846,
480       118,  153,  879,  864,  879,  100,  162,  879,  863,  879,
481       879,  879,  879,  879,  849,  176,  879,  156,  879,  879,
482       844,  167,  171,  836,  828,  879,  817,  815,  183,  184,
483       185,  191,  814,  195,  198,  200,  201,  206,  202,  207,
484       811,  216,  199,  223,  210,  212,  233,  228,  222,  250,
485
486       229,  234,  253,  261,  226,  259,  241,  256,  272,  280,
487       274,  268,  879,  879,  809,  807,  291,  879,  879,  296,
488       806,  288,  283,  805,  290,  299,  307,  300,  803,  302,
489       310,  305,  800,  316,  312,  314,  322,  798,  332,  340,
490       326,  337,  341,  343,  344,  333,  347,  338,  351,  362,
491       367,  376,  373,  360,  379,  797,  796,  381,  380,  393,
492       390,  396,  795,  404,  406,  408,  411,  409,  412,  428,
493       424,  420,  794,  793,  429,  425,  432,  444,  431,  456,
494       450,  452,  788,  779,  454,  457,  778,  477,  479,  776,
495       473,  460,  433,  484,  773,  491,  493,  494,  487,  502,
496
497       503,  504,  463,  506,  512,  508,  521,  517,  513,  525,
498       522,  533,  531,  535,  540,  769,  545,  753,  551,  712,
499       549,  562,  550,  546,  101,  564,  577,  676,  563,  580,
500       582,  675,  585,  670,  579,  574,  587,  592,  567,  648,
501       598,  602,  607,  609,  603,  608,  625,  615,  645,  626,
502       610,  635,  638,  611,  639,  641,  653,  637,  664,  643,
503       667,  642,  612,  668,  529,  672,  678,  647,  669,  684,
504       686,  693,  691,  695,  703,  696,  706,  497,  705,  701,
505       719,  465,  711,  726,  715,  729,  439,  436,  723,  421,
506       388,  731,  372,  353,  735,  737,  734,  740,  746,  741,
507
508       744,  752,  275,  267,  218,  763,  768,  203,  163,  158,
509       771,  747,  759,  764,  757,  145,   93,   88,  879,  834,
510       840,  845,  848,  851,  855,  858
511     } ;
512
513 static yyconst flex_int16_t yy_def[327] =
514     {   0,
515       319,    1,  319,  319,  319,  319,  319,  319,  320,  319,
516       321,  319,  319,  319,  319,  319,  319,  319,  322,  319,
517       319,  319,  319,  319,  319,  319,  323,  323,  323,  323,
518       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
519       323,  323,  323,  319,  319,  319,  319,  319,  319,  319,
520       320,  320,  319,  320,  319,  321,  321,  319,  321,  319,
521       319,  319,  319,  319,  319,  322,  319,  319,  319,  319,
522       324,  319,  319,  319,  319,  319,  325,  323,  323,  323,
523       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
524       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
525
526       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
527       323,  323,  319,  319,  319,  324,  319,  319,  319,  319,
528       326,  323,  323,  323,  323,  323,  323,  323,  323,  323,
529       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
530       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
531       323,  323,  323,  323,  323,  319,  326,  323,  323,  323,
532       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
533       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
534       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
535       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
536
537       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
538       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
539       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
540       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
541       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
542       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
543       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
544       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
545       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
546       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
547
548       323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
549       323,  323,  323,  323,  323,  323,  323,  323,    0,  319,
550       319,  319,  319,  319,  319,  319
551     } ;
552
553 static yyconst flex_int16_t yy_nxt[959] =
554     {   0,
555         4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
556        14,   15,   16,   17,   18,   19,   20,   20,   21,   22,
557        23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
558        33,   27,   34,   27,   27,   35,   27,   36,   37,   38,
559        27,   39,   40,   41,   27,   42,   43,   27,   27,   44,
560         4,   45,   27,   28,   29,   30,   31,   32,   33,   27,
561        34,   27,   35,   27,   36,   37,   38,   27,   39,   40,
562        41,   27,   42,   43,   27,   27,   46,   47,   48,   52,
563        57,   61,   53,   77,   63,   58,   65,   66,   77,   67,
564        77,   62,   64,   68,   69,   72,   77,   73,   73,   77,
565
566        70,   77,   57,   77,   77,   80,   77,   58,   77,   79,
567        85,   83,   81,   91,   89,   86,   77,   84,  249,   82,
568        52,   92,   77,   53,   90,   77,   77,   54,   59,   87,
569        97,   77,   88,   80,  111,   93,   79,   85,   83,   95,
570        81,   91,   89,   86,   84,   94,   82,  112,   92,   96,
571        59,   90,   77,   77,   77,   52,   87,   97,   53,   88,
572        77,  101,  111,   93,   57,  102,  103,   95,   54,   58,
573       115,   66,   94,   77,   98,  112,   96,   99,   77,   77,
574       100,  104,  105,  117,  117,   72,  319,   73,   73,  101,
575        68,  319,  106,  102,  103,  107,  108,  319,   77,   77,
576
577        77,   98,  109,   54,   99,  110,   77,  100,  104,  105,
578        77,  122,   59,   77,   77,   77,   77,   77,   77,  123,
579       106,   77,   77,  107,  108,   77,  124,   77,  125,  109,
580       130,   77,  110,   77,  126,  128,  134,   77,   77,  122,
581       127,   77,  129,   77,   77,  131,  123,  135,   77,   77,
582       132,  147,  139,  124,  137,  125,   77,  136,  130,  133,
583       138,  126,  128,  134,  140,   77,  142,  127,   77,  129,
584       143,   77,  131,  149,   77,  135,   77,  132,  141,  147,
585       139,  137,   77,   77,  136,  145,  133,   77,  138,   77,
586        77,  140,  150,  142,  148,   77,  144,  143,   77,  146,
587
588       155,  149,  151,   77,  152,   77,  141,  117,  117,  154,
589       156,   77,  158,  145,   77,   77,  160,   77,  159,  150,
590        77,  148,   77,  144,  153,   77,  146,   77,  155,   77,
591       151,   77,  152,  161,  162,  163,  154,   77,  165,  170,
592       158,   77,  164,  168,  160,  159,  169,   77,   77,  166,
593       172,  153,   77,   77,  167,   77,   77,  171,   77,   77,
594       161,  162,   77,  163,  176,  165,   77,  170,   77,  164,
595       168,  175,  180,  182,  169,   77,  166,   77,  172,  177,
596       173,  167,   77,  174,  171,  179,  178,   77,   77,  181,
597       184,   77,  176,  183,   77,   77,   77,  185,  175,  180,
598
599       182,  187,  186,   77,  188,   77,  177,  173,   77,  191,
600       174,   77,  179,  178,  189,  190,  181,  192,  184,   77,
601       183,   77,  193,   77,   77,  185,   77,   77,  194,  187,
602       186,  188,  195,  199,  196,   77,   77,  191,  200,   77,
603        77,  189,  190,   77,   77,  192,   77,   77,   77,  197,
604       193,   77,  198,  204,   77,  201,  194,  205,  206,   77,
605       195,  199,  196,  207,  202,   77,  200,   77,  209,   77,
606       221,   77,   77,  203,  210,   77,  197,  208,   77,  198,
607        77,  204,  201,  211,  205,  216,  206,  230,   77,  215,
608       207,  202,   77,  213,   77,  214,  209,  221,  212,   77,
609
610       203,  210,   77,  220,  208,  217,   77,  218,   77,   77,
611       222,  211,   77,  216,  219,  230,  215,   77,   77,   77,
612       213,   77,  214,   77,  226,  212,  223,   77,   77,  225,
613       220,  224,   77,  217,  228,  218,   77,   77,  222,  232,
614        77,  219,  229,  227,   77,  235,   77,  231,   77,  233,
615        77,  226,  237,  223,  236,   77,  225,  234,  224,  241,
616        77,   77,  228,  238,   77,   77,   77,  232,  242,  229,
617       227,  239,  240,  235,  231,  244,  233,   77,   77,   77,
618       237,  236,   77,  243,  234,  248,  246,  241,  247,   77,
619       238,  250,   77,  245,   77,   77,  242,   77,  239,  240,
620
621        77,  251,   77,  244,  257,  256,  254,   77,  252,  255,
622       243,  260,  248,   77,  246,  247,  259,   77,   77,  250,
623       245,  253,   77,   77,   77,   77,   77,   77,  258,  251,
624        77,  265,  257,  256,  254,  252,  263,  255,  260,  261,
625        77,   77,  262,  268,  259,  264,  270,  273,  253,  267,
626        77,  266,   77,   77,   77,  258,   77,   77,   77,  265,
627        77,  277,   77,   77,  263,  269,  261,  271,   77,  262,
628       272,  268,  264,  270,  273,  274,  275,  267,  266,   77,
629       279,  276,   77,   77,   77,   77,  281,   77,  285,  277,
630        77,   77,  269,   77,  278,  271,  282,  280,  272,   77,
631
632       283,   77,  274,  275,  286,  284,   77,  279,   77,  276,
633        77,   77,  287,  281,  288,  285,   77,  289,   77,  290,
634        77,   77,  278,  291,  282,  280,   77,   77,  283,  296,
635        77,  286,  295,  284,   77,  292,  294,  298,   77,  293,
636       287,   77,  288,  297,   77,  289,   77,  290,  302,   77,
637        77,  291,   77,  301,  299,   77,   77,  296,  300,   77,
638       295,   77,   77,  292,  294,  298,  293,   77,   77,  306,
639       303,  297,   77,  308,   77,  307,  302,  304,   77,   77,
640       305,  301,  299,   77,   77,  300,   77,  311,   77,  309,
641       315,   77,  310,   77,   77,  312,  306,  303,  316,  314,
642
643       313,  308,  307,   77,  304,  318,  317,  305,   77,   77,
644        77,   77,   77,   77,  311,   77,  309,  315,   77,  310,
645        77,   77,   66,  312,   66,  316,   77,  314,  313,   77,
646        77,  120,  318,  317,   51,   51,   51,   51,   51,   51,
647        56,   56,   56,   56,   56,   56,   71,   71,   71,  119,
648        71,   78,   78,   78,  116,  116,  116,  121,  118,   66,
649       121,  157,  157,  157,   66,  319,  319,  114,  113,   77,
650        76,   75,   74,   60,   55,   50,   49,  319,    3,  319,
651       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
652       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
653
654       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
655       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
656       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
657       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
658       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
659       319,  319,  319,  319,  319,  319,  319,  319
660     } ;
661
662 static yyconst flex_int16_t yy_chk[959] =
663     {   0,
664         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
665         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
666         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
667         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
668         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
669         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
670         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
671         1,    1,    1,    1,    1,    1,    1,    1,    1,    9,
672        11,   15,    9,   28,   17,   11,   18,   18,   30,   19,
673        31,   15,   17,   19,   19,   20,   29,   20,   20,   34,
674
675        19,   33,   56,  318,   37,   29,   32,   56,  317,   28,
676        31,   30,   29,   34,   33,   32,  225,   30,  225,   29,
677        51,   34,   35,   51,   33,   42,   36,    9,   11,   32,
678        37,   43,   32,   29,   42,   35,   28,   31,   30,   36,
679        29,   34,   33,   32,   30,   35,   29,   43,   34,   36,
680        56,   33,   39,   40,   38,   52,   32,   37,   52,   32,
681       316,   39,   42,   35,   57,   39,   40,   36,   51,   57,
682        68,   68,   35,  310,   38,   43,   36,   38,  309,   41,
683        38,   40,   40,   72,   72,   73,   66,   73,   73,   39,
684        66,   66,   41,   39,   40,   41,   41,   66,   79,   80,
685
686        81,   38,   41,   52,   38,   41,   82,   38,   40,   40,
687        84,   79,   57,   85,   93,   86,   87,   89,  308,   80,
688        41,   88,   90,   41,   41,   95,   81,   96,   82,   41,
689        88,   92,   41,  305,   84,   86,   93,   99,   94,   79,
690        85,  105,   87,   98,  101,   89,   80,   94,   97,  102,
691        90,  105,   98,   81,   96,   82,  107,   95,   88,   92,
692        97,   84,   86,   93,   99,  100,  101,   85,  103,   87,
693       102,  108,   89,  107,  106,   94,  104,   90,  100,  105,
694        98,   96,  304,  112,   95,  104,   92,  109,   97,  111,
695       303,   99,  108,  101,  106,  110,  103,  102,  123,  104,
696
697       112,  107,  109,  122,  110,  125,  100,  117,  117,  111,
698       120,  120,  122,  104,  126,  128,  125,  130,  123,  108,
699       132,  106,  127,  103,  110,  131,  104,  135,  112,  136,
700       109,  134,  110,  125,  126,  127,  111,  137,  130,  135,
701       122,  141,  128,  132,  125,  123,  134,  139,  146,  131,
702       137,  110,  142,  148,  131,  140,  143,  136,  144,  145,
703       125,  126,  147,  127,  142,  130,  149,  135,  294,  128,
704       132,  141,  146,  148,  134,  154,  131,  150,  137,  143,
705       139,  131,  151,  140,  136,  145,  144,  293,  153,  147,
706       150,  152,  142,  149,  155,  159,  158,  151,  141,  146,
707
708       148,  153,  152,  291,  154,  161,  143,  139,  160,  159,
709       140,  162,  145,  144,  155,  158,  147,  160,  150,  164,
710       149,  165,  161,  166,  168,  151,  167,  169,  162,  153,
711       152,  154,  164,  168,  165,  172,  290,  159,  168,  171,
712       176,  155,  158,  170,  175,  160,  179,  177,  193,  166,
713       161,  288,  167,  171,  287,  169,  162,  172,  175,  178,
714       164,  168,  165,  176,  170,  181,  168,  182,  178,  185,
715       193,  180,  186,  170,  179,  192,  166,  177,  203,  167,
716       282,  171,  169,  180,  172,  186,  175,  203,  191,  185,
717       176,  170,  188,  181,  189,  182,  178,  193,  180,  194,
718
719       170,  179,  199,  192,  177,  188,  196,  189,  197,  198,
720       194,  180,  278,  186,  191,  203,  185,  200,  201,  202,
721       181,  204,  182,  206,  199,  180,  196,  205,  209,  198,
722       192,  197,  208,  188,  201,  189,  207,  211,  194,  205,
723       210,  191,  202,  200,  265,  208,  213,  204,  212,  206,
724       214,  199,  210,  196,  209,  215,  198,  207,  197,  214,
725       217,  224,  201,  211,  221,  223,  219,  205,  215,  202,
726       200,  212,  213,  208,  204,  219,  206,  222,  229,  226,
727       210,  209,  239,  217,  207,  224,  222,  214,  223,  236,
728       211,  226,  227,  221,  235,  230,  215,  231,  212,  213,
729
730       233,  227,  237,  219,  236,  235,  231,  238,  229,  233,
731       217,  239,  224,  241,  222,  223,  238,  242,  245,  226,
732       221,  230,  243,  246,  244,  251,  254,  263,  237,  227,
733       248,  245,  236,  235,  231,  229,  243,  233,  239,  241,
734       247,  250,  242,  248,  238,  244,  251,  254,  230,  247,
735       252,  246,  258,  253,  255,  237,  256,  262,  260,  245,
736       249,  258,  268,  240,  243,  250,  241,  252,  257,  242,
737       253,  248,  244,  251,  254,  255,  256,  247,  246,  259,
738       260,  257,  261,  264,  269,  234,  262,  266,  268,  258,
739       232,  228,  250,  267,  259,  252,  264,  261,  253,  270,
740
741       266,  271,  255,  256,  269,  267,  273,  260,  272,  257,
742       274,  276,  270,  262,  271,  268,  280,  272,  275,  273,
743       279,  277,  259,  274,  264,  261,  283,  220,  266,  280,
744       285,  269,  279,  267,  281,  275,  277,  283,  289,  276,
745       270,  284,  271,  281,  286,  272,  292,  273,  289,  297,
746       295,  274,  296,  286,  284,  298,  300,  280,  285,  301,
747       279,  299,  312,  275,  277,  283,  276,  302,  218,  297,
748       292,  281,  315,  299,  313,  298,  289,  295,  306,  314,
749       296,  286,  284,  307,  216,  285,  311,  302,  195,  300,
750       312,  190,  301,  187,  184,  306,  297,  292,  313,  311,
751
752       307,  299,  298,  183,  295,  315,  314,  296,  174,  173,
753       163,  157,  156,  138,  302,  133,  300,  312,  129,  301,
754       124,  121,  116,  306,  115,  313,   91,  311,  307,   83,
755        78,   77,  315,  314,  320,  320,  320,  320,  320,  320,
756       321,  321,  321,  321,  321,  321,  322,  322,  322,   75,
757       322,  323,  323,  323,  324,  324,  324,  325,   74,   71,
758       325,  326,  326,  326,   65,   59,   54,   50,   47,   27,
759        25,   24,   23,   14,   10,    8,    7,    3,  319,  319,
760       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
761       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
762
763       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
764       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
765       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
766       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
767       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
768       319,  319,  319,  319,  319,  319,  319,  319
769     } ;
770
771 static yy_state_type yy_last_accepting_state;
772 static char *yy_last_accepting_cpos;
773
774 extern int swf4_flex_debug;
775 int swf4_flex_debug = 0;
776
777 /* The intent behind this definition is that it'll catch
778  * any uses of REJECT which flex missed.
779  */
780 #define REJECT reject_used_but_not_detected
781 #define yymore() yymore_used_but_not_detected
782 #define YY_MORE_ADJ 0
783 #define YY_RESTORE_YY_MORE_OFFSET
784 char *swf4text;
785 #line 1 "swf4compiler.flex"
786 #line 2 "swf4compiler.flex"
787
788 #include <math.h>
789 #include <string.h>
790
791 #include "compile.h"
792 #include "action.h"
793 #include "blocks/error.h"
794 #include "swf4compiler.tab.h" /* defines token types */
795
796 static int swf4debug;
797
798 static const char *lexBuffer = NULL;
799 static int lexBufferLen = 0;
800
801 static int  sLineNumber = 0;
802 static char szLine[1024];
803 static char msgbufs[2][1024] = { {0}, {0} }, *msgline = {0};
804 static int  column = 0;
805
806 static void comment();
807 static void comment1();
808 static void count();
809 static void warning(char *msg);
810
811 #define YY_INPUT(buf,result,max_size) result=lexBufferInput(buf, max_size)
812
813 /* thanks to the prolific and brilliant Raff: */
814 static int lexBufferInput(char *buf, int max_size)
815 {
816   int l = lexBufferLen > max_size ? max_size : lexBufferLen;
817   
818   if (lexBufferLen <= 0)
819     return YY_NULL;
820
821   memcpy(buf, lexBuffer, l);
822   lexBuffer += l;
823   lexBufferLen -= l;
824   return l;
825 }
826
827         /* very inefficient method of unescaping strings */
828 static void unescape(char *buf)
829 {
830   char *p, *p1;
831
832   for (p1=buf; (p=strchr(p1, '\\')) != 0; p1 = p+1) {
833     switch(p[1])
834     {
835     case 'b' : p[1] = '\b'; break;
836     case 'f' : p[1] = '\f'; break;
837     case 'n' : p[1] = '\n'; break;
838     case 'r' : p[1] = '\r'; break;
839     case 't' : p[1] = '\t'; break;
840     case 'x' :
841     case 'u' : warning("unsupported escape sequence");
842     }
843     strcpy(p, p+1);
844   }
845 }
846
847 void swf4ParseInit(const char *script, int debug)
848 {
849   checkByteOrder();
850   swf4restart(NULL);
851
852   swf4debug = debug;
853
854   lexBuffer = script;
855   lexBufferLen = strlen(script);
856   sLineNumber = 0;
857   column = 0;
858   msgline = msgbufs[0];
859 }
860
861 #line 79 "swf4compiler.flex"
862  // forward declaration needed by the following function
863 #ifndef YY_PROTO
864 #ifdef YY_USE_PROTOS
865 #define YY_PROTO(proto) proto
866 #else
867 #define YY_PROTO(proto) ()
868 #endif
869 #endif
870  static void yyunput YY_PROTO(( int c, char *buf_ptr ));
871
872  void do_unput4(const char c) { unput(c); }
873 #line 874 "lex.swf4.c"
874
875 #define INITIAL 0
876
877 #ifndef YY_NO_UNISTD_H
878 /* Special case for "unistd.h", since it is non-ANSI. We include it way
879  * down here because we want the user's section 1 to have been scanned first.
880  * The user has a chance to override it with an option.
881  */
882 #include <unistd.h>
883 #endif
884
885 #ifndef YY_EXTRA_TYPE
886 #define YY_EXTRA_TYPE void *
887 #endif
888
889 static int yy_init_globals (void );
890
891 /* Accessor methods to globals.
892    These are made visible to non-reentrant scanners for convenience. */
893
894 int swf4lex_destroy (void );
895
896 int swf4get_debug (void );
897
898 void swf4set_debug (int debug_flag  );
899
900 YY_EXTRA_TYPE swf4get_extra (void );
901
902 void swf4set_extra (YY_EXTRA_TYPE user_defined  );
903
904 FILE *swf4get_in (void );
905
906 void swf4set_in  (FILE * in_str  );
907
908 FILE *swf4get_out (void );
909
910 void swf4set_out  (FILE * out_str  );
911
912 int swf4get_leng (void );
913
914 char *swf4get_text (void );
915
916 int swf4get_lineno (void );
917
918 void swf4set_lineno (int line_number  );
919
920 /* Macros after this point can all be overridden by user definitions in
921  * section 1.
922  */
923
924 #ifndef YY_SKIP_YYWRAP
925 #ifdef __cplusplus
926 extern "C" int swf4wrap (void );
927 #else
928 extern int swf4wrap (void );
929 #endif
930 #endif
931
932     static void yyunput (int c,char *buf_ptr  );
933     
934 #ifndef yytext_ptr
935 static void yy_flex_strncpy (char *,yyconst char *,int );
936 #endif
937
938 #ifdef YY_NEED_STRLEN
939 static int yy_flex_strlen (yyconst char * );
940 #endif
941
942 #ifndef YY_NO_INPUT
943
944 #ifdef __cplusplus
945 static int yyinput (void );
946 #else
947 static int input (void );
948 #endif
949
950 #endif
951
952 /* Amount of stuff to slurp up with each read. */
953 #ifndef YY_READ_BUF_SIZE
954 #define YY_READ_BUF_SIZE 8192
955 #endif
956
957 /* Copy whatever the last rule matched to the standard output. */
958 #ifndef ECHO
959 /* This used to be an fputs(), but since the string might contain NUL's,
960  * we now use fwrite().
961  */
962 #define ECHO fwrite( swf4text, swf4leng, 1, swf4out )
963 #endif
964
965 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
966  * is returned in "result".
967  */
968 #ifndef YY_INPUT
969 #define YY_INPUT(buf,result,max_size) \
970         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
971                 { \
972                 int c = '*'; \
973                 int n; \
974                 for ( n = 0; n < max_size && \
975                              (c = getc( swf4in )) != EOF && c != '\n'; ++n ) \
976                         buf[n] = (char) c; \
977                 if ( c == '\n' ) \
978                         buf[n++] = (char) c; \
979                 if ( c == EOF && ferror( swf4in ) ) \
980                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
981                 result = n; \
982                 } \
983         else \
984                 { \
985                 errno=0; \
986                 while ( (result = fread(buf, 1, max_size, swf4in))==0 && ferror(swf4in)) \
987                         { \
988                         if( errno != EINTR) \
989                                 { \
990                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
991                                 break; \
992                                 } \
993                         errno=0; \
994                         clearerr(swf4in); \
995                         } \
996                 }\
997 \
998
999 #endif
1000
1001 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1002  * we don't want an extra ';' after the "return" because that will cause
1003  * some compilers to complain about unreachable statements.
1004  */
1005 #ifndef yyterminate
1006 #define yyterminate() return YY_NULL
1007 #endif
1008
1009 /* Number of entries by which start-condition stack grows. */
1010 #ifndef YY_START_STACK_INCR
1011 #define YY_START_STACK_INCR 25
1012 #endif
1013
1014 /* Report a fatal error. */
1015 #ifndef YY_FATAL_ERROR
1016 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1017 #endif
1018
1019 /* end tables serialization structures and prototypes */
1020
1021 /* Default declaration of generated scanner - a define so the user can
1022  * easily add parameters.
1023  */
1024 #ifndef YY_DECL
1025 #define YY_DECL_IS_OURS 1
1026
1027 extern int swf4lex (void);
1028
1029 #define YY_DECL int swf4lex (void)
1030 #endif /* !YY_DECL */
1031
1032 /* Code executed at the beginning of each rule, after swf4text and swf4leng
1033  * have been set up.
1034  */
1035 #ifndef YY_USER_ACTION
1036 #define YY_USER_ACTION
1037 #endif
1038
1039 /* Code executed at the end of each rule. */
1040 #ifndef YY_BREAK
1041 #define YY_BREAK break;
1042 #endif
1043
1044 #define YY_RULE_SETUP \
1045         YY_USER_ACTION
1046
1047 /** The main scanner function which does all the work.
1048  */
1049 YY_DECL
1050 {
1051         register yy_state_type yy_current_state;
1052         register char *yy_cp, *yy_bp;
1053         register int yy_act;
1054     
1055 #line 96 "swf4compiler.flex"
1056
1057
1058 #line 1059 "lex.swf4.c"
1059
1060         if ( !(yy_init) )
1061                 {
1062                 (yy_init) = 1;
1063
1064 #ifdef YY_USER_INIT
1065                 YY_USER_INIT;
1066 #endif
1067
1068                 if ( ! (yy_start) )
1069                         (yy_start) = 1; /* first start state */
1070
1071                 if ( ! swf4in )
1072                         swf4in = stdin;
1073
1074                 if ( ! swf4out )
1075                         swf4out = stdout;
1076
1077                 if ( ! YY_CURRENT_BUFFER ) {
1078                         swf4ensure_buffer_stack ();
1079                         YY_CURRENT_BUFFER_LVALUE =
1080                                 swf4_create_buffer(swf4in,YY_BUF_SIZE );
1081                 }
1082
1083                 swf4_load_buffer_state( );
1084                 }
1085
1086         while ( 1 )             /* loops until end-of-file is reached */
1087                 {
1088                 yy_cp = (yy_c_buf_p);
1089
1090                 /* Support of swf4text. */
1091                 *yy_cp = (yy_hold_char);
1092
1093                 /* yy_bp points to the position in yy_ch_buf of the start of
1094                  * the current run.
1095                  */
1096                 yy_bp = yy_cp;
1097
1098                 yy_current_state = (yy_start);
1099 yy_match:
1100                 do
1101                         {
1102                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1103                         if ( yy_accept[yy_current_state] )
1104                                 {
1105                                 (yy_last_accepting_state) = yy_current_state;
1106                                 (yy_last_accepting_cpos) = yy_cp;
1107                                 }
1108                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1109                                 {
1110                                 yy_current_state = (int) yy_def[yy_current_state];
1111                                 if ( yy_current_state >= 320 )
1112                                         yy_c = yy_meta[(unsigned int) yy_c];
1113                                 }
1114                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1115                         ++yy_cp;
1116                         }
1117                 while ( yy_base[yy_current_state] != 879 );
1118
1119 yy_find_action:
1120                 yy_act = yy_accept[yy_current_state];
1121                 if ( yy_act == 0 )
1122                         { /* have to back up */
1123                         yy_cp = (yy_last_accepting_cpos);
1124                         yy_current_state = (yy_last_accepting_state);
1125                         yy_act = yy_accept[yy_current_state];
1126                         }
1127
1128                 YY_DO_BEFORE_ACTION;
1129
1130 do_action:      /* This label is used only to access EOF actions. */
1131
1132                 switch ( yy_act )
1133         { /* beginning of action switch */
1134                         case 0: /* must back up */
1135                         /* undo the effects of YY_DO_BEFORE_ACTION */
1136                         *yy_cp = (yy_hold_char);
1137                         yy_cp = (yy_last_accepting_cpos);
1138                         yy_current_state = (yy_last_accepting_state);
1139                         goto yy_find_action;
1140
1141 case 1:
1142 YY_RULE_SETUP
1143 #line 98 "swf4compiler.flex"
1144 { count();      swf4lval.str = strdup(swf4text);
1145                                         return NUMBER;          }
1146         YY_BREAK
1147 case 2:
1148 YY_RULE_SETUP
1149 #line 100 "swf4compiler.flex"
1150 { count();      swf4lval.str = strdup(swf4text);
1151                                         return NUMBER;          }
1152         YY_BREAK
1153 case 3:
1154 YY_RULE_SETUP
1155 #line 102 "swf4compiler.flex"
1156 { count();      swf4lval.str = strdup("1");
1157                                         return NUMBER;          }
1158         YY_BREAK
1159 case 4:
1160 YY_RULE_SETUP
1161 #line 104 "swf4compiler.flex"
1162 { count();      swf4lval.str = strdup("0");
1163                                         return NUMBER;          }
1164         YY_BREAK
1165 case 5:
1166 YY_RULE_SETUP
1167 #line 106 "swf4compiler.flex"
1168 { count();      return BREAK;           }
1169         YY_BREAK
1170 case 6:
1171 YY_RULE_SETUP
1172 #line 107 "swf4compiler.flex"
1173 { count();      return CONTINUE;        }
1174         YY_BREAK
1175 case 7:
1176 YY_RULE_SETUP
1177 #line 108 "swf4compiler.flex"
1178 { count();      return ELSE;            }
1179         YY_BREAK
1180 case 8:
1181 YY_RULE_SETUP
1182 #line 109 "swf4compiler.flex"
1183 { count();      return FOR;             }
1184         YY_BREAK
1185 case 9:
1186 YY_RULE_SETUP
1187 #line 110 "swf4compiler.flex"
1188 { count();      return IF;              }
1189         YY_BREAK
1190 case 10:
1191 YY_RULE_SETUP
1192 #line 111 "swf4compiler.flex"
1193 { count();      return WHILE;           }
1194         YY_BREAK
1195 case 11:
1196 YY_RULE_SETUP
1197 #line 112 "swf4compiler.flex"
1198 { count();      return DO;              }
1199         YY_BREAK
1200 case 12:
1201 YY_RULE_SETUP
1202 #line 113 "swf4compiler.flex"
1203 { count();      return EVAL;            }
1204         YY_BREAK
1205 /* functions */
1206 case 13:
1207 YY_RULE_SETUP
1208 #line 116 "swf4compiler.flex"
1209 { count();      return RANDOM;  }
1210         YY_BREAK
1211 case 14:
1212 YY_RULE_SETUP
1213 #line 117 "swf4compiler.flex"
1214 { count();      return TIME;    }
1215         YY_BREAK
1216 case 15:
1217 YY_RULE_SETUP
1218 #line 118 "swf4compiler.flex"
1219 { count();      return LENGTH;  }
1220         YY_BREAK
1221 case 16:
1222 YY_RULE_SETUP
1223 #line 119 "swf4compiler.flex"
1224 { count();      return INT;     }
1225         YY_BREAK
1226 case 17:
1227 YY_RULE_SETUP
1228 #line 120 "swf4compiler.flex"
1229 { count();      return CONCAT;  }
1230         YY_BREAK
1231 case 18:
1232 YY_RULE_SETUP
1233 #line 121 "swf4compiler.flex"
1234 { count();      return DUPLICATECLIP;   }
1235         YY_BREAK
1236 case 19:
1237 YY_RULE_SETUP
1238 #line 122 "swf4compiler.flex"
1239 { count();      return REMOVECLIP;      }
1240         YY_BREAK
1241 case 20:
1242 YY_RULE_SETUP
1243 #line 123 "swf4compiler.flex"
1244 { count();      return TRACE;   }
1245         YY_BREAK
1246 case 21:
1247 YY_RULE_SETUP
1248 #line 124 "swf4compiler.flex"
1249 { count();      return STARTDRAG;       }
1250         YY_BREAK
1251 case 22:
1252 YY_RULE_SETUP
1253 #line 125 "swf4compiler.flex"
1254 { count();      return STOPDRAG;        }
1255         YY_BREAK
1256 case 23:
1257 YY_RULE_SETUP
1258 #line 126 "swf4compiler.flex"
1259 { count();      return ORD;     }
1260         YY_BREAK
1261 case 24:
1262 YY_RULE_SETUP
1263 #line 127 "swf4compiler.flex"
1264 { count();      return CHR;     }
1265         YY_BREAK
1266 case 25:
1267 YY_RULE_SETUP
1268 #line 128 "swf4compiler.flex"
1269 { count();      return CALLFRAME;       }
1270         YY_BREAK
1271 case 26:
1272 YY_RULE_SETUP
1273 #line 129 "swf4compiler.flex"
1274 { count();      return GETURL;  }
1275         YY_BREAK
1276 case 27:
1277 YY_RULE_SETUP
1278 #line 130 "swf4compiler.flex"
1279 { count();      return GETURL1; }
1280         YY_BREAK
1281 case 28:
1282 YY_RULE_SETUP
1283 #line 131 "swf4compiler.flex"
1284 { count();      return LOADMOVIE;       }
1285         YY_BREAK
1286 case 29:
1287 YY_RULE_SETUP
1288 #line 132 "swf4compiler.flex"
1289 { count();      return LOADVARIABLES;   }
1290         YY_BREAK
1291 case 30:
1292 YY_RULE_SETUP
1293 #line 133 "swf4compiler.flex"
1294 { count();      return SUBSTR;  }
1295         YY_BREAK
1296 case 31:
1297 YY_RULE_SETUP
1298 #line 135 "swf4compiler.flex"
1299 { count();      return GETPROPERTY;     }
1300         YY_BREAK
1301 /* getURL2 methods */
1302 case 32:
1303 YY_RULE_SETUP
1304 #line 138 "swf4compiler.flex"
1305 { count();      swf4lval.getURLMethod = GETURL_METHOD_POST;
1306                                 return GETURL_METHOD;   }
1307         YY_BREAK
1308 case 33:
1309 YY_RULE_SETUP
1310 #line 140 "swf4compiler.flex"
1311 { count();      swf4lval.getURLMethod = GETURL_METHOD_GET;
1312                                 return GETURL_METHOD;   }
1313         YY_BREAK
1314 case 34:
1315 YY_RULE_SETUP
1316 #line 142 "swf4compiler.flex"
1317 { count();      swf4lval.getURLMethod = GETURL_METHOD_NOSEND;
1318                                 return GETURL_METHOD;   }
1319         YY_BREAK
1320 /* v3 functions */
1321 case 35:
1322 YY_RULE_SETUP
1323 #line 147 "swf4compiler.flex"
1324 { count();      return NEXTFRAME;       }
1325         YY_BREAK
1326 case 36:
1327 YY_RULE_SETUP
1328 #line 148 "swf4compiler.flex"
1329 { count();      return PREVFRAME;       }
1330         YY_BREAK
1331 case 37:
1332 YY_RULE_SETUP
1333 #line 149 "swf4compiler.flex"
1334 { count();      return PLAY;            }
1335         YY_BREAK
1336 case 38:
1337 YY_RULE_SETUP
1338 #line 150 "swf4compiler.flex"
1339 { count();      return STOP;            }
1340         YY_BREAK
1341 case 39:
1342 YY_RULE_SETUP
1343 #line 151 "swf4compiler.flex"
1344 { count();      return TOGGLEQUALITY;   }
1345         YY_BREAK
1346 case 40:
1347 YY_RULE_SETUP
1348 #line 152 "swf4compiler.flex"
1349 { count();      return STOPSOUNDS;      }
1350         YY_BREAK
1351 case 41:
1352 YY_RULE_SETUP
1353 #line 153 "swf4compiler.flex"
1354 { count();      return GOTOFRAME;       }
1355         YY_BREAK
1356 case 42:
1357 YY_RULE_SETUP
1358 #line 154 "swf4compiler.flex"
1359 { count();      return GOTOANDPLAY;     }
1360         YY_BREAK
1361 case 43:
1362 YY_RULE_SETUP
1363 #line 155 "swf4compiler.flex"
1364 { count();      return FRAMELOADED;     }
1365         YY_BREAK
1366 case 44:
1367 YY_RULE_SETUP
1368 #line 156 "swf4compiler.flex"
1369 { count();      return SETTARGET;       }
1370         YY_BREAK
1371 /* high level functions */
1372 case 45:
1373 YY_RULE_SETUP
1374 #line 159 "swf4compiler.flex"
1375 { count();      return TELLTARGET;      }
1376         YY_BREAK
1377 case 46:
1378 YY_RULE_SETUP
1379 #line 162 "swf4compiler.flex"
1380 { count();      return THIS;    }
1381         YY_BREAK
1382 case 47:
1383 YY_RULE_SETUP
1384 #line 164 "swf4compiler.flex"
1385 { count();      swf4lval.str = strdup(swf4text);
1386                                         return IDENTIFIER;      }
1387         YY_BREAK
1388 case 48:
1389 YY_RULE_SETUP
1390 #line 167 "swf4compiler.flex"
1391 { count();      swf4lval.str = strdup(swf4text);
1392                                         return PATH;    }
1393         YY_BREAK
1394 case 49:
1395 YY_RULE_SETUP
1396 #line 170 "swf4compiler.flex"
1397 { count();      swf4lval.str = strdup(swf4text);
1398                                         return PATH;    }
1399         YY_BREAK
1400 case 50:
1401 /* rule 50 can match eol */
1402 YY_RULE_SETUP
1403 #line 173 "swf4compiler.flex"
1404 { count();      swf4lval.str = strdup(swf4text+1);
1405                                         swf4lval.str[strlen(swf4lval.str)-1]=0;
1406                                         unescape(swf4lval.str);
1407                                         return STRING;          }
1408         YY_BREAK
1409 case 51:
1410 /* rule 51 can match eol */
1411 YY_RULE_SETUP
1412 #line 178 "swf4compiler.flex"
1413 { count();      swf4lval.str = strdup(swf4text+1);
1414                                         swf4lval.str[strlen(swf4lval.str)-1]=0;
1415                                         unescape(swf4lval.str);
1416                                         return STRING;          }
1417         YY_BREAK
1418 case 52:
1419 /* rule 52 can match eol */
1420 *yy_cp = (yy_hold_char); /* undo effects of setting up swf4text */
1421 (yy_c_buf_p) = yy_cp -= 1;
1422 YY_DO_BEFORE_ACTION; /* set up swf4text again */
1423 YY_RULE_SETUP
1424 #line 183 "swf4compiler.flex"
1425 { count();      swf4lval.str = strdup("");
1426                                         warning("Unterminated string!");
1427                                         return STRING;          }
1428         YY_BREAK
1429 case 53:
1430 /* rule 53 can match eol */
1431 *yy_cp = (yy_hold_char); /* undo effects of setting up swf4text */
1432 (yy_c_buf_p) = yy_cp -= 1;
1433 YY_DO_BEFORE_ACTION; /* set up swf4text again */
1434 YY_RULE_SETUP
1435 #line 187 "swf4compiler.flex"
1436 { count();      swf4lval.str = strdup("");
1437                                         warning("Unterminated string!");
1438                                         return STRING;          }
1439         YY_BREAK
1440 case 54:
1441 YY_RULE_SETUP
1442 #line 191 "swf4compiler.flex"
1443 { count();      comment();              }
1444         YY_BREAK
1445 case 55:
1446 YY_RULE_SETUP
1447 #line 192 "swf4compiler.flex"
1448 { count();      comment1();             }
1449         YY_BREAK
1450 case 56:
1451 YY_RULE_SETUP
1452 #line 193 "swf4compiler.flex"
1453 { count(); }
1454         YY_BREAK
1455 case 57:
1456 YY_RULE_SETUP
1457 #line 195 "swf4compiler.flex"
1458 { count();      return INC; }
1459         YY_BREAK
1460 case 58:
1461 YY_RULE_SETUP
1462 #line 196 "swf4compiler.flex"
1463 { count();      return DEC; }
1464         YY_BREAK
1465 case 59:
1466 YY_RULE_SETUP
1467 #line 197 "swf4compiler.flex"
1468 { count();      return '<'; }
1469         YY_BREAK
1470 case 60:
1471 YY_RULE_SETUP
1472 #line 198 "swf4compiler.flex"
1473 { count();      return '>'; }
1474         YY_BREAK
1475 case 61:
1476 YY_RULE_SETUP
1477 #line 199 "swf4compiler.flex"
1478 { count();      return LE; }
1479         YY_BREAK
1480 case 62:
1481 YY_RULE_SETUP
1482 #line 200 "swf4compiler.flex"
1483 { count();      return GE; }
1484         YY_BREAK
1485 case 63:
1486 YY_RULE_SETUP
1487 #line 201 "swf4compiler.flex"
1488 { count();      return EQ; }
1489         YY_BREAK
1490 case 64:
1491 YY_RULE_SETUP
1492 #line 202 "swf4compiler.flex"
1493 { count();      return NE; }
1494         YY_BREAK
1495 case 65:
1496 YY_RULE_SETUP
1497 #line 203 "swf4compiler.flex"
1498 { count();      return LAN; }
1499         YY_BREAK
1500 case 66:
1501 YY_RULE_SETUP
1502 #line 204 "swf4compiler.flex"
1503 { count();      return LOR; }
1504         YY_BREAK
1505 case 67:
1506 YY_RULE_SETUP
1507 #line 205 "swf4compiler.flex"
1508 { count();      return MEQ; }
1509         YY_BREAK
1510 case 68:
1511 YY_RULE_SETUP
1512 #line 206 "swf4compiler.flex"
1513 { count();      return DEQ; }
1514         YY_BREAK
1515 case 69:
1516 YY_RULE_SETUP
1517 #line 207 "swf4compiler.flex"
1518 { count();      return IEQ; }
1519         YY_BREAK
1520 case 70:
1521 YY_RULE_SETUP
1522 #line 208 "swf4compiler.flex"
1523 { count();      return SEQ; }
1524         YY_BREAK
1525 case 71:
1526 YY_RULE_SETUP
1527 #line 209 "swf4compiler.flex"
1528 { count();      return STREQ; }
1529         YY_BREAK
1530 case 72:
1531 YY_RULE_SETUP
1532 #line 210 "swf4compiler.flex"
1533 { count();      return STRNE; }
1534         YY_BREAK
1535 case 73:
1536 YY_RULE_SETUP
1537 #line 211 "swf4compiler.flex"
1538 { count();      return STRCMP; }
1539         YY_BREAK
1540 case 74:
1541 YY_RULE_SETUP
1542 #line 212 "swf4compiler.flex"
1543 { count();      return PARENT; }
1544         YY_BREAK
1545 case 75:
1546 YY_RULE_SETUP
1547 #line 214 "swf4compiler.flex"
1548 { count();      return ';'; }
1549         YY_BREAK
1550 case 76:
1551 YY_RULE_SETUP
1552 #line 215 "swf4compiler.flex"
1553 { count();      return '='; }
1554         YY_BREAK
1555 case 77:
1556 YY_RULE_SETUP
1557 #line 216 "swf4compiler.flex"
1558 { count();      return '+'; }
1559         YY_BREAK
1560 case 78:
1561 YY_RULE_SETUP
1562 #line 217 "swf4compiler.flex"
1563 { count();      return '-'; }
1564         YY_BREAK
1565 case 79:
1566 YY_RULE_SETUP
1567 #line 218 "swf4compiler.flex"
1568 { count();      return '&'; }
1569         YY_BREAK
1570 case 80:
1571 YY_RULE_SETUP
1572 #line 219 "swf4compiler.flex"
1573 { count();      return '*'; }
1574         YY_BREAK
1575 case 81:
1576 YY_RULE_SETUP
1577 #line 220 "swf4compiler.flex"
1578 { count();      return '/'; }
1579         YY_BREAK
1580 case 82:
1581 YY_RULE_SETUP
1582 #line 221 "swf4compiler.flex"
1583 { count();      return '!'; }
1584         YY_BREAK
1585 case 83:
1586 YY_RULE_SETUP
1587 #line 222 "swf4compiler.flex"
1588 { count();      return '('; }
1589         YY_BREAK
1590 case 84:
1591 YY_RULE_SETUP
1592 #line 223 "swf4compiler.flex"
1593 { count();      return ')'; }
1594         YY_BREAK
1595 case 85:
1596 YY_RULE_SETUP
1597 #line 224 "swf4compiler.flex"
1598 { count();      return '['; }
1599         YY_BREAK
1600 case 86:
1601 YY_RULE_SETUP
1602 #line 225 "swf4compiler.flex"
1603 { count();      return ']'; }
1604         YY_BREAK
1605 case 87:
1606 YY_RULE_SETUP
1607 #line 226 "swf4compiler.flex"
1608 { count();      return '{'; }
1609         YY_BREAK
1610 case 88:
1611 YY_RULE_SETUP
1612 #line 227 "swf4compiler.flex"
1613 { count();      return '}'; }
1614         YY_BREAK
1615 case 89:
1616 YY_RULE_SETUP
1617 #line 228 "swf4compiler.flex"
1618 { count();      return ','; }
1619         YY_BREAK
1620 case 90:
1621 YY_RULE_SETUP
1622 #line 229 "swf4compiler.flex"
1623 { count();      return '.'; }
1624         YY_BREAK
1625 case 91:
1626 YY_RULE_SETUP
1627 #line 230 "swf4compiler.flex"
1628 { count();      return '?'; }
1629         YY_BREAK
1630 case 92:
1631 YY_RULE_SETUP
1632 #line 231 "swf4compiler.flex"
1633 { count();      return ':'; }
1634         YY_BREAK
1635 case 93:
1636 /* rule 93 can match eol */
1637 YY_RULE_SETUP
1638 #line 233 "swf4compiler.flex"
1639 { count();      column = 0;
1640                                         strcpy(szLine, swf4text + 1);
1641                                         ++sLineNumber;  yyless(1);      }
1642         YY_BREAK
1643 case 94:
1644 YY_RULE_SETUP
1645 #line 237 "swf4compiler.flex"
1646 printf( "Unrecognized character: %s\n", swf4text );
1647         YY_BREAK
1648 case 95:
1649 YY_RULE_SETUP
1650 #line 239 "swf4compiler.flex"
1651 ECHO;
1652         YY_BREAK
1653 #line 1654 "lex.swf4.c"
1654 case YY_STATE_EOF(INITIAL):
1655         yyterminate();
1656
1657         case YY_END_OF_BUFFER:
1658                 {
1659                 /* Amount of text matched not including the EOB char. */
1660                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1661
1662                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1663                 *yy_cp = (yy_hold_char);
1664                 YY_RESTORE_YY_MORE_OFFSET
1665
1666                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1667                         {
1668                         /* We're scanning a new file or input source.  It's
1669                          * possible that this happened because the user
1670                          * just pointed swf4in at a new source and called
1671                          * swf4lex().  If so, then we have to assure
1672                          * consistency between YY_CURRENT_BUFFER and our
1673                          * globals.  Here is the right place to do so, because
1674                          * this is the first action (other than possibly a
1675                          * back-up) that will match for the new input source.
1676                          */
1677                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1678                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = swf4in;
1679                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1680                         }
1681
1682                 /* Note that here we test for yy_c_buf_p "<=" to the position
1683                  * of the first EOB in the buffer, since yy_c_buf_p will
1684                  * already have been incremented past the NUL character
1685                  * (since all states make transitions on EOB to the
1686                  * end-of-buffer state).  Contrast this with the test
1687                  * in input().
1688                  */
1689                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1690                         { /* This was really a NUL. */
1691                         yy_state_type yy_next_state;
1692
1693                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1694
1695                         yy_current_state = yy_get_previous_state(  );
1696
1697                         /* Okay, we're now positioned to make the NUL
1698                          * transition.  We couldn't have
1699                          * yy_get_previous_state() go ahead and do it
1700                          * for us because it doesn't know how to deal
1701                          * with the possibility of jamming (and we don't
1702                          * want to build jamming into it because then it
1703                          * will run more slowly).
1704                          */
1705
1706                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1707
1708                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1709
1710                         if ( yy_next_state )
1711                                 {
1712                                 /* Consume the NUL. */
1713                                 yy_cp = ++(yy_c_buf_p);
1714                                 yy_current_state = yy_next_state;
1715                                 goto yy_match;
1716                                 }
1717
1718                         else
1719                                 {
1720                                 yy_cp = (yy_c_buf_p);
1721                                 goto yy_find_action;
1722                                 }
1723                         }
1724
1725                 else switch ( yy_get_next_buffer(  ) )
1726                         {
1727                         case EOB_ACT_END_OF_FILE:
1728                                 {
1729                                 (yy_did_buffer_switch_on_eof) = 0;
1730
1731                                 if ( swf4wrap( ) )
1732                                         {
1733                                         /* Note: because we've taken care in
1734                                          * yy_get_next_buffer() to have set up
1735                                          * swf4text, we can now set up
1736                                          * yy_c_buf_p so that if some total
1737                                          * hoser (like flex itself) wants to
1738                                          * call the scanner after we return the
1739                                          * YY_NULL, it'll still work - another
1740                                          * YY_NULL will get returned.
1741                                          */
1742                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1743
1744                                         yy_act = YY_STATE_EOF(YY_START);
1745                                         goto do_action;
1746                                         }
1747
1748                                 else
1749                                         {
1750                                         if ( ! (yy_did_buffer_switch_on_eof) )
1751                                                 YY_NEW_FILE;
1752                                         }
1753                                 break;
1754                                 }
1755
1756                         case EOB_ACT_CONTINUE_SCAN:
1757                                 (yy_c_buf_p) =
1758                                         (yytext_ptr) + yy_amount_of_matched_text;
1759
1760                                 yy_current_state = yy_get_previous_state(  );
1761
1762                                 yy_cp = (yy_c_buf_p);
1763                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1764                                 goto yy_match;
1765
1766                         case EOB_ACT_LAST_MATCH:
1767                                 (yy_c_buf_p) =
1768                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1769
1770                                 yy_current_state = yy_get_previous_state(  );
1771
1772                                 yy_cp = (yy_c_buf_p);
1773                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1774                                 goto yy_find_action;
1775                         }
1776                 break;
1777                 }
1778
1779         default:
1780                 YY_FATAL_ERROR(
1781                         "fatal flex scanner internal error--no action found" );
1782         } /* end of action switch */
1783                 } /* end of scanning one token */
1784 } /* end of swf4lex */
1785
1786 /* yy_get_next_buffer - try to read in a new buffer
1787  *
1788  * Returns a code representing an action:
1789  *      EOB_ACT_LAST_MATCH -
1790  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1791  *      EOB_ACT_END_OF_FILE - end of file
1792  */
1793 static int yy_get_next_buffer (void)
1794 {
1795         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1796         register char *source = (yytext_ptr);
1797         register int number_to_move, i;
1798         int ret_val;
1799
1800         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1801                 YY_FATAL_ERROR(
1802                 "fatal flex scanner internal error--end of buffer missed" );
1803
1804         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1805                 { /* Don't try to fill the buffer, so this is an EOF. */
1806                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1807                         {
1808                         /* We matched a single character, the EOB, so
1809                          * treat this as a final EOF.
1810                          */
1811                         return EOB_ACT_END_OF_FILE;
1812                         }
1813
1814                 else
1815                         {
1816                         /* We matched some text prior to the EOB, first
1817                          * process it.
1818                          */
1819                         return EOB_ACT_LAST_MATCH;
1820                         }
1821                 }
1822
1823         /* Try to read more data. */
1824
1825         /* First move last chars to start of buffer. */
1826         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1827
1828         for ( i = 0; i < number_to_move; ++i )
1829                 *(dest++) = *(source++);
1830
1831         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1832                 /* don't do the read, it's not guaranteed to return an EOF,
1833                  * just force an EOF
1834                  */
1835                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1836
1837         else
1838                 {
1839                         int num_to_read =
1840                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1841
1842                 while ( num_to_read <= 0 )
1843                         { /* Not enough room in the buffer - grow it. */
1844
1845                         /* just a shorter name for the current buffer */
1846                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1847
1848                         int yy_c_buf_p_offset =
1849                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1850
1851                         if ( b->yy_is_our_buffer )
1852                                 {
1853                                 int new_size = b->yy_buf_size * 2;
1854
1855                                 if ( new_size <= 0 )
1856                                         b->yy_buf_size += b->yy_buf_size / 8;
1857                                 else
1858                                         b->yy_buf_size *= 2;
1859
1860                                 b->yy_ch_buf = (char *)
1861                                         /* Include room in for 2 EOB chars. */
1862                                         swf4realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1863                                 }
1864                         else
1865                                 /* Can't grow it, we don't own it. */
1866                                 b->yy_ch_buf = 0;
1867
1868                         if ( ! b->yy_ch_buf )
1869                                 YY_FATAL_ERROR(
1870                                 "fatal error - scanner input buffer overflow" );
1871
1872                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1873
1874                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1875                                                 number_to_move - 1;
1876
1877                         }
1878
1879                 if ( num_to_read > YY_READ_BUF_SIZE )
1880                         num_to_read = YY_READ_BUF_SIZE;
1881
1882                 /* Read in more data. */
1883                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1884                         (yy_n_chars), (size_t) num_to_read );
1885
1886                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1887                 }
1888
1889         if ( (yy_n_chars) == 0 )
1890                 {
1891                 if ( number_to_move == YY_MORE_ADJ )
1892                         {
1893                         ret_val = EOB_ACT_END_OF_FILE;
1894                         swf4restart(swf4in  );
1895                         }
1896
1897                 else
1898                         {
1899                         ret_val = EOB_ACT_LAST_MATCH;
1900                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1901                                 YY_BUFFER_EOF_PENDING;
1902                         }
1903                 }
1904
1905         else
1906                 ret_val = EOB_ACT_CONTINUE_SCAN;
1907
1908         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1909                 /* Extend the array by 50%, plus the number we really need. */
1910                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1911                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) swf4realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1912                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1913                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1914         }
1915
1916         (yy_n_chars) += number_to_move;
1917         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1918         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1919
1920         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1921
1922         return ret_val;
1923 }
1924
1925 /* yy_get_previous_state - get the state just before the EOB char was reached */
1926
1927     static yy_state_type yy_get_previous_state (void)
1928 {
1929         register yy_state_type yy_current_state;
1930         register char *yy_cp;
1931     
1932         yy_current_state = (yy_start);
1933
1934         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1935                 {
1936                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1937                 if ( yy_accept[yy_current_state] )
1938                         {
1939                         (yy_last_accepting_state) = yy_current_state;
1940                         (yy_last_accepting_cpos) = yy_cp;
1941                         }
1942                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1943                         {
1944                         yy_current_state = (int) yy_def[yy_current_state];
1945                         if ( yy_current_state >= 320 )
1946                                 yy_c = yy_meta[(unsigned int) yy_c];
1947                         }
1948                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1949                 }
1950
1951         return yy_current_state;
1952 }
1953
1954 /* yy_try_NUL_trans - try to make a transition on the NUL character
1955  *
1956  * synopsis
1957  *      next_state = yy_try_NUL_trans( current_state );
1958  */
1959     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1960 {
1961         register int yy_is_jam;
1962         register char *yy_cp = (yy_c_buf_p);
1963
1964         register YY_CHAR yy_c = 1;
1965         if ( yy_accept[yy_current_state] )
1966                 {
1967                 (yy_last_accepting_state) = yy_current_state;
1968                 (yy_last_accepting_cpos) = yy_cp;
1969                 }
1970         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1971                 {
1972                 yy_current_state = (int) yy_def[yy_current_state];
1973                 if ( yy_current_state >= 320 )
1974                         yy_c = yy_meta[(unsigned int) yy_c];
1975                 }
1976         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1977         yy_is_jam = (yy_current_state == 319);
1978
1979         return yy_is_jam ? 0 : yy_current_state;
1980 }
1981
1982     static void yyunput (int c, register char * yy_bp )
1983 {
1984         register char *yy_cp;
1985     
1986     yy_cp = (yy_c_buf_p);
1987
1988         /* undo effects of setting up swf4text */
1989         *yy_cp = (yy_hold_char);
1990
1991         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1992                 { /* need to shift things up to make room */
1993                 /* +2 for EOB chars. */
1994                 register int number_to_move = (yy_n_chars) + 2;
1995                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1996                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1997                 register char *source =
1998                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1999
2000                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2001                         *--dest = *--source;
2002
2003                 yy_cp += (int) (dest - source);
2004                 yy_bp += (int) (dest - source);
2005                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2006                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2007
2008                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2009                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2010                 }
2011
2012         *--yy_cp = (char) c;
2013
2014         (yytext_ptr) = yy_bp;
2015         (yy_hold_char) = *yy_cp;
2016         (yy_c_buf_p) = yy_cp;
2017 }
2018
2019 #ifndef YY_NO_INPUT
2020 #ifdef __cplusplus
2021     static int yyinput (void)
2022 #else
2023     static int input  (void)
2024 #endif
2025
2026 {
2027         int c;
2028     
2029         *(yy_c_buf_p) = (yy_hold_char);
2030
2031         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2032                 {
2033                 /* yy_c_buf_p now points to the character we want to return.
2034                  * If this occurs *before* the EOB characters, then it's a
2035                  * valid NUL; if not, then we've hit the end of the buffer.
2036                  */
2037                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2038                         /* This was really a NUL. */
2039                         *(yy_c_buf_p) = '\0';
2040
2041                 else
2042                         { /* need more input */
2043                         int offset = (yy_c_buf_p) - (yytext_ptr);
2044                         ++(yy_c_buf_p);
2045
2046                         switch ( yy_get_next_buffer(  ) )
2047                                 {
2048                                 case EOB_ACT_LAST_MATCH:
2049                                         /* This happens because yy_g_n_b()
2050                                          * sees that we've accumulated a
2051                                          * token and flags that we need to
2052                                          * try matching the token before
2053                                          * proceeding.  But for input(),
2054                                          * there's no matching to consider.
2055                                          * So convert the EOB_ACT_LAST_MATCH
2056                                          * to EOB_ACT_END_OF_FILE.
2057                                          */
2058
2059                                         /* Reset buffer status. */
2060                                         swf4restart(swf4in );
2061
2062                                         /*FALLTHROUGH*/
2063
2064                                 case EOB_ACT_END_OF_FILE:
2065                                         {
2066                                         if ( swf4wrap( ) )
2067                                                 return EOF;
2068
2069                                         if ( ! (yy_did_buffer_switch_on_eof) )
2070                                                 YY_NEW_FILE;
2071 #ifdef __cplusplus
2072                                         return yyinput();
2073 #else
2074                                         return input();
2075 #endif
2076                                         }
2077
2078                                 case EOB_ACT_CONTINUE_SCAN:
2079                                         (yy_c_buf_p) = (yytext_ptr) + offset;
2080                                         break;
2081                                 }
2082                         }
2083                 }
2084
2085         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
2086         *(yy_c_buf_p) = '\0';   /* preserve swf4text */
2087         (yy_hold_char) = *++(yy_c_buf_p);
2088
2089         return c;
2090 }
2091 #endif  /* ifndef YY_NO_INPUT */
2092
2093 /** Immediately switch to a different input stream.
2094  * @param input_file A readable stream.
2095  * 
2096  * @note This function does not reset the start condition to @c INITIAL .
2097  */
2098     void swf4restart  (FILE * input_file )
2099 {
2100     
2101         if ( ! YY_CURRENT_BUFFER ){
2102         swf4ensure_buffer_stack ();
2103                 YY_CURRENT_BUFFER_LVALUE =
2104             swf4_create_buffer(swf4in,YY_BUF_SIZE );
2105         }
2106
2107         swf4_init_buffer(YY_CURRENT_BUFFER,input_file );
2108         swf4_load_buffer_state( );
2109 }
2110
2111 /** Switch to a different input buffer.
2112  * @param new_buffer The new input buffer.
2113  * 
2114  */
2115     void swf4_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2116 {
2117     
2118         /* TODO. We should be able to replace this entire function body
2119          * with
2120          *              swf4pop_buffer_state();
2121          *              swf4push_buffer_state(new_buffer);
2122      */
2123         swf4ensure_buffer_stack ();
2124         if ( YY_CURRENT_BUFFER == new_buffer )
2125                 return;
2126
2127         if ( YY_CURRENT_BUFFER )
2128                 {
2129                 /* Flush out information for old buffer. */
2130                 *(yy_c_buf_p) = (yy_hold_char);
2131                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2132                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2133                 }
2134
2135         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2136         swf4_load_buffer_state( );
2137
2138         /* We don't actually know whether we did this switch during
2139          * EOF (swf4wrap()) processing, but the only time this flag
2140          * is looked at is after swf4wrap() is called, so it's safe
2141          * to go ahead and always set it.
2142          */
2143         (yy_did_buffer_switch_on_eof) = 1;
2144 }
2145
2146 static void swf4_load_buffer_state  (void)
2147 {
2148         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2149         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2150         swf4in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2151         (yy_hold_char) = *(yy_c_buf_p);
2152 }
2153
2154 /** Allocate and initialize an input buffer state.
2155  * @param file A readable stream.
2156  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2157  * 
2158  * @return the allocated buffer state.
2159  */
2160     YY_BUFFER_STATE swf4_create_buffer  (FILE * file, int  size )
2161 {
2162         YY_BUFFER_STATE b;
2163     
2164         b = (YY_BUFFER_STATE) swf4alloc(sizeof( struct yy_buffer_state )  );
2165         if ( ! b )
2166                 YY_FATAL_ERROR( "out of dynamic memory in swf4_create_buffer()" );
2167
2168         b->yy_buf_size = size;
2169
2170         /* yy_ch_buf has to be 2 characters longer than the size given because
2171          * we need to put in 2 end-of-buffer characters.
2172          */
2173         b->yy_ch_buf = (char *) swf4alloc(b->yy_buf_size + 2  );
2174         if ( ! b->yy_ch_buf )
2175                 YY_FATAL_ERROR( "out of dynamic memory in swf4_create_buffer()" );
2176
2177         b->yy_is_our_buffer = 1;
2178
2179         swf4_init_buffer(b,file );
2180
2181         return b;
2182 }
2183
2184 /** Destroy the buffer.
2185  * @param b a buffer created with swf4_create_buffer()
2186  * 
2187  */
2188     void swf4_delete_buffer (YY_BUFFER_STATE  b )
2189 {
2190     
2191         if ( ! b )
2192                 return;
2193
2194         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2195                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2196
2197         if ( b->yy_is_our_buffer )
2198                 swf4free((void *) b->yy_ch_buf  );
2199
2200         swf4free((void *) b  );
2201 }
2202
2203 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
2204 #ifdef __cplusplus
2205 extern "C" {
2206 #endif
2207 #ifdef __THROW /* this is a gnuism */
2208 extern int isatty (int ) __THROW;
2209 #else
2210 extern int isatty (int );
2211 #endif
2212 #ifdef __cplusplus
2213 }
2214 #endif
2215 #endif
2216     
2217 /* Initializes or reinitializes a buffer.
2218  * This function is sometimes called more than once on the same buffer,
2219  * such as during a swf4restart() or at EOF.
2220  */
2221     static void swf4_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
2222
2223 {
2224         int oerrno = errno;
2225     
2226         swf4_flush_buffer(b );
2227
2228         b->yy_input_file = file;
2229         b->yy_fill_buffer = 1;
2230
2231     /* If b is the current buffer, then swf4_init_buffer was _probably_
2232      * called from swf4restart() or through yy_get_next_buffer.
2233      * In that case, we don't want to reset the lineno or column.
2234      */
2235     if (b != YY_CURRENT_BUFFER){
2236         b->yy_bs_lineno = 1;
2237         b->yy_bs_column = 0;
2238     }
2239
2240         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2241     
2242         errno = oerrno;
2243 }
2244
2245 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2246  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2247  * 
2248  */
2249     void swf4_flush_buffer (YY_BUFFER_STATE  b )
2250 {
2251         if ( ! b )
2252                 return;
2253
2254         b->yy_n_chars = 0;
2255
2256         /* We always need two end-of-buffer characters.  The first causes
2257          * a transition to the end-of-buffer state.  The second causes
2258          * a jam in that state.
2259          */
2260         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2261         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2262
2263         b->yy_buf_pos = &b->yy_ch_buf[0];
2264
2265         b->yy_at_bol = 1;
2266         b->yy_buffer_status = YY_BUFFER_NEW;
2267
2268         if ( b == YY_CURRENT_BUFFER )
2269                 swf4_load_buffer_state( );
2270 }
2271
2272 /** Pushes the new state onto the stack. The new state becomes
2273  *  the current state. This function will allocate the stack
2274  *  if necessary.
2275  *  @param new_buffer The new state.
2276  *  
2277  */
2278 void swf4push_buffer_state (YY_BUFFER_STATE new_buffer )
2279 {
2280         if (new_buffer == NULL)
2281                 return;
2282
2283         swf4ensure_buffer_stack();
2284
2285         /* This block is copied from swf4_switch_to_buffer. */
2286         if ( YY_CURRENT_BUFFER )
2287                 {
2288                 /* Flush out information for old buffer. */
2289                 *(yy_c_buf_p) = (yy_hold_char);
2290                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2291                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2292                 }
2293
2294         /* Only push if top exists. Otherwise, replace top. */
2295         if (YY_CURRENT_BUFFER)
2296                 (yy_buffer_stack_top)++;
2297         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2298
2299         /* copied from swf4_switch_to_buffer. */
2300         swf4_load_buffer_state( );
2301         (yy_did_buffer_switch_on_eof) = 1;
2302 }
2303
2304 /** Removes and deletes the top of the stack, if present.
2305  *  The next element becomes the new top.
2306  *  
2307  */
2308 void swf4pop_buffer_state (void)
2309 {
2310         if (!YY_CURRENT_BUFFER)
2311                 return;
2312
2313         swf4_delete_buffer(YY_CURRENT_BUFFER );
2314         YY_CURRENT_BUFFER_LVALUE = NULL;
2315         if ((yy_buffer_stack_top) > 0)
2316                 --(yy_buffer_stack_top);
2317
2318         if (YY_CURRENT_BUFFER) {
2319                 swf4_load_buffer_state( );
2320                 (yy_did_buffer_switch_on_eof) = 1;
2321         }
2322 }
2323
2324 /* Allocates the stack if it does not exist.
2325  *  Guarantees space for at least one push.
2326  */
2327 static void swf4ensure_buffer_stack (void)
2328 {
2329         int num_to_alloc;
2330     
2331         if (!(yy_buffer_stack)) {
2332
2333                 /* First allocation is just for 2 elements, since we don't know if this
2334                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2335                  * immediate realloc on the next call.
2336          */
2337                 num_to_alloc = 1;
2338                 (yy_buffer_stack) = (struct yy_buffer_state**)swf4alloc
2339                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
2340                                                                 );
2341                 if ( ! (yy_buffer_stack) )
2342                         YY_FATAL_ERROR( "out of dynamic memory in swf4ensure_buffer_stack()" );
2343                                                                   
2344                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2345                                 
2346                 (yy_buffer_stack_max) = num_to_alloc;
2347                 (yy_buffer_stack_top) = 0;
2348                 return;
2349         }
2350
2351         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2352
2353                 /* Increase the buffer to prepare for a possible push. */
2354                 int grow_size = 8 /* arbitrary grow size */;
2355
2356                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2357                 (yy_buffer_stack) = (struct yy_buffer_state**)swf4realloc
2358                                                                 ((yy_buffer_stack),
2359                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
2360                                                                 );
2361                 if ( ! (yy_buffer_stack) )
2362                         YY_FATAL_ERROR( "out of dynamic memory in swf4ensure_buffer_stack()" );
2363
2364                 /* zero only the new slots.*/
2365                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2366                 (yy_buffer_stack_max) = num_to_alloc;
2367         }
2368 }
2369
2370 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2371  * @param base the character buffer
2372  * @param size the size in bytes of the character buffer
2373  * 
2374  * @return the newly allocated buffer state object. 
2375  */
2376 YY_BUFFER_STATE swf4_scan_buffer  (char * base, yy_size_t  size )
2377 {
2378         YY_BUFFER_STATE b;
2379     
2380         if ( size < 2 ||
2381              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2382              base[size-1] != YY_END_OF_BUFFER_CHAR )
2383                 /* They forgot to leave room for the EOB's. */
2384                 return 0;
2385
2386         b = (YY_BUFFER_STATE) swf4alloc(sizeof( struct yy_buffer_state )  );
2387         if ( ! b )
2388                 YY_FATAL_ERROR( "out of dynamic memory in swf4_scan_buffer()" );
2389
2390         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2391         b->yy_buf_pos = b->yy_ch_buf = base;
2392         b->yy_is_our_buffer = 0;
2393         b->yy_input_file = 0;
2394         b->yy_n_chars = b->yy_buf_size;
2395         b->yy_is_interactive = 0;
2396         b->yy_at_bol = 1;
2397         b->yy_fill_buffer = 0;
2398         b->yy_buffer_status = YY_BUFFER_NEW;
2399
2400         swf4_switch_to_buffer(b  );
2401
2402         return b;
2403 }
2404
2405 /** Setup the input buffer state to scan a string. The next call to swf4lex() will
2406  * scan from a @e copy of @a str.
2407  * @param yystr a NUL-terminated string to scan
2408  * 
2409  * @return the newly allocated buffer state object.
2410  * @note If you want to scan bytes that may contain NUL values, then use
2411  *       swf4_scan_bytes() instead.
2412  */
2413 YY_BUFFER_STATE swf4_scan_string (yyconst char * yystr )
2414 {
2415     
2416         return swf4_scan_bytes(yystr,strlen(yystr) );
2417 }
2418
2419 /** Setup the input buffer state to scan the given bytes. The next call to swf4lex() will
2420  * scan from a @e copy of @a bytes.
2421  * @param bytes the byte buffer to scan
2422  * @param len the number of bytes in the buffer pointed to by @a bytes.
2423  * 
2424  * @return the newly allocated buffer state object.
2425  */
2426 YY_BUFFER_STATE swf4_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2427 {
2428         YY_BUFFER_STATE b;
2429         char *buf;
2430         yy_size_t n;
2431         int i;
2432     
2433         /* Get memory for full buffer, including space for trailing EOB's. */
2434         n = _yybytes_len + 2;
2435         buf = (char *) swf4alloc(n  );
2436         if ( ! buf )
2437                 YY_FATAL_ERROR( "out of dynamic memory in swf4_scan_bytes()" );
2438
2439         for ( i = 0; i < _yybytes_len; ++i )
2440                 buf[i] = yybytes[i];
2441
2442         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2443
2444         b = swf4_scan_buffer(buf,n );
2445         if ( ! b )
2446                 YY_FATAL_ERROR( "bad buffer in swf4_scan_bytes()" );
2447
2448         /* It's okay to grow etc. this buffer, and we should throw it
2449          * away when we're done.
2450          */
2451         b->yy_is_our_buffer = 1;
2452
2453         return b;
2454 }
2455
2456 #ifndef YY_EXIT_FAILURE
2457 #define YY_EXIT_FAILURE 2
2458 #endif
2459
2460 static void yy_fatal_error (yyconst char* msg )
2461 {
2462         (void) fprintf( stderr, "%s\n", msg );
2463         exit( YY_EXIT_FAILURE );
2464 }
2465
2466 /* Redefine yyless() so it works in section 3 code. */
2467
2468 #undef yyless
2469 #define yyless(n) \
2470         do \
2471                 { \
2472                 /* Undo effects of setting up swf4text. */ \
2473         int yyless_macro_arg = (n); \
2474         YY_LESS_LINENO(yyless_macro_arg);\
2475                 swf4text[swf4leng] = (yy_hold_char); \
2476                 (yy_c_buf_p) = swf4text + yyless_macro_arg; \
2477                 (yy_hold_char) = *(yy_c_buf_p); \
2478                 *(yy_c_buf_p) = '\0'; \
2479                 swf4leng = yyless_macro_arg; \
2480                 } \
2481         while ( 0 )
2482
2483 /* Accessor  methods (get/set functions) to struct members. */
2484
2485 /** Get the current line number.
2486  * 
2487  */
2488 int swf4get_lineno  (void)
2489 {
2490         
2491     return swf4lineno;
2492 }
2493
2494 /** Get the input stream.
2495  * 
2496  */
2497 FILE *swf4get_in  (void)
2498 {
2499         return swf4in;
2500 }
2501
2502 /** Get the output stream.
2503  * 
2504  */
2505 FILE *swf4get_out  (void)
2506 {
2507         return swf4out;
2508 }
2509
2510 /** Get the length of the current token.
2511  * 
2512  */
2513 int swf4get_leng  (void)
2514 {
2515         return swf4leng;
2516 }
2517
2518 /** Get the current token.
2519  * 
2520  */
2521
2522 char *swf4get_text  (void)
2523 {
2524         return swf4text;
2525 }
2526
2527 /** Set the current line number.
2528  * @param line_number
2529  * 
2530  */
2531 void swf4set_lineno (int  line_number )
2532 {
2533     
2534     swf4lineno = line_number;
2535 }
2536
2537 /** Set the input stream. This does not discard the current
2538  * input buffer.
2539  * @param in_str A readable stream.
2540  * 
2541  * @see swf4_switch_to_buffer
2542  */
2543 void swf4set_in (FILE *  in_str )
2544 {
2545         swf4in = in_str ;
2546 }
2547
2548 void swf4set_out (FILE *  out_str )
2549 {
2550         swf4out = out_str ;
2551 }
2552
2553 int swf4get_debug  (void)
2554 {
2555         return swf4_flex_debug;
2556 }
2557
2558 void swf4set_debug (int  bdebug )
2559 {
2560         swf4_flex_debug = bdebug ;
2561 }
2562
2563 static int yy_init_globals (void)
2564 {
2565         /* Initialization is the same as for the non-reentrant scanner.
2566      * This function is called from swf4lex_destroy(), so don't allocate here.
2567      */
2568
2569     (yy_buffer_stack) = 0;
2570     (yy_buffer_stack_top) = 0;
2571     (yy_buffer_stack_max) = 0;
2572     (yy_c_buf_p) = (char *) 0;
2573     (yy_init) = 0;
2574     (yy_start) = 0;
2575
2576 /* Defined in main.c */
2577 #ifdef YY_STDINIT
2578     swf4in = stdin;
2579     swf4out = stdout;
2580 #else
2581     swf4in = (FILE *) 0;
2582     swf4out = (FILE *) 0;
2583 #endif
2584
2585     /* For future reference: Set errno on error, since we are called by
2586      * swf4lex_init()
2587      */
2588     return 0;
2589 }
2590
2591 /* swf4lex_destroy is for both reentrant and non-reentrant scanners. */
2592 int swf4lex_destroy  (void)
2593 {
2594     
2595     /* Pop the buffer stack, destroying each element. */
2596         while(YY_CURRENT_BUFFER){
2597                 swf4_delete_buffer(YY_CURRENT_BUFFER  );
2598                 YY_CURRENT_BUFFER_LVALUE = NULL;
2599                 swf4pop_buffer_state();
2600         }
2601
2602         /* Destroy the stack itself. */
2603         swf4free((yy_buffer_stack) );
2604         (yy_buffer_stack) = NULL;
2605
2606     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2607      * swf4lex() is called, initialization will occur. */
2608     yy_init_globals( );
2609
2610     return 0;
2611 }
2612
2613 /*
2614  * Internal utility routines.
2615  */
2616
2617 #ifndef yytext_ptr
2618 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2619 {
2620         register int i;
2621         for ( i = 0; i < n; ++i )
2622                 s1[i] = s2[i];
2623 }
2624 #endif
2625
2626 #ifdef YY_NEED_STRLEN
2627 static int yy_flex_strlen (yyconst char * s )
2628 {
2629         register int n;
2630         for ( n = 0; s[n]; ++n )
2631                 ;
2632
2633         return n;
2634 }
2635 #endif
2636
2637 void *swf4alloc (yy_size_t  size )
2638 {
2639         return (void *) malloc( size );
2640 }
2641
2642 void *swf4realloc  (void * ptr, yy_size_t  size )
2643 {
2644         /* The cast to (char *) in the following accommodates both
2645          * implementations that use char* generic pointers, and those
2646          * that use void* generic pointers.  It works with the latter
2647          * because both ANSI C and C++ allow castless assignment from
2648          * any pointer type to void*, and deal with argument conversions
2649          * as though doing an assignment.
2650          */
2651         return (void *) realloc( (char *) ptr, size );
2652 }
2653
2654 void swf4free (void * ptr )
2655 {
2656         free( (char *) ptr );   /* see swf4realloc() for (char *) cast */
2657 }
2658
2659 #define YYTABLES_NAME "yytables"
2660
2661 #line 239 "swf4compiler.flex"
2662
2663
2664 static int getinput() {
2665 #ifdef __cplusplus
2666                                         return yyinput();
2667 #else
2668                                         return input();
2669 #endif
2670 }
2671
2672 int swf4wrap()
2673 {
2674   return 1;
2675 }
2676
2677 static void countline()
2678 {
2679   if(sLineNumber != 0)
2680     msgline[column] = 0;
2681
2682   ++sLineNumber;
2683   column = 0;
2684   msgline = msgbufs[sLineNumber & 1];
2685 }
2686
2687 static int LineNumber(void)
2688 {
2689    return (sLineNumber + 1);
2690 }
2691
2692 static int ColumnNumber(void)
2693 {
2694    return column;
2695 }
2696
2697 static char *LineText(void)
2698 {
2699   msgline[column] = 0;
2700   return msgline;
2701 }
2702
2703 static void comment(void)
2704 {
2705    // Handle block comments
2706
2707    int c, c1;
2708
2709 loop:
2710    // We have the start of a comment so look skip everything up to the
2711    // end of the comment character
2712    while ((c = getinput()) != '*' && c != EOF)
2713    {
2714       if(column < 1023)
2715          msgline[column] = c;
2716
2717       ++column;
2718
2719       // keep the line number in synch
2720       if (c == '\n')
2721       {
2722          // start the output (matches the algorithim in the lexx above)
2723          countline();
2724       }
2725
2726       if (swf4debug) putchar(c);
2727    }
2728
2729    // is this the end of comment character
2730    if ((c1 = getinput()) != '/' && c != EOF)
2731    {
2732       // false start as this was no end of comment
2733       do_unput4(c1);
2734       goto loop;
2735    }
2736
2737    // write out the start of the end of comment
2738    if (c != EOF)
2739       if (swf4debug) putchar(c);
2740
2741    // write out the end of the end of comment
2742    if (c1 != EOF) 
2743       if (swf4debug) putchar(c1);
2744 }
2745
2746 static void comment1(void)
2747 {
2748    // Handle comment of type 1 (ie '//')
2749
2750    int c;
2751
2752    // this is a line comment
2753    while ((c = getinput()) != '\n' && c != EOF)
2754    {
2755       if (swf4debug) putchar(c);
2756
2757       if(column < 1023)
2758          msgline[column] = c;
2759
2760       ++column;
2761    };
2762
2763    // keep the line number in synch
2764    if (c == '\n')
2765    {
2766       if (swf4debug) putchar(c);
2767
2768       countline();
2769    }
2770 }
2771
2772 static void count(void)
2773 {
2774    int n;
2775
2776    // Count the characters to maintain the current column position
2777    if (swf4text[0] == '\n')
2778    {
2779       if (swf4debug) printf("\n");
2780    }
2781    else
2782    {
2783       if (swf4debug) printf("%s", swf4text);
2784
2785       for(n=0; n<swf4leng; ++n, ++column)
2786       {
2787         if(column < 1023)
2788           msgline[column] = swf4text[n];
2789       }
2790
2791       //-- keep writing the stuff to standard output
2792       //column += swf4leng;
2793    }
2794 }
2795
2796 static void printprog()
2797 {
2798   if(sLineNumber)
2799     SWF_warn("\n%s", msgbufs[(sLineNumber-1)&1]);
2800
2801   if(column < 1023)
2802     msgline[column] = 0;
2803
2804   SWF_warn("\n%s", msgline);
2805 }
2806
2807 static void warning(char *msg)
2808 {
2809    // print a warning message
2810    printprog();
2811    SWF_warn("\n%*s", ColumnNumber(), "^");
2812    SWF_warn("\nLine %4.4d:  Reason: '%s' \n", LineNumber(), msg);
2813 }
2814
2815 void swf4error(char *msg)
2816 {
2817   // report a error
2818   if(strlen(swf4text))
2819   {
2820     SWF_error("\n%s\n%*s\nLine %i:  Reason: '%s'\n",
2821               LineText(), ColumnNumber(), "^", LineNumber(), msg);
2822   }
2823   else
2824   {
2825     SWF_error("\nLine %d: Reason: 'Unexpected EOF found while looking for input.'\n", LineNumber());
2826   }
2827 }
2828