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