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