implemented two-pass compiling
[swftools.git] / lib / as3 / tokenizer.yy.c
1 #line 2 "tokenizer.yy.c"
2
3 #line 4 "tokenizer.yy.c"
4
5 #define  YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define yy_create_buffer avm2__create_buffer
10 #define yy_delete_buffer avm2__delete_buffer
11 #define yy_flex_debug avm2__flex_debug
12 #define yy_init_buffer avm2__init_buffer
13 #define yy_flush_buffer avm2__flush_buffer
14 #define yy_load_buffer_state avm2__load_buffer_state
15 #define yy_switch_to_buffer avm2__switch_to_buffer
16 #define yyin avm2_in
17 #define yyleng avm2_leng
18 #define yylex avm2_lex
19 #define yylineno avm2_lineno
20 #define yyout avm2_out
21 #define yyrestart avm2_restart
22 #define yytext avm2_text
23 #define yywrap avm2_wrap
24 #define yyalloc avm2_alloc
25 #define yyrealloc avm2_realloc
26 #define yyfree avm2_free
27
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35
36 /* First, we deal with  platform-specific or compiler-specific issues. */
37
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43
44 /* end standard C headers. */
45
46 /* flex integer type definitions */
47
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56  * if you want the limit (max/min) macros for int types. 
57  */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t; 
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
76 #endif /* ! C99 */
77
78 /* Limits of integral types. */
79 #ifndef INT8_MIN
80 #define INT8_MIN               (-128)
81 #endif
82 #ifndef INT16_MIN
83 #define INT16_MIN              (-32767-1)
84 #endif
85 #ifndef INT32_MIN
86 #define INT32_MIN              (-2147483647-1)
87 #endif
88 #ifndef INT8_MAX
89 #define INT8_MAX               (127)
90 #endif
91 #ifndef INT16_MAX
92 #define INT16_MAX              (32767)
93 #endif
94 #ifndef INT32_MAX
95 #define INT32_MAX              (2147483647)
96 #endif
97 #ifndef UINT8_MAX
98 #define UINT8_MAX              (255U)
99 #endif
100 #ifndef UINT16_MAX
101 #define UINT16_MAX             (65535U)
102 #endif
103 #ifndef UINT32_MAX
104 #define UINT32_MAX             (4294967295U)
105 #endif
106
107 #endif /* ! FLEXINT_H */
108
109 #ifdef __cplusplus
110
111 /* The "const" storage-class-modifier is valid. */
112 #define YY_USE_CONST
113
114 #else   /* ! __cplusplus */
115
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
118
119 #define YY_USE_CONST
120
121 #endif  /* defined (__STDC__) */
122 #endif  /* ! __cplusplus */
123
124 #ifdef YY_USE_CONST
125 #define yyconst const
126 #else
127 #define yyconst
128 #endif
129
130 /* Returned upon end-of-file. */
131 #define YY_NULL 0
132
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134  * integer for use as an array index.  If the signed char is negative,
135  * we want to instead treat it as an 8-bit unsigned char, hence the
136  * double cast.
137  */
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139
140 /* Enter a start condition.  This macro really ought to take a parameter,
141  * but we do it the disgusting crufty way forced on us by the ()-less
142  * definition of BEGIN.
143  */
144 #define BEGIN (yy_start) = 1 + 2 *
145
146 /* Translate the current start state into a value that can be later handed
147  * to BEGIN to return to the state.  The YYSTATE alias is for lex
148  * compatibility.
149  */
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
152
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE avm2_restart(avm2_in  )
158
159 #define YY_END_OF_BUFFER_CHAR 0
160
161 /* Size of default input buffer. */
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE 16384
164 #endif
165
166 /* The state buf must be large enough to hold one state per character in the main buffer.
167  */
168 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
173 #endif
174
175 extern int avm2_leng;
176
177 extern FILE *avm2_in, *avm2_out;
178
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182
183     #define YY_LESS_LINENO(n)
184     
185 /* Return all but the first "n" matched characters back to the input stream. */
186 #define yyless(n) \
187         do \
188                 { \
189                 /* Undo effects of setting up avm2_text. */ \
190         int yyless_macro_arg = (n); \
191         YY_LESS_LINENO(yyless_macro_arg);\
192                 *yy_cp = (yy_hold_char); \
193                 YY_RESTORE_YY_MORE_OFFSET \
194                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
195                 YY_DO_BEFORE_ACTION; /* set up avm2_text again */ \
196                 } \
197         while ( 0 )
198
199 #define unput(c) yyunput( c, (yytext_ptr)  )
200
201 #ifndef YY_TYPEDEF_YY_SIZE_T
202 #define YY_TYPEDEF_YY_SIZE_T
203 typedef size_t yy_size_t;
204 #endif
205
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
209         {
210         FILE *yy_input_file;
211
212         char *yy_ch_buf;                /* input buffer */
213         char *yy_buf_pos;               /* current position in input buffer */
214
215         /* Size of input buffer in bytes, not including room for EOB
216          * characters.
217          */
218         yy_size_t yy_buf_size;
219
220         /* Number of characters read into yy_ch_buf, not including EOB
221          * characters.
222          */
223         int yy_n_chars;
224
225         /* Whether we "own" the buffer - i.e., we know we created it,
226          * and can realloc() it to grow it, and should free() it to
227          * delete it.
228          */
229         int yy_is_our_buffer;
230
231         /* Whether this is an "interactive" input source; if so, and
232          * if we're using stdio for input, then we want to use getc()
233          * instead of fread(), to make sure we stop fetching input after
234          * each newline.
235          */
236         int yy_is_interactive;
237
238         /* Whether we're considered to be at the beginning of a line.
239          * If so, '^' rules will be active on the next match, otherwise
240          * not.
241          */
242         int yy_at_bol;
243
244     int yy_bs_lineno; /**< The line count. */
245     int yy_bs_column; /**< The column count. */
246     
247         /* Whether to try to fill the input buffer when we reach the
248          * end of it.
249          */
250         int yy_fill_buffer;
251
252         int yy_buffer_status;
253
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256         /* When an EOF's been seen but there's still some text to process
257          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258          * shouldn't try reading from the input source any more.  We might
259          * still have a bunch of tokens to match, though, because of
260          * possible backing-up.
261          *
262          * When we actually see the EOF, we change the status to "new"
263          * (via avm2_restart()), so that the user can continue scanning by
264          * just pointing avm2_in at a new input file.
265          */
266 #define YY_BUFFER_EOF_PENDING 2
267
268         };
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
270
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
273 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
274 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
275
276 /* We provide macros for accessing buffer states in case in the
277  * future we want to put the buffer states in a more general
278  * "scanner state".
279  *
280  * Returns the top of the stack, or NULL.
281  */
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
284                           : NULL)
285
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287  * NULL or when we need an lvalue. For internal use only.
288  */
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
290
291 /* yy_hold_char holds the character lost when avm2_text is formed. */
292 static char yy_hold_char;
293 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
294 int avm2_leng;
295
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0;         /* whether we need to initialize */
299 static int yy_start = 0;        /* start state number */
300
301 /* Flag which is used to allow avm2_wrap()'s to do buffer switches
302  * instead of setting up a fresh avm2_in.  A bit of a hack ...
303  */
304 static int yy_did_buffer_switch_on_eof;
305
306 void avm2_restart (FILE *input_file  );
307 void avm2__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
308 YY_BUFFER_STATE avm2__create_buffer (FILE *file,int size  );
309 void avm2__delete_buffer (YY_BUFFER_STATE b  );
310 void avm2__flush_buffer (YY_BUFFER_STATE b  );
311 void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer  );
312 void avm2_pop_buffer_state (void );
313
314 static void avm2_ensure_buffer_stack (void );
315 static void avm2__load_buffer_state (void );
316 static void avm2__init_buffer (YY_BUFFER_STATE b,FILE *file  );
317
318 #define YY_FLUSH_BUFFER avm2__flush_buffer(YY_CURRENT_BUFFER )
319
320 YY_BUFFER_STATE avm2__scan_buffer (char *base,yy_size_t size  );
321 YY_BUFFER_STATE avm2__scan_string (yyconst char *yy_str  );
322 YY_BUFFER_STATE avm2__scan_bytes (yyconst char *bytes,int len  );
323
324 void *avm2_alloc (yy_size_t  );
325 void *avm2_realloc (void *,yy_size_t  );
326 void avm2_free (void *  );
327
328 #define yy_new_buffer avm2__create_buffer
329
330 #define yy_set_interactive(is_interactive) \
331         { \
332         if ( ! YY_CURRENT_BUFFER ){ \
333         avm2_ensure_buffer_stack (); \
334                 YY_CURRENT_BUFFER_LVALUE =    \
335             avm2__create_buffer(avm2_in,YY_BUF_SIZE ); \
336         } \
337         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
338         }
339
340 #define yy_set_bol(at_bol) \
341         { \
342         if ( ! YY_CURRENT_BUFFER ){\
343         avm2_ensure_buffer_stack (); \
344                 YY_CURRENT_BUFFER_LVALUE =    \
345             avm2__create_buffer(avm2_in,YY_BUF_SIZE ); \
346         } \
347         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
348         }
349
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
351
352 /* Begin user sect3 */
353
354 typedef unsigned char YY_CHAR;
355
356 FILE *avm2_in = (FILE *) 0, *avm2_out = (FILE *) 0;
357
358 typedef int yy_state_type;
359
360 extern int avm2_lineno;
361
362 int avm2_lineno = 1;
363
364 extern char *avm2_text;
365 #define yytext_ptr avm2_text
366
367 static yy_state_type yy_get_previous_state (void );
368 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
369 static int yy_get_next_buffer (void );
370 static void yy_fatal_error (yyconst char msg[]  );
371
372 /* Done after the current pattern has been matched and before the
373  * corresponding action - sets up avm2_text.
374  */
375 #define YY_DO_BEFORE_ACTION \
376         (yytext_ptr) = yy_bp; \
377         avm2_leng = (size_t) (yy_cp - yy_bp); \
378         (yy_hold_char) = *yy_cp; \
379         *yy_cp = '\0'; \
380         (yy_c_buf_p) = yy_cp;
381
382 #define YY_NUM_RULES 106
383 #define YY_END_OF_BUFFER 107
384 /* This struct is not used in this scanner,
385    but its presence is necessary. */
386 struct yy_trans_info
387         {
388         flex_int32_t yy_verify;
389         flex_int32_t yy_nxt;
390         };
391 static yyconst flex_int16_t yy_accept[468] =
392     {   0,
393         0,    0,    0,    0,    0,    0,  107,  105,   13,   13,
394       103,  105,  103,  103,  103,  105,  104,  103,  103,  103,
395        51,  103,   16,   16,   16,   53,  103,  103,  103,  102,
396       103,  102,  102,  102,  102,  102,  102,  102,  102,  102,
397       102,  102,  102,  102,  102,  102,  102,  102,  103,  105,
398       102,  103,  103,   51,  103,   10,   10,   10,   29,    0,
399         6,    0,   40,   27,    0,    0,   41,   36,   37,   35,
400        38,   50,   17,    3,    0,   39,   17,   16,    0,    0,
401        52,   46,   34,   32,   33,   48,    0,  102,    0,  101,
402       102,  102,  102,  102,  102,   24,  102,  102,  102,  102,
403
404       102,  102,  102,  102,  102,  100,  102,   99,   98,  102,
405       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
406       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
407        42,   28,    0,   99,    0,   10,   10,   11,    0,    3,
408         7,   39,    0,   11,   10,    0,   30,   49,    0,    0,
409         0,    0,    0,    1,   17,   15,   14,    0,   44,   31,
410        43,   47,    0,    0,    0,    0,    0,  102,  102,  102,
411       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
412        23,  102,   94,  102,  102,  102,  102,  102,   93,  102,
413       102,  102,  102,  102,  102,  102,   95,  102,  102,  102,
414
415       102,  102,   97,  102,  102,   92,   96,  102,  102,  102,
416        12,  102,   11,   11,    0,    7,    0,    0,    0,    7,
417         0,    7,    7,   11,    9,    8,    0,    0,    0,    2,
418         0,   15,    0,   45,    0,    0,    0,    0,  102,   90,
419       102,  102,  102,  102,  102,  102,  102,   85,   89,  102,
420       102,  102,  102,  102,  102,  102,  102,  102,  102,   88,
421       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
422        87,  102,  102,   86,  102,   91,  102,   11,    9,    8,
423         7,    0,    7,    0,    0,    2,    0,    7,    7,    9,
424         0,    2,   18,   20,    0,    0,    0,   83,   80,   78,
425
426        79,  102,  102,  102,  102,  102,   82,   81,  102,  102,
427       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
428       102,  102,   84,  102,   77,  102,  102,   25,  102,    9,
429         0,    0,    2,    0,    7,    7,   19,    0,    0,  102,
430       102,   70,  102,  102,  102,  102,  102,   75,  102,  102,
431       102,  102,   73,  102,  102,  102,  102,   72,   71,   74,
432        26,   76,  102,  102,    7,    0,    0,  102,   65,   68,
433        69,   64,  102,  102,  102,  102,  102,  102,  102,   66,
434        67,  102,  102,  102,    7,    0,   21,   60,   63,  102,
435       102,  102,   62,  102,   61,  102,  102,    0,   22,  102,
436
437       102,   56,   57,   58,   59,    0,    0,    0,    0,   55,
438        54,    0,    5,    0,    0,    0,    0,    0,    0,    0,
439         0,    0,    0,    0,    0,    5,    0,    0,    0,    0,
440         0,    0,    4,    0,    0,    4,    0,    5,    0,    0,
441         0,    0,   20,    5,   20,   20,    0,    0,    0,   19,
442         5,   19,   19,    0,    0,    0,    0,    0,   21,    5,
443        21,   21,   22,    5,   22,   22,    0
444     } ;
445
446 static yyconst flex_int32_t yy_ec[256] =
447     {   0,
448         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
449         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
450         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
451         1,    4,    5,    6,    7,    8,    9,   10,   11,    8,
452        12,   13,   14,    8,   15,   16,   17,   18,   19,   19,
453        20,   19,   19,   19,   19,   19,   19,   21,    8,   22,
454        23,   24,    8,    8,   25,   25,   25,   25,   25,   25,
455        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
456        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
457         8,   26,   27,    8,   28,    7,   29,   30,   31,   32,
458
459        33,   34,   35,   36,   37,   25,   38,   39,   40,   41,
460        42,   43,   25,   44,   45,   46,   47,   48,   49,   50,
461        51,   25,    8,   52,    8,    8,    7,    7,    7,    7,
462         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
463         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
464         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
465         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
466         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
467         7,    7,    7,    7,    7,    7,   53,    7,    7,    7,
468        54,    7,    7,    7,    7,    7,    7,    7,    7,    7,
469
470         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
471         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
472         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
473         7,    7,    7,    7,    7,    7,    7,    7,   55,    7,
474         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
475         7,    7,    7,    7,    7
476     } ;
477
478 static yyconst flex_int32_t yy_meta[56] =
479     {   0,
480         1,    2,    3,    2,    4,    4,    4,    4,    4,    4,
481         4,    4,    4,    4,    4,    5,    4,    6,    6,    6,
482         2,    4,    4,    4,    7,    8,    4,    8,    7,    7,
483         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
484         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
485         7,    4,    4,    4,    4
486     } ;
487
488 static yyconst flex_int16_t yy_base[495] =
489     {   0,
490         0,  420,   42,   49,   56,   63,  455, 2184, 2184, 2184,
491       431,   78, 2184,  427,  436,   76, 2184,  418,   71,   73,
492        73,   82,   90,   95,  100,  415,   75,  406,   98,  121,
493      2184,  124,  127,  131,  108,  107,  114,  125,  143,  147,
494       126,  158,  162,  170,  179,  186,  193,  200,   80,  365,
495       376,  227,  233,  239,  247,  247,  256,  261,  391,  172,
496      2184,  403, 2184, 2184,  155,  400, 2184, 2184, 2184, 2184,
497      2184,  384,  264,  285,  393, 2184,  271,  276,  379,  344,
498      2184,  362, 2184,  360, 2184,  115,  297,  264,  305,  275,
499       282,  281,  283,  290,  299,  301,  305,  320,  313,  324,
500
501       306,  332,  336,  340,  347,  348,  355,  362,  363,  370,
502       382,  384,  386,  391,  398,  409,  403,  414,  405,  423,
503       430,  429,  435,  441,  446,  458,  450,  464,  470,  469,
504      2184, 2184,  318,  485,  499,  516,  521,  502,  207,  541,
505       565,  208,  245,  527,  532,  352, 2184, 2184,  558,  561,
506       574,  350,  361, 2184,  537,    0,  344,  339, 2184, 2184,
507      2184,  333,  615,  294,  274,  264,  249,  484,  540,  541,
508       591,  592,  593,  611,  600,  612,  623,  628,  629,  630,
509       634,  646,  650,  651,  652,  666,  667,  673,  672,  674,
510       678,  689,  690,  694,  695,  706,  710,  712,  717,  718,
511
512       726,  733,  732,  734,  748,  740,  741,  756,  755,  757,
513      2184,  762,  566,  605,  262,    0,  804,  807,  810,  252,
514       836,    0,  846,  608,    0,  252,  162,  813,  839,  244,
515       842,    0,  210, 2184,    0,  200,  203,  201,  790,  818,
516       822,  869,  870,  876,  878,  890,  895,  899,  901,  910,
517       915,  916,  917,  931,  932,  933,  938,  939,  950,  954,
518       958,  962,  966,  970,  977,  978,  984,  986,  998, 1002,
519      1003, 1004, 1018, 1019, 1020, 1025, 1026,  664,    0,  212,
520         0, 1053, 1079, 1134, 1137,  197, 1140, 1166,    0,    0,
521      1221, 2184, 2184, 2184,    0,  165,  167, 1116, 1117, 1123,
522
523      1197, 1201, 1202, 1216, 1217, 1218, 1222, 1223, 1234, 1238,
524      1240, 1246, 1249, 1262, 1264, 1270, 1279, 1271, 1291, 1295,
525      1286, 1300, 1306, 1307, 1311, 1318, 1322, 1326, 1334,    0,
526      1368, 1376,    0, 1394,    0,    0, 2184,  165,  130, 1333,
527      1345, 1359, 1361, 1370, 1375, 1377, 1389, 1394, 1396, 1395,
528      1400, 1401, 1412, 1416, 1417, 1424, 1423, 1431, 1432, 1438,
529      1439, 1443, 1447, 1454,  145,   81,    0, 1461, 1462, 1463,
530      1468, 1469, 1477, 1483, 1484, 1498, 1491, 1503, 1502, 1507,
531      1509, 1514, 1521,  900,   95,    0, 2184, 1523, 1528, 1529,
532      1530, 1544, 1537, 1545, 1551, 1553, 1559, 1600, 2184, 1568,
533
534      1580, 1576, 1587, 1588, 1594,  740,  184, 1636, 1639, 1606,
535      1615,  863,  866, 1032, 1072,  187, 1225,  104,  181, 1648,
536      1664, 1675, 1678, 1690, 1693, 1696, 1701, 1705, 1709, 1712,
537      1716, 1719, 1751,   98, 1754, 1760, 1763, 1766, 1792, 1776,
538      1780, 1784, 1769, 1772, 1787, 1808, 1847, 1820, 1826, 1823,
539      1829, 1832, 1835, 1873, 1839, 1876, 1912, 1967, 1879, 1882,
540      1885, 1888, 1891, 1894, 1903, 1906, 2184, 2022, 2030, 2037,
541      2045, 2053, 2061, 2065, 2072, 2076, 2083, 2086, 2089,   83,
542      2096, 2099, 2106, 2114, 2114, 2121, 2129, 2134, 2139, 2144,
543      2151, 2159, 2167, 2175
544
545     } ;
546
547 static yyconst flex_int16_t yy_def[495] =
548     {   0,
549       467,    1,    1,    1,    1,    1,  467,  467,  467,  467,
550       467,  468,  467,  467,  467,  469,  467,  467,  467,  467,
551       467,  467,  467,  467,  467,  467,  467,  467,  467,  470,
552       467,  470,  470,  470,   34,   34,   34,   34,   34,   34,
553        34,   34,   34,   34,   34,   39,   34,   34,  467,  467,
554        39,  467,  467,  467,  471,  467,  467,  467,  467,  468,
555       467,  468,  467,  467,  469,  469,  467,  467,  467,  467,
556       467,  467,  467,  472,  473,  467,  467,  467,  474,  467,
557       467,  467,  467,  467,  467,  467,  467,   34,  467,   34,
558        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
559
560        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
561        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
562        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
563       467,  467,  467,   34,  467,  467,  467,  467,  471,  475,
564       473,  471,  471,  467,  467,  476,  467,  467,  472,  472,
565       477,  467,  473,  467,  467,  478,  474,  467,  467,  467,
566       467,  467,  467,  467,  467,  467,  467,   34,   34,   34,
567        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
568        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
569        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
570
571        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
572       467,   34,  467,  467,  479,  480,  475,  475,  481,  480,
573       475,  141,  471,  467,  482,  476,  483,  472,  477,  467,
574       472,  478,  467,  467,  484,  467,  467,  467,   34,   34,
575        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
576        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
577        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
578        34,   34,   34,   34,   34,   34,   34,  467,  485,  479,
579       480,  486,  467,  475,  481,  480,  475,  467,  223,  482,
580       472,  467,  467,  467,  487,  467,  467,   34,   34,   34,
581
582        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
583        34,   34,   39,   34,   34,   34,   34,   34,   34,   34,
584        34,   34,   34,   34,   34,   34,   34,   34,   34,  485,
585       475,  475,  480,  475,  283,  288,  467,  467,  467,   34,
586        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
587        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
588        34,   34,   34,   34,  223,  467,  488,   34,   34,   34,
589        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
590        34,   34,   34,  470,  283,  489,  467,   34,   34,   34,
591        34,   34,   34,   34,   34,   34,   34,  490,  467,   34,
592
593        34,   34,   34,   34,   34,  491,  492,  493,  491,   34,
594        34,  467,  467,  491,  491,  492,  467,  492,  494,  494,
595       493,  493,  491,  493,  467,  467,  491,  491,  491,  491,
596       491,  467,  467,  494,  467,  467,  491,  494,  491,  491,
597       491,  491,  467,  467,  491,  491,  491,  491,  491,  467,
598       467,  491,  491,  491,  491,  491,  491,  491,  467,  467,
599       491,  491,  467,  467,  491,  491,    0,  467,  467,  467,
600       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
601       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
602       467,  467,  467,  467
603
604     } ;
605
606 static yyconst flex_int16_t yy_nxt[2240] =
607     {   0,
608         8,    9,   10,    9,   11,   12,    8,   13,   14,   15,
609        16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
610        26,   27,   28,   29,   30,    8,   31,   30,   32,   33,
611        34,   35,   36,   37,   38,   30,   39,   30,   30,   30,
612        40,   41,   42,   43,   44,   45,   46,   47,   48,   30,
613        30,   49,    8,    8,   50,   52,   53,   54,   55,   56,
614        57,   58,   52,   53,   54,   55,   56,   57,   58,   52,
615        53,   54,   55,   56,   57,   58,   52,   53,   54,   55,
616        56,   57,   58,   61,   68,   51,   61,   70,   72,  281,
617        73,   73,   73,   69,   74,   71,   82,   83,   75,   51,
618
619       419,   66,  131,   62,   76,   77,  416,   78,   78,   78,
620        77,  152,   78,   78,   78,   77,  386,   78,   78,   78,
621        85,   86,   87,   87,   87,   87,   87,   87,   87,   87,
622        87,  132,   87,   87,   87,   98,   88,  161,  162,   79,
623        95,   89,  101,   80,   89,   99,   88,   89,   88,   96,
624       102,   89,   88,   88,   88,  103,  100,  105,   97,   92,
625       104,  385,  367,   88,   88,   61,   88,   88,   90,   93,
626        91,   88,   94,  113,  291,  110,  106,   61,  292,  111,
627        66,   88,  107,  108,   88,   88,  114,  109,   88,  417,
628        88,  417,  417,  112,  117,  366,   88,   62,   88,   88,
629
630        88,  115,  118,   88,  116,  339,  434,   88,   88,  418,
631       338,   88,  418,  231,  122,  119,  120,   88,  121,   88,
632        88,  127,  123,  216,  216,   88,  125,  279,   88,  124,
633       126,   88,  143,  143,  128,  129,  130,  297,   88,  296,
634        68,   88,  135,  295,  136,  137,  137,   70,  135,   69,
635       136,  137,  137,  293,   72,   71,  138,  138,  138,  140,
636       231,  223,  144,  141,  145,  145,  145,  225,  231,  142,
637       143,  144,  143,  145,  145,  145,  144,  279,  145,  145,
638       145,   73,   73,   73,  238,  149,  149,  149,  155,  155,
639       155,   77,   88,   78,   78,   78,  146,  151,   87,   87,
640
641        87,  152,   88,   88,   80,   88,  163,  163,  163,   88,
642        88,  171,  237,   88,  168,  236,   88,   89,   88,   88,
643        88,   88,   88,   88,   88,  169,  170,   88,   88,   88,
644       172,   88,  173,   88,   88,  235,  164,  174,  165,   88,
645        88,   88,   88,   88,  179,  175,   88,   88,   88,  166,
646       176,   88,   88,  167,   88,  234,  233,  177,   88,  156,
647        88,   88,   88,  154,   88,   88,  231,  225,   88,  178,
648        88,  211,  180,   88,   88,   88,   88,   88,   88,  181,
649       182,   88,  160,   88,  159,   88,   88,  158,   88,   88,
650        88,   88,  183,   88,  156,  154,   88,  184,   88,  148,
651
652        88,   88,   65,   88,   88,   60,  185,  186,   88,  187,
653        88,   88,   88,  147,   88,  188,  134,  133,  191,   88,
654        88,  192,  190,   88,   88,   88,   88,   88,   84,   88,
655       189,   88,   88,  198,  193,   81,   88,   88,  195,  194,
656        67,   88,   88,   88,   88,   64,   88,   88,  196,   63,
657        88,   88,   88,   59,  467,   88,   51,   88,   88,  197,
658       467,   88,  467,   88,   88,  199,  200,   88,   88,   88,
659        88,   88,  201,   88,   88,  467,   88,  205,   88,   88,
660       467,  202,   88,  204,   88,  203,   88,   88,   88,  467,
661       206,   88,   88,  207,  467,  467,   88,   88,   88,   88,
662
663       208,  467,   88,  467,  467,   88,  209,   88,   88,  467,
664        88,   88,  239,   88,  210,  212,  213,  213,  213,  138,
665       138,  138,   88,   88,  467,   88,   88,  467,  467,  185,
666       186,  214,  467,  137,  137,  137,  214,  467,  137,  137,
667       137,  217,  217,  149,  224,  224,  224,  144,  467,  145,
668       145,  145,  467,  219,  155,  155,  155,  220,  149,  149,
669       149,  149,  149,  149,  467,  215,  221,  154,   88,   88,
670       227,  241,  240,  227,  228,  228,  228,  467,   88,   88,
671       467,   88,   88,  213,  213,  213,  229,  467,  467,  222,
672       230,  467,  467,  222,  222,  222,  222,  222,  222,  222,
673
674       222,  222,  222,  222,  222,  222,  222,  222,  222,  222,
675       222,  222,  222,  222,  222,  222,  163,  163,  163,   88,
676        88,  245,  278,  278,  278,  224,  224,  224,  247,   88,
677        88,   88,   88,   88,   88,  242,  243,  244,   88,   88,
678        88,   88,  467,  246,  467,  467,  164,  248,  165,   88,
679        88,   88,   88,   88,  467,  249,   88,   88,  252,  166,
680       250,   88,   88,  167,   88,  467,   88,   88,   88,   88,
681        88,   88,   88,  251,   88,   88,  253,  467,   88,   88,
682        88,  278,  278,  278,   88,  467,  467,   88,   88,  254,
683        88,   88,  255,   88,   88,   88,  467,  256,  257,  258,
684
685        88,   88,   88,  467,   88,   88,   88,   88,   88,  259,
686        88,   88,  260,   88,   88,   88,   88,   88,   88,   88,
687       467,  261,   88,   88,  467,  467,  262,   88,   88,  467,
688        88,   88,   88,  265,   88,   88,   88,  263,   88,  264,
689        88,  412,  413,  414,   88,   88,   88,   88,   88,  268,
690        88,   88,  266,   88,   88,   88,   88,  267,   88,   88,
691        88,   88,   88,  269,   88,  271,  272,  270,   88,   88,
692        88,   88,   88,   88,   88,   88,   88,  467,   88,   88,
693       273,   88,   88,   88,   88,   88,   88,  274,  467,   88,
694        88,  467,  276,  275,   88,   88,   88,   88,   88,  467,
695
696       277,  467,  467,   88,  217,  217,  149,  217,  217,  149,
697       284,  284,  228,  149,  149,  149,  282,  467,   88,  282,
698       283,  467,  285,  283,  467,  227,  286,  298,   88,  221,
699       467,   88,  221,  467,  467,  287,  217,  217,  149,  228,
700       228,  228,  149,  149,  149,  467,   88,  467,  282,  467,
701        88,  229,  288,  467,  227,  230,   88,  299,  152,   88,
702        88,  221,  216,   88,  412,  413,  412,  412,  413,  412,
703       289,  143,  467,  467,  289,  289,  289,  289,  289,  289,
704       289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
705       289,  289,  289,  289,  289,  289,  289,   88,   88,  467,
706
707       467,  398,  398,  398,   88,  467,   88,   88,   88,  467,
708        88,   88,  302,  300,   88,  301,   88,   88,   88,   88,
709        89,  467,  467,   88,  303,  467,  467,   88,   88,   88,
710       467,   88,  467,   88,  305,  304,   88,   88,   88,   88,
711        88,  467,   88,   88,   88,   88,  467,  307,   88,  467,
712       306,   88,  467,   88,  308,   88,   88,   88,   88,   88,
713        88,  312,  309,  310,  467,  467,   88,   88,  467,   88,
714        88,   88,   88,   88,   88,  311,   88,   88,   88,   88,
715        88,  313,   88,  314,  467,  467,   88,  467,   88,  467,
716       317,   88,   88,  467,  318,   88,   88,  315,   88,   88,
717
718        88,  316,  319,   88,   88,   88,   88,   88,   88,  467,
719       467,   88,   88,  320,   88,   88,   88,  467,   88,   88,
720       322,  321,   88,  467,   88,   88,   88,   88,  324,  323,
721        88,   88,   88,  412,  413,  414,   88,  467,  467,   88,
722        88,   88,   88,   88,   88,  326,   88,   88,   88,  467,
723       325,  327,  328,   88,   88,  231,   88,   88,   88,   88,
724        88,   88,  467,   88,   88,  332,   88,   88,  467,  333,
725       467,  467,  329,  412,  413,  414,  467,  467,  334,  149,
726       149,  149,  150,  150,  150,  150,  150,  150,  150,  150,
727       150,  227,  150,  150,  150,  150,  150,  150,  150,  150,
728
729       150,  150,  150,  335,  150,  150,  150,  335,  335,  335,
730       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
731       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
732       150,  150,  150,  150,  217,  217,  149,  284,  284,  228,
733       217,  217,  149,  467,   88,   88,  282,  467,  467,  285,
734       283,   88,  282,  286,   88,   88,  288,   88,   88,  221,
735       467,   88,  287,  467,   88,  221,  217,  217,  149,  218,
736       218,  218,  218,  218,  218,  218,  218,  218,  282,  218,
737       218,  218,  283,  218,  218,  218,  218,  218,  218,  218,
738       336,  221,  218,  218,  336,  336,  336,  336,  336,  336,
739
740       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
741       336,  336,  336,  336,  336,  336,  336,  218,  218,  218,
742       218,  149,  149,  149,  467,   88,  432,  433,  432,   88,
743        88,  467,  467,  227,  467,   88,  467,  230,   88,   88,
744       341,  340,   88,   88,   88,   88,   88,  467,  342,  344,
745        88,   88,  467,  343,   88,   88,   88,   88,   88,   88,
746        88,  345,   88,   88,   88,  467,   88,  467,   88,  467,
747       346,  467,   88,  467,   88,   88,   88,  347,   88,   88,
748       467,   88,  350,  467,   88,  348,  349,   88,   88,  351,
749        88,  467,   88,   88,  467,  467,  353,  467,   88,   88,
750
751        88,  467,   88,   88,  352,   88,  354,   88,   88,   88,
752       467,   88,   88,  355,   88,  467,  356,   88,  467,   88,
753        88,  357,  467,   88,   88,  358,  359,   88,   88,   88,
754       360,  467,   88,   88,   88,   88,   88,  467,   88,   88,
755       467,   88,  361,  467,   88,   88,   88,   88,   88,   88,
756        88,  362,   88,  467,   88,  467,   88,  467,  363,   88,
757        88,   88,   88,   88,   88,  364,  467,   88,  217,  217,
758       149,   88,   88,   88,   88,   88,  217,  217,  149,  368,
759       282,  467,  467,   88,  220,  467,   88,   88,  282,   88,
760       369,  370,  286,  221,  217,  217,  149,   88,   88,   88,
761
762        88,  221,   88,   88,  467,   88,  282,  467,   88,  467,
763       365,   88,  467,   88,  371,   88,   88,   88,  373,  221,
764       467,  374,   88,  376,   88,  372,  375,   88,  377,  378,
765        88,  467,   88,   88,   88,   88,   88,   88,   88,   88,
766        88,   88,   88,  467,   88,   88,  467,  379,  467,  380,
767        88,   88,   88,   88,   88,   88,  381,   88,   88,   88,
768        88,   88,   88,  467,   88,   88,   88,   88,  382,   88,
769        88,   88,   88,   88,  467,   88,   88,   88,  467,   88,
770        88,   88,   88,  467,   88,   88,  384,  383,   88,   88,
771        88,   88,   88,  388,  467,   88,   88,   88,  467,   88,
772
773        88,   88,   88,   88,   88,   88,   88,   88,  467,   88,
774        88,   88,   88,  467,  467,   88,  391,  389,   88,   88,
775       467,   88,   88,  390,   88,   88,   88,  467,  392,  393,
776        88,   88,   88,  394,  395,   88,   88,   88,  467,   88,
777        88,   88,   88,   88,   88,   88,  396,   88,   88,   88,
778        88,   88,   88,  397,  467,   88,   88,   88,   88,   88,
779       467,   88,   88,  467,   88,   88,   88,   88,   88,   88,
780        88,  401,   88,   88,  400,   88,  402,  403,   88,   88,
781       467,   88,   88,   88,  404,   88,   88,   88,  467,   88,
782       405,   88,   88,  467,   88,  467,   88,   88,  467,  467,
783
784        88,  398,  398,  398,   88,  407,   88,  467,   88,   88,
785       408,  467,  410,  411,   88,   88,   88,   88,   88,  467,
786       409,   88,   88,  467,  467,   88,   88,  467,   88,   88,
787       467,  467,   88,  467,   88,   88,  419,  420,  413,  421,
788       425,  426,  427,   88,   88,  467,  423,   88,  467,  420,
789       413,  420,  467,   88,  467,  467,   88,  467,  417,  467,
790       467,  424,  467,  467,  419,  420,  413,  421,  467,  467,
791       428,  467,  429,  434,  423,  419,  420,  413,  421,  435,
792       436,  437,  467,  430,  467,  423,  467,  431,  467,  424,
793       419,  420,  438,  421,  425,  426,  425,  425,  426,  425,
794
795       424,  467,  425,  426,  427,  467,  412,  413,  414,  467,
796       412,  413,  414,  412,  413,  414,  467,  412,  413,  414,
797       432,  433,  432,  467,  164,  467,  165,  164,  467,  165,
798       467,  467,  428,  467,  429,  467,  467,  166,  467,  467,
799       166,  167,  467,  467,  167,  430,  439,  467,  467,  431,
800       440,  442,  432,  433,  432,  435,  436,  435,  467,  467,
801       441,  435,  436,  435,  435,  436,  437,  420,  413,  420,
802       412,  413,  412,  412,  413,  412,  417,  412,  413,  414,
803       467,  412,  413,  414,  467,  412,  413,  414,  412,  413,
804       414,  434,  294,  443,  444,  445,  446,  446,  446,  446,
805
806       446,  446,  446,  446,  446,  446,  446,  446,  446,  412,
807       413,  414,  446,  446,  446,  446,  448,  467,  446,  447,
808       449,  412,  413,  414,  412,  413,  412,  412,  413,  414,
809       412,  413,  412,  412,  413,  414,  412,  413,  414,  467,
810       412,  413,  414,  446,  446,  446,  446,  337,  450,  451,
811       452,  453,  453,  453,  453,  453,  453,  453,  453,  453,
812       453,  453,  453,  453,  455,  454,  467,  453,  453,  453,
813       453,  457,  467,  453,  412,  413,  414,  412,  413,  414,
814       412,  413,  412,  412,  413,  412,  412,  413,  414,  412,
815       413,  414,  412,  413,  412,  412,  413,  412,  453,  453,
816
817       453,  453,  467,  456,  412,  413,  414,  412,  413,  414,
818       467,  458,  387,  459,  460,  461,  462,  462,  462,  462,
819       462,  462,  462,  462,  462,  462,  462,  462,  462,  467,
820       467,  467,  462,  462,  462,  462,  467,  467,  462,  467,
821       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
822       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
823       467,  467,  467,  462,  462,  462,  462,  399,  463,  464,
824       465,  466,  466,  466,  466,  466,  466,  466,  466,  466,
825       466,  466,  466,  466,  467,  467,  467,  466,  466,  466,
826       466,  467,  467,  466,  467,  467,  467,  467,  467,  467,
827
828       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
829       467,  467,  467,  467,  467,  467,  467,  467,  466,  466,
830       466,  466,   60,   60,  467,   60,   60,   60,   60,   60,
831        65,   65,  467,   65,   65,   65,   65,   65,   88,   88,
832       467,  467,   88,   88,   88,  139,  139,  467,  139,  139,
833       139,  139,  139,  150,  150,  150,  150,  150,  150,  150,
834       150,  153,  153,  153,  153,  153,  153,  153,  153,  157,
835       157,  157,  218,  218,  218,  218,  218,  218,  218,  218,
836       226,  226,  226,  149,  149,  149,  149,  149,  149,  149,
837       149,  232,  232,  280,  280,  280,  217,  217,  217,  217,
838
839       217,  217,  217,  217,  290,  290,  231,  231,  231,  231,
840       231,  231,  231,  231,  294,  294,  294,  294,  294,  330,
841       330,  331,  331,  331,  331,  331,  331,  331,  331,  337,
842       337,  337,  337,  337,  387,  387,  387,  387,  387,  399,
843       399,  399,  399,  399,  406,  406,  406,  406,  406,  406,
844       406,  406,  415,  415,  415,  415,  415,  415,  415,  416,
845       416,  467,  416,  416,  416,  416,  416,  422,  422,  422,
846       422,  422,  422,  422,  422,  419,  419,  467,  419,  419,
847       419,  419,  419,    7,  467,  467,  467,  467,  467,  467,
848       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
849
850       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
851       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
852       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
853       467,  467,  467,  467,  467,  467,  467,  467,  467
854     } ;
855
856 static yyconst flex_int16_t yy_chk[2240] =
857     {   0,
858         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
859         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
860         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
861         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
862         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
863         1,    1,    1,    1,    1,    3,    3,    3,    3,    3,
864         3,    3,    4,    4,    4,    4,    4,    4,    4,    5,
865         5,    5,    5,    5,    5,    5,    6,    6,    6,    6,
866         6,    6,    6,   12,   19,    4,   16,   20,   21,  480,
867        21,   21,   21,   19,   22,   20,   27,   27,   22,    6,
868
869       434,   16,   49,   12,   22,   23,  418,   23,   23,   23,
870        24,  385,   24,   24,   24,   25,  366,   25,   25,   25,
871        29,   29,   30,   30,   30,   32,   32,   32,   33,   33,
872        33,   49,   34,   34,   34,   36,   35,   86,   86,   23,
873        35,   30,   37,   25,   32,   36,   35,   33,   36,   35,
874        37,   34,   37,   38,   41,   37,   36,   38,   35,   34,
875        37,  365,  339,   38,   41,   65,   38,   41,   32,   34,
876        33,   39,   34,   41,  227,   40,   39,   60,  227,   40,
877        65,   39,   39,   39,   39,   40,   42,   39,   40,  407,
878        43,  419,  416,   40,   43,  338,   42,   60,   44,   42,
879
880        43,   42,   44,   43,   42,  297,  419,   45,   44,  407,
881       296,   44,  416,  286,   45,   44,   44,   45,   44,   46,
882        45,   47,   45,  139,  142,   46,   46,  280,   48,   45,
883        46,   47,  139,  142,   47,   48,   48,  238,   48,  237,
884        52,   48,   52,  236,   52,   52,   52,   53,   53,   52,
885        53,   53,   53,  233,   54,   53,   54,   54,   54,   55,
886       230,  143,   56,   55,   56,   56,   56,  226,  220,   55,
887       143,   57,   55,   57,   57,   57,   58,  215,   58,   58,
888        58,   73,   73,   73,  167,   74,   74,   74,   77,   77,
889        77,   78,   88,   78,   78,   78,   56,   74,   87,   87,
890
891        87,   74,   88,   90,   58,   88,   89,   89,   89,   92,
892        91,   93,  166,   90,   91,  165,   90,   87,   94,   92,
893        91,   93,   92,   91,   93,   92,   92,   95,   94,   96,
894        94,   94,   95,   97,  101,  164,   89,   95,   89,   96,
895        95,   99,   96,   97,  101,   97,   97,  101,   98,   89,
896        98,   99,  100,   89,   99,  162,  158,   99,   98,  157,
897       102,   98,  100,  153,  103,  100,  152,  146,  104,  100,
898       102,  133,  102,  102,  103,  105,  106,  103,  104,  103,
899       104,  104,   84,  107,   82,  105,  106,   80,  105,  106,
900       108,  109,  105,  107,   79,   75,  107,  107,  110,   72,
901
902       108,  109,   66,  108,  109,   62,  108,  108,  110,  110,
903       111,  110,  112,   59,  113,  110,   51,   50,  113,  114,
904       111,  114,  112,  111,  113,  112,  115,  113,   28,  114,
905       111,  117,  114,  119,  115,   26,  115,  116,  116,  115,
906        18,  117,  118,  119,  117,   15,  119,  116,  117,   14,
907       116,  120,  118,   11,    7,  118,    2,  122,  121,  118,
908         0,  120,    0,  123,  120,  120,  121,  122,  121,  124,
909       122,  121,  122,  123,  125,    0,  123,  125,  127,  124,
910         0,  123,  124,  124,  125,  123,  126,  125,  127,    0,
911       126,  127,  128,  127,    0,    0,  126,  130,  129,  126,
912
913       128,    0,  128,    0,    0,  128,  129,  130,  129,    0,
914       130,  129,  168,  134,  130,  134,  135,  135,  135,  138,
915       138,  138,  168,  134,    0,  168,  134,    0,    0,  134,
916       134,  136,    0,  136,  136,  136,  137,    0,  137,  137,
917       137,  140,  140,  140,  144,  144,  144,  145,    0,  145,
918       145,  145,    0,  140,  155,  155,  155,  140,  149,  149,
919       149,  150,  150,  150,    0,  136,  140,  141,  169,  170,
920       149,  170,  169,  150,  151,  151,  151,    0,  169,  170,
921         0,  169,  170,  213,  213,  213,  151,    0,    0,  141,
922       151,    0,    0,  141,  141,  141,  141,  141,  141,  141,
923
924       141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
925       141,  141,  141,  141,  141,  141,  163,  163,  163,  171,
926       172,  173,  214,  214,  214,  224,  224,  224,  175,  171,
927       172,  173,  171,  172,  173,  171,  172,  172,  175,  174,
928       176,  175,    0,  174,    0,    0,  163,  176,  163,  174,
929       176,  177,  174,  176,    0,  177,  178,  179,  180,  163,
930       178,  177,  181,  163,  177,    0,  178,  179,  180,  178,
931       179,  180,  181,  179,  182,  181,  182,    0,  183,  184,
932       185,  278,  278,  278,  182,    0,    0,  182,  183,  184,
933       185,  183,  184,  185,  186,  187,    0,  185,  186,  187,
934
935       189,  188,  190,    0,  186,  187,  191,  186,  187,  188,
936       189,  188,  190,  189,  188,  190,  191,  192,  193,  191,
937         0,  191,  194,  195,    0,    0,  192,  192,  193,    0,
938       192,  193,  194,  195,  196,  194,  195,  193,  197,  194,
939       198,  406,  406,  406,  196,  199,  200,  196,  197,  199,
940       198,  197,  196,  198,  201,  199,  200,  198,  199,  200,
941       203,  202,  204,  200,  201,  202,  204,  201,  206,  207,
942       203,  202,  204,  203,  202,  204,  205,    0,  206,  207,
943       205,  206,  207,  209,  208,  210,  205,  208,    0,  205,
944       212,    0,  210,  209,  208,  210,  209,  208,  210,    0,
945
946       212,    0,    0,  212,  217,  217,  217,  218,  218,  218,
947       219,  219,  219,  228,  228,  228,  217,    0,  239,  218,
948       217,    0,  219,  218,    0,  228,  219,  239,  239,  217,
949         0,  239,  218,    0,    0,  219,  221,  221,  221,  229,
950       229,  229,  231,  231,  231,    0,  240,    0,  221,    0,
951       241,  229,  221,    0,  231,  229,  240,  241,  231,  240,
952       241,  221,  223,  241,  412,  412,  412,  413,  413,  413,
953       223,  223,    0,    0,  223,  223,  223,  223,  223,  223,
954       223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
955       223,  223,  223,  223,  223,  223,  223,  242,  243,    0,
956
957         0,  384,  384,  384,  244,    0,  245,  242,  243,    0,
958       242,  243,  244,  242,  244,  243,  245,  244,  246,  245,
959       384,    0,    0,  247,  245,    0,    0,  248,  246,  249,
960         0,  246,    0,  247,  247,  246,  247,  248,  250,  249,
961       248,    0,  249,  251,  252,  253,    0,  251,  250,    0,
962       250,  250,    0,  251,  252,  253,  251,  252,  253,  254,
963       255,  256,  253,  254,    0,    0,  257,  258,    0,  254,
964       255,  256,  254,  255,  256,  255,  257,  258,  259,  257,
965       258,  257,  260,  258,    0,    0,  261,    0,  259,    0,
966       262,  259,  260,    0,  263,  260,  261,  259,  264,  261,
967
968       262,  261,  264,  262,  263,  265,  266,  263,  264,    0,
969         0,  264,  267,  265,  268,  265,  266,    0,  265,  266,
970       267,  266,  267,    0,  268,  267,  269,  268,  269,  268,
971       270,  271,  272,  414,  414,  414,  269,    0,    0,  269,
972       270,  271,  272,  270,  271,  272,  273,  274,  275,    0,
973       270,  273,  275,  276,  277,  282,  273,  274,  275,  273,
974       274,  275,    0,  276,  277,  282,  276,  277,    0,  282,
975         0,    0,  277,  415,  415,  415,    0,    0,  282,  283,
976       283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
977       283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
978
979       283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
980       283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
981       283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
982       283,  283,  283,  283,  284,  284,  284,  285,  285,  285,
983       287,  287,  287,    0,  298,  299,  284,    0,    0,  285,
984       284,  300,  287,  285,  298,  299,  287,  298,  299,  284,
985         0,  300,  285,    0,  300,  287,  288,  288,  288,  288,
986       288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
987       288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
988       288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
989
990       288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
991       288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
992       288,  291,  291,  291,    0,  301,  417,  417,  417,  302,
993       303,    0,    0,  291,    0,  301,    0,  291,  301,  302,
994       303,  302,  302,  303,  304,  305,  306,    0,  304,  306,
995       307,  308,    0,  305,  304,  305,  306,  304,  305,  306,
996       307,  308,  309,  307,  308,    0,  310,    0,  311,    0,
997       309,    0,  309,    0,  312,  309,  310,  310,  311,  310,
998         0,  311,  313,    0,  312,  311,  312,  312,  313,  313,
999       314,    0,  315,  313,    0,    0,  315,    0,  316,  318,
1000
1001       314,    0,  315,  314,  314,  315,  316,  317,  316,  318,
1002         0,  316,  318,  317,  321,    0,  318,  317,    0,  319,
1003       317,  319,    0,  320,  321,  320,  321,  321,  322,  319,
1004       322,    0,  319,  320,  323,  324,  320,    0,  322,  325,
1005         0,  322,  324,    0,  323,  324,  326,  323,  324,  325,
1006       327,  326,  325,    0,  328,    0,  326,    0,  327,  326,
1007       327,  340,  329,  327,  328,  329,    0,  328,  331,  331,
1008       331,  340,  329,  341,  340,  329,  332,  332,  332,  340,
1009       331,    0,    0,  341,  331,    0,  341,  342,  332,  343,
1010       341,  343,  332,  331,  334,  334,  334,  342,  344,  343,
1011
1012       342,  332,  343,  345,    0,  346,  334,    0,  344,    0,
1013       334,  344,    0,  345,  344,  346,  345,  347,  346,  334,
1014         0,  347,  348,  350,  349,  345,  349,  347,  351,  352,
1015       347,    0,  348,  350,  349,  348,  350,  349,  351,  352,
1016       353,  351,  352,    0,  354,  355,    0,  354,    0,  355,
1017       353,  357,  356,  353,  354,  355,  356,  354,  355,  358,
1018       359,  357,  356,    0,  357,  356,  360,  361,  357,  358,
1019       359,  362,  358,  359,    0,  363,  360,  361,    0,  360,
1020       361,  362,  364,    0,  362,  363,  364,  363,  363,  368,
1021       369,  370,  364,  368,    0,  364,  371,  372,    0,  368,
1022
1023       369,  370,  368,  369,  370,  373,  371,  372,    0,  371,
1024       372,  374,  375,    0,    0,  373,  375,  373,  373,  377,
1025         0,  374,  375,  374,  374,  375,  376,    0,  376,  377,
1026       379,  378,  377,  378,  379,  380,  376,  381,    0,  376,
1027       379,  378,  382,  379,  378,  380,  382,  381,  380,  383,
1028       381,  388,  382,  383,    0,  382,  389,  390,  391,  383,
1029         0,  388,  383,    0,  388,  393,  389,  390,  391,  389,
1030       390,  391,  392,  394,  390,  393,  392,  394,  393,  395,
1031         0,  396,  392,  394,  396,  392,  394,  397,    0,  395,
1032       397,  396,  395,    0,  396,    0,  400,  397,    0,    0,
1033
1034       397,  398,  398,  398,  402,  398,  400,    0,  401,  400,
1035       398,    0,  400,  401,  402,  403,  404,  402,  401,    0,
1036       398,  401,  405,    0,    0,  403,  404,    0,  403,  404,
1037         0,    0,  405,    0,  410,  405,  408,  408,  408,  408,
1038       409,  409,  409,  411,  410,    0,  408,  410,    0,  420,
1039       420,  420,    0,  411,    0,    0,  411,    0,  420,    0,
1040         0,  408,    0,    0,  421,  421,  421,  421,    0,    0,
1041       409,    0,  409,  420,  421,  422,  422,  422,  422,  423,
1042       423,  423,    0,  409,    0,  422,    0,  409,    0,  421,
1043       424,  424,  424,  424,  425,  425,  425,  426,  426,  426,
1044
1045       422,    0,  427,  427,  427,    0,  428,  428,  428,    0,
1046       429,  429,  429,  430,  430,  430,    0,  431,  431,  431,
1047       432,  432,  432,    0,  425,    0,  425,  426,    0,  426,
1048         0,    0,  427,    0,  427,    0,    0,  425,    0,    0,
1049       426,  425,    0,    0,  426,  427,  428,    0,    0,  427,
1050       429,  431,  433,  433,  433,  435,  435,  435,    0,    0,
1051       430,  436,  436,  436,  437,  437,  437,  438,  438,  438,
1052       443,  443,  443,  444,  444,  444,  438,  440,  440,  440,
1053         0,  441,  441,  441,    0,  442,  442,  442,  445,  445,
1054       445,  438,  439,  439,  439,  439,  439,  439,  439,  439,
1055
1056       439,  439,  439,  439,  439,  439,  439,  439,  439,  446,
1057       446,  446,  439,  439,  439,  439,  441,    0,  439,  440,
1058       442,  448,  448,  448,  450,  450,  450,  449,  449,  449,
1059       451,  451,  451,  452,  452,  452,  453,  453,  453,    0,
1060       455,  455,  455,  439,  439,  439,  439,  447,  447,  447,
1061       447,  447,  447,  447,  447,  447,  447,  447,  447,  447,
1062       447,  447,  447,  447,  449,  448,    0,  447,  447,  447,
1063       447,  455,    0,  447,  454,  454,  454,  456,  456,  456,
1064       459,  459,  459,  460,  460,  460,  461,  461,  461,  462,
1065       462,  462,  463,  463,  463,  464,  464,  464,  447,  447,
1066
1067       447,  447,    0,  454,  465,  465,  465,  466,  466,  466,
1068         0,  456,  457,  457,  457,  457,  457,  457,  457,  457,
1069       457,  457,  457,  457,  457,  457,  457,  457,  457,    0,
1070         0,    0,  457,  457,  457,  457,    0,    0,  457,    0,
1071         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1072         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1073         0,    0,    0,  457,  457,  457,  457,  458,  458,  458,
1074       458,  458,  458,  458,  458,  458,  458,  458,  458,  458,
1075       458,  458,  458,  458,    0,    0,    0,  458,  458,  458,
1076       458,    0,    0,  458,    0,    0,    0,    0,    0,    0,
1077
1078         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
1079         0,    0,    0,    0,    0,    0,    0,    0,  458,  458,
1080       458,  458,  468,  468,    0,  468,  468,  468,  468,  468,
1081       469,  469,    0,  469,  469,  469,  469,  469,  470,  470,
1082         0,    0,  470,  470,  470,  471,  471,    0,  471,  471,
1083       471,  471,  471,  472,  472,  472,  472,  472,  472,  472,
1084       472,  473,  473,  473,  473,  473,  473,  473,  473,  474,
1085       474,  474,  475,  475,  475,  475,  475,  475,  475,  475,
1086       476,  476,  476,  477,  477,  477,  477,  477,  477,  477,
1087       477,  478,  478,  479,  479,  479,  481,  481,  481,  481,
1088
1089       481,  481,  481,  481,  482,  482,  483,  483,  483,  483,
1090       483,  483,  483,  483,  484,  484,  484,  484,  484,  485,
1091       485,  486,  486,  486,  486,  486,  486,  486,  486,  487,
1092       487,  487,  487,  487,  488,  488,  488,  488,  488,  489,
1093       489,  489,  489,  489,  490,  490,  490,  490,  490,  490,
1094       490,  490,  491,  491,  491,  491,  491,  491,  491,  492,
1095       492,    0,  492,  492,  492,  492,  492,  493,  493,  493,
1096       493,  493,  493,  493,  493,  494,  494,    0,  494,  494,
1097       494,  494,  494,  467,  467,  467,  467,  467,  467,  467,
1098       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
1099
1100       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
1101       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
1102       467,  467,  467,  467,  467,  467,  467,  467,  467,  467,
1103       467,  467,  467,  467,  467,  467,  467,  467,  467
1104     } ;
1105
1106 static yy_state_type yy_last_accepting_state;
1107 static char *yy_last_accepting_cpos;
1108
1109 extern int avm2__flex_debug;
1110 int avm2__flex_debug = 0;
1111
1112 /* The intent behind this definition is that it'll catch
1113  * any uses of REJECT which flex missed.
1114  */
1115 #define REJECT reject_used_but_not_detected
1116 #define yymore() yymore_used_but_not_detected
1117 #define YY_MORE_ADJ 0
1118 #define YY_RESTORE_YY_MORE_OFFSET
1119 char *avm2_text;
1120 #line 1 "tokenizer.lex"
1121 /* tokenizer.lex
1122
1123    Routines for compiling Flash2 AVM2 ABC Actionscript
1124
1125    Extension module for the rfxswf library.
1126    Part of the swftools package.
1127
1128    Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
1129  
1130    This program is free software; you can redistribute it and/or modify
1131    it under the terms of the GNU General Public License as published by
1132    the Free Software Foundation; either version 2 of the License, or
1133    (at your option) any later version.
1134
1135    This program is distributed in the hope that it will be useful,
1136    but WITHOUT ANY WARRANTY; without even the implied warranty of
1137    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1138    GNU General Public License for more details.
1139
1140    You should have received a copy of the GNU General Public License
1141    along with this program; if not, write to the Free Software
1142    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
1143 #line 24 "tokenizer.lex"
1144
1145
1146 #include <string.h>
1147 #include <stdlib.h>
1148 #include <stdio.h>
1149 #include <stdarg.h>
1150 #include "../utf8.h"
1151 #include "tokenizer.h"
1152 #include "files.h"
1153
1154 int as3_pass = 0;
1155
1156 int as3_verbosity = 1;
1157 void as3_error(const char*format, ...)
1158 {
1159     char buf[1024];
1160     int l;
1161     va_list arglist;
1162     if(as3_verbosity<0)
1163         exit(1);
1164     va_start(arglist, format);
1165     vsprintf(buf, format, arglist);
1166     va_end(arglist);
1167     fprintf(stderr, "%s:%d:%d: error: %s\n", current_filename_short, current_line, current_column, buf);
1168     fflush(stderr);
1169     exit(1);
1170 }
1171 void as3_warning(const char*format, ...)
1172 {
1173     char buf[1024];
1174     int l;
1175     va_list arglist;
1176     if(as3_verbosity<1)
1177         return;
1178     va_start(arglist, format);
1179     vsprintf(buf, format, arglist);
1180     va_end(arglist);
1181     fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename_short, current_line, current_column, buf);
1182     fflush(stderr);
1183 }
1184 void as3_softwarning(const char*format, ...)
1185 {
1186     char buf[1024];
1187     int l;
1188     va_list arglist;
1189     if(as3_verbosity<2)
1190         return;
1191     va_start(arglist, format);
1192     vsprintf(buf, format, arglist);
1193     va_end(arglist);
1194     fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename_short, current_line, current_column, buf);
1195     fflush(stderr);
1196 }
1197 static void dbg(const char*format, ...)
1198 {
1199     char buf[1024];
1200     int l;
1201     va_list arglist;
1202     if(as3_verbosity<3)
1203         return;
1204     va_start(arglist, format);
1205     vsprintf(buf, format, arglist);
1206     va_end(arglist);
1207     l = strlen(buf);
1208     while(l && buf[l-1]=='\n') {
1209         buf[l-1] = 0;
1210         l--;
1211     }
1212     printf("(tokenizer) ");
1213     printf("%s\n", buf);
1214     fflush(stdout);
1215 }
1216
1217
1218
1219 #ifndef YY_CURRENT_BUFFER
1220 #define YY_CURRENT_BUFFER yy_current_buffer
1221 #endif
1222
1223 void handleInclude(char*text, int len, char quotes)
1224 {
1225     char*filename = 0;
1226     if(quotes) {
1227         char*p1 = strchr(text, '"');
1228         char*p2 = strrchr(text, '"');
1229         if(!p1 || !p2 || p1==p2) {
1230             syntaxerror("Invalid include in line %d\n", current_line);
1231         }
1232         *p2 = 0;
1233         filename = strdup(p1+1);
1234     } else {
1235         int i1=0,i2=len;
1236         // find start
1237         while(!strchr(" \n\r\t", text[i1])) i1++;
1238         // strip
1239         while(strchr(" \n\r\t", text[i1])) i1++;
1240         while(strchr(" \n\r\t", text[i2-1])) i2--;
1241         if(i2!=len) text[i2]=0;
1242         filename = strdup(&text[i1]);
1243     }
1244     
1245     char*fullfilename = enter_file(filename, YY_CURRENT_BUFFER);
1246     avm2_in = fopen(fullfilename, "rb");
1247     if (!avm2_in) {
1248         syntaxerror("Couldn't open include file \"%s\"\n", fullfilename);
1249     }
1250
1251     avm2__switch_to_buffer(avm2__create_buffer(avm2_in,YY_BUF_SIZE ) );
1252     //BEGIN(INITIAL); keep context
1253 }
1254
1255 static int do_unescape(const char*s, const char*end, char*n) 
1256 {
1257     char*o = n;
1258     int len=0;
1259     while(s<end) {
1260         if(*s!='\\') {
1261             if(o) o[len] = *s;len++;
1262             s++;
1263             continue;
1264         }
1265         s++; //skip past '\'
1266         if(s==end) syntaxerror("invalid \\ at end of string");
1267
1268         /* handle the various line endings (mac, dos, unix) */
1269         if(*s=='\r') { 
1270             s++; 
1271             if(s==end) break;
1272             if(*s=='\n') 
1273                 s++;
1274             continue;
1275         }
1276         if(*s=='\n')  {
1277             s++;
1278             continue;
1279         }
1280         switch(*s) {
1281             case '\\': if(o) o[len] = '\\';s++;len++; break;
1282             case '"': if(o) o[len] = '"';s++;len++; break;
1283             case '\'': if(o) o[len] = '\'';s++;len++; break;
1284             case 'b': if(o) o[len] = '\b';s++;len++; break;
1285             case 'f': if(o) o[len] = '\f';s++;len++; break;
1286             case 'n': if(o) o[len] = '\n';s++;len++; break;
1287             case 'r': if(o) o[len] = '\r';s++;len++; break;
1288             case 't': if(o) o[len] = '\t';s++;len++; break;
1289             case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': {
1290                 unsigned int num=0;
1291                 int nr = 0;
1292                 while(strchr("01234567", *s) && nr<3 && s<end) {
1293                     num <<= 3;
1294                     num |= *s-'0';
1295                     nr++;
1296                     s++;
1297                 }
1298                 if(num>256) 
1299                     syntaxerror("octal number out of range (0-255): %d", num);
1300                 if(o) o[len] = num;len++;
1301                 continue;
1302             }
1303             case 'x': case 'u': {
1304                 int max=2;
1305                 char bracket = 0;
1306                 char unicode = 0;
1307                 if(*s == 'u') {
1308                     max = 6;
1309                     unicode = 1;
1310                 }
1311                 s++;
1312                 if(s==end) syntaxerror("invalid \\u or \\x at end of string");
1313                 if(*s == '{')  {
1314                     s++;
1315                     if(s==end) syntaxerror("invalid \\u{ at end of string");
1316                     bracket=1;
1317                 }
1318                 unsigned int num=0;
1319                 int nr = 0;
1320                 while(strchr("0123456789abcdefABCDEF", *s) && (bracket || nr < max) && s<end) {
1321                     num <<= 4;
1322                     if(*s>='0' && *s<='9') num |= *s - '0';
1323                     if(*s>='a' && *s<='f') num |= *s - 'a' + 10;
1324                     if(*s>='A' && *s<='F') num |= *s - 'A' + 10;
1325                     nr++;
1326                     s++;
1327                 }
1328                 if(bracket) {
1329                     if(*s=='}' && s<end) {
1330                         s++;
1331                     } else {
1332                         syntaxerror("missing terminating '}'");
1333                     }
1334                 }
1335                 if(unicode) {
1336                     char*utf8 = getUTF8(num);
1337                     while(*utf8) {
1338                         if(o) o[len] = *utf8;utf8++;len++;
1339                     }
1340                 } else {
1341                     if(num>256) 
1342                         syntaxerror("byte out of range (0-255): %d", num);
1343                     if(o) o[len] = num;len++;
1344                 }
1345                 break;
1346             }
1347             default:
1348                 syntaxerror("unknown escape sequence: \"\\%c\"", *s);
1349         }
1350     }
1351     if(o) o[len]=0;
1352     return len;
1353 }
1354
1355 static string_t string_unescape(const char*in, int l)
1356 {
1357     const char*s = in;
1358     const char*end = &in[l];
1359
1360     int len = do_unescape(s, end, 0);
1361     char*n = (char*)malloc(len+1);
1362     do_unescape(s, end, n);
1363     string_t out = string_new(n, len);
1364     return out; 
1365 }
1366
1367 static void handleString(char*s, int len)
1368 {
1369     if(s[0]=='"') {
1370         if(s[len-1]!='"') syntaxerror("String doesn't end with '\"'");
1371         s++;len-=2;
1372     }
1373     else if(s[0]=='\'') {
1374         if(s[len-1]!='\'') syntaxerror("String doesn't end with '\"'");
1375         s++;len-=2;
1376     }
1377     else syntaxerror("String incorrectly terminated");
1378
1379     
1380     avm2_lval.str = string_unescape(s, len);
1381 }
1382
1383
1384 char start_of_expression;
1385
1386 static inline int mkid(int type)
1387 {
1388     char*s = malloc(avm2_leng+1);
1389     memcpy(s, avm2_text, avm2_leng);
1390     s[avm2_leng]=0;
1391     avm2_lval.id = s;
1392     return type;
1393 }
1394
1395 static inline int m(int type)
1396 {
1397     avm2_lval.token = type;
1398     return type;
1399 }
1400
1401
1402 static char numberbuf[64];
1403 static char*nrbuf()
1404 {
1405     if(avm2_leng>sizeof(numberbuf)-1)
1406         syntaxerror("decimal number overflow");
1407     char*s = numberbuf;
1408     memcpy(s, avm2_text, avm2_leng);
1409     s[avm2_leng]=0;
1410     return s;
1411 }
1412
1413 static inline int setint(int v)
1414 {
1415     avm2_lval.number_int = v;
1416     if(v>-128)
1417         return T_BYTE;
1418     else if(v>=-32768)
1419         return T_SHORT;
1420     else
1421         return T_INT;
1422 }
1423 static inline int setuint(unsigned int v)
1424 {
1425     avm2_lval.number_uint = v;
1426     if(v<128)
1427         return T_BYTE;
1428     else if(v<32768)
1429         return T_SHORT;
1430     else
1431         return T_UINT;
1432 }
1433 static inline int setfloat(double v)
1434 {
1435     avm2_lval.number_float = v;
1436     return T_FLOAT;
1437 }
1438
1439 static inline int handlefloat()
1440 {
1441     char*s = nrbuf();
1442     avm2_lval.number_float = atof(s);
1443     return T_FLOAT;
1444 }
1445
1446 static inline int handleint()
1447 {
1448     char*s = nrbuf();
1449     char l = (avm2_text[0]=='-');
1450
1451     char*max = l?"1073741824":"2147483647";
1452     if(avm2_leng-l>10) {
1453         as3_warning("integer overflow: %s (converted to Number)", s);
1454         return handlefloat();
1455     }
1456     if(avm2_leng-l==10) {
1457         int t;
1458         for(t=0;t<avm2_leng-l;t++) {
1459             if(avm2_text[l+t]>max[t]) {
1460                 as3_warning("integer overflow: %s (converted to Number)", s);
1461                 return handlefloat();
1462             }
1463             else if(avm2_text[l+t]<max[t])
1464                 break;
1465         }
1466     }
1467     if(avm2_text[0]=='-') {
1468         int v = atoi(s);
1469         return setint(v);
1470     } else {
1471         unsigned int v = 0;
1472         int t;
1473         for(t=0;t<avm2_leng;t++) {
1474             v*=10;
1475             v+=avm2_text[t]-'0';
1476         }
1477         return setuint(v);
1478     }
1479 }
1480
1481 static inline int handlehexfloat()
1482 {
1483     char l = (avm2_text[0]=='-')+2;
1484     double d=0;
1485     char dot=0;
1486     double base=1;
1487     int t;
1488     for(t=l;t<avm2_leng;t++) {
1489         char c = avm2_text[t];
1490         if(c=='.') {
1491             dot=1;
1492             continue;
1493         }
1494         if(!dot) {
1495             d*=16;
1496         } else {
1497             base*=1/16.0;
1498         }
1499         if(c>='0' && c<='9')
1500             d+=(c&15)*base;
1501         else if((c>='a' && c<='f') || (c>='A' && c<='F'))
1502             d+=((c&0x0f)+9)*base;
1503     }
1504     return setfloat(d);
1505 }
1506 static inline int handlehex()
1507 {
1508     char l = (avm2_text[0]=='-')+2;
1509     int len = avm2_leng;
1510
1511     if(len-l>8) {
1512         char*s = nrbuf();
1513         syntaxerror("integer overflow %s", s);
1514     }
1515
1516     int t;
1517     unsigned int v = 0;
1518     for(t=l;t<len;t++) {
1519         v<<=4;
1520         char c = avm2_text[t];
1521         if(c>='0' && c<='9')
1522             v|=(c&15);
1523         else if((c>='a' && c<='f') || (c>='A' && c<='F'))
1524             v|=(c&0x0f)+9;
1525     }
1526     if(l && v>1073741824) {
1527         char*s = nrbuf();
1528         as3_warning("signed integer overflow: %s (converted to Number)", s);
1529         return setfloat(v);
1530     }
1531     if(!l && v>2147483647) {
1532         char*s = nrbuf();
1533         as3_warning("unsigned integer overflow: %s (converted to Number)", s);
1534         return setfloat(v);
1535     }
1536
1537     if(l==3) {
1538         return setint(-(int)v);
1539     } else {
1540         return setuint(v);
1541     }
1542 }
1543
1544 void handleLabel(char*text, int len)
1545 {
1546     int t;
1547     for(t=len-1;t>=0;--t) {
1548         if(text[t]!=' ' &&
1549            text[t]!=':')
1550             break;
1551     }
1552     char*s = malloc(t+1);
1553     memcpy(s, avm2_text, t);
1554     s[t]=0;
1555     avm2_lval.id = s;
1556 }
1557
1558 static int handleregexp()
1559 {
1560     char*s = malloc(avm2_leng);
1561     int len=avm2_leng-1;
1562     memcpy(s, avm2_text+1, len);
1563     s[len] = 0;
1564     int t;
1565     for(t=len;t>=0;--t) {
1566         if(s[t]=='/') {
1567             s[t] = 0;
1568             break;
1569         }
1570     }
1571     avm2_lval.regexp.pattern = s;
1572     if(t==len) {
1573         avm2_lval.regexp.options = 0;
1574     } else {
1575         avm2_lval.regexp.options = s+t+1;
1576     }
1577     return T_REGEXP;
1578 }
1579
1580 void initialize_scanner();
1581 #define YY_USER_INIT initialize_scanner();
1582
1583 /* count the number of lines+columns consumed by this token */
1584 static inline void l() {
1585     int t;
1586     for(t=0;t<avm2_leng;t++) {
1587         if(avm2_text[t]=='\n') {
1588             current_line++;
1589             current_column=0;
1590         } else {
1591             current_column++;
1592         }
1593     }
1594 }
1595 /* count the number of columns consumed by this token */
1596 static inline void c() {
1597     current_column+=avm2_leng;
1598 }
1599
1600 //Boolean                      {c();return m(KW_BOOLEAN);}
1601 //int                          {c();return m(KW_INT);}
1602 //uint                         {c();return m(KW_UINT);}
1603 //Number                       {c();return m(KW_NUMBER);}
1604
1605
1606
1607
1608 #line 1609 "tokenizer.yy.c"
1609
1610 #define INITIAL 0
1611 #define REGEXPOK 1
1612 #define BEGINNING 2
1613
1614 #ifndef YY_NO_UNISTD_H
1615 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1616  * down here because we want the user's section 1 to have been scanned first.
1617  * The user has a chance to override it with an option.
1618  */
1619 #include <unistd.h>
1620 #endif
1621
1622 #ifndef YY_EXTRA_TYPE
1623 #define YY_EXTRA_TYPE void *
1624 #endif
1625
1626 static int yy_init_globals (void );
1627
1628 /* Accessor methods to globals.
1629    These are made visible to non-reentrant scanners for convenience. */
1630
1631 int avm2_lex_destroy (void );
1632
1633 int avm2_get_debug (void );
1634
1635 void avm2_set_debug (int debug_flag  );
1636
1637 YY_EXTRA_TYPE avm2_get_extra (void );
1638
1639 void avm2_set_extra (YY_EXTRA_TYPE user_defined  );
1640
1641 FILE *avm2_get_in (void );
1642
1643 void avm2_set_in  (FILE * in_str  );
1644
1645 FILE *avm2_get_out (void );
1646
1647 void avm2_set_out  (FILE * out_str  );
1648
1649 int avm2_get_leng (void );
1650
1651 char *avm2_get_text (void );
1652
1653 int avm2_get_lineno (void );
1654
1655 void avm2_set_lineno (int line_number  );
1656
1657 /* Macros after this point can all be overridden by user definitions in
1658  * section 1.
1659  */
1660
1661 #ifndef YY_SKIP_YYWRAP
1662 #ifdef __cplusplus
1663 extern "C" int avm2_wrap (void );
1664 #else
1665 extern int avm2_wrap (void );
1666 #endif
1667 #endif
1668
1669     static void yyunput (int c,char *buf_ptr  );
1670     
1671 #ifndef yytext_ptr
1672 static void yy_flex_strncpy (char *,yyconst char *,int );
1673 #endif
1674
1675 #ifdef YY_NEED_STRLEN
1676 static int yy_flex_strlen (yyconst char * );
1677 #endif
1678
1679 #ifndef YY_NO_INPUT
1680
1681 #ifdef __cplusplus
1682 static int yyinput (void );
1683 #else
1684 static int input (void );
1685 #endif
1686
1687 #endif
1688
1689 /* Amount of stuff to slurp up with each read. */
1690 #ifndef YY_READ_BUF_SIZE
1691 #define YY_READ_BUF_SIZE 8192
1692 #endif
1693
1694 /* Copy whatever the last rule matched to the standard output. */
1695 #ifndef ECHO
1696 /* This used to be an fputs(), but since the string might contain NUL's,
1697  * we now use fwrite().
1698  */
1699 #define ECHO fwrite( avm2_text, avm2_leng, 1, avm2_out )
1700 #endif
1701
1702 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1703  * is returned in "result".
1704  */
1705 #ifndef YY_INPUT
1706 #define YY_INPUT(buf,result,max_size) \
1707         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1708                 { \
1709                 int c = '*'; \
1710                 int n; \
1711                 for ( n = 0; n < max_size && \
1712                              (c = getc( avm2_in )) != EOF && c != '\n'; ++n ) \
1713                         buf[n] = (char) c; \
1714                 if ( c == '\n' ) \
1715                         buf[n++] = (char) c; \
1716                 if ( c == EOF && ferror( avm2_in ) ) \
1717                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1718                 result = n; \
1719                 } \
1720         else \
1721                 { \
1722                 errno=0; \
1723                 while ( (result = fread(buf, 1, max_size, avm2_in))==0 && ferror(avm2_in)) \
1724                         { \
1725                         if( errno != EINTR) \
1726                                 { \
1727                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1728                                 break; \
1729                                 } \
1730                         errno=0; \
1731                         clearerr(avm2_in); \
1732                         } \
1733                 }\
1734 \
1735
1736 #endif
1737
1738 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1739  * we don't want an extra ';' after the "return" because that will cause
1740  * some compilers to complain about unreachable statements.
1741  */
1742 #ifndef yyterminate
1743 #define yyterminate() return YY_NULL
1744 #endif
1745
1746 /* Number of entries by which start-condition stack grows. */
1747 #ifndef YY_START_STACK_INCR
1748 #define YY_START_STACK_INCR 25
1749 #endif
1750
1751 /* Report a fatal error. */
1752 #ifndef YY_FATAL_ERROR
1753 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1754 #endif
1755
1756 /* end tables serialization structures and prototypes */
1757
1758 /* Default declaration of generated scanner - a define so the user can
1759  * easily add parameters.
1760  */
1761 #ifndef YY_DECL
1762 #define YY_DECL_IS_OURS 1
1763
1764 extern int avm2_lex (void);
1765
1766 #define YY_DECL int avm2_lex (void)
1767 #endif /* !YY_DECL */
1768
1769 /* Code executed at the beginning of each rule, after avm2_text and avm2_leng
1770  * have been set up.
1771  */
1772 #ifndef YY_USER_ACTION
1773 #define YY_USER_ACTION
1774 #endif
1775
1776 /* Code executed at the end of each rule. */
1777 #ifndef YY_BREAK
1778 #define YY_BREAK break;
1779 #endif
1780
1781 #define YY_RULE_SETUP \
1782         if ( avm2_leng > 0 ) \
1783                 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1784                                 (avm2_text[avm2_leng - 1] == '\n'); \
1785         YY_USER_ACTION
1786
1787 /** The main scanner function which does all the work.
1788  */
1789 YY_DECL
1790 {
1791         register yy_state_type yy_current_state;
1792         register char *yy_cp, *yy_bp;
1793         register int yy_act;
1794     
1795 #line 509 "tokenizer.lex"
1796
1797
1798
1799 #line 1800 "tokenizer.yy.c"
1800
1801         if ( !(yy_init) )
1802                 {
1803                 (yy_init) = 1;
1804
1805 #ifdef YY_USER_INIT
1806                 YY_USER_INIT;
1807 #endif
1808
1809                 if ( ! (yy_start) )
1810                         (yy_start) = 1; /* first start state */
1811
1812                 if ( ! avm2_in )
1813                         avm2_in = stdin;
1814
1815                 if ( ! avm2_out )
1816                         avm2_out = stdout;
1817
1818                 if ( ! YY_CURRENT_BUFFER ) {
1819                         avm2_ensure_buffer_stack ();
1820                         YY_CURRENT_BUFFER_LVALUE =
1821                                 avm2__create_buffer(avm2_in,YY_BUF_SIZE );
1822                 }
1823
1824                 avm2__load_buffer_state( );
1825                 }
1826
1827         while ( 1 )             /* loops until end-of-file is reached */
1828                 {
1829                 yy_cp = (yy_c_buf_p);
1830
1831                 /* Support of avm2_text. */
1832                 *yy_cp = (yy_hold_char);
1833
1834                 /* yy_bp points to the position in yy_ch_buf of the start of
1835                  * the current run.
1836                  */
1837                 yy_bp = yy_cp;
1838
1839                 yy_current_state = (yy_start);
1840                 yy_current_state += YY_AT_BOL();
1841 yy_match:
1842                 do
1843                         {
1844                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1845                         if ( yy_accept[yy_current_state] )
1846                                 {
1847                                 (yy_last_accepting_state) = yy_current_state;
1848                                 (yy_last_accepting_cpos) = yy_cp;
1849                                 }
1850                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1851                                 {
1852                                 yy_current_state = (int) yy_def[yy_current_state];
1853                                 if ( yy_current_state >= 468 )
1854                                         yy_c = yy_meta[(unsigned int) yy_c];
1855                                 }
1856                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1857                         ++yy_cp;
1858                         }
1859                 while ( yy_current_state != 467 );
1860                 yy_cp = (yy_last_accepting_cpos);
1861                 yy_current_state = (yy_last_accepting_state);
1862
1863 yy_find_action:
1864                 yy_act = yy_accept[yy_current_state];
1865
1866                 YY_DO_BEFORE_ACTION;
1867
1868 do_action:      /* This label is used only to access EOF actions. */
1869
1870                 switch ( yy_act )
1871         { /* beginning of action switch */
1872                         case 0: /* must back up */
1873                         /* undo the effects of YY_DO_BEFORE_ACTION */
1874                         *yy_cp = (yy_hold_char);
1875                         yy_cp = (yy_last_accepting_cpos);
1876                         yy_current_state = (yy_last_accepting_state);
1877                         goto yy_find_action;
1878
1879 case 1:
1880 /* rule 1 can match eol */
1881 YY_RULE_SETUP
1882 #line 512 "tokenizer.lex"
1883 {l(); /* single line comment */}
1884         YY_BREAK
1885 case 2:
1886 /* rule 2 can match eol */
1887 YY_RULE_SETUP
1888 #line 513 "tokenizer.lex"
1889 {l(); /* multi line comment */}
1890         YY_BREAK
1891 case 3:
1892 YY_RULE_SETUP
1893 #line 514 "tokenizer.lex"
1894 {syntaxerror("syntax error: unterminated comment", avm2_text);}
1895         YY_BREAK
1896 case 4:
1897 /* rule 4 can match eol */
1898 *yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
1899 (yy_c_buf_p) = yy_cp -= 1;
1900 YY_DO_BEFORE_ACTION; /* set up avm2_text again */
1901 YY_RULE_SETUP
1902 #line 516 "tokenizer.lex"
1903 {l();handleInclude(avm2_text, avm2_leng, 1);}
1904         YY_BREAK
1905 case 5:
1906 /* rule 5 can match eol */
1907 *yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
1908 (yy_c_buf_p) = yy_cp -= 1;
1909 YY_DO_BEFORE_ACTION; /* set up avm2_text again */
1910 YY_RULE_SETUP
1911 #line 517 "tokenizer.lex"
1912 {l();handleInclude(avm2_text, avm2_leng, 0);}
1913         YY_BREAK
1914 case 6:
1915 /* rule 6 can match eol */
1916 YY_RULE_SETUP
1917 #line 518 "tokenizer.lex"
1918 {l(); BEGIN(INITIAL);handleString(avm2_text, avm2_leng);return T_STRING;}
1919         YY_BREAK
1920
1921 case 7:
1922 YY_RULE_SETUP
1923 #line 521 "tokenizer.lex"
1924 {c(); BEGIN(INITIAL);return handleregexp();} 
1925         YY_BREAK
1926 case 8:
1927 YY_RULE_SETUP
1928 #line 522 "tokenizer.lex"
1929 {c(); BEGIN(INITIAL);return handlehex();}
1930         YY_BREAK
1931 case 9:
1932 YY_RULE_SETUP
1933 #line 523 "tokenizer.lex"
1934 {c(); BEGIN(INITIAL);return handlehexfloat();}
1935         YY_BREAK
1936 case 10:
1937 YY_RULE_SETUP
1938 #line 524 "tokenizer.lex"
1939 {c(); BEGIN(INITIAL);return handleint();}
1940         YY_BREAK
1941 case 11:
1942 YY_RULE_SETUP
1943 #line 525 "tokenizer.lex"
1944 {c(); BEGIN(INITIAL);return handlefloat();}
1945         YY_BREAK
1946
1947 case 12:
1948 YY_RULE_SETUP
1949 #line 528 "tokenizer.lex"
1950 {/* utf 8 bom */}
1951         YY_BREAK
1952 case 13:
1953 /* rule 13 can match eol */
1954 YY_RULE_SETUP
1955 #line 529 "tokenizer.lex"
1956 {l();}
1957         YY_BREAK
1958 case 14:
1959 YY_RULE_SETUP
1960 #line 531 "tokenizer.lex"
1961 {c(); BEGIN(INITIAL);return handlehex();}
1962         YY_BREAK
1963 case 15:
1964 YY_RULE_SETUP
1965 #line 532 "tokenizer.lex"
1966 {c(); BEGIN(INITIAL);return handlehexfloat();}
1967         YY_BREAK
1968 case 16:
1969 YY_RULE_SETUP
1970 #line 533 "tokenizer.lex"
1971 {c(); BEGIN(INITIAL);return handleint();}
1972         YY_BREAK
1973 case 17:
1974 YY_RULE_SETUP
1975 #line 534 "tokenizer.lex"
1976 {c(); BEGIN(INITIAL);return handlefloat();}
1977         YY_BREAK
1978 case 18:
1979 YY_RULE_SETUP
1980 #line 536 "tokenizer.lex"
1981 {/* for debugging: generates a tokenizer-level error */
1982                               syntaxerror("3rr0r");}
1983         YY_BREAK
1984 case 19:
1985 /* rule 19 can match eol */
1986 *yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
1987 (yy_c_buf_p) = yy_cp -= 1;
1988 YY_DO_BEFORE_ACTION; /* set up avm2_text again */
1989 YY_RULE_SETUP
1990 #line 539 "tokenizer.lex"
1991 {l();handleLabel(avm2_text, avm2_leng-3);return T_FOR;}
1992         YY_BREAK
1993 case 20:
1994 /* rule 20 can match eol */
1995 *yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
1996 (yy_c_buf_p) = yy_cp -= 1;
1997 YY_DO_BEFORE_ACTION; /* set up avm2_text again */
1998 YY_RULE_SETUP
1999 #line 540 "tokenizer.lex"
2000 {l();handleLabel(avm2_text, avm2_leng-2);return T_DO;}
2001         YY_BREAK
2002 case 21:
2003 /* rule 21 can match eol */
2004 *yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
2005 (yy_c_buf_p) = yy_cp -= 1;
2006 YY_DO_BEFORE_ACTION; /* set up avm2_text again */
2007 YY_RULE_SETUP
2008 #line 541 "tokenizer.lex"
2009 {l();handleLabel(avm2_text, avm2_leng-5);return T_WHILE;}
2010         YY_BREAK
2011 case 22:
2012 /* rule 22 can match eol */
2013 *yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
2014 (yy_c_buf_p) = yy_cp -= 1;
2015 YY_DO_BEFORE_ACTION; /* set up avm2_text again */
2016 YY_RULE_SETUP
2017 #line 542 "tokenizer.lex"
2018 {l();handleLabel(avm2_text, avm2_leng-6);return T_SWITCH;}
2019         YY_BREAK
2020 case 23:
2021 YY_RULE_SETUP
2022 #line 543 "tokenizer.lex"
2023 {c();avm2_lval.id="";return T_FOR;}
2024         YY_BREAK
2025 case 24:
2026 YY_RULE_SETUP
2027 #line 544 "tokenizer.lex"
2028 {c();avm2_lval.id="";return T_DO;}
2029         YY_BREAK
2030 case 25:
2031 YY_RULE_SETUP
2032 #line 545 "tokenizer.lex"
2033 {c();avm2_lval.id="";return T_WHILE;}
2034         YY_BREAK
2035 case 26:
2036 YY_RULE_SETUP
2037 #line 546 "tokenizer.lex"
2038 {c();avm2_lval.id="";return T_SWITCH;}
2039         YY_BREAK
2040 case 27:
2041 YY_RULE_SETUP
2042 #line 548 "tokenizer.lex"
2043 {c();BEGIN(REGEXPOK);return m(T_ANDAND);}
2044         YY_BREAK
2045 case 28:
2046 YY_RULE_SETUP
2047 #line 549 "tokenizer.lex"
2048 {c();BEGIN(REGEXPOK);return m(T_OROR);}
2049         YY_BREAK
2050 case 29:
2051 YY_RULE_SETUP
2052 #line 550 "tokenizer.lex"
2053 {c();BEGIN(REGEXPOK);return m(T_NE);}
2054         YY_BREAK
2055 case 30:
2056 YY_RULE_SETUP
2057 #line 551 "tokenizer.lex"
2058 {c();BEGIN(REGEXPOK);return m(T_NEE);}
2059         YY_BREAK
2060 case 31:
2061 YY_RULE_SETUP
2062 #line 552 "tokenizer.lex"
2063 {c();BEGIN(REGEXPOK);return m(T_EQEQEQ);}
2064         YY_BREAK
2065 case 32:
2066 YY_RULE_SETUP
2067 #line 553 "tokenizer.lex"
2068 {c();BEGIN(REGEXPOK);return m(T_EQEQ);}
2069         YY_BREAK
2070 case 33:
2071 YY_RULE_SETUP
2072 #line 554 "tokenizer.lex"
2073 {c();return m(T_GE);}
2074         YY_BREAK
2075 case 34:
2076 YY_RULE_SETUP
2077 #line 555 "tokenizer.lex"
2078 {c();return m(T_LE);}
2079         YY_BREAK
2080 case 35:
2081 YY_RULE_SETUP
2082 #line 556 "tokenizer.lex"
2083 {c();BEGIN(INITIAL);return m(T_MINUSMINUS);}
2084         YY_BREAK
2085 case 36:
2086 YY_RULE_SETUP
2087 #line 557 "tokenizer.lex"
2088 {c();BEGIN(INITIAL);return m(T_PLUSPLUS);}
2089         YY_BREAK
2090 case 37:
2091 YY_RULE_SETUP
2092 #line 558 "tokenizer.lex"
2093 {c();return m(T_PLUSBY);}
2094         YY_BREAK
2095 case 38:
2096 YY_RULE_SETUP
2097 #line 559 "tokenizer.lex"
2098 {c();return m(T_MINUSBY);}
2099         YY_BREAK
2100 case 39:
2101 YY_RULE_SETUP
2102 #line 560 "tokenizer.lex"
2103 {c();return m(T_DIVBY);}
2104         YY_BREAK
2105 case 40:
2106 YY_RULE_SETUP
2107 #line 561 "tokenizer.lex"
2108 {c();return m(T_MODBY);}
2109         YY_BREAK
2110 case 41:
2111 YY_RULE_SETUP
2112 #line 562 "tokenizer.lex"
2113 {c();return m(T_MULBY);}
2114         YY_BREAK
2115 case 42:
2116 YY_RULE_SETUP
2117 #line 563 "tokenizer.lex"
2118 {c();return m(T_ORBY);}
2119         YY_BREAK
2120 case 43:
2121 YY_RULE_SETUP
2122 #line 564 "tokenizer.lex"
2123 {c();return m(T_SHRBY);}
2124         YY_BREAK
2125 case 44:
2126 YY_RULE_SETUP
2127 #line 565 "tokenizer.lex"
2128 {c();return m(T_SHLBY);}
2129         YY_BREAK
2130 case 45:
2131 YY_RULE_SETUP
2132 #line 566 "tokenizer.lex"
2133 {c();return m(T_USHRBY);}
2134         YY_BREAK
2135 case 46:
2136 YY_RULE_SETUP
2137 #line 567 "tokenizer.lex"
2138 {c();return m(T_SHL);}
2139         YY_BREAK
2140 case 47:
2141 YY_RULE_SETUP
2142 #line 568 "tokenizer.lex"
2143 {c();return m(T_USHR);}
2144         YY_BREAK
2145 case 48:
2146 YY_RULE_SETUP
2147 #line 569 "tokenizer.lex"
2148 {c();return m(T_SHR);}
2149         YY_BREAK
2150 case 49:
2151 YY_RULE_SETUP
2152 #line 570 "tokenizer.lex"
2153 {c();return m(T_DOTDOTDOT);}
2154         YY_BREAK
2155 case 50:
2156 YY_RULE_SETUP
2157 #line 571 "tokenizer.lex"
2158 {c();return m(T_DOTDOT);}
2159         YY_BREAK
2160 case 51:
2161 YY_RULE_SETUP
2162 #line 572 "tokenizer.lex"
2163 {c();return m('.');}
2164         YY_BREAK
2165 case 52:
2166 YY_RULE_SETUP
2167 #line 573 "tokenizer.lex"
2168 {c();return m(T_COLONCOLON);}
2169         YY_BREAK
2170 case 53:
2171 YY_RULE_SETUP
2172 #line 574 "tokenizer.lex"
2173 {c();return m(':');}
2174         YY_BREAK
2175 case 54:
2176 YY_RULE_SETUP
2177 #line 575 "tokenizer.lex"
2178 {c();return m(KW_INSTANCEOF);}
2179         YY_BREAK
2180 case 55:
2181 YY_RULE_SETUP
2182 #line 576 "tokenizer.lex"
2183 {c();return m(KW_IMPLEMENTS);}
2184         YY_BREAK
2185 case 56:
2186 YY_RULE_SETUP
2187 #line 577 "tokenizer.lex"
2188 {c();return m(KW_INTERFACE);}
2189         YY_BREAK
2190 case 57:
2191 YY_RULE_SETUP
2192 #line 578 "tokenizer.lex"
2193 {c();return m(KW_NAMESPACE);}
2194         YY_BREAK
2195 case 58:
2196 YY_RULE_SETUP
2197 #line 579 "tokenizer.lex"
2198 {c();return m(KW_PROTECTED);}
2199         YY_BREAK
2200 case 59:
2201 YY_RULE_SETUP
2202 #line 580 "tokenizer.lex"
2203 {c();return m(KW_UNDEFINED);}
2204         YY_BREAK
2205 case 60:
2206 YY_RULE_SETUP
2207 #line 581 "tokenizer.lex"
2208 {c();return m(KW_CONTINUE);}
2209         YY_BREAK
2210 case 61:
2211 YY_RULE_SETUP
2212 #line 582 "tokenizer.lex"
2213 {c();return m(KW_OVERRIDE);}
2214         YY_BREAK
2215 case 62:
2216 YY_RULE_SETUP
2217 #line 583 "tokenizer.lex"
2218 {c();return m(KW_INTERNAL);}
2219         YY_BREAK
2220 case 63:
2221 YY_RULE_SETUP
2222 #line 584 "tokenizer.lex"
2223 {c();return m(KW_FUNCTION);}
2224         YY_BREAK
2225 case 64:
2226 YY_RULE_SETUP
2227 #line 585 "tokenizer.lex"
2228 {c();return m(KW_FINALLY);}
2229         YY_BREAK
2230 case 65:
2231 YY_RULE_SETUP
2232 #line 586 "tokenizer.lex"
2233 {c();return m(KW_DEFAULT);}
2234         YY_BREAK
2235 case 66:
2236 YY_RULE_SETUP
2237 #line 587 "tokenizer.lex"
2238 {c();return m(KW_PACKAGE);}
2239         YY_BREAK
2240 case 67:
2241 YY_RULE_SETUP
2242 #line 588 "tokenizer.lex"
2243 {c();return m(KW_PRIVATE);}
2244         YY_BREAK
2245 case 68:
2246 YY_RULE_SETUP
2247 #line 589 "tokenizer.lex"
2248 {c();return m(KW_DYNAMIC);}
2249         YY_BREAK
2250 case 69:
2251 YY_RULE_SETUP
2252 #line 590 "tokenizer.lex"
2253 {c();return m(KW_EXTENDS);}
2254         YY_BREAK
2255 case 70:
2256 YY_RULE_SETUP
2257 #line 591 "tokenizer.lex"
2258 {c();return m(KW_DELETE);}
2259         YY_BREAK
2260 case 71:
2261 YY_RULE_SETUP
2262 #line 592 "tokenizer.lex"
2263 {c();return m(KW_RETURN);}
2264         YY_BREAK
2265 case 72:
2266 YY_RULE_SETUP
2267 #line 593 "tokenizer.lex"
2268 {c();return m(KW_PUBLIC);}
2269         YY_BREAK
2270 case 73:
2271 YY_RULE_SETUP
2272 #line 594 "tokenizer.lex"
2273 {c();return m(KW_NATIVE);}
2274         YY_BREAK
2275 case 74:
2276 YY_RULE_SETUP
2277 #line 595 "tokenizer.lex"
2278 {c();return m(KW_STATIC);}
2279         YY_BREAK
2280 case 75:
2281 YY_RULE_SETUP
2282 #line 596 "tokenizer.lex"
2283 {c();return m(KW_IMPORT);}
2284         YY_BREAK
2285 case 76:
2286 YY_RULE_SETUP
2287 #line 597 "tokenizer.lex"
2288 {c();return m(KW_TYPEOF);}
2289         YY_BREAK
2290 case 77:
2291 YY_RULE_SETUP
2292 #line 598 "tokenizer.lex"
2293 {c();return m(KW_THROW);}
2294         YY_BREAK
2295 case 78:
2296 YY_RULE_SETUP
2297 #line 599 "tokenizer.lex"
2298 {c();return m(KW_CLASS);}
2299         YY_BREAK
2300 case 79:
2301 YY_RULE_SETUP
2302 #line 600 "tokenizer.lex"
2303 {c();return m(KW_CONST);}
2304         YY_BREAK
2305 case 80:
2306 YY_RULE_SETUP
2307 #line 601 "tokenizer.lex"
2308 {c();return m(KW_CATCH);}
2309         YY_BREAK
2310 case 81:
2311 YY_RULE_SETUP
2312 #line 602 "tokenizer.lex"
2313 {c();return m(KW_FINAL);}
2314         YY_BREAK
2315 case 82:
2316 YY_RULE_SETUP
2317 #line 603 "tokenizer.lex"
2318 {c();return m(KW_FALSE);}
2319         YY_BREAK
2320 case 83:
2321 YY_RULE_SETUP
2322 #line 604 "tokenizer.lex"
2323 {c();return m(KW_BREAK);}
2324         YY_BREAK
2325 case 84:
2326 YY_RULE_SETUP
2327 #line 605 "tokenizer.lex"
2328 {c();return m(KW_SUPER);}
2329         YY_BREAK
2330 case 85:
2331 YY_RULE_SETUP
2332 #line 606 "tokenizer.lex"
2333 {c();return m(KW_EACH);}
2334         YY_BREAK
2335 case 86:
2336 YY_RULE_SETUP
2337 #line 607 "tokenizer.lex"
2338 {c();return m(KW_VOID);}
2339         YY_BREAK
2340 case 87:
2341 YY_RULE_SETUP
2342 #line 608 "tokenizer.lex"
2343 {c();return m(KW_TRUE);}
2344         YY_BREAK
2345 case 88:
2346 YY_RULE_SETUP
2347 #line 609 "tokenizer.lex"
2348 {c();return m(KW_NULL);}
2349         YY_BREAK
2350 case 89:
2351 YY_RULE_SETUP
2352 #line 610 "tokenizer.lex"
2353 {c();return m(KW_ELSE);}
2354         YY_BREAK
2355 case 90:
2356 YY_RULE_SETUP
2357 #line 611 "tokenizer.lex"
2358 {c();return m(KW_CASE);}
2359         YY_BREAK
2360 case 91:
2361 YY_RULE_SETUP
2362 #line 612 "tokenizer.lex"
2363 {c();return m(KW_WITH);}
2364         YY_BREAK
2365 case 92:
2366 YY_RULE_SETUP
2367 #line 613 "tokenizer.lex"
2368 {c();return m(KW_USE);}
2369         YY_BREAK
2370 case 93:
2371 YY_RULE_SETUP
2372 #line 614 "tokenizer.lex"
2373 {c();return m(KW_NEW);}
2374         YY_BREAK
2375 case 94:
2376 YY_RULE_SETUP
2377 #line 615 "tokenizer.lex"
2378 {c();return m(KW_GET);}
2379         YY_BREAK
2380 case 95:
2381 YY_RULE_SETUP
2382 #line 616 "tokenizer.lex"
2383 {c();return m(KW_SET);}
2384         YY_BREAK
2385 case 96:
2386 YY_RULE_SETUP
2387 #line 617 "tokenizer.lex"
2388 {c();return m(KW_VAR);}
2389         YY_BREAK
2390 case 97:
2391 YY_RULE_SETUP
2392 #line 618 "tokenizer.lex"
2393 {c();return m(KW_TRY);}
2394         YY_BREAK
2395 case 98:
2396 YY_RULE_SETUP
2397 #line 619 "tokenizer.lex"
2398 {c();return m(KW_IS) ;}
2399         YY_BREAK
2400 case 99:
2401 YY_RULE_SETUP
2402 #line 620 "tokenizer.lex"
2403 {c();return m(KW_IN) ;}
2404         YY_BREAK
2405 case 100:
2406 YY_RULE_SETUP
2407 #line 621 "tokenizer.lex"
2408 {c();return m(KW_IF) ;}
2409         YY_BREAK
2410 case 101:
2411 YY_RULE_SETUP
2412 #line 622 "tokenizer.lex"
2413 {c();return m(KW_AS);}
2414         YY_BREAK
2415 case 102:
2416 YY_RULE_SETUP
2417 #line 623 "tokenizer.lex"
2418 {c();BEGIN(INITIAL);return mkid(T_IDENTIFIER);}
2419         YY_BREAK
2420 case 103:
2421 YY_RULE_SETUP
2422 #line 625 "tokenizer.lex"
2423 {c();BEGIN(REGEXPOK);return m(avm2_text[0]);}
2424         YY_BREAK
2425 case 104:
2426 YY_RULE_SETUP
2427 #line 626 "tokenizer.lex"
2428 {c();BEGIN(INITIAL);return m(avm2_text[0]);}
2429         YY_BREAK
2430 case 105:
2431 YY_RULE_SETUP
2432 #line 628 "tokenizer.lex"
2433 {char c1=avm2_text[0];
2434                               char buf[128];
2435                               buf[0] = avm2_text[0];
2436                               int t;
2437                               for(t=1;t<128;t++) {
2438                                   char c = buf[t]=input();
2439                                   if(c=='\n' || c==EOF)  {
2440                                       buf[t] = 0;
2441                                       break;
2442                                   }
2443                               }
2444                               if(c1>='0' && c1<='9')
2445                                   syntaxerror("syntax error: %s (identifiers must not start with a digit)");
2446                               else
2447                                   syntaxerror("syntax error: %s", buf);
2448                               printf("\n");
2449                               exit(1);
2450                               yyterminate();
2451                              }
2452         YY_BREAK
2453 case YY_STATE_EOF(INITIAL):
2454 case YY_STATE_EOF(REGEXPOK):
2455 case YY_STATE_EOF(BEGINNING):
2456 #line 647 "tokenizer.lex"
2457 {l();
2458                               void*b = leave_file();
2459                               if (!b) {
2460                                  yyterminate();
2461                                  avm2__delete_buffer(YY_CURRENT_BUFFER);
2462                                  return m(T_EOF);
2463                               } else {
2464                                   avm2__delete_buffer(YY_CURRENT_BUFFER);
2465                                   avm2__switch_to_buffer(b);
2466                               }
2467                              }
2468         YY_BREAK
2469 case 106:
2470 YY_RULE_SETUP
2471 #line 659 "tokenizer.lex"
2472 ECHO;
2473         YY_BREAK
2474 #line 2475 "tokenizer.yy.c"
2475
2476         case YY_END_OF_BUFFER:
2477                 {
2478                 /* Amount of text matched not including the EOB char. */
2479                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2480
2481                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2482                 *yy_cp = (yy_hold_char);
2483                 YY_RESTORE_YY_MORE_OFFSET
2484
2485                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2486                         {
2487                         /* We're scanning a new file or input source.  It's
2488                          * possible that this happened because the user
2489                          * just pointed avm2_in at a new source and called
2490                          * avm2_lex().  If so, then we have to assure
2491                          * consistency between YY_CURRENT_BUFFER and our
2492                          * globals.  Here is the right place to do so, because
2493                          * this is the first action (other than possibly a
2494                          * back-up) that will match for the new input source.
2495                          */
2496                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2497                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = avm2_in;
2498                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2499                         }
2500
2501                 /* Note that here we test for yy_c_buf_p "<=" to the position
2502                  * of the first EOB in the buffer, since yy_c_buf_p will
2503                  * already have been incremented past the NUL character
2504                  * (since all states make transitions on EOB to the
2505                  * end-of-buffer state).  Contrast this with the test
2506                  * in input().
2507                  */
2508                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2509                         { /* This was really a NUL. */
2510                         yy_state_type yy_next_state;
2511
2512                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2513
2514                         yy_current_state = yy_get_previous_state(  );
2515
2516                         /* Okay, we're now positioned to make the NUL
2517                          * transition.  We couldn't have
2518                          * yy_get_previous_state() go ahead and do it
2519                          * for us because it doesn't know how to deal
2520                          * with the possibility of jamming (and we don't
2521                          * want to build jamming into it because then it
2522                          * will run more slowly).
2523                          */
2524
2525                         yy_next_state = yy_try_NUL_trans( yy_current_state );
2526
2527                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2528
2529                         if ( yy_next_state )
2530                                 {
2531                                 /* Consume the NUL. */
2532                                 yy_cp = ++(yy_c_buf_p);
2533                                 yy_current_state = yy_next_state;
2534                                 goto yy_match;
2535                                 }
2536
2537                         else
2538                                 {
2539                                 yy_cp = (yy_last_accepting_cpos);
2540                                 yy_current_state = (yy_last_accepting_state);
2541                                 goto yy_find_action;
2542                                 }
2543                         }
2544
2545                 else switch ( yy_get_next_buffer(  ) )
2546                         {
2547                         case EOB_ACT_END_OF_FILE:
2548                                 {
2549                                 (yy_did_buffer_switch_on_eof) = 0;
2550
2551                                 if ( avm2_wrap( ) )
2552                                         {
2553                                         /* Note: because we've taken care in
2554                                          * yy_get_next_buffer() to have set up
2555                                          * avm2_text, we can now set up
2556                                          * yy_c_buf_p so that if some total
2557                                          * hoser (like flex itself) wants to
2558                                          * call the scanner after we return the
2559                                          * YY_NULL, it'll still work - another
2560                                          * YY_NULL will get returned.
2561                                          */
2562                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2563
2564                                         yy_act = YY_STATE_EOF(YY_START);
2565                                         goto do_action;
2566                                         }
2567
2568                                 else
2569                                         {
2570                                         if ( ! (yy_did_buffer_switch_on_eof) )
2571                                                 YY_NEW_FILE;
2572                                         }
2573                                 break;
2574                                 }
2575
2576                         case EOB_ACT_CONTINUE_SCAN:
2577                                 (yy_c_buf_p) =
2578                                         (yytext_ptr) + yy_amount_of_matched_text;
2579
2580                                 yy_current_state = yy_get_previous_state(  );
2581
2582                                 yy_cp = (yy_c_buf_p);
2583                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2584                                 goto yy_match;
2585
2586                         case EOB_ACT_LAST_MATCH:
2587                                 (yy_c_buf_p) =
2588                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2589
2590                                 yy_current_state = yy_get_previous_state(  );
2591
2592                                 yy_cp = (yy_c_buf_p);
2593                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2594                                 goto yy_find_action;
2595                         }
2596                 break;
2597                 }
2598
2599         default:
2600                 YY_FATAL_ERROR(
2601                         "fatal flex scanner internal error--no action found" );
2602         } /* end of action switch */
2603                 } /* end of scanning one token */
2604 } /* end of avm2_lex */
2605
2606 /* yy_get_next_buffer - try to read in a new buffer
2607  *
2608  * Returns a code representing an action:
2609  *      EOB_ACT_LAST_MATCH -
2610  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2611  *      EOB_ACT_END_OF_FILE - end of file
2612  */
2613 static int yy_get_next_buffer (void)
2614 {
2615         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2616         register char *source = (yytext_ptr);
2617         register int number_to_move, i;
2618         int ret_val;
2619
2620         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2621                 YY_FATAL_ERROR(
2622                 "fatal flex scanner internal error--end of buffer missed" );
2623
2624         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2625                 { /* Don't try to fill the buffer, so this is an EOF. */
2626                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2627                         {
2628                         /* We matched a single character, the EOB, so
2629                          * treat this as a final EOF.
2630                          */
2631                         return EOB_ACT_END_OF_FILE;
2632                         }
2633
2634                 else
2635                         {
2636                         /* We matched some text prior to the EOB, first
2637                          * process it.
2638                          */
2639                         return EOB_ACT_LAST_MATCH;
2640                         }
2641                 }
2642
2643         /* Try to read more data. */
2644
2645         /* First move last chars to start of buffer. */
2646         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2647
2648         for ( i = 0; i < number_to_move; ++i )
2649                 *(dest++) = *(source++);
2650
2651         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2652                 /* don't do the read, it's not guaranteed to return an EOF,
2653                  * just force an EOF
2654                  */
2655                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2656
2657         else
2658                 {
2659                         int num_to_read =
2660                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2661
2662                 while ( num_to_read <= 0 )
2663                         { /* Not enough room in the buffer - grow it. */
2664
2665                         /* just a shorter name for the current buffer */
2666                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2667
2668                         int yy_c_buf_p_offset =
2669                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
2670
2671                         if ( b->yy_is_our_buffer )
2672                                 {
2673                                 int new_size = b->yy_buf_size * 2;
2674
2675                                 if ( new_size <= 0 )
2676                                         b->yy_buf_size += b->yy_buf_size / 8;
2677                                 else
2678                                         b->yy_buf_size *= 2;
2679
2680                                 b->yy_ch_buf = (char *)
2681                                         /* Include room in for 2 EOB chars. */
2682                                         avm2_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
2683                                 }
2684                         else
2685                                 /* Can't grow it, we don't own it. */
2686                                 b->yy_ch_buf = 0;
2687
2688                         if ( ! b->yy_ch_buf )
2689                                 YY_FATAL_ERROR(
2690                                 "fatal error - scanner input buffer overflow" );
2691
2692                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2693
2694                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2695                                                 number_to_move - 1;
2696
2697                         }
2698
2699                 if ( num_to_read > YY_READ_BUF_SIZE )
2700                         num_to_read = YY_READ_BUF_SIZE;
2701
2702                 /* Read in more data. */
2703                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2704                         (yy_n_chars), (size_t) num_to_read );
2705
2706                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2707                 }
2708
2709         if ( (yy_n_chars) == 0 )
2710                 {
2711                 if ( number_to_move == YY_MORE_ADJ )
2712                         {
2713                         ret_val = EOB_ACT_END_OF_FILE;
2714                         avm2_restart(avm2_in  );
2715                         }
2716
2717                 else
2718                         {
2719                         ret_val = EOB_ACT_LAST_MATCH;
2720                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2721                                 YY_BUFFER_EOF_PENDING;
2722                         }
2723                 }
2724
2725         else
2726                 ret_val = EOB_ACT_CONTINUE_SCAN;
2727
2728         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2729                 /* Extend the array by 50%, plus the number we really need. */
2730                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2731                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) avm2_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
2732                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2733                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2734         }
2735
2736         (yy_n_chars) += number_to_move;
2737         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2738         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2739
2740         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2741
2742         return ret_val;
2743 }
2744
2745 /* yy_get_previous_state - get the state just before the EOB char was reached */
2746
2747     static yy_state_type yy_get_previous_state (void)
2748 {
2749         register yy_state_type yy_current_state;
2750         register char *yy_cp;
2751     
2752         yy_current_state = (yy_start);
2753         yy_current_state += YY_AT_BOL();
2754
2755         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2756                 {
2757                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2758                 if ( yy_accept[yy_current_state] )
2759                         {
2760                         (yy_last_accepting_state) = yy_current_state;
2761                         (yy_last_accepting_cpos) = yy_cp;
2762                         }
2763                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2764                         {
2765                         yy_current_state = (int) yy_def[yy_current_state];
2766                         if ( yy_current_state >= 468 )
2767                                 yy_c = yy_meta[(unsigned int) yy_c];
2768                         }
2769                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2770                 }
2771
2772         return yy_current_state;
2773 }
2774
2775 /* yy_try_NUL_trans - try to make a transition on the NUL character
2776  *
2777  * synopsis
2778  *      next_state = yy_try_NUL_trans( current_state );
2779  */
2780     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
2781 {
2782         register int yy_is_jam;
2783         register char *yy_cp = (yy_c_buf_p);
2784
2785         register YY_CHAR yy_c = 1;
2786         if ( yy_accept[yy_current_state] )
2787                 {
2788                 (yy_last_accepting_state) = yy_current_state;
2789                 (yy_last_accepting_cpos) = yy_cp;
2790                 }
2791         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2792                 {
2793                 yy_current_state = (int) yy_def[yy_current_state];
2794                 if ( yy_current_state >= 468 )
2795                         yy_c = yy_meta[(unsigned int) yy_c];
2796                 }
2797         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2798         yy_is_jam = (yy_current_state == 467);
2799
2800         return yy_is_jam ? 0 : yy_current_state;
2801 }
2802
2803     static void yyunput (int c, register char * yy_bp )
2804 {
2805         register char *yy_cp;
2806     
2807     yy_cp = (yy_c_buf_p);
2808
2809         /* undo effects of setting up avm2_text */
2810         *yy_cp = (yy_hold_char);
2811
2812         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2813                 { /* need to shift things up to make room */
2814                 /* +2 for EOB chars. */
2815                 register int number_to_move = (yy_n_chars) + 2;
2816                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2817                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2818                 register char *source =
2819                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2820
2821                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2822                         *--dest = *--source;
2823
2824                 yy_cp += (int) (dest - source);
2825                 yy_bp += (int) (dest - source);
2826                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2827                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2828
2829                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2830                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2831                 }
2832
2833         *--yy_cp = (char) c;
2834
2835         (yytext_ptr) = yy_bp;
2836         (yy_hold_char) = *yy_cp;
2837         (yy_c_buf_p) = yy_cp;
2838 }
2839
2840 #ifndef YY_NO_INPUT
2841 #ifdef __cplusplus
2842     static int yyinput (void)
2843 #else
2844     static int input  (void)
2845 #endif
2846
2847 {
2848         int c;
2849     
2850         *(yy_c_buf_p) = (yy_hold_char);
2851
2852         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2853                 {
2854                 /* yy_c_buf_p now points to the character we want to return.
2855                  * If this occurs *before* the EOB characters, then it's a
2856                  * valid NUL; if not, then we've hit the end of the buffer.
2857                  */
2858                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2859                         /* This was really a NUL. */
2860                         *(yy_c_buf_p) = '\0';
2861
2862                 else
2863                         { /* need more input */
2864                         int offset = (yy_c_buf_p) - (yytext_ptr);
2865                         ++(yy_c_buf_p);
2866
2867                         switch ( yy_get_next_buffer(  ) )
2868                                 {
2869                                 case EOB_ACT_LAST_MATCH:
2870                                         /* This happens because yy_g_n_b()
2871                                          * sees that we've accumulated a
2872                                          * token and flags that we need to
2873                                          * try matching the token before
2874                                          * proceeding.  But for input(),
2875                                          * there's no matching to consider.
2876                                          * So convert the EOB_ACT_LAST_MATCH
2877                                          * to EOB_ACT_END_OF_FILE.
2878                                          */
2879
2880                                         /* Reset buffer status. */
2881                                         avm2_restart(avm2_in );
2882
2883                                         /*FALLTHROUGH*/
2884
2885                                 case EOB_ACT_END_OF_FILE:
2886                                         {
2887                                         if ( avm2_wrap( ) )
2888                                                 return EOF;
2889
2890                                         if ( ! (yy_did_buffer_switch_on_eof) )
2891                                                 YY_NEW_FILE;
2892 #ifdef __cplusplus
2893                                         return yyinput();
2894 #else
2895                                         return input();
2896 #endif
2897                                         }
2898
2899                                 case EOB_ACT_CONTINUE_SCAN:
2900                                         (yy_c_buf_p) = (yytext_ptr) + offset;
2901                                         break;
2902                                 }
2903                         }
2904                 }
2905
2906         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
2907         *(yy_c_buf_p) = '\0';   /* preserve avm2_text */
2908         (yy_hold_char) = *++(yy_c_buf_p);
2909
2910         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2911
2912         return c;
2913 }
2914 #endif  /* ifndef YY_NO_INPUT */
2915
2916 /** Immediately switch to a different input stream.
2917  * @param input_file A readable stream.
2918  * 
2919  * @note This function does not reset the start condition to @c INITIAL .
2920  */
2921     void avm2_restart  (FILE * input_file )
2922 {
2923     
2924         if ( ! YY_CURRENT_BUFFER ){
2925         avm2_ensure_buffer_stack ();
2926                 YY_CURRENT_BUFFER_LVALUE =
2927             avm2__create_buffer(avm2_in,YY_BUF_SIZE );
2928         }
2929
2930         avm2__init_buffer(YY_CURRENT_BUFFER,input_file );
2931         avm2__load_buffer_state( );
2932 }
2933
2934 /** Switch to a different input buffer.
2935  * @param new_buffer The new input buffer.
2936  * 
2937  */
2938     void avm2__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2939 {
2940     
2941         /* TODO. We should be able to replace this entire function body
2942          * with
2943          *              avm2_pop_buffer_state();
2944          *              avm2_push_buffer_state(new_buffer);
2945      */
2946         avm2_ensure_buffer_stack ();
2947         if ( YY_CURRENT_BUFFER == new_buffer )
2948                 return;
2949
2950         if ( YY_CURRENT_BUFFER )
2951                 {
2952                 /* Flush out information for old buffer. */
2953                 *(yy_c_buf_p) = (yy_hold_char);
2954                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2955                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2956                 }
2957
2958         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2959         avm2__load_buffer_state( );
2960
2961         /* We don't actually know whether we did this switch during
2962          * EOF (avm2_wrap()) processing, but the only time this flag
2963          * is looked at is after avm2_wrap() is called, so it's safe
2964          * to go ahead and always set it.
2965          */
2966         (yy_did_buffer_switch_on_eof) = 1;
2967 }
2968
2969 static void avm2__load_buffer_state  (void)
2970 {
2971         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2972         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2973         avm2_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2974         (yy_hold_char) = *(yy_c_buf_p);
2975 }
2976
2977 /** Allocate and initialize an input buffer state.
2978  * @param file A readable stream.
2979  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2980  * 
2981  * @return the allocated buffer state.
2982  */
2983     YY_BUFFER_STATE avm2__create_buffer  (FILE * file, int  size )
2984 {
2985         YY_BUFFER_STATE b;
2986     
2987         b = (YY_BUFFER_STATE) avm2_alloc(sizeof( struct yy_buffer_state )  );
2988         if ( ! b )
2989                 YY_FATAL_ERROR( "out of dynamic memory in avm2__create_buffer()" );
2990
2991         b->yy_buf_size = size;
2992
2993         /* yy_ch_buf has to be 2 characters longer than the size given because
2994          * we need to put in 2 end-of-buffer characters.
2995          */
2996         b->yy_ch_buf = (char *) avm2_alloc(b->yy_buf_size + 2  );
2997         if ( ! b->yy_ch_buf )
2998                 YY_FATAL_ERROR( "out of dynamic memory in avm2__create_buffer()" );
2999
3000         b->yy_is_our_buffer = 1;
3001
3002         avm2__init_buffer(b,file );
3003
3004         return b;
3005 }
3006
3007 /** Destroy the buffer.
3008  * @param b a buffer created with avm2__create_buffer()
3009  * 
3010  */
3011     void avm2__delete_buffer (YY_BUFFER_STATE  b )
3012 {
3013     
3014         if ( ! b )
3015                 return;
3016
3017         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3018                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3019
3020         if ( b->yy_is_our_buffer )
3021                 avm2_free((void *) b->yy_ch_buf  );
3022
3023         avm2_free((void *) b  );
3024 }
3025
3026 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
3027 #ifdef __cplusplus
3028 extern "C" {
3029 #endif
3030 #ifdef __THROW /* this is a gnuism */
3031 extern int isatty (int ) __THROW;
3032 #else
3033 extern int isatty (int );
3034 #endif
3035 #ifdef __cplusplus
3036 }
3037 #endif
3038 #endif
3039     
3040 /* Initializes or reinitializes a buffer.
3041  * This function is sometimes called more than once on the same buffer,
3042  * such as during a avm2_restart() or at EOF.
3043  */
3044     static void avm2__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
3045
3046 {
3047         int oerrno = errno;
3048     
3049         avm2__flush_buffer(b );
3050
3051         b->yy_input_file = file;
3052         b->yy_fill_buffer = 1;
3053
3054     /* If b is the current buffer, then avm2__init_buffer was _probably_
3055      * called from avm2_restart() or through yy_get_next_buffer.
3056      * In that case, we don't want to reset the lineno or column.
3057      */
3058     if (b != YY_CURRENT_BUFFER){
3059         b->yy_bs_lineno = 1;
3060         b->yy_bs_column = 0;
3061     }
3062
3063         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3064     
3065         errno = oerrno;
3066 }
3067
3068 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3069  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3070  * 
3071  */
3072     void avm2__flush_buffer (YY_BUFFER_STATE  b )
3073 {
3074         if ( ! b )
3075                 return;
3076
3077         b->yy_n_chars = 0;
3078
3079         /* We always need two end-of-buffer characters.  The first causes
3080          * a transition to the end-of-buffer state.  The second causes
3081          * a jam in that state.
3082          */
3083         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3084         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3085
3086         b->yy_buf_pos = &b->yy_ch_buf[0];
3087
3088         b->yy_at_bol = 1;
3089         b->yy_buffer_status = YY_BUFFER_NEW;
3090
3091         if ( b == YY_CURRENT_BUFFER )
3092                 avm2__load_buffer_state( );
3093 }
3094
3095 /** Pushes the new state onto the stack. The new state becomes
3096  *  the current state. This function will allocate the stack
3097  *  if necessary.
3098  *  @param new_buffer The new state.
3099  *  
3100  */
3101 void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer )
3102 {
3103         if (new_buffer == NULL)
3104                 return;
3105
3106         avm2_ensure_buffer_stack();
3107
3108         /* This block is copied from avm2__switch_to_buffer. */
3109         if ( YY_CURRENT_BUFFER )
3110                 {
3111                 /* Flush out information for old buffer. */
3112                 *(yy_c_buf_p) = (yy_hold_char);
3113                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3114                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3115                 }
3116
3117         /* Only push if top exists. Otherwise, replace top. */
3118         if (YY_CURRENT_BUFFER)
3119                 (yy_buffer_stack_top)++;
3120         YY_CURRENT_BUFFER_LVALUE = new_buffer;
3121
3122         /* copied from avm2__switch_to_buffer. */
3123         avm2__load_buffer_state( );
3124         (yy_did_buffer_switch_on_eof) = 1;
3125 }
3126
3127 /** Removes and deletes the top of the stack, if present.
3128  *  The next element becomes the new top.
3129  *  
3130  */
3131 void avm2_pop_buffer_state (void)
3132 {
3133         if (!YY_CURRENT_BUFFER)
3134                 return;
3135
3136         avm2__delete_buffer(YY_CURRENT_BUFFER );
3137         YY_CURRENT_BUFFER_LVALUE = NULL;
3138         if ((yy_buffer_stack_top) > 0)
3139                 --(yy_buffer_stack_top);
3140
3141         if (YY_CURRENT_BUFFER) {
3142                 avm2__load_buffer_state( );
3143                 (yy_did_buffer_switch_on_eof) = 1;
3144         }
3145 }
3146
3147 /* Allocates the stack if it does not exist.
3148  *  Guarantees space for at least one push.
3149  */
3150 static void avm2_ensure_buffer_stack (void)
3151 {
3152         int num_to_alloc;
3153     
3154         if (!(yy_buffer_stack)) {
3155
3156                 /* First allocation is just for 2 elements, since we don't know if this
3157                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
3158                  * immediate realloc on the next call.
3159          */
3160                 num_to_alloc = 1;
3161                 (yy_buffer_stack) = (struct yy_buffer_state**)avm2_alloc
3162                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
3163                                                                 );
3164                 if ( ! (yy_buffer_stack) )
3165                         YY_FATAL_ERROR( "out of dynamic memory in avm2_ensure_buffer_stack()" );
3166                                                                   
3167                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3168                                 
3169                 (yy_buffer_stack_max) = num_to_alloc;
3170                 (yy_buffer_stack_top) = 0;
3171                 return;
3172         }
3173
3174         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3175
3176                 /* Increase the buffer to prepare for a possible push. */
3177                 int grow_size = 8 /* arbitrary grow size */;
3178
3179                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3180                 (yy_buffer_stack) = (struct yy_buffer_state**)avm2_realloc
3181                                                                 ((yy_buffer_stack),
3182                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
3183                                                                 );
3184                 if ( ! (yy_buffer_stack) )
3185                         YY_FATAL_ERROR( "out of dynamic memory in avm2_ensure_buffer_stack()" );
3186
3187                 /* zero only the new slots.*/
3188                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3189                 (yy_buffer_stack_max) = num_to_alloc;
3190         }
3191 }
3192
3193 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3194  * @param base the character buffer
3195  * @param size the size in bytes of the character buffer
3196  * 
3197  * @return the newly allocated buffer state object. 
3198  */
3199 YY_BUFFER_STATE avm2__scan_buffer  (char * base, yy_size_t  size )
3200 {
3201         YY_BUFFER_STATE b;
3202     
3203         if ( size < 2 ||
3204              base[size-2] != YY_END_OF_BUFFER_CHAR ||
3205              base[size-1] != YY_END_OF_BUFFER_CHAR )
3206                 /* They forgot to leave room for the EOB's. */
3207                 return 0;
3208
3209         b = (YY_BUFFER_STATE) avm2_alloc(sizeof( struct yy_buffer_state )  );
3210         if ( ! b )
3211                 YY_FATAL_ERROR( "out of dynamic memory in avm2__scan_buffer()" );
3212
3213         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3214         b->yy_buf_pos = b->yy_ch_buf = base;
3215         b->yy_is_our_buffer = 0;
3216         b->yy_input_file = 0;
3217         b->yy_n_chars = b->yy_buf_size;
3218         b->yy_is_interactive = 0;
3219         b->yy_at_bol = 1;
3220         b->yy_fill_buffer = 0;
3221         b->yy_buffer_status = YY_BUFFER_NEW;
3222
3223         avm2__switch_to_buffer(b  );
3224
3225         return b;
3226 }
3227
3228 /** Setup the input buffer state to scan a string. The next call to avm2_lex() will
3229  * scan from a @e copy of @a str.
3230  * @param yystr a NUL-terminated string to scan
3231  * 
3232  * @return the newly allocated buffer state object.
3233  * @note If you want to scan bytes that may contain NUL values, then use
3234  *       avm2__scan_bytes() instead.
3235  */
3236 YY_BUFFER_STATE avm2__scan_string (yyconst char * yystr )
3237 {
3238     
3239         return avm2__scan_bytes(yystr,strlen(yystr) );
3240 }
3241
3242 /** Setup the input buffer state to scan the given bytes. The next call to avm2_lex() will
3243  * scan from a @e copy of @a bytes.
3244  * @param bytes the byte buffer to scan
3245  * @param len the number of bytes in the buffer pointed to by @a bytes.
3246  * 
3247  * @return the newly allocated buffer state object.
3248  */
3249 YY_BUFFER_STATE avm2__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
3250 {
3251         YY_BUFFER_STATE b;
3252         char *buf;
3253         yy_size_t n;
3254         int i;
3255     
3256         /* Get memory for full buffer, including space for trailing EOB's. */
3257         n = _yybytes_len + 2;
3258         buf = (char *) avm2_alloc(n  );
3259         if ( ! buf )
3260                 YY_FATAL_ERROR( "out of dynamic memory in avm2__scan_bytes()" );
3261
3262         for ( i = 0; i < _yybytes_len; ++i )
3263                 buf[i] = yybytes[i];
3264
3265         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3266
3267         b = avm2__scan_buffer(buf,n );
3268         if ( ! b )
3269                 YY_FATAL_ERROR( "bad buffer in avm2__scan_bytes()" );
3270
3271         /* It's okay to grow etc. this buffer, and we should throw it
3272          * away when we're done.
3273          */
3274         b->yy_is_our_buffer = 1;
3275
3276         return b;
3277 }
3278
3279 #ifndef YY_EXIT_FAILURE
3280 #define YY_EXIT_FAILURE 2
3281 #endif
3282
3283 static void yy_fatal_error (yyconst char* msg )
3284 {
3285         (void) fprintf( stderr, "%s\n", msg );
3286         exit( YY_EXIT_FAILURE );
3287 }
3288
3289 /* Redefine yyless() so it works in section 3 code. */
3290
3291 #undef yyless
3292 #define yyless(n) \
3293         do \
3294                 { \
3295                 /* Undo effects of setting up avm2_text. */ \
3296         int yyless_macro_arg = (n); \
3297         YY_LESS_LINENO(yyless_macro_arg);\
3298                 avm2_text[avm2_leng] = (yy_hold_char); \
3299                 (yy_c_buf_p) = avm2_text + yyless_macro_arg; \
3300                 (yy_hold_char) = *(yy_c_buf_p); \
3301                 *(yy_c_buf_p) = '\0'; \
3302                 avm2_leng = yyless_macro_arg; \
3303                 } \
3304         while ( 0 )
3305
3306 /* Accessor  methods (get/set functions) to struct members. */
3307
3308 /** Get the current line number.
3309  * 
3310  */
3311 int avm2_get_lineno  (void)
3312 {
3313         
3314     return avm2_lineno;
3315 }
3316
3317 /** Get the input stream.
3318  * 
3319  */
3320 FILE *avm2_get_in  (void)
3321 {
3322         return avm2_in;
3323 }
3324
3325 /** Get the output stream.
3326  * 
3327  */
3328 FILE *avm2_get_out  (void)
3329 {
3330         return avm2_out;
3331 }
3332
3333 /** Get the length of the current token.
3334  * 
3335  */
3336 int avm2_get_leng  (void)
3337 {
3338         return avm2_leng;
3339 }
3340
3341 /** Get the current token.
3342  * 
3343  */
3344
3345 char *avm2_get_text  (void)
3346 {
3347         return avm2_text;
3348 }
3349
3350 /** Set the current line number.
3351  * @param line_number
3352  * 
3353  */
3354 void avm2_set_lineno (int  line_number )
3355 {
3356     
3357     avm2_lineno = line_number;
3358 }
3359
3360 /** Set the input stream. This does not discard the current
3361  * input buffer.
3362  * @param in_str A readable stream.
3363  * 
3364  * @see avm2__switch_to_buffer
3365  */
3366 void avm2_set_in (FILE *  in_str )
3367 {
3368         avm2_in = in_str ;
3369 }
3370
3371 void avm2_set_out (FILE *  out_str )
3372 {
3373         avm2_out = out_str ;
3374 }
3375
3376 int avm2_get_debug  (void)
3377 {
3378         return avm2__flex_debug;
3379 }
3380
3381 void avm2_set_debug (int  bdebug )
3382 {
3383         avm2__flex_debug = bdebug ;
3384 }
3385
3386 static int yy_init_globals (void)
3387 {
3388         /* Initialization is the same as for the non-reentrant scanner.
3389      * This function is called from avm2_lex_destroy(), so don't allocate here.
3390      */
3391
3392     (yy_buffer_stack) = 0;
3393     (yy_buffer_stack_top) = 0;
3394     (yy_buffer_stack_max) = 0;
3395     (yy_c_buf_p) = (char *) 0;
3396     (yy_init) = 0;
3397     (yy_start) = 0;
3398
3399 /* Defined in main.c */
3400 #ifdef YY_STDINIT
3401     avm2_in = stdin;
3402     avm2_out = stdout;
3403 #else
3404     avm2_in = (FILE *) 0;
3405     avm2_out = (FILE *) 0;
3406 #endif
3407
3408     /* For future reference: Set errno on error, since we are called by
3409      * avm2_lex_init()
3410      */
3411     return 0;
3412 }
3413
3414 /* avm2_lex_destroy is for both reentrant and non-reentrant scanners. */
3415 int avm2_lex_destroy  (void)
3416 {
3417     
3418     /* Pop the buffer stack, destroying each element. */
3419         while(YY_CURRENT_BUFFER){
3420                 avm2__delete_buffer(YY_CURRENT_BUFFER  );
3421                 YY_CURRENT_BUFFER_LVALUE = NULL;
3422                 avm2_pop_buffer_state();
3423         }
3424
3425         /* Destroy the stack itself. */
3426         avm2_free((yy_buffer_stack) );
3427         (yy_buffer_stack) = NULL;
3428
3429     /* Reset the globals. This is important in a non-reentrant scanner so the next time
3430      * avm2_lex() is called, initialization will occur. */
3431     yy_init_globals( );
3432
3433     return 0;
3434 }
3435
3436 /*
3437  * Internal utility routines.
3438  */
3439
3440 #ifndef yytext_ptr
3441 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3442 {
3443         register int i;
3444         for ( i = 0; i < n; ++i )
3445                 s1[i] = s2[i];
3446 }
3447 #endif
3448
3449 #ifdef YY_NEED_STRLEN
3450 static int yy_flex_strlen (yyconst char * s )
3451 {
3452         register int n;
3453         for ( n = 0; s[n]; ++n )
3454                 ;
3455
3456         return n;
3457 }
3458 #endif
3459
3460 void *avm2_alloc (yy_size_t  size )
3461 {
3462         return (void *) malloc( size );
3463 }
3464
3465 void *avm2_realloc  (void * ptr, yy_size_t  size )
3466 {
3467         /* The cast to (char *) in the following accommodates both
3468          * implementations that use char* generic pointers, and those
3469          * that use void* generic pointers.  It works with the latter
3470          * because both ANSI C and C++ allow castless assignment from
3471          * any pointer type to void*, and deal with argument conversions
3472          * as though doing an assignment.
3473          */
3474         return (void *) realloc( (char *) ptr, size );
3475 }
3476
3477 void avm2_free (void * ptr )
3478 {
3479         free( (char *) ptr );   /* see avm2_realloc() for (char *) cast */
3480 }
3481
3482 #define YYTABLES_NAME "yytables"
3483
3484 #line 659 "tokenizer.lex"
3485
3486
3487
3488 int avm2_wrap()
3489 {
3490     return 1;
3491 }
3492
3493 static char mbuf[256];
3494 char*token2string(enum yytokentype nr, YYSTYPE v)
3495 {
3496     if(nr==T_STRING)     return "<string>";
3497     else if(nr==T_INT)     return "<int>";
3498     else if(nr==T_UINT)     return "<uint>";
3499     else if(nr==T_BYTE)     return "<byte>";
3500     else if(nr==T_FLOAT)     return "<float>";
3501     else if(nr==T_REGEXP)     return "REGEXP";
3502     else if(nr==T_EOF)        return "***END***";
3503     else if(nr==T_GE)         return ">=";
3504     else if(nr==T_LE)         return "<=";
3505     else if(nr==T_MINUSMINUS) return "--";
3506     else if(nr==T_PLUSPLUS)   return "++";
3507     else if(nr==KW_IMPLEMENTS) return "implements";
3508     else if(nr==KW_INTERFACE)  return "interface";
3509     else if(nr==KW_NAMESPACE)  return "namespace";
3510     else if(nr==KW_PROTECTED)  return "protected";
3511     else if(nr==KW_OVERRIDE)   return "override";
3512     else if(nr==KW_INTERNAL)   return "internal";
3513     else if(nr==KW_FUNCTION)   return "function";
3514     else if(nr==KW_PACKAGE)    return "package";
3515     else if(nr==KW_PRIVATE)    return "private";
3516     else if(nr==KW_BOOLEAN)    return "Boolean";
3517     else if(nr==KW_DYNAMIC)    return "dynamic";
3518     else if(nr==KW_EXTENDS)    return "extends";
3519     else if(nr==KW_PUBLIC)     return "public";
3520     else if(nr==KW_NATIVE)     return "native";
3521     else if(nr==KW_STATIC)     return "static";
3522     else if(nr==KW_IMPORT)     return "import";
3523     else if(nr==KW_NUMBER)     return "number";
3524     else if(nr==KW_CLASS)      return "class";
3525     else if(nr==KW_CONST)      return "const";
3526     else if(nr==KW_FINAL)      return "final";
3527     else if(nr==KW_FALSE)      return "False";
3528     else if(nr==KW_TRUE)       return "True";
3529     else if(nr==KW_UINT)       return "uint";
3530     else if(nr==KW_NULL)       return "null";
3531     else if(nr==KW_ELSE)       return "else";
3532     else if(nr==KW_USE)        return "use";
3533     else if(nr==KW_INT)        return "int";
3534     else if(nr==KW_NEW)        return "new";
3535     else if(nr==KW_GET)        return "get";
3536     else if(nr==KW_SET)        return "set";
3537     else if(nr==KW_VAR)        return "var";
3538     else if(nr==KW_IS)         return "is";
3539     else if(nr==KW_AS)         return "as";
3540     else if(nr==T_IDENTIFIER)  return "ID";
3541     else {
3542         sprintf(mbuf, "%d", nr);
3543         return mbuf;
3544     }
3545 }
3546
3547 void initialize_scanner()
3548 {
3549     BEGIN(BEGINNING);
3550 }
3551
3552