flex and bison now have different prefixes
[swftools.git] / lib / as3 / tokenizer.yy.c
index 3e02c8e..dd92251 100644 (file)
@@ -6,24 +6,24 @@
 
 /* A lexical scanner generated by flex */
 
-#define yy_create_buffer avm2__create_buffer
-#define yy_delete_buffer avm2__delete_buffer
-#define yy_flex_debug avm2__flex_debug
-#define yy_init_buffer avm2__init_buffer
-#define yy_flush_buffer avm2__flush_buffer
-#define yy_load_buffer_state avm2__load_buffer_state
-#define yy_switch_to_buffer avm2__switch_to_buffer
-#define yyin avm2_in
-#define yyleng avm2_leng
-#define yylex avm2_lex
-#define yylineno avm2_lineno
-#define yyout avm2_out
-#define yyrestart avm2_restart
-#define yytext avm2_text
-#define yywrap avm2_wrap
-#define yyalloc avm2_alloc
-#define yyrealloc avm2_realloc
-#define yyfree avm2_free
+#define yy_create_buffer as3__create_buffer
+#define yy_delete_buffer as3__delete_buffer
+#define yy_flex_debug as3__flex_debug
+#define yy_init_buffer as3__init_buffer
+#define yy_flush_buffer as3__flush_buffer
+#define yy_load_buffer_state as3__load_buffer_state
+#define yy_switch_to_buffer as3__switch_to_buffer
+#define yyin as3_in
+#define yyleng as3_leng
+#define yylex as3_lex
+#define yylineno as3_lineno
+#define yyout as3_out
+#define yyrestart as3_restart
+#define yytext as3_text
+#define yywrap as3_wrap
+#define yyalloc as3_alloc
+#define yyrealloc as3_realloc
+#define yyfree as3_free
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
@@ -154,7 +154,7 @@ typedef unsigned int flex_uint32_t;
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE avm2_restart(avm2_in  )
+#define YY_NEW_FILE as3_restart(as3_in  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
@@ -172,9 +172,9 @@ typedef unsigned int flex_uint32_t;
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-extern int avm2_leng;
+extern int as3_leng;
 
-extern FILE *avm2_in, *avm2_out;
+extern FILE *as3_in, *as3_out;
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
@@ -186,13 +186,13 @@ extern FILE *avm2_in, *avm2_out;
 #define yyless(n) \
        do \
                { \
-               /* Undo effects of setting up avm2_text. */ \
+               /* Undo effects of setting up as3_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
                *yy_cp = (yy_hold_char); \
                YY_RESTORE_YY_MORE_OFFSET \
                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-               YY_DO_BEFORE_ACTION; /* set up avm2_text again */ \
+               YY_DO_BEFORE_ACTION; /* set up as3_text again */ \
                } \
        while ( 0 )
 
@@ -260,8 +260,8 @@ struct yy_buffer_state
         * possible backing-up.
         *
         * When we actually see the EOF, we change the status to "new"
-        * (via avm2_restart()), so that the user can continue scanning by
-        * just pointing avm2_in at a new input file.
+        * (via as3_restart()), so that the user can continue scanning by
+        * just pointing as3_in at a new input file.
         */
 #define YY_BUFFER_EOF_PENDING 2
 
@@ -288,51 +288,51 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  */
 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
-/* yy_hold_char holds the character lost when avm2_text is formed. */
+/* yy_hold_char holds the character lost when as3_text is formed. */
 static char yy_hold_char;
 static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-int avm2_leng;
+int as3_leng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
 static int yy_init = 0;                /* whether we need to initialize */
 static int yy_start = 0;       /* start state number */
 
-/* Flag which is used to allow avm2_wrap()'s to do buffer switches
- * instead of setting up a fresh avm2_in.  A bit of a hack ...
+/* Flag which is used to allow as3_wrap()'s to do buffer switches
+ * instead of setting up a fresh as3_in.  A bit of a hack ...
  */
 static int yy_did_buffer_switch_on_eof;
 
-void avm2_restart (FILE *input_file  );
-void avm2__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE avm2__create_buffer (FILE *file,int size  );
-void avm2__delete_buffer (YY_BUFFER_STATE b  );
-void avm2__flush_buffer (YY_BUFFER_STATE b  );
-void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer  );
-void avm2_pop_buffer_state (void );
+void as3_restart (FILE *input_file  );
+void as3__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE as3__create_buffer (FILE *file,int size  );
+void as3__delete_buffer (YY_BUFFER_STATE b  );
+void as3__flush_buffer (YY_BUFFER_STATE b  );
+void as3_push_buffer_state (YY_BUFFER_STATE new_buffer  );
+void as3_pop_buffer_state (void );
 
-static void avm2_ensure_buffer_stack (void );
-static void avm2__load_buffer_state (void );
-static void avm2__init_buffer (YY_BUFFER_STATE b,FILE *file  );
+static void as3_ensure_buffer_stack (void );
+static void as3__load_buffer_state (void );
+static void as3__init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
-#define YY_FLUSH_BUFFER avm2__flush_buffer(YY_CURRENT_BUFFER )
+#define YY_FLUSH_BUFFER as3__flush_buffer(YY_CURRENT_BUFFER )
 
-YY_BUFFER_STATE avm2__scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE avm2__scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE avm2__scan_bytes (yyconst char *bytes,int len  );
+YY_BUFFER_STATE as3__scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE as3__scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE as3__scan_bytes (yyconst char *bytes,int len  );
 
-void *avm2_alloc (yy_size_t  );
-void *avm2_realloc (void *,yy_size_t  );
-void avm2_free (void *  );
+void *as3_alloc (yy_size_t  );
+void *as3_realloc (void *,yy_size_t  );
+void as3_free (void *  );
 
-#define yy_new_buffer avm2__create_buffer
+#define yy_new_buffer as3__create_buffer
 
 #define yy_set_interactive(is_interactive) \
        { \
        if ( ! YY_CURRENT_BUFFER ){ \
-        avm2_ensure_buffer_stack (); \
+        as3_ensure_buffer_stack (); \
                YY_CURRENT_BUFFER_LVALUE =    \
-            avm2__create_buffer(avm2_in,YY_BUF_SIZE ); \
+            as3__create_buffer(as3_in,YY_BUF_SIZE ); \
        } \
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
        }
@@ -340,9 +340,9 @@ void avm2_free (void *  );
 #define yy_set_bol(at_bol) \
        { \
        if ( ! YY_CURRENT_BUFFER ){\
-        avm2_ensure_buffer_stack (); \
+        as3_ensure_buffer_stack (); \
                YY_CURRENT_BUFFER_LVALUE =    \
-            avm2__create_buffer(avm2_in,YY_BUF_SIZE ); \
+            as3__create_buffer(as3_in,YY_BUF_SIZE ); \
        } \
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
        }
@@ -353,16 +353,16 @@ void avm2_free (void *  );
 
 typedef unsigned char YY_CHAR;
 
-FILE *avm2_in = (FILE *) 0, *avm2_out = (FILE *) 0;
+FILE *as3_in = (FILE *) 0, *as3_out = (FILE *) 0;
 
 typedef int yy_state_type;
 
-extern int avm2_lineno;
+extern int as3_lineno;
 
-int avm2_lineno = 1;
+int as3_lineno = 1;
 
-extern char *avm2_text;
-#define yytext_ptr avm2_text
+extern char *as3_text;
+#define yytext_ptr as3_text
 
 static yy_state_type yy_get_previous_state (void );
 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
@@ -370,11 +370,11 @@ static int yy_get_next_buffer (void );
 static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
- * corresponding action - sets up avm2_text.
+ * corresponding action - sets up as3_text.
  */
 #define YY_DO_BEFORE_ACTION \
        (yytext_ptr) = yy_bp; \
-       avm2_leng = (size_t) (yy_cp - yy_bp); \
+       as3_leng = (size_t) (yy_cp - yy_bp); \
        (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
        (yy_c_buf_p) = yy_cp;
@@ -1106,8 +1106,8 @@ static yyconst flex_int16_t yy_chk[2240] =
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
 
-extern int avm2__flex_debug;
-int avm2__flex_debug = 0;
+extern int as3__flex_debug;
+int as3__flex_debug = 0;
 
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
@@ -1116,7 +1116,7 @@ int avm2__flex_debug = 0;
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
-char *avm2_text;
+char *as3_text;
 #line 1 "tokenizer.lex"
 /* tokenizer.lex
 
@@ -1243,12 +1243,12 @@ void handleInclude(char*text, int len, char quotes)
     }
     
     char*fullfilename = enter_file(filename, YY_CURRENT_BUFFER);
-    avm2_in = fopen(fullfilename, "rb");
-    if (!avm2_in) {
+    as3_in = fopen(fullfilename, "rb");
+    if (!as3_in) {
        syntaxerror("Couldn't open include file \"%s\"\n", fullfilename);
     }
 
-    avm2__switch_to_buffer(avm2__create_buffer(avm2_in,YY_BUF_SIZE ) );
+    as3__switch_to_buffer(as3__create_buffer(as3_in,YY_BUF_SIZE ) );
     //BEGIN(INITIAL); keep context
 }
 
@@ -1377,7 +1377,7 @@ static void handleString(char*s, int len)
     else syntaxerror("String incorrectly terminated");
 
     
-    avm2_lval.str = string_unescape(s, len);
+    a3_lval.str = string_unescape(s, len);
 }
 
 
@@ -1385,16 +1385,16 @@ char start_of_expression;
 
 static inline int mkid(int type)
 {
-    char*s = malloc(avm2_leng+1);
-    memcpy(s, avm2_text, avm2_leng);
-    s[avm2_leng]=0;
-    avm2_lval.id = s;
+    char*s = malloc(as3_leng+1);
+    memcpy(s, as3_text, as3_leng);
+    s[as3_leng]=0;
+    a3_lval.id = s;
     return type;
 }
 
 static inline int m(int type)
 {
-    avm2_lval.token = type;
+    a3_lval.token = type;
     return type;
 }
 
@@ -1402,17 +1402,17 @@ static inline int m(int type)
 static char numberbuf[64];
 static char*nrbuf()
 {
-    if(avm2_leng>sizeof(numberbuf)-1)
+    if(as3_leng>sizeof(numberbuf)-1)
         syntaxerror("decimal number overflow");
     char*s = numberbuf;
-    memcpy(s, avm2_text, avm2_leng);
-    s[avm2_leng]=0;
+    memcpy(s, as3_text, as3_leng);
+    s[as3_leng]=0;
     return s;
 }
 
 static inline int setint(int v)
 {
-    avm2_lval.number_int = v;
+    a3_lval.number_int = v;
     if(v>-128)
         return T_BYTE;
     else if(v>=-32768)
@@ -1422,7 +1422,7 @@ static inline int setint(int v)
 }
 static inline int setuint(unsigned int v)
 {
-    avm2_lval.number_uint = v;
+    a3_lval.number_uint = v;
     if(v<128)
         return T_BYTE;
     else if(v<32768)
@@ -1432,47 +1432,47 @@ static inline int setuint(unsigned int v)
 }
 static inline int setfloat(double v)
 {
-    avm2_lval.number_float = v;
+    a3_lval.number_float = v;
     return T_FLOAT;
 }
 
 static inline int handlefloat()
 {
     char*s = nrbuf();
-    avm2_lval.number_float = atof(s);
+    a3_lval.number_float = atof(s);
     return T_FLOAT;
 }
 
 static inline int handleint()
 {
     char*s = nrbuf();
-    char l = (avm2_text[0]=='-');
+    char l = (as3_text[0]=='-');
 
     char*max = l?"1073741824":"2147483647";
-    if(avm2_leng-l>10) {
+    if(as3_leng-l>10) {
         as3_warning("integer overflow: %s (converted to Number)", s);
         return handlefloat();
     }
-    if(avm2_leng-l==10) {
+    if(as3_leng-l==10) {
         int t;
-        for(t=0;t<avm2_leng-l;t++) {
-            if(avm2_text[l+t]>max[t]) {
+        for(t=0;t<as3_leng-l;t++) {
+            if(as3_text[l+t]>max[t]) {
                 as3_warning("integer overflow: %s (converted to Number)", s);
                 return handlefloat();
             }
-            else if(avm2_text[l+t]<max[t])
+            else if(as3_text[l+t]<max[t])
                 break;
         }
     }
-    if(avm2_text[0]=='-') {
+    if(as3_text[0]=='-') {
         int v = atoi(s);
         return setint(v);
     } else {
         unsigned int v = 0;
         int t;
-        for(t=0;t<avm2_leng;t++) {
+        for(t=0;t<as3_leng;t++) {
             v*=10;
-            v+=avm2_text[t]-'0';
+            v+=as3_text[t]-'0';
         }
         return setuint(v);
     }
@@ -1480,13 +1480,13 @@ static inline int handleint()
 
 static inline int handlehexfloat()
 {
-    char l = (avm2_text[0]=='-')+2;
+    char l = (as3_text[0]=='-')+2;
     double d=0;
     char dot=0;
     double base=1;
     int t;
-    for(t=l;t<avm2_leng;t++) {
-        char c = avm2_text[t];
+    for(t=l;t<as3_leng;t++) {
+        char c = as3_text[t];
         if(c=='.') {
             dot=1;
             continue;
@@ -1505,8 +1505,8 @@ static inline int handlehexfloat()
 }
 static inline int handlehex()
 {
-    char l = (avm2_text[0]=='-')+2;
-    int len = avm2_leng;
+    char l = (as3_text[0]=='-')+2;
+    int len = as3_leng;
 
     if(len-l>8) {
         char*s = nrbuf();
@@ -1517,7 +1517,7 @@ static inline int handlehex()
     unsigned int v = 0;
     for(t=l;t<len;t++) {
         v<<=4;
-        char c = avm2_text[t];
+        char c = as3_text[t];
         if(c>='0' && c<='9')
             v|=(c&15);
         else if((c>='a' && c<='f') || (c>='A' && c<='F'))
@@ -1550,16 +1550,16 @@ void handleLabel(char*text, int len)
             break;
     }
     char*s = malloc(t+1);
-    memcpy(s, avm2_text, t);
+    memcpy(s, as3_text, t);
     s[t]=0;
-    avm2_lval.id = s;
+    a3_lval.id = s;
 }
 
 static int handleregexp()
 {
-    char*s = malloc(avm2_leng);
-    int len=avm2_leng-1;
-    memcpy(s, avm2_text+1, len);
+    char*s = malloc(as3_leng);
+    int len=as3_leng-1;
+    memcpy(s, as3_text+1, len);
     s[len] = 0;
     int t;
     for(t=len;t>=0;--t) {
@@ -1568,11 +1568,11 @@ static int handleregexp()
             break;
         }
     }
-    avm2_lval.regexp.pattern = s;
+    a3_lval.regexp.pattern = s;
     if(t==len) {
-        avm2_lval.regexp.options = 0;
+        a3_lval.regexp.options = 0;
     } else {
-        avm2_lval.regexp.options = s+t+1;
+        a3_lval.regexp.options = s+t+1;
     }
     return T_REGEXP;
 }
@@ -1583,8 +1583,8 @@ void initialize_scanner();
 /* count the number of lines+columns consumed by this token */
 static inline void l() {
     int t;
-    for(t=0;t<avm2_leng;t++) {
-       if(avm2_text[t]=='\n') {
+    for(t=0;t<as3_leng;t++) {
+       if(as3_text[t]=='\n') {
            current_line++;
            current_column=0;
        } else {
@@ -1594,7 +1594,7 @@ static inline void l() {
 }
 /* count the number of columns consumed by this token */
 static inline void c() {
-    current_column+=avm2_leng;
+    current_column+=as3_leng;
 }
 
 //Boolean                      {c();return m(KW_BOOLEAN);}
@@ -1628,31 +1628,31 @@ static int yy_init_globals (void );
 /* Accessor methods to globals.
    These are made visible to non-reentrant scanners for convenience. */
 
-int avm2_lex_destroy (void );
+int as3_lex_destroy (void );
 
-int avm2_get_debug (void );
+int as3_get_debug (void );
 
-void avm2_set_debug (int debug_flag  );
+void as3_set_debug (int debug_flag  );
 
-YY_EXTRA_TYPE avm2_get_extra (void );
+YY_EXTRA_TYPE as3_get_extra (void );
 
-void avm2_set_extra (YY_EXTRA_TYPE user_defined  );
+void as3_set_extra (YY_EXTRA_TYPE user_defined  );
 
-FILE *avm2_get_in (void );
+FILE *as3_get_in (void );
 
-void avm2_set_in  (FILE * in_str  );
+void as3_set_in  (FILE * in_str  );
 
-FILE *avm2_get_out (void );
+FILE *as3_get_out (void );
 
-void avm2_set_out  (FILE * out_str  );
+void as3_set_out  (FILE * out_str  );
 
-int avm2_get_leng (void );
+int as3_get_leng (void );
 
-char *avm2_get_text (void );
+char *as3_get_text (void );
 
-int avm2_get_lineno (void );
+int as3_get_lineno (void );
 
-void avm2_set_lineno (int line_number  );
+void as3_set_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -1660,9 +1660,9 @@ void avm2_set_lineno (int line_number  );
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int avm2_wrap (void );
+extern "C" int as3_wrap (void );
 #else
-extern int avm2_wrap (void );
+extern int as3_wrap (void );
 #endif
 #endif
 
@@ -1696,7 +1696,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( avm2_text, avm2_leng, 1, avm2_out )
+#define ECHO fwrite( as3_text, as3_leng, 1, as3_out )
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -1709,18 +1709,18 @@ static int input (void );
                int c = '*'; \
                int n; \
                for ( n = 0; n < max_size && \
-                            (c = getc( avm2_in )) != EOF && c != '\n'; ++n ) \
+                            (c = getc( as3_in )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
                if ( c == '\n' ) \
                        buf[n++] = (char) c; \
-               if ( c == EOF && ferror( avm2_in ) ) \
+               if ( c == EOF && ferror( as3_in ) ) \
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
                result = n; \
                } \
        else \
                { \
                errno=0; \
-               while ( (result = fread(buf, 1, max_size, avm2_in))==0 && ferror(avm2_in)) \
+               while ( (result = fread(buf, 1, max_size, as3_in))==0 && ferror(as3_in)) \
                        { \
                        if( errno != EINTR) \
                                { \
@@ -1728,7 +1728,7 @@ static int input (void );
                                break; \
                                } \
                        errno=0; \
-                       clearerr(avm2_in); \
+                       clearerr(as3_in); \
                        } \
                }\
 \
@@ -1761,12 +1761,12 @@ static int input (void );
 #ifndef YY_DECL
 #define YY_DECL_IS_OURS 1
 
-extern int avm2_lex (void);
+extern int as3_lex (void);
 
-#define YY_DECL int avm2_lex (void)
+#define YY_DECL int as3_lex (void)
 #endif /* !YY_DECL */
 
-/* Code executed at the beginning of each rule, after avm2_text and avm2_leng
+/* Code executed at the beginning of each rule, after as3_text and as3_leng
  * have been set up.
  */
 #ifndef YY_USER_ACTION
@@ -1779,9 +1779,9 @@ extern int avm2_lex (void);
 #endif
 
 #define YY_RULE_SETUP \
-       if ( avm2_leng > 0 ) \
+       if ( as3_leng > 0 ) \
                YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
-                               (avm2_text[avm2_leng - 1] == '\n'); \
+                               (as3_text[as3_leng - 1] == '\n'); \
        YY_USER_ACTION
 
 /** The main scanner function which does all the work.
@@ -1809,26 +1809,26 @@ YY_DECL
                if ( ! (yy_start) )
                        (yy_start) = 1; /* first start state */
 
-               if ( ! avm2_in )
-                       avm2_in = stdin;
+               if ( ! as3_in )
+                       as3_in = stdin;
 
-               if ( ! avm2_out )
-                       avm2_out = stdout;
+               if ( ! as3_out )
+                       as3_out = stdout;
 
                if ( ! YY_CURRENT_BUFFER ) {
-                       avm2_ensure_buffer_stack ();
+                       as3_ensure_buffer_stack ();
                        YY_CURRENT_BUFFER_LVALUE =
-                               avm2__create_buffer(avm2_in,YY_BUF_SIZE );
+                               as3__create_buffer(as3_in,YY_BUF_SIZE );
                }
 
-               avm2__load_buffer_state( );
+               as3__load_buffer_state( );
                }
 
        while ( 1 )             /* loops until end-of-file is reached */
                {
                yy_cp = (yy_c_buf_p);
 
-               /* Support of avm2_text. */
+               /* Support of as3_text. */
                *yy_cp = (yy_hold_char);
 
                /* yy_bp points to the position in yy_ch_buf of the start of
@@ -1891,31 +1891,31 @@ YY_RULE_SETUP
 case 3:
 YY_RULE_SETUP
 #line 514 "tokenizer.lex"
-{syntaxerror("syntax error: unterminated comment", avm2_text);}
+{syntaxerror("syntax error: unterminated comment", as3_text);}
        YY_BREAK
 case 4:
 /* rule 4 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
+*yy_cp = (yy_hold_char); /* undo effects of setting up as3_text */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up avm2_text again */
+YY_DO_BEFORE_ACTION; /* set up as3_text again */
 YY_RULE_SETUP
 #line 516 "tokenizer.lex"
-{l();handleInclude(avm2_text, avm2_leng, 1);}
+{l();handleInclude(as3_text, as3_leng, 1);}
        YY_BREAK
 case 5:
 /* rule 5 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
+*yy_cp = (yy_hold_char); /* undo effects of setting up as3_text */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up avm2_text again */
+YY_DO_BEFORE_ACTION; /* set up as3_text again */
 YY_RULE_SETUP
 #line 517 "tokenizer.lex"
-{l();handleInclude(avm2_text, avm2_leng, 0);}
+{l();handleInclude(as3_text, as3_leng, 0);}
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
 #line 518 "tokenizer.lex"
-{l(); BEGIN(INITIAL);handleString(avm2_text, avm2_leng);return T_STRING;}
+{l(); BEGIN(INITIAL);handleString(as3_text, as3_leng);return T_STRING;}
        YY_BREAK
 
 case 7:
@@ -1983,59 +1983,59 @@ YY_RULE_SETUP
        YY_BREAK
 case 19:
 /* rule 19 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
+*yy_cp = (yy_hold_char); /* undo effects of setting up as3_text */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up avm2_text again */
+YY_DO_BEFORE_ACTION; /* set up as3_text again */
 YY_RULE_SETUP
 #line 539 "tokenizer.lex"
-{l();handleLabel(avm2_text, avm2_leng-3);return T_FOR;}
+{l();handleLabel(as3_text, as3_leng-3);return T_FOR;}
        YY_BREAK
 case 20:
 /* rule 20 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
+*yy_cp = (yy_hold_char); /* undo effects of setting up as3_text */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up avm2_text again */
+YY_DO_BEFORE_ACTION; /* set up as3_text again */
 YY_RULE_SETUP
 #line 540 "tokenizer.lex"
-{l();handleLabel(avm2_text, avm2_leng-2);return T_DO;}
+{l();handleLabel(as3_text, as3_leng-2);return T_DO;}
        YY_BREAK
 case 21:
 /* rule 21 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
+*yy_cp = (yy_hold_char); /* undo effects of setting up as3_text */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up avm2_text again */
+YY_DO_BEFORE_ACTION; /* set up as3_text again */
 YY_RULE_SETUP
 #line 541 "tokenizer.lex"
-{l();handleLabel(avm2_text, avm2_leng-5);return T_WHILE;}
+{l();handleLabel(as3_text, as3_leng-5);return T_WHILE;}
        YY_BREAK
 case 22:
 /* rule 22 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */
+*yy_cp = (yy_hold_char); /* undo effects of setting up as3_text */
 (yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up avm2_text again */
+YY_DO_BEFORE_ACTION; /* set up as3_text again */
 YY_RULE_SETUP
 #line 542 "tokenizer.lex"
-{l();handleLabel(avm2_text, avm2_leng-6);return T_SWITCH;}
+{l();handleLabel(as3_text, as3_leng-6);return T_SWITCH;}
        YY_BREAK
 case 23:
 YY_RULE_SETUP
 #line 543 "tokenizer.lex"
-{c();avm2_lval.id="";return T_FOR;}
+{c();a3_lval.id="";return T_FOR;}
        YY_BREAK
 case 24:
 YY_RULE_SETUP
 #line 544 "tokenizer.lex"
-{c();avm2_lval.id="";return T_DO;}
+{c();a3_lval.id="";return T_DO;}
        YY_BREAK
 case 25:
 YY_RULE_SETUP
 #line 545 "tokenizer.lex"
-{c();avm2_lval.id="";return T_WHILE;}
+{c();a3_lval.id="";return T_WHILE;}
        YY_BREAK
 case 26:
 YY_RULE_SETUP
 #line 546 "tokenizer.lex"
-{c();avm2_lval.id="";return T_SWITCH;}
+{c();a3_lval.id="";return T_SWITCH;}
        YY_BREAK
 case 27:
 YY_RULE_SETUP
@@ -2420,19 +2420,19 @@ YY_RULE_SETUP
 case 103:
 YY_RULE_SETUP
 #line 625 "tokenizer.lex"
-{c();BEGIN(REGEXPOK);return m(avm2_text[0]);}
+{c();BEGIN(REGEXPOK);return m(as3_text[0]);}
        YY_BREAK
 case 104:
 YY_RULE_SETUP
 #line 626 "tokenizer.lex"
-{c();BEGIN(INITIAL);return m(avm2_text[0]);}
+{c();BEGIN(INITIAL);return m(as3_text[0]);}
        YY_BREAK
 case 105:
 YY_RULE_SETUP
 #line 628 "tokenizer.lex"
-{char c1=avm2_text[0];
+{char c1=as3_text[0];
                               char buf[128];
-                              buf[0] = avm2_text[0];
+                              buf[0] = as3_text[0];
                               int t;
                               for(t=1;t<128;t++) {
                                  char c = buf[t]=input();
@@ -2458,11 +2458,11 @@ case YY_STATE_EOF(BEGINNING):
                               void*b = leave_file();
                              if (!b) {
                                 yyterminate();
-                                 avm2__delete_buffer(YY_CURRENT_BUFFER);
+                                 as3__delete_buffer(YY_CURRENT_BUFFER);
                                  return m(T_EOF);
                              } else {
-                                 avm2__delete_buffer(YY_CURRENT_BUFFER);
-                                 avm2__switch_to_buffer(b);
+                                 as3__delete_buffer(YY_CURRENT_BUFFER);
+                                 as3__switch_to_buffer(b);
                              }
                             }
        YY_BREAK
@@ -2486,15 +2486,15 @@ ECHO;
                        {
                        /* We're scanning a new file or input source.  It's
                         * possible that this happened because the user
-                        * just pointed avm2_in at a new source and called
-                        * avm2_lex().  If so, then we have to assure
+                        * just pointed as3_in at a new source and called
+                        * as3_lex().  If so, then we have to assure
                         * consistency between YY_CURRENT_BUFFER and our
                         * globals.  Here is the right place to do so, because
                         * this is the first action (other than possibly a
                         * back-up) that will match for the new input source.
                         */
                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = avm2_in;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = as3_in;
                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
                        }
 
@@ -2548,11 +2548,11 @@ ECHO;
                                {
                                (yy_did_buffer_switch_on_eof) = 0;
 
-                               if ( avm2_wrap( ) )
+                               if ( as3_wrap( ) )
                                        {
                                        /* Note: because we've taken care in
                                         * yy_get_next_buffer() to have set up
-                                        * avm2_text, we can now set up
+                                        * as3_text, we can now set up
                                         * yy_c_buf_p so that if some total
                                         * hoser (like flex itself) wants to
                                         * call the scanner after we return the
@@ -2601,7 +2601,7 @@ ECHO;
                        "fatal flex scanner internal error--no action found" );
        } /* end of action switch */
                } /* end of scanning one token */
-} /* end of avm2_lex */
+} /* end of as3_lex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
@@ -2679,7 +2679,7 @@ static int yy_get_next_buffer (void)
 
                                b->yy_ch_buf = (char *)
                                        /* Include room in for 2 EOB chars. */
-                                       avm2_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+                                       as3_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
                                }
                        else
                                /* Can't grow it, we don't own it. */
@@ -2711,7 +2711,7 @@ static int yy_get_next_buffer (void)
                if ( number_to_move == YY_MORE_ADJ )
                        {
                        ret_val = EOB_ACT_END_OF_FILE;
-                       avm2_restart(avm2_in  );
+                       as3_restart(as3_in  );
                        }
 
                else
@@ -2728,7 +2728,7 @@ static int yy_get_next_buffer (void)
        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
                /* Extend the array by 50%, plus the number we really need. */
                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) avm2_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) as3_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
        }
@@ -2806,7 +2806,7 @@ static int yy_get_next_buffer (void)
     
     yy_cp = (yy_c_buf_p);
 
-       /* undo effects of setting up avm2_text */
+       /* undo effects of setting up as3_text */
        *yy_cp = (yy_hold_char);
 
        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
@@ -2878,13 +2878,13 @@ static int yy_get_next_buffer (void)
                                         */
 
                                        /* Reset buffer status. */
-                                       avm2_restart(avm2_in );
+                                       as3_restart(as3_in );
 
                                        /*FALLTHROUGH*/
 
                                case EOB_ACT_END_OF_FILE:
                                        {
-                                       if ( avm2_wrap( ) )
+                                       if ( as3_wrap( ) )
                                                return EOF;
 
                                        if ( ! (yy_did_buffer_switch_on_eof) )
@@ -2904,7 +2904,7 @@ static int yy_get_next_buffer (void)
                }
 
        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
-       *(yy_c_buf_p) = '\0';   /* preserve avm2_text */
+       *(yy_c_buf_p) = '\0';   /* preserve as3_text */
        (yy_hold_char) = *++(yy_c_buf_p);
 
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
@@ -2918,32 +2918,32 @@ static int yy_get_next_buffer (void)
  * 
  * @note This function does not reset the start condition to @c INITIAL .
  */
-    void avm2_restart  (FILE * input_file )
+    void as3_restart  (FILE * input_file )
 {
     
        if ( ! YY_CURRENT_BUFFER ){
-        avm2_ensure_buffer_stack ();
+        as3_ensure_buffer_stack ();
                YY_CURRENT_BUFFER_LVALUE =
-            avm2__create_buffer(avm2_in,YY_BUF_SIZE );
+            as3__create_buffer(as3_in,YY_BUF_SIZE );
        }
 
-       avm2__init_buffer(YY_CURRENT_BUFFER,input_file );
-       avm2__load_buffer_state( );
+       as3__init_buffer(YY_CURRENT_BUFFER,input_file );
+       as3__load_buffer_state( );
 }
 
 /** Switch to a different input buffer.
  * @param new_buffer The new input buffer.
  * 
  */
-    void avm2__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+    void as3__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
 {
     
        /* TODO. We should be able to replace this entire function body
         * with
-        *              avm2_pop_buffer_state();
-        *              avm2_push_buffer_state(new_buffer);
+        *              as3_pop_buffer_state();
+        *              as3_push_buffer_state(new_buffer);
      */
-       avm2_ensure_buffer_stack ();
+       as3_ensure_buffer_stack ();
        if ( YY_CURRENT_BUFFER == new_buffer )
                return;
 
@@ -2956,21 +2956,21 @@ static int yy_get_next_buffer (void)
                }
 
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
-       avm2__load_buffer_state( );
+       as3__load_buffer_state( );
 
        /* We don't actually know whether we did this switch during
-        * EOF (avm2_wrap()) processing, but the only time this flag
-        * is looked at is after avm2_wrap() is called, so it's safe
+        * EOF (as3_wrap()) processing, but the only time this flag
+        * is looked at is after as3_wrap() is called, so it's safe
         * to go ahead and always set it.
         */
        (yy_did_buffer_switch_on_eof) = 1;
 }
 
-static void avm2__load_buffer_state  (void)
+static void as3__load_buffer_state  (void)
 {
        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-       avm2_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       as3_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
        (yy_hold_char) = *(yy_c_buf_p);
 }
 
@@ -2980,35 +2980,35 @@ static void avm2__load_buffer_state  (void)
  * 
  * @return the allocated buffer state.
  */
-    YY_BUFFER_STATE avm2__create_buffer  (FILE * file, int  size )
+    YY_BUFFER_STATE as3__create_buffer  (FILE * file, int  size )
 {
        YY_BUFFER_STATE b;
     
-       b = (YY_BUFFER_STATE) avm2_alloc(sizeof( struct yy_buffer_state )  );
+       b = (YY_BUFFER_STATE) as3_alloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in avm2__create_buffer()" );
+               YY_FATAL_ERROR( "out of dynamic memory in as3__create_buffer()" );
 
        b->yy_buf_size = size;
 
        /* yy_ch_buf has to be 2 characters longer than the size given because
         * we need to put in 2 end-of-buffer characters.
         */
-       b->yy_ch_buf = (char *) avm2_alloc(b->yy_buf_size + 2  );
+       b->yy_ch_buf = (char *) as3_alloc(b->yy_buf_size + 2  );
        if ( ! b->yy_ch_buf )
-               YY_FATAL_ERROR( "out of dynamic memory in avm2__create_buffer()" );
+               YY_FATAL_ERROR( "out of dynamic memory in as3__create_buffer()" );
 
        b->yy_is_our_buffer = 1;
 
-       avm2__init_buffer(b,file );
+       as3__init_buffer(b,file );
 
        return b;
 }
 
 /** Destroy the buffer.
- * @param b a buffer created with avm2__create_buffer()
+ * @param b a buffer created with as3__create_buffer()
  * 
  */
-    void avm2__delete_buffer (YY_BUFFER_STATE  b )
+    void as3__delete_buffer (YY_BUFFER_STATE  b )
 {
     
        if ( ! b )
@@ -3018,9 +3018,9 @@ static void avm2__load_buffer_state  (void)
                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
        if ( b->yy_is_our_buffer )
-               avm2_free((void *) b->yy_ch_buf  );
+               as3_free((void *) b->yy_ch_buf  );
 
-       avm2_free((void *) b  );
+       as3_free((void *) b  );
 }
 
 #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */
@@ -3039,20 +3039,20 @@ extern int isatty (int );
     
 /* Initializes or reinitializes a buffer.
  * This function is sometimes called more than once on the same buffer,
- * such as during a avm2_restart() or at EOF.
+ * such as during a as3_restart() or at EOF.
  */
-    static void avm2__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+    static void as3__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
 {
        int oerrno = errno;
     
-       avm2__flush_buffer(b );
+       as3__flush_buffer(b );
 
        b->yy_input_file = file;
        b->yy_fill_buffer = 1;
 
-    /* If b is the current buffer, then avm2__init_buffer was _probably_
-     * called from avm2_restart() or through yy_get_next_buffer.
+    /* If b is the current buffer, then as3__init_buffer was _probably_
+     * called from as3_restart() or through yy_get_next_buffer.
      * In that case, we don't want to reset the lineno or column.
      */
     if (b != YY_CURRENT_BUFFER){
@@ -3069,7 +3069,7 @@ extern int isatty (int );
  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  * 
  */
-    void avm2__flush_buffer (YY_BUFFER_STATE  b )
+    void as3__flush_buffer (YY_BUFFER_STATE  b )
 {
        if ( ! b )
                return;
@@ -3089,7 +3089,7 @@ extern int isatty (int );
        b->yy_buffer_status = YY_BUFFER_NEW;
 
        if ( b == YY_CURRENT_BUFFER )
-               avm2__load_buffer_state( );
+               as3__load_buffer_state( );
 }
 
 /** Pushes the new state onto the stack. The new state becomes
@@ -3098,14 +3098,14 @@ extern int isatty (int );
  *  @param new_buffer The new state.
  *  
  */
-void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer )
+void as3_push_buffer_state (YY_BUFFER_STATE new_buffer )
 {
        if (new_buffer == NULL)
                return;
 
-       avm2_ensure_buffer_stack();
+       as3_ensure_buffer_stack();
 
-       /* This block is copied from avm2__switch_to_buffer. */
+       /* This block is copied from as3__switch_to_buffer. */
        if ( YY_CURRENT_BUFFER )
                {
                /* Flush out information for old buffer. */
@@ -3119,8 +3119,8 @@ void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer )
                (yy_buffer_stack_top)++;
        YY_CURRENT_BUFFER_LVALUE = new_buffer;
 
-       /* copied from avm2__switch_to_buffer. */
-       avm2__load_buffer_state( );
+       /* copied from as3__switch_to_buffer. */
+       as3__load_buffer_state( );
        (yy_did_buffer_switch_on_eof) = 1;
 }
 
@@ -3128,18 +3128,18 @@ void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer )
  *  The next element becomes the new top.
  *  
  */
-void avm2_pop_buffer_state (void)
+void as3_pop_buffer_state (void)
 {
        if (!YY_CURRENT_BUFFER)
                return;
 
-       avm2__delete_buffer(YY_CURRENT_BUFFER );
+       as3__delete_buffer(YY_CURRENT_BUFFER );
        YY_CURRENT_BUFFER_LVALUE = NULL;
        if ((yy_buffer_stack_top) > 0)
                --(yy_buffer_stack_top);
 
        if (YY_CURRENT_BUFFER) {
-               avm2__load_buffer_state( );
+               as3__load_buffer_state( );
                (yy_did_buffer_switch_on_eof) = 1;
        }
 }
@@ -3147,7 +3147,7 @@ void avm2_pop_buffer_state (void)
 /* Allocates the stack if it does not exist.
  *  Guarantees space for at least one push.
  */
-static void avm2_ensure_buffer_stack (void)
+static void as3_ensure_buffer_stack (void)
 {
        int num_to_alloc;
     
@@ -3158,11 +3158,11 @@ static void avm2_ensure_buffer_stack (void)
                 * immediate realloc on the next call.
          */
                num_to_alloc = 1;
-               (yy_buffer_stack) = (struct yy_buffer_state**)avm2_alloc
+               (yy_buffer_stack) = (struct yy_buffer_state**)as3_alloc
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                );
                if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in avm2_ensure_buffer_stack()" );
+                       YY_FATAL_ERROR( "out of dynamic memory in as3_ensure_buffer_stack()" );
                                                                  
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
                                
@@ -3177,12 +3177,12 @@ static void avm2_ensure_buffer_stack (void)
                int grow_size = 8 /* arbitrary grow size */;
 
                num_to_alloc = (yy_buffer_stack_max) + grow_size;
-               (yy_buffer_stack) = (struct yy_buffer_state**)avm2_realloc
+               (yy_buffer_stack) = (struct yy_buffer_state**)as3_realloc
                                                                ((yy_buffer_stack),
                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
                                                                );
                if ( ! (yy_buffer_stack) )
-                       YY_FATAL_ERROR( "out of dynamic memory in avm2_ensure_buffer_stack()" );
+                       YY_FATAL_ERROR( "out of dynamic memory in as3_ensure_buffer_stack()" );
 
                /* zero only the new slots.*/
                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -3196,7 +3196,7 @@ static void avm2_ensure_buffer_stack (void)
  * 
  * @return the newly allocated buffer state object. 
  */
-YY_BUFFER_STATE avm2__scan_buffer  (char * base, yy_size_t  size )
+YY_BUFFER_STATE as3__scan_buffer  (char * base, yy_size_t  size )
 {
        YY_BUFFER_STATE b;
     
@@ -3206,9 +3206,9 @@ YY_BUFFER_STATE avm2__scan_buffer  (char * base, yy_size_t  size )
                /* They forgot to leave room for the EOB's. */
                return 0;
 
-       b = (YY_BUFFER_STATE) avm2_alloc(sizeof( struct yy_buffer_state )  );
+       b = (YY_BUFFER_STATE) as3_alloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
-               YY_FATAL_ERROR( "out of dynamic memory in avm2__scan_buffer()" );
+               YY_FATAL_ERROR( "out of dynamic memory in as3__scan_buffer()" );
 
        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
        b->yy_buf_pos = b->yy_ch_buf = base;
@@ -3220,33 +3220,33 @@ YY_BUFFER_STATE avm2__scan_buffer  (char * base, yy_size_t  size )
        b->yy_fill_buffer = 0;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       avm2__switch_to_buffer(b  );
+       as3__switch_to_buffer(b  );
 
        return b;
 }
 
-/** Setup the input buffer state to scan a string. The next call to avm2_lex() will
+/** Setup the input buffer state to scan a string. The next call to as3_lex() will
  * scan from a @e copy of @a str.
  * @param yystr a NUL-terminated string to scan
  * 
  * @return the newly allocated buffer state object.
  * @note If you want to scan bytes that may contain NUL values, then use
- *       avm2__scan_bytes() instead.
+ *       as3__scan_bytes() instead.
  */
-YY_BUFFER_STATE avm2__scan_string (yyconst char * yystr )
+YY_BUFFER_STATE as3__scan_string (yyconst char * yystr )
 {
     
-       return avm2__scan_bytes(yystr,strlen(yystr) );
+       return as3__scan_bytes(yystr,strlen(yystr) );
 }
 
-/** Setup the input buffer state to scan the given bytes. The next call to avm2_lex() will
+/** Setup the input buffer state to scan the given bytes. The next call to as3_lex() will
  * scan from a @e copy of @a bytes.
  * @param bytes the byte buffer to scan
  * @param len the number of bytes in the buffer pointed to by @a bytes.
  * 
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE avm2__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+YY_BUFFER_STATE as3__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
 {
        YY_BUFFER_STATE b;
        char *buf;
@@ -3255,18 +3255,18 @@ YY_BUFFER_STATE avm2__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
     
        /* Get memory for full buffer, including space for trailing EOB's. */
        n = _yybytes_len + 2;
-       buf = (char *) avm2_alloc(n  );
+       buf = (char *) as3_alloc(n  );
        if ( ! buf )
-               YY_FATAL_ERROR( "out of dynamic memory in avm2__scan_bytes()" );
+               YY_FATAL_ERROR( "out of dynamic memory in as3__scan_bytes()" );
 
        for ( i = 0; i < _yybytes_len; ++i )
                buf[i] = yybytes[i];
 
        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-       b = avm2__scan_buffer(buf,n );
+       b = as3__scan_buffer(buf,n );
        if ( ! b )
-               YY_FATAL_ERROR( "bad buffer in avm2__scan_bytes()" );
+               YY_FATAL_ERROR( "bad buffer in as3__scan_bytes()" );
 
        /* It's okay to grow etc. this buffer, and we should throw it
         * away when we're done.
@@ -3292,14 +3292,14 @@ static void yy_fatal_error (yyconst char* msg )
 #define yyless(n) \
        do \
                { \
-               /* Undo effects of setting up avm2_text. */ \
+               /* Undo effects of setting up as3_text. */ \
         int yyless_macro_arg = (n); \
         YY_LESS_LINENO(yyless_macro_arg);\
-               avm2_text[avm2_leng] = (yy_hold_char); \
-               (yy_c_buf_p) = avm2_text + yyless_macro_arg; \
+               as3_text[as3_leng] = (yy_hold_char); \
+               (yy_c_buf_p) = as3_text + yyless_macro_arg; \
                (yy_hold_char) = *(yy_c_buf_p); \
                *(yy_c_buf_p) = '\0'; \
-               avm2_leng = yyless_macro_arg; \
+               as3_leng = yyless_macro_arg; \
                } \
        while ( 0 )
 
@@ -3308,85 +3308,85 @@ static void yy_fatal_error (yyconst char* msg )
 /** Get the current line number.
  * 
  */
-int avm2_get_lineno  (void)
+int as3_get_lineno  (void)
 {
         
-    return avm2_lineno;
+    return as3_lineno;
 }
 
 /** Get the input stream.
  * 
  */
-FILE *avm2_get_in  (void)
+FILE *as3_get_in  (void)
 {
-        return avm2_in;
+        return as3_in;
 }
 
 /** Get the output stream.
  * 
  */
-FILE *avm2_get_out  (void)
+FILE *as3_get_out  (void)
 {
-        return avm2_out;
+        return as3_out;
 }
 
 /** Get the length of the current token.
  * 
  */
-int avm2_get_leng  (void)
+int as3_get_leng  (void)
 {
-        return avm2_leng;
+        return as3_leng;
 }
 
 /** Get the current token.
  * 
  */
 
-char *avm2_get_text  (void)
+char *as3_get_text  (void)
 {
-        return avm2_text;
+        return as3_text;
 }
 
 /** Set the current line number.
  * @param line_number
  * 
  */
-void avm2_set_lineno (int  line_number )
+void as3_set_lineno (int  line_number )
 {
     
-    avm2_lineno = line_number;
+    as3_lineno = line_number;
 }
 
 /** Set the input stream. This does not discard the current
  * input buffer.
  * @param in_str A readable stream.
  * 
- * @see avm2__switch_to_buffer
+ * @see as3__switch_to_buffer
  */
-void avm2_set_in (FILE *  in_str )
+void as3_set_in (FILE *  in_str )
 {
-        avm2_in = in_str ;
+        as3_in = in_str ;
 }
 
-void avm2_set_out (FILE *  out_str )
+void as3_set_out (FILE *  out_str )
 {
-        avm2_out = out_str ;
+        as3_out = out_str ;
 }
 
-int avm2_get_debug  (void)
+int as3_get_debug  (void)
 {
-        return avm2__flex_debug;
+        return as3__flex_debug;
 }
 
-void avm2_set_debug (int  bdebug )
+void as3_set_debug (int  bdebug )
 {
-        avm2__flex_debug = bdebug ;
+        as3__flex_debug = bdebug ;
 }
 
 static int yy_init_globals (void)
 {
         /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from avm2_lex_destroy(), so don't allocate here.
+     * This function is called from as3_lex_destroy(), so don't allocate here.
      */
 
     (yy_buffer_stack) = 0;
@@ -3398,36 +3398,36 @@ static int yy_init_globals (void)
 
 /* Defined in main.c */
 #ifdef YY_STDINIT
-    avm2_in = stdin;
-    avm2_out = stdout;
+    as3_in = stdin;
+    as3_out = stdout;
 #else
-    avm2_in = (FILE *) 0;
-    avm2_out = (FILE *) 0;
+    as3_in = (FILE *) 0;
+    as3_out = (FILE *) 0;
 #endif
 
     /* For future reference: Set errno on error, since we are called by
-     * avm2_lex_init()
+     * as3_lex_init()
      */
     return 0;
 }
 
-/* avm2_lex_destroy is for both reentrant and non-reentrant scanners. */
-int avm2_lex_destroy  (void)
+/* as3_lex_destroy is for both reentrant and non-reentrant scanners. */
+int as3_lex_destroy  (void)
 {
     
     /* Pop the buffer stack, destroying each element. */
        while(YY_CURRENT_BUFFER){
-               avm2__delete_buffer(YY_CURRENT_BUFFER  );
+               as3__delete_buffer(YY_CURRENT_BUFFER  );
                YY_CURRENT_BUFFER_LVALUE = NULL;
-               avm2_pop_buffer_state();
+               as3_pop_buffer_state();
        }
 
        /* Destroy the stack itself. */
-       avm2_free((yy_buffer_stack) );
+       as3_free((yy_buffer_stack) );
        (yy_buffer_stack) = NULL;
 
     /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * avm2_lex() is called, initialization will occur. */
+     * as3_lex() is called, initialization will occur. */
     yy_init_globals( );
 
     return 0;
@@ -3457,12 +3457,12 @@ static int yy_flex_strlen (yyconst char * s )
 }
 #endif
 
-void *avm2_alloc (yy_size_t  size )
+void *as3_alloc (yy_size_t  size )
 {
        return (void *) malloc( size );
 }
 
-void *avm2_realloc  (void * ptr, yy_size_t  size )
+void *as3_realloc  (void * ptr, yy_size_t  size )
 {
        /* The cast to (char *) in the following accommodates both
         * implementations that use char* generic pointers, and those
@@ -3474,9 +3474,9 @@ void *avm2_realloc  (void * ptr, yy_size_t  size )
        return (void *) realloc( (char *) ptr, size );
 }
 
-void avm2_free (void * ptr )
+void as3_free (void * ptr )
 {
-       free( (char *) ptr );   /* see avm2_realloc() for (char *) cast */
+       free( (char *) ptr );   /* see as3_realloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
@@ -3485,7 +3485,7 @@ void avm2_free (void * ptr )
 
 
 
-int avm2_wrap()
+int as3_wrap()
 {
     return 1;
 }