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