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