From: Matthias Kramm Date: Mon, 2 Feb 2009 19:03:00 +0000 (+0100) Subject: flex and bison now have different prefixes X-Git-Tag: release-0-9-0~174 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=a07a14a5eafaeaea1d8881ffc364c55ab204878e;p=swftools.git flex and bison now have different prefixes --- diff --git a/lib/as3/parser.tab.c b/lib/as3/parser.tab.c index af7d917..5f7ddf1 100644 --- a/lib/as3/parser.tab.c +++ b/lib/as3/parser.tab.c @@ -64,13 +64,13 @@ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse avm2_parse -#define yylex avm2_lex -#define yyerror avm2_error -#define yylval avm2_lval -#define yychar avm2_char -#define yydebug avm2_debug -#define yynerrs avm2_nerrs +#define yyparse a3_parse +#define yylex a3_lex +#define yyerror a3_error +#define yylval a3_lval +#define yychar a3_char +#define yydebug a3_debug +#define yynerrs a3_nerrs /* Copy the first part of user declarations. */ @@ -278,12 +278,13 @@ tokenunion #line 251 "parser.y" -static int yyerror(char*s) +static int a3_error(char*s) { syntaxerror("%s", s); return 0; //make gcc happy } + static char* concat2(const char* t1, const char* t2) { int l1 = strlen(t1); @@ -330,6 +331,7 @@ typedef struct _methodstate { char has_super; char is_global; char inner; + int variable_count; abc_exception_list_t*exceptions; } methodstate_t; @@ -353,8 +355,6 @@ typedef struct _state { typedef struct _global { abc_file_t*file; abc_script_t*init; - - int variable_count; } global_t; static global_t*global = 0; @@ -474,14 +474,11 @@ void initialize_parser() global = rfx_calloc(sizeof(global_t)); global->file = abc_file_new(); global->file->flags &= ~ABCFILE_LAZY; - global->variable_count = 1; + global->init = abc_initscript(global->file); code_t*c = global->init->method->body->code; c = abc_getlocal_0(c); c = abc_pushscope(c); - /*c = abc_findpropstrict(c, "[package]::trace"); - c = abc_pushstring(c, "[entering global init function]"); - c = abc_callpropvoid(c, "[package]::trace", 1);*/ global->init->method->body->code = c; } @@ -489,9 +486,11 @@ void initialize_file(char*filename) { new_state(); state->package = filename; - // needed for state->method->late_binding: + state->method = rfx_calloc(sizeof(methodstate_t)); + state->method->variable_count = 1; } + void finish_file() { if(!state || state->level!=1) { @@ -577,13 +576,13 @@ code_t*defaultvalue(code_t*c, classinfo_t*type); static int new_variable(char*name, classinfo_t*type, char init) { NEW(variable_t, v); - v->index = global->variable_count; + v->index = state->method->variable_count; v->type = type; v->init = init; dict_put(state->vars, name, v); - return global->variable_count++; + return state->method->variable_count++; } #define TEMPVARNAME "__as3_temp__" static int gettempvar() @@ -656,7 +655,6 @@ static void startpackage(char*name) new_state(); /*printf("entering package \"%s\"\n", name);*/ state->package = strdup(name); - global->variable_count = 1; } static void endpackage() { @@ -681,9 +679,9 @@ static void startclass(int flags, char*classname, classinfo_t*extends, classinfo syntaxerror("inner classes now allowed"); } new_state(); - global->variable_count = 1; state->cls = rfx_calloc(sizeof(classstate_t)); state->method = rfx_calloc(sizeof(methodstate_t)); // method state, for static constructor + state->method->variable_count = 1; token_list_t*t=0; classinfo_list_t*mlist=0; @@ -972,15 +970,36 @@ static void innerfunction(char*name, params_t*params, classinfo_t*return_type) new_state(); state->method = rfx_calloc(sizeof(methodstate_t)); state->method->inner = 1; - - NEW(memberinfo_t,minfo); - minfo->return_type = return_type; - minfo->name = name; + state->method->variable_count = 0; + + memberinfo_t*minfo = 0; + + /* TODO: we need some better way to pass things from pass1 to pass2 */ + char myname[200]; + sprintf(myname, "as3-innerfunction-%d-%d", current_line, current_column); + + if(as3_pass == 1) { + minfo = rfx_calloc(sizeof(memberinfo_t)); + minfo->name = name; + if(!parent_method->subfunctions) + parent_method->subfunctions = dict_new(); + if(name) + dict_put(parent_method->subfunctions, name, minfo); + dict_put(parent_method->subfunctions, myname, minfo); + } + + if(as3_pass == 2) { + minfo = dict_lookup(parent_method->subfunctions, myname); + parserassert(minfo); - if(!parent_method->subfunctions) - parent_method->subfunctions = dict_new(); + minfo->return_type = return_type; - dict_put(parent_method->subfunctions, name, minfo); + new_variable("FIXME", 0, 0); //FIXME: is local_0 "this"? + param_list_t*p=0; + for(p=params->list;p;p=p->next) { + new_variable(p->param->name, p->param->type, 0); + } + } state->method->info = minfo; } @@ -993,6 +1012,7 @@ static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*n new_state(); state->method = rfx_calloc(sizeof(methodstate_t)); state->method->has_super = 0; + state->method->variable_count = 0; if(state->cls) { state->method->is_constructor = !strcmp(state->cls->info->name,name); @@ -1016,7 +1036,6 @@ static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*n else state->method->info = registry_findmember(state->cls->info, name, 0); state->method->info->return_type = return_type; - global->variable_count = 0; /* state->vars is initialized by state_new */ if(!state->method->is_global) new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0); @@ -1043,7 +1062,6 @@ static abc_method_t* endfunction(token_t*ns, int flags, enum yytokentype getset, int slot = 0; if(state->method->inner) { f = abc_method_new(global->file, type2, 1); - //trait_t*t = trait_new_method(&global->init->traits, 0, f); } else if(state->method->is_constructor) { f = abc_class_getconstructor(state->cls->abc, type2); } else if(!state->method->is_global) { @@ -1570,7 +1588,7 @@ code_t* insert_finally(code_t*c, code_t*finally, int tempvar) /* Line 273 of skeleton.m4 */ -#line 1574 "parser.tab.c" +#line 1592 "parser.tab.c" #ifdef short # undef short @@ -1974,35 +1992,35 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1548, 1548, 1550, 1550, 1551, 1552, 1554, 1555, 1556, - 1557, 1558, 1559, 1560, 1562, 1562, 1563, 1564, 1566, 1567, - 1568, 1569, 1570, 1571, 1573, 1574, 1576, 1577, 1580, 1581, - 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1592, 1593, - 1594, 1595, 1596, 1597, 1598, 1600, 1601, 1603, 1604, 1605, - 1606, 1610, 1617, 1618, 1622, 1623, 1625, 1626, 1628, 1669, - 1670, 1673, 1673, 1692, 1693, 1694, 1697, 1700, 1704, 1705, - 1707, 1727, 1770, 1770, 1789, 1789, 1804, 1807, 1810, 1813, - 1817, 1818, 1819, 1820, 1821, 1822, 1824, 1835, 1838, 1838, - 1867, 1867, 1887, 1887, 1904, 1905, 1906, 1907, 1915, 1924, - 1924, 1969, 1973, 1984, 1993, 1994, 1996, 1997, 1999, 1999, - 2001, 2001, 2004, 2012, 2022, 2023, 2024, 2025, 2027, 2028, - 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2037, 2038, 2040, - 2041, 2043, 2044, 2048, 2046, 2054, 2052, 2060, 2061, 2062, - 2063, 2064, 2065, 2066, 2068, 2074, 2075, 2076, 2077, 2078, - 2079, 2082, 2094, 2094, 2096, 2155, 2156, 2158, 2159, 2160, - 2161, 2162, 2164, 2165, 2166, 2171, 2174, 2179, 2184, 2191, - 2195, 2200, 2206, 2212, 2213, 2214, 2217, 2216, 2238, 2239, - 2241, 2240, 2260, 2268, 2276, 2277, 2279, 2280, 2282, 2283, - 2284, 2293, 2294, 2298, 2299, 2301, 2302, 2303, 2306, 2311, - 2335, 2383, 2403, 2424, 2427, 2434, 2435, 2436, 2442, 2448, - 2450, 2452, 2454, 2456, 2458, 2475, 2480, 2483, 2486, 2489, - 2492, 2495, 2498, 2501, 2504, 2508, 2509, 2512, 2515, 2518, - 2521, 2524, 2527, 2530, 2534, 2545, 2563, 2568, 2573, 2578, - 2583, 2588, 2592, 2596, 2601, 2605, 2609, 2618, 2627, 2637, - 2642, 2654, 2660, 2665, 2671, 2677, 2681, 2683, 2694, 2703, - 2710, 2711, 2713, 2719, 2728, 2735, 2747, 2753, 2759, 2765, - 2771, 2777, 2783, 2796, 2807, 2814, 2827, 2854, 2868, 2882, - 2896, 2911, 2945, 3043, 3044, 3045, 3047 + 0, 1566, 1566, 1568, 1568, 1569, 1570, 1572, 1573, 1574, + 1575, 1576, 1577, 1578, 1580, 1580, 1581, 1582, 1584, 1585, + 1586, 1587, 1588, 1589, 1591, 1592, 1594, 1595, 1598, 1599, + 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1610, 1611, + 1612, 1613, 1614, 1615, 1616, 1618, 1619, 1621, 1622, 1623, + 1624, 1628, 1635, 1636, 1640, 1641, 1643, 1644, 1646, 1687, + 1688, 1691, 1691, 1710, 1711, 1712, 1715, 1718, 1722, 1723, + 1725, 1745, 1788, 1788, 1807, 1807, 1822, 1825, 1828, 1831, + 1835, 1836, 1837, 1838, 1839, 1840, 1842, 1853, 1856, 1856, + 1885, 1885, 1905, 1905, 1922, 1923, 1924, 1925, 1933, 1942, + 1942, 1987, 1991, 2002, 2011, 2012, 2014, 2015, 2017, 2017, + 2019, 2019, 2022, 2030, 2040, 2041, 2042, 2043, 2045, 2046, + 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2055, 2056, 2058, + 2059, 2061, 2062, 2066, 2064, 2072, 2070, 2078, 2079, 2080, + 2081, 2082, 2083, 2084, 2086, 2092, 2093, 2094, 2095, 2096, + 2097, 2100, 2112, 2112, 2114, 2173, 2174, 2176, 2177, 2178, + 2179, 2180, 2182, 2183, 2184, 2189, 2192, 2197, 2202, 2209, + 2213, 2218, 2224, 2230, 2231, 2232, 2235, 2234, 2257, 2258, + 2260, 2259, 2279, 2287, 2295, 2296, 2298, 2299, 2301, 2302, + 2303, 2312, 2313, 2317, 2318, 2320, 2321, 2322, 2325, 2330, + 2354, 2402, 2422, 2443, 2446, 2453, 2454, 2455, 2461, 2467, + 2469, 2471, 2473, 2475, 2477, 2494, 2499, 2502, 2505, 2508, + 2511, 2514, 2517, 2520, 2523, 2527, 2528, 2531, 2534, 2537, + 2540, 2543, 2546, 2549, 2553, 2564, 2582, 2587, 2592, 2597, + 2602, 2607, 2611, 2615, 2620, 2624, 2628, 2637, 2646, 2656, + 2661, 2673, 2679, 2684, 2690, 2696, 2700, 2702, 2713, 2722, + 2729, 2730, 2732, 2738, 2747, 2754, 2766, 2772, 2778, 2784, + 2790, 2796, 2802, 2815, 2826, 2833, 2846, 2873, 2887, 2901, + 2915, 2930, 2964, 3062, 3063, 3064, 3066 }; #endif @@ -3665,7 +3683,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1573 "parser.y" +#line 1591 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -3676,7 +3694,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1574 "parser.y" +#line 1592 "parser.y" {(yyval.code)=code_new();} } break; @@ -3687,7 +3705,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1576 "parser.y" +#line 1594 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; @@ -3698,7 +3716,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1577 "parser.y" +#line 1595 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -3709,7 +3727,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1592 "parser.y" +#line 1610 "parser.y" {(yyval.code)=0;} } break; @@ -3720,7 +3738,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1600 "parser.y" +#line 1618 "parser.y" {/*TODO*/(yyval.code)=0;} } break; @@ -3731,7 +3749,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1601 "parser.y" +#line 1619 "parser.y" {/*TODO*/(yyval.code)=0;} } break; @@ -3742,7 +3760,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1603 "parser.y" +#line 1621 "parser.y" {(yyval.code)=(yyvsp[(2) - (3)].code);} } break; @@ -3753,7 +3771,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1604 "parser.y" +#line 1622 "parser.y" {(yyval.code)=0;} } break; @@ -3764,7 +3782,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1605 "parser.y" +#line 1623 "parser.y" {(yyval.code)=(yyvsp[(1) - (2)].code);} } break; @@ -3775,7 +3793,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1606 "parser.y" +#line 1624 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -3786,7 +3804,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1610 "parser.y" +#line 1628 "parser.y" { code_t**cc = &global->init->method->body->code; *cc = code_append(*cc, (yyvsp[(1) - (1)].code)); @@ -3800,7 +3818,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1617 "parser.y" +#line 1635 "parser.y" {(yyval.value)=(yyvsp[(2) - (2)].value);} } break; @@ -3811,7 +3829,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1618 "parser.y" +#line 1636 "parser.y" {(yyval.value).c=abc_pushundefined(0); (yyval.value).t=TYPE_ANY; } @@ -3824,7 +3842,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1622 "parser.y" +#line 1640 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -3835,7 +3853,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1623 "parser.y" +#line 1641 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -3846,7 +3864,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1625 "parser.y" +#line 1643 "parser.y" {(yyval.code) = (yyvsp[(1) - (1)].code);} } break; @@ -3857,7 +3875,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1626 "parser.y" +#line 1644 "parser.y" {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));} } break; @@ -3868,7 +3886,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1629 "parser.y" +#line 1647 "parser.y" { if(variable_exists((yyvsp[(1) - (3)].id))) syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id)); @@ -3915,7 +3933,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1669 "parser.y" +#line 1687 "parser.y" {(yyval.code) = code_new();} } break; @@ -3926,7 +3944,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1670 "parser.y" +#line 1688 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -3937,7 +3955,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1673 "parser.y" +#line 1691 "parser.y" {new_state();} } break; @@ -3948,7 +3966,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1673 "parser.y" +#line 1691 "parser.y" { (yyval.code) = code_new(); @@ -3976,7 +3994,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1692 "parser.y" +#line 1710 "parser.y" {(yyval.code)=code_new();} } break; @@ -3987,7 +4005,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1697 "parser.y" +#line 1715 "parser.y" { (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1); } @@ -4000,7 +4018,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1700 "parser.y" +#line 1718 "parser.y" { (yyval.id)=(yyvsp[(1) - (1)].id); } @@ -4013,7 +4031,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1704 "parser.y" +#line 1722 "parser.y" {new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;} } break; @@ -4024,7 +4042,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1705 "parser.y" +#line 1723 "parser.y" {new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;} } break; @@ -4035,7 +4053,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1707 "parser.y" +#line 1725 "parser.y" { if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement"); (yyval.code) = code_new(); @@ -4064,7 +4082,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1727 "parser.y" +#line 1745 "parser.y" { variable_t*var = find_variable((yyvsp[(2) - (6)].id)); char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__"); @@ -4116,7 +4134,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1770 "parser.y" +#line 1788 "parser.y" {new_state();} } break; @@ -4127,7 +4145,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1770 "parser.y" +#line 1788 "parser.y" { (yyval.code) = code_new(); @@ -4155,7 +4173,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1789 "parser.y" +#line 1807 "parser.y" {new_state();} } break; @@ -4166,7 +4184,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1789 "parser.y" +#line 1807 "parser.y" { (yyval.code) = code_new(); code_t*loopstart = (yyval.code) = abc_label((yyval.code)); @@ -4190,7 +4208,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1804 "parser.y" +#line 1822 "parser.y" { (yyval.code) = abc___break__(0, ""); } @@ -4203,7 +4221,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1807 "parser.y" +#line 1825 "parser.y" { (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id)); } @@ -4216,7 +4234,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1810 "parser.y" +#line 1828 "parser.y" { (yyval.code) = abc___continue__(0, ""); } @@ -4229,7 +4247,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1813 "parser.y" +#line 1831 "parser.y" { (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id)); } @@ -4242,7 +4260,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1817 "parser.y" +#line 1835 "parser.y" {(yyval.code)=0;} } break; @@ -4253,7 +4271,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1818 "parser.y" +#line 1836 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4264,7 +4282,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1819 "parser.y" +#line 1837 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4275,7 +4293,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1820 "parser.y" +#line 1838 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; @@ -4286,7 +4304,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1821 "parser.y" +#line 1839 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4297,7 +4315,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1822 "parser.y" +#line 1840 "parser.y" {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));} } break; @@ -4308,7 +4326,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1824 "parser.y" +#line 1842 "parser.y" { (yyval.code) = abc_dup(0); (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c); @@ -4329,7 +4347,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1835 "parser.y" +#line 1853 "parser.y" { (yyval.code) = (yyvsp[(3) - (3)].code); } @@ -4342,7 +4360,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1838 "parser.y" +#line 1856 "parser.y" {new_state();} } break; @@ -4353,7 +4371,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1838 "parser.y" +#line 1856 "parser.y" { (yyval.code)=(yyvsp[(4) - (8)].value).c; (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code)); @@ -4389,7 +4407,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1867 "parser.y" +#line 1885 "parser.y" {new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);} } break; @@ -4400,7 +4418,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1868 "parser.y" +#line 1886 "parser.y" { namespace_t name_ns = {ACCESS_PACKAGE, ""}; multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)}; @@ -4429,7 +4447,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1887 "parser.y" +#line 1905 "parser.y" {new_state();state->exception_name=0;} } break; @@ -4440,7 +4458,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1887 "parser.y" +#line 1905 "parser.y" { (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code)); if(!(yyvsp[(4) - (5)].code)) { @@ -4466,7 +4484,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1904 "parser.y" +#line 1922 "parser.y" {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));} } break; @@ -4477,7 +4495,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1905 "parser.y" +#line 1923 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));} } break; @@ -4488,7 +4506,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1906 "parser.y" +#line 1924 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);} } break; @@ -4499,7 +4517,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1907 "parser.y" +#line 1925 "parser.y" { (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list); (yyval.catch_list).finally = 0; @@ -4517,7 +4535,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1915 "parser.y" +#line 1933 "parser.y" { (yyval.catch_list).l=list_new(); (yyval.catch_list).finally = 0; @@ -4535,7 +4553,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1924 "parser.y" +#line 1942 "parser.y" {new_state();} } break; @@ -4546,7 +4564,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1924 "parser.y" +#line 1942 "parser.y" { code_t*out = abc_nop(0); @@ -4598,7 +4616,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1969 "parser.y" +#line 1987 "parser.y" { (yyval.code)=(yyvsp[(2) - (2)].value).c; (yyval.code)=abc_throw((yyval.code)); @@ -4612,7 +4630,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1973 "parser.y" +#line 1991 "parser.y" { if(!state->exception_name) syntaxerror("re-throw only possible within a catch block"); @@ -4630,7 +4648,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1984 "parser.y" +#line 2002 "parser.y" { (yyval.code) = (yyvsp[(3) - (5)].value).c; (yyval.code) = abc_pushscope((yyval.code)); @@ -4646,7 +4664,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1994 "parser.y" +#line 2012 "parser.y" {PASS12 (yyval.id)="package";} } break; @@ -4657,7 +4675,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1996 "parser.y" +#line 2014 "parser.y" {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;} } break; @@ -4668,7 +4686,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1997 "parser.y" +#line 2015 "parser.y" {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));} } break; @@ -4679,7 +4697,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1999 "parser.y" +#line 2017 "parser.y" {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;} } break; @@ -4690,7 +4708,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2000 "parser.y" +#line 2018 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; @@ -4701,7 +4719,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2001 "parser.y" +#line 2019 "parser.y" {PASS12 startpackage("");} } break; @@ -4712,7 +4730,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2002 "parser.y" +#line 2020 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; @@ -4723,7 +4741,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2004 "parser.y" +#line 2022 "parser.y" { classinfo_t*c = (yyvsp[(2) - (2)].classinfo); if(!c) @@ -4741,7 +4759,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2012 "parser.y" +#line 2030 "parser.y" { NEW(import_t,i); i->package = (yyvsp[(2) - (4)].id); @@ -4758,7 +4776,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2022 "parser.y" +#line 2040 "parser.y" {PASS12 (yyval.flags)=0;} } break; @@ -4769,7 +4787,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2023 "parser.y" +#line 2041 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; @@ -4780,7 +4798,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2024 "parser.y" +#line 2042 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].token);} } break; @@ -4791,7 +4809,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2025 "parser.y" +#line 2043 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);} } break; @@ -4802,7 +4820,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2027 "parser.y" +#line 2045 "parser.y" {PASS12 (yyval.token)=FLAG_PUBLIC;} } break; @@ -4813,7 +4831,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2028 "parser.y" +#line 2046 "parser.y" {PASS12 (yyval.token)=FLAG_PRIVATE;} } break; @@ -4824,7 +4842,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2029 "parser.y" +#line 2047 "parser.y" {PASS12 (yyval.token)=FLAG_PROTECTED;} } break; @@ -4835,7 +4853,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2030 "parser.y" +#line 2048 "parser.y" {PASS12 (yyval.token)=FLAG_STATIC;} } break; @@ -4846,7 +4864,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2031 "parser.y" +#line 2049 "parser.y" {PASS12 (yyval.token)=FLAG_DYNAMIC;} } break; @@ -4857,7 +4875,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2032 "parser.y" +#line 2050 "parser.y" {PASS12 (yyval.token)=FLAG_FINAL;} } break; @@ -4868,7 +4886,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2033 "parser.y" +#line 2051 "parser.y" {PASS12 (yyval.token)=FLAG_OVERRIDE;} } break; @@ -4879,7 +4897,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2034 "parser.y" +#line 2052 "parser.y" {PASS12 (yyval.token)=FLAG_NATIVE;} } break; @@ -4890,7 +4908,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2035 "parser.y" +#line 2053 "parser.y" {PASS12 (yyval.token)=FLAG_PACKAGEINTERNAL;} } break; @@ -4901,7 +4919,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2037 "parser.y" +#line 2055 "parser.y" {(yyval.classinfo)=registry_getobjectclass();} } break; @@ -4912,7 +4930,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2038 "parser.y" +#line 2056 "parser.y" {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; @@ -4923,7 +4941,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2040 "parser.y" +#line 2058 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; @@ -4934,7 +4952,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2041 "parser.y" +#line 2059 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; @@ -4945,7 +4963,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2043 "parser.y" +#line 2061 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; @@ -4956,7 +4974,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2044 "parser.y" +#line 2062 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; @@ -4967,7 +4985,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2048 "parser.y" +#line 2066 "parser.y" {PASS12 startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list), 0);} } break; @@ -4978,7 +4996,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2050 "parser.y" +#line 2068 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; @@ -4989,7 +5007,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2054 "parser.y" +#line 2072 "parser.y" {PASS12 startclass((yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list),1);} } break; @@ -5000,7 +5018,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2056 "parser.y" +#line 2074 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; @@ -5011,7 +5029,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2068 "parser.y" +#line 2086 "parser.y" { code_t*c = state->cls->static_init; c = code_append(c, (yyvsp[(1) - (1)].code)); @@ -5026,7 +5044,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2079 "parser.y" +#line 2097 "parser.y" { syntaxerror("variable declarations not allowed in interfaces"); } @@ -5039,7 +5057,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2082 "parser.y" +#line 2100 "parser.y" { PASS12 (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC; @@ -5058,7 +5076,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2096 "parser.y" +#line 2114 "parser.y" { int flags = (yyvsp[(1) - (5)].flags); memberinfo_t* info = state->cls? @@ -5124,7 +5142,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2155 "parser.y" +#line 2173 "parser.y" {(yyval.constant)=0;} } break; @@ -5135,7 +5153,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2156 "parser.y" +#line 2174 "parser.y" {(yyval.constant)=(yyvsp[(2) - (2)].constant);} } break; @@ -5146,7 +5164,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2158 "parser.y" +#line 2176 "parser.y" {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));} } break; @@ -5157,7 +5175,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2159 "parser.y" +#line 2177 "parser.y" {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));} } break; @@ -5168,7 +5186,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2160 "parser.y" +#line 2178 "parser.y" {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));} } break; @@ -5179,7 +5197,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2161 "parser.y" +#line 2179 "parser.y" {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));} } break; @@ -5190,7 +5208,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2162 "parser.y" +#line 2180 "parser.y" {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);} } break; @@ -5201,7 +5219,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2164 "parser.y" +#line 2182 "parser.y" {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));} } break; @@ -5212,7 +5230,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2165 "parser.y" +#line 2183 "parser.y" {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));} } break; @@ -5223,7 +5241,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2166 "parser.y" +#line 2184 "parser.y" {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));} } break; @@ -5234,7 +5252,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2171 "parser.y" +#line 2189 "parser.y" { memset(&(yyval.params),0,sizeof((yyval.params))); } @@ -5247,7 +5265,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2174 "parser.y" +#line 2192 "parser.y" { (yyval.params)=(yyvsp[(1) - (1)].params); } @@ -5260,7 +5278,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2179 "parser.y" +#line 2197 "parser.y" { memset(&(yyval.params),0,sizeof((yyval.params))); (yyval.params).varargs=1; @@ -5275,7 +5293,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2184 "parser.y" +#line 2202 "parser.y" { (yyval.params) =(yyvsp[(1) - (4)].params); (yyval.params).varargs=1; @@ -5290,7 +5308,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2191 "parser.y" +#line 2209 "parser.y" { (yyval.params) = (yyvsp[(1) - (3)].params); list_append((yyval.params).list, (yyvsp[(3) - (3)].param)); @@ -5304,7 +5322,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2195 "parser.y" +#line 2213 "parser.y" { memset(&(yyval.params),0,sizeof((yyval.params))); list_append((yyval.params).list, (yyvsp[(1) - (1)].param)); @@ -5318,7 +5336,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2200 "parser.y" +#line 2218 "parser.y" { (yyval.param) = malloc(sizeof(param_t)); (yyval.param)->name=(yyvsp[(1) - (4)].id); @@ -5334,7 +5352,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2206 "parser.y" +#line 2224 "parser.y" { (yyval.param) = malloc(sizeof(param_t)); (yyval.param)->name=(yyvsp[(1) - (2)].id); @@ -5350,7 +5368,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2212 "parser.y" +#line 2230 "parser.y" {(yyval.token)=(yyvsp[(1) - (1)].token);} } break; @@ -5361,7 +5379,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2213 "parser.y" +#line 2231 "parser.y" {(yyval.token)=(yyvsp[(1) - (1)].token);} } break; @@ -5372,7 +5390,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2214 "parser.y" +#line 2232 "parser.y" {(yyval.token)=0;} } break; @@ -5383,7 +5401,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2217 "parser.y" +#line 2235 "parser.y" {PASS12 startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));} } break; @@ -5394,7 +5412,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2218 "parser.y" +#line 2236 "parser.y" { PASS1 old_state(); PASS2 @@ -5409,6 +5427,7 @@ yyreduce: c = abc_getlocal_0(c); c = abc_constructsuper(c, 0); } + c = wrap_function(c, 0, (yyvsp[(11) - (12)].code)); endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c); @@ -5423,8 +5442,8 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2239 "parser.y" - {(yyval.id)=0;} +#line 2258 "parser.y" + {PASS12 (yyval.id)=0;} } break; @@ -5434,7 +5453,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2241 "parser.y" +#line 2260 "parser.y" {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));} } break; @@ -5445,7 +5464,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2242 "parser.y" +#line 2261 "parser.y" { PASS1 old_state(); PASS2 @@ -5469,7 +5488,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2260 "parser.y" +#line 2279 "parser.y" { PASS1 (yyval.classinfo)=0; PASS2 @@ -5486,7 +5505,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2268 "parser.y" +#line 2287 "parser.y" { PASS1 (yyval.classinfo)=0; PASS2 @@ -5503,7 +5522,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2279 "parser.y" +#line 2298 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));} } break; @@ -5514,7 +5533,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2280 "parser.y" +#line 2299 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));} } break; @@ -5525,7 +5544,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2282 "parser.y" +#line 2301 "parser.y" {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);} } break; @@ -5536,7 +5555,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2283 "parser.y" +#line 2302 "parser.y" {(yyval.classinfo)=registry_getanytype();} } break; @@ -5547,7 +5566,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2284 "parser.y" +#line 2303 "parser.y" {(yyval.classinfo)=registry_getanytype();} } break; @@ -5558,7 +5577,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2293 "parser.y" +#line 2312 "parser.y" {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; @@ -5569,7 +5588,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2294 "parser.y" +#line 2313 "parser.y" {(yyval.classinfo)=0;} } break; @@ -5580,7 +5599,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2298 "parser.y" +#line 2317 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).len=0;} } break; @@ -5591,7 +5610,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2299 "parser.y" +#line 2318 "parser.y" {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);} } break; @@ -5602,7 +5621,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2301 "parser.y" +#line 2320 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).len=0;} } break; @@ -5613,7 +5632,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2303 "parser.y" +#line 2322 "parser.y" {(yyval.value_list).len=1; (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c; } @@ -5626,7 +5645,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2306 "parser.y" +#line 2325 "parser.y" { (yyval.value_list).len= (yyvsp[(1) - (3)].value_list).len+1; (yyval.value_list).cc = code_append((yyvsp[(1) - (3)].value_list).cc, (yyvsp[(3) - (3)].value).c); @@ -5640,7 +5659,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2311 "parser.y" +#line 2330 "parser.y" { MULTINAME(m, (yyvsp[(2) - (3)].classinfo)); (yyval.value).c = code_new(); @@ -5669,7 +5688,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2335 "parser.y" +#line 2354 "parser.y" { (yyval.value).c = (yyvsp[(1) - (4)].value).c; @@ -5727,7 +5746,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2383 "parser.y" +#line 2402 "parser.y" { if(!state->cls) syntaxerror("super() not allowed outside of a class"); if(!state->method) syntaxerror("super() not allowed outside of a function"); @@ -5756,7 +5775,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2403 "parser.y" +#line 2422 "parser.y" { (yyval.value).c = (yyvsp[(2) - (2)].value).c; if((yyval.value).c->opcode == OPCODE_COERCE_A) { @@ -5786,7 +5805,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2424 "parser.y" +#line 2443 "parser.y" { (yyval.code) = abc_returnvoid(0); } @@ -5799,7 +5818,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2427 "parser.y" +#line 2446 "parser.y" { (yyval.code) = (yyvsp[(2) - (2)].value).c; (yyval.code) = abc_returnvalue((yyval.code)); @@ -5813,7 +5832,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2434 "parser.y" +#line 2453 "parser.y" {(yyval.value)=(yyvsp[(1) - (1)].value);} } break; @@ -5824,7 +5843,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2435 "parser.y" +#line 2454 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -5835,7 +5854,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2436 "parser.y" +#line 2455 "parser.y" { (yyval.value).c = (yyvsp[(1) - (3)].value).c; (yyval.value).c = cut_last_push((yyval.value).c); @@ -5851,7 +5870,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2442 "parser.y" +#line 2461 "parser.y" { (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c); } @@ -5864,7 +5883,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2448 "parser.y" +#line 2467 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -5875,7 +5894,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2452 "parser.y" +#line 2471 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -5886,7 +5905,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2454 "parser.y" +#line 2473 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -5897,7 +5916,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2456 "parser.y" +#line 2475 "parser.y" {(yyval.value) = (yyvsp[(1) - (1)].value);} } break; @@ -5908,7 +5927,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2458 "parser.y" +#line 2477 "parser.y" { (yyval.value).c = 0; namespace_t ns = {ACCESS_PACKAGE, ""}; @@ -5934,7 +5953,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2475 "parser.y" +#line 2494 "parser.y" {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint)); //MULTINAME(m, registry_getintclass()); //$$.c = abc_coerce2($$.c, &m); // FIXME @@ -5949,7 +5968,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2480 "parser.y" +#line 2499 "parser.y" {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint)); (yyval.value).t = TYPE_INT; } @@ -5962,7 +5981,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2483 "parser.y" +#line 2502 "parser.y" {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int)); (yyval.value).t = TYPE_INT; } @@ -5975,7 +5994,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2486 "parser.y" +#line 2505 "parser.y" {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint)); (yyval.value).t = TYPE_UINT; } @@ -5988,7 +6007,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2489 "parser.y" +#line 2508 "parser.y" {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float)); (yyval.value).t = TYPE_FLOAT; } @@ -6001,7 +6020,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2492 "parser.y" +#line 2511 "parser.y" {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str)); (yyval.value).t = TYPE_STRING; } @@ -6014,7 +6033,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2495 "parser.y" +#line 2514 "parser.y" {(yyval.value).c = abc_pushundefined(0); (yyval.value).t = TYPE_ANY; } @@ -6027,7 +6046,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2498 "parser.y" +#line 2517 "parser.y" {(yyval.value).c = abc_pushtrue(0); (yyval.value).t = TYPE_BOOLEAN; } @@ -6040,7 +6059,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2501 "parser.y" +#line 2520 "parser.y" {(yyval.value).c = abc_pushfalse(0); (yyval.value).t = TYPE_BOOLEAN; } @@ -6053,7 +6072,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2504 "parser.y" +#line 2523 "parser.y" {(yyval.value).c = abc_pushnull(0); (yyval.value).t = TYPE_NULL; } @@ -6066,7 +6085,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2509 "parser.y" +#line 2528 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6079,7 +6098,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2512 "parser.y" +#line 2531 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6092,7 +6111,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2515 "parser.y" +#line 2534 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6105,7 +6124,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2518 "parser.y" +#line 2537 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6118,7 +6137,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2521 "parser.y" +#line 2540 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6131,7 +6150,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2524 "parser.y" +#line 2543 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6144,7 +6163,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2527 "parser.y" +#line 2546 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6157,7 +6176,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2530 "parser.y" +#line 2549 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; } @@ -6170,7 +6189,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2534 "parser.y" +#line 2553 "parser.y" {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O'); (yyval.value).c = (yyvsp[(1) - (3)].value).c; (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t); @@ -6191,7 +6210,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2545 "parser.y" +#line 2564 "parser.y" { (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A'); /*printf("%08x:\n",$1.t); @@ -6218,7 +6237,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2563 "parser.y" +#line 2582 "parser.y" {(yyval.value).c=(yyvsp[(2) - (2)].value).c; (yyval.value).c = abc_not((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -6232,7 +6251,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2568 "parser.y" +#line 2587 "parser.y" {(yyval.value).c=(yyvsp[(2) - (2)].value).c; (yyval.value).c = abc_bitnot((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6246,7 +6265,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2573 "parser.y" +#line 2592 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_bitand((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6260,7 +6279,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2578 "parser.y" +#line 2597 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_bitxor((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6274,7 +6293,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2583 "parser.y" +#line 2602 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_bitor((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6288,7 +6307,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2588 "parser.y" +#line 2607 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_rshift((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6302,7 +6321,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2592 "parser.y" +#line 2611 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_urshift((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6316,7 +6335,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2596 "parser.y" +#line 2615 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_lshift((yyval.value).c); (yyval.value).t = TYPE_INT; @@ -6330,7 +6349,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2601 "parser.y" +#line 2620 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_divide((yyval.value).c); (yyval.value).t = TYPE_NUMBER; @@ -6344,7 +6363,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2605 "parser.y" +#line 2624 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_modulo((yyval.value).c); (yyval.value).t = TYPE_NUMBER; @@ -6358,7 +6377,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2609 "parser.y" +#line 2628 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) { (yyval.value).c = abc_add_i((yyval.value).c); @@ -6377,7 +6396,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2618 "parser.y" +#line 2637 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { (yyval.value).c = abc_subtract_i((yyval.value).c); @@ -6396,7 +6415,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2627 "parser.y" +#line 2646 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { (yyval.value).c = abc_multiply_i((yyval.value).c); @@ -6415,7 +6434,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2637 "parser.y" +#line 2656 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_in((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -6429,7 +6448,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2642 "parser.y" +#line 2661 "parser.y" {char use_astype=0; // flash player's astype works differently than astypelate if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t)) { MULTINAME(m,(yyvsp[(3) - (3)].value).t->cls); @@ -6450,7 +6469,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2655 "parser.y" +#line 2674 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_instanceof((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -6464,7 +6483,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2660 "parser.y" +#line 2679 "parser.y" {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); (yyval.value).c = abc_istypelate((yyval.value).c); (yyval.value).t = TYPE_BOOLEAN; @@ -6478,7 +6497,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2665 "parser.y" +#line 2684 "parser.y" { (yyval.value).c = (yyvsp[(3) - (4)].value).c; (yyval.value).c = abc_typeof((yyval.value).c); @@ -6493,7 +6512,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2671 "parser.y" +#line 2690 "parser.y" { (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c); (yyval.value).c = abc_pushundefined((yyval.value).c); @@ -6508,7 +6527,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2677 "parser.y" +#line 2696 "parser.y" { (yyval.value).c = abc_pushundefined(0); (yyval.value).t = TYPE_ANY; } @@ -6521,7 +6540,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2681 "parser.y" +#line 2700 "parser.y" {(yyval.value)=(yyvsp[(2) - (3)].value);} } break; @@ -6532,7 +6551,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2683 "parser.y" +#line 2702 "parser.y" { (yyval.value)=(yyvsp[(2) - (2)].value); if(IS_INT((yyvsp[(2) - (2)].value).t)) { @@ -6552,7 +6571,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2694 "parser.y" +#line 2713 "parser.y" { (yyval.value).c = (yyvsp[(1) - (4)].value).c; (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c); @@ -6570,7 +6589,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2703 "parser.y" +#line 2722 "parser.y" { (yyval.value).c = code_new(); (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc); @@ -6586,7 +6605,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2710 "parser.y" +#line 2729 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).len=0;} } break; @@ -6597,7 +6616,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2711 "parser.y" +#line 2730 "parser.y" {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);} } break; @@ -6608,7 +6627,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2713 "parser.y" +#line 2732 "parser.y" { (yyval.value_list).cc = 0; (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c); @@ -6624,7 +6643,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2719 "parser.y" +#line 2738 "parser.y" { (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc; (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2; @@ -6640,7 +6659,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2728 "parser.y" +#line 2747 "parser.y" { (yyval.value).c = code_new(); (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc); @@ -6656,7 +6675,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2735 "parser.y" +#line 2754 "parser.y" { code_t*c = (yyvsp[(3) - (3)].value).c; if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { @@ -6677,7 +6696,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2747 "parser.y" +#line 2766 "parser.y" { code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t); @@ -6693,7 +6712,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2753 "parser.y" +#line 2772 "parser.y" { code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t); @@ -6709,7 +6728,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2759 "parser.y" +#line 2778 "parser.y" { code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t); @@ -6725,7 +6744,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2765 "parser.y" +#line 2784 "parser.y" { code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t); @@ -6741,7 +6760,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2771 "parser.y" +#line 2790 "parser.y" { code_t*c = abc_divide((yyvsp[(3) - (3)].value).c); c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t); @@ -6757,7 +6776,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2777 "parser.y" +#line 2796 "parser.y" { code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c); c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t); @@ -6773,7 +6792,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2783 "parser.y" +#line 2802 "parser.y" { code_t*c = (yyvsp[(3) - (3)].value).c; @@ -6796,7 +6815,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2796 "parser.y" +#line 2815 "parser.y" { code_t*c = (yyvsp[(3) - (3)].value).c; if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) { c=abc_subtract_i(c); @@ -6817,7 +6836,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2807 "parser.y" +#line 2826 "parser.y" { code_t*c = 0; c = code_append(c, (yyvsp[(3) - (3)].value).c); c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t); @@ -6833,7 +6852,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2814 "parser.y" +#line 2833 "parser.y" { (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?'); (yyval.value).c = (yyvsp[(1) - (5)].value).c; @@ -6855,7 +6874,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2827 "parser.y" +#line 2846 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(1) - (2)].value).t; if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) { @@ -6890,7 +6909,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2854 "parser.y" +#line 2873 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(1) - (2)].value).t; if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { @@ -6913,7 +6932,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2868 "parser.y" +#line 2887 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(2) - (2)].value).t; if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { @@ -6936,7 +6955,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2882 "parser.y" +#line 2901 "parser.y" { code_t*c = 0; classinfo_t*type = (yyvsp[(2) - (2)].value).t; if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { @@ -6959,7 +6978,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2897 "parser.y" +#line 2916 "parser.y" { if(!state->cls->info) syntaxerror("super keyword not allowed outside a class"); classinfo_t*t = state->cls->info->superclass; @@ -6982,7 +7001,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2912 "parser.y" +#line 2931 "parser.y" {(yyval.value).c = (yyvsp[(1) - (3)].value).c; classinfo_t*t = (yyvsp[(1) - (3)].value).t; char is_static = 0; @@ -7024,7 +7043,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2945 "parser.y" +#line 2964 "parser.y" { (yyval.value).t = 0; (yyval.value).c = 0; @@ -7124,7 +7143,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3043 "parser.y" +#line 3062 "parser.y" {(yyval.code)=0;} } break; @@ -7135,7 +7154,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3044 "parser.y" +#line 3063 "parser.y" {(yyval.code)=0;} } break; @@ -7146,7 +7165,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3045 "parser.y" +#line 3064 "parser.y" {(yyval.code)=0;} } break; @@ -7157,7 +7176,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3047 "parser.y" +#line 3066 "parser.y" {(yyval.token)=0;} } break; @@ -7166,7 +7185,7 @@ yyreduce: /* Line 1464 of skeleton.m4 */ -#line 7170 "parser.tab.c" +#line 7189 "parser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/lib/as3/parser.tab.h b/lib/as3/parser.tab.h index 344de76..7ea9153 100644 --- a/lib/as3/parser.tab.h +++ b/lib/as3/parser.tab.h @@ -191,6 +191,6 @@ tokenunion # define YYSTYPE_IS_DECLARED 1 #endif -extern YYSTYPE avm2_lval; +extern YYSTYPE a3_lval; diff --git a/lib/as3/tokenizer.lex b/lib/as3/tokenizer.lex index c06b2be..11b1162 100644 --- a/lib/as3/tokenizer.lex +++ b/lib/as3/tokenizer.lex @@ -257,7 +257,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); } @@ -268,13 +268,13 @@ static inline int mkid(int type) char*s = malloc(yyleng+1); memcpy(s, yytext, yyleng); s[yyleng]=0; - avm2_lval.id = s; + a3_lval.id = s; return type; } static inline int m(int type) { - avm2_lval.token = type; + a3_lval.token = type; return type; } @@ -292,7 +292,7 @@ static char*nrbuf() 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) @@ -302,7 +302,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) @@ -312,14 +312,14 @@ 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; } @@ -432,7 +432,7 @@ void handleLabel(char*text, int len) char*s = malloc(t+1); memcpy(s, yytext, t); s[t]=0; - avm2_lval.id = s; + a3_lval.id = s; } static int handleregexp() @@ -448,11 +448,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; } @@ -520,7 +520,7 @@ REGEXP [/]([^/\n]|\\[/])*[/][a-zA-Z]* { {REGEXP} {c(); BEGIN(INITIAL);return handleregexp();} {HEXWITHSIGN} {c(); BEGIN(INITIAL);return handlehex();} -{HEXFLOATWITHSIGN} {c(); BEGIN(INITIAL);return handlehexfloat();} +{HEXFLOATWITHSIGN} {c(); BEGIN(INITIAL);return handlehexfloat();} {INTWITHSIGN} {c(); BEGIN(INITIAL);return handleint();} {FLOATWITHSIGN} {c(); BEGIN(INITIAL);return handlefloat();} } @@ -540,10 +540,10 @@ REGEXP [/]([^/\n]|\\[/])*[/][a-zA-Z]* {NAME}{S}*:{S}*do/{_} {l();handleLabel(yytext, yyleng-2);return T_DO;} {NAME}{S}*:{S}*while/{_} {l();handleLabel(yytext, yyleng-5);return T_WHILE;} {NAME}{S}*:{S}*switch/{_} {l();handleLabel(yytext, yyleng-6);return T_SWITCH;} -for {c();avm2_lval.id="";return T_FOR;} -do {c();avm2_lval.id="";return T_DO;} -while {c();avm2_lval.id="";return T_WHILE;} -switch {c();avm2_lval.id="";return T_SWITCH;} +for {c();a3_lval.id="";return T_FOR;} +do {c();a3_lval.id="";return T_DO;} +while {c();a3_lval.id="";return T_WHILE;} +switch {c();a3_lval.id="";return T_SWITCH;} [&][&] {c();BEGIN(REGEXPOK);return m(T_ANDAND);} [|][|] {c();BEGIN(REGEXPOK);return m(T_OROR);} diff --git a/lib/as3/tokenizer.yy.c b/lib/as3/tokenizer.yy.c index 3e02c8e..dd92251 100644 --- a/lib/as3/tokenizer.yy.c +++ b/lib/as3/tokenizer.yy.c @@ -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;tmax[t]) { + for(t=0;tmax[t]) { as3_warning("integer overflow: %s (converted to Number)", s); return handlefloat(); } - else if(avm2_text[l+t]8) { char*s = nrbuf(); @@ -1517,7 +1517,7 @@ static inline int handlehex() unsigned int v = 0; for(t=l;t='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 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; }