#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. */
#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);
char has_super;
char is_global;
char inner;
+ int variable_count;
abc_exception_list_t*exceptions;
} methodstate_t;
typedef struct _global {
abc_file_t*file;
abc_script_t*init;
-
- int variable_count;
} global_t;
static global_t*global = 0;
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;
}
{
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) {
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()
new_state();
/*printf("entering package \"%s\"\n", name);*/
state->package = strdup(name);
- global->variable_count = 1;
}
static void endpackage()
{
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;
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;
}
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);
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);
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) {
/* Line 273 of skeleton.m4 */
-#line 1574 "parser.tab.c"
+#line 1592 "parser.tab.c"
#ifdef short
# undef short
/* 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
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1573 "parser.y"
+#line 1591 "parser.y"
{(yyval.code)=(yyvsp[(1) - (1)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1574 "parser.y"
+#line 1592 "parser.y"
{(yyval.code)=code_new();}
}
break;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1577 "parser.y"
+#line 1595 "parser.y"
{(yyval.code)=(yyvsp[(1) - (1)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1592 "parser.y"
+#line 1610 "parser.y"
{(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1600 "parser.y"
+#line 1618 "parser.y"
{/*TODO*/(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1601 "parser.y"
+#line 1619 "parser.y"
{/*TODO*/(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1603 "parser.y"
+#line 1621 "parser.y"
{(yyval.code)=(yyvsp[(2) - (3)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1604 "parser.y"
+#line 1622 "parser.y"
{(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1605 "parser.y"
+#line 1623 "parser.y"
{(yyval.code)=(yyvsp[(1) - (2)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1606 "parser.y"
+#line 1624 "parser.y"
{(yyval.code)=(yyvsp[(1) - (1)].code);}
}
break;
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));
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1617 "parser.y"
+#line 1635 "parser.y"
{(yyval.value)=(yyvsp[(2) - (2)].value);}
}
break;
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;
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1622 "parser.y"
+#line 1640 "parser.y"
{(yyval.code)=(yyvsp[(2) - (2)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1623 "parser.y"
+#line 1641 "parser.y"
{(yyval.code)=(yyvsp[(2) - (2)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1625 "parser.y"
+#line 1643 "parser.y"
{(yyval.code) = (yyvsp[(1) - (1)].code);}
}
break;
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;
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));
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1669 "parser.y"
+#line 1687 "parser.y"
{(yyval.code) = code_new();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1670 "parser.y"
+#line 1688 "parser.y"
{(yyval.code)=(yyvsp[(2) - (2)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1673 "parser.y"
+#line 1691 "parser.y"
{new_state();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1673 "parser.y"
+#line 1691 "parser.y"
{
(yyval.code) = code_new();
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1692 "parser.y"
+#line 1710 "parser.y"
{(yyval.code)=code_new();}
}
break;
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);
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1700 "parser.y"
+#line 1718 "parser.y"
{
(yyval.id)=(yyvsp[(1) - (1)].id);
}
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;
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;
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();
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__");
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1770 "parser.y"
+#line 1788 "parser.y"
{new_state();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1770 "parser.y"
+#line 1788 "parser.y"
{
(yyval.code) = code_new();
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1789 "parser.y"
+#line 1807 "parser.y"
{new_state();}
}
break;
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));
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1804 "parser.y"
+#line 1822 "parser.y"
{
(yyval.code) = abc___break__(0, "");
}
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));
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1810 "parser.y"
+#line 1828 "parser.y"
{
(yyval.code) = abc___continue__(0, "");
}
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));
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1817 "parser.y"
+#line 1835 "parser.y"
{(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1818 "parser.y"
+#line 1836 "parser.y"
{(yyval.code)=(yyvsp[(1) - (1)].code);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1819 "parser.y"
+#line 1837 "parser.y"
{(yyval.code)=(yyvsp[(1) - (1)].code);}
}
break;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1821 "parser.y"
+#line 1839 "parser.y"
{(yyval.code)=(yyvsp[(1) - (1)].code);}
}
break;
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;
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);
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1835 "parser.y"
+#line 1853 "parser.y"
{
(yyval.code) = (yyvsp[(3) - (3)].code);
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1838 "parser.y"
+#line 1856 "parser.y"
{new_state();}
}
break;
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));
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;
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)};
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1887 "parser.y"
+#line 1905 "parser.y"
{new_state();state->exception_name=0;}
}
break;
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)) {
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;
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;
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;
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1924 "parser.y"
+#line 1942 "parser.y"
{new_state();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1924 "parser.y"
+#line 1942 "parser.y"
{
code_t*out = abc_nop(0);
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));
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");
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));
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 1994 "parser.y"
+#line 2012 "parser.y"
{PASS12 (yyval.id)="package";}
}
break;
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;
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2000 "parser.y"
+#line 2018 "parser.y"
{PASS12 endpackage();(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2001 "parser.y"
+#line 2019 "parser.y"
{PASS12 startpackage("");}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2002 "parser.y"
+#line 2020 "parser.y"
{PASS12 endpackage();(yyval.code)=0;}
}
break;
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)
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);
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2022 "parser.y"
+#line 2040 "parser.y"
{PASS12 (yyval.flags)=0;}
}
break;
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;
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2027 "parser.y"
+#line 2045 "parser.y"
{PASS12 (yyval.token)=FLAG_PUBLIC;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2028 "parser.y"
+#line 2046 "parser.y"
{PASS12 (yyval.token)=FLAG_PRIVATE;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2029 "parser.y"
+#line 2047 "parser.y"
{PASS12 (yyval.token)=FLAG_PROTECTED;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2030 "parser.y"
+#line 2048 "parser.y"
{PASS12 (yyval.token)=FLAG_STATIC;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2031 "parser.y"
+#line 2049 "parser.y"
{PASS12 (yyval.token)=FLAG_DYNAMIC;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2032 "parser.y"
+#line 2050 "parser.y"
{PASS12 (yyval.token)=FLAG_FINAL;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2033 "parser.y"
+#line 2051 "parser.y"
{PASS12 (yyval.token)=FLAG_OVERRIDE;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2034 "parser.y"
+#line 2052 "parser.y"
{PASS12 (yyval.token)=FLAG_NATIVE;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2035 "parser.y"
+#line 2053 "parser.y"
{PASS12 (yyval.token)=FLAG_PACKAGEINTERNAL;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2037 "parser.y"
+#line 2055 "parser.y"
{(yyval.classinfo)=registry_getobjectclass();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2038 "parser.y"
+#line 2056 "parser.y"
{(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2040 "parser.y"
+#line 2058 "parser.y"
{PASS12 (yyval.classinfo_list)=list_new();}
}
break;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2043 "parser.y"
+#line 2061 "parser.y"
{PASS12 (yyval.classinfo_list)=list_new();}
}
break;
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2050 "parser.y"
+#line 2068 "parser.y"
{PASS12 endclass();(yyval.code)=0;}
}
break;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2056 "parser.y"
+#line 2074 "parser.y"
{PASS12 endclass();(yyval.code)=0;}
}
break;
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));
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2079 "parser.y"
+#line 2097 "parser.y"
{
syntaxerror("variable declarations not allowed in interfaces");
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2082 "parser.y"
+#line 2100 "parser.y"
{
PASS12
(yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC;
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?
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2155 "parser.y"
+#line 2173 "parser.y"
{(yyval.constant)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2156 "parser.y"
+#line 2174 "parser.y"
{(yyval.constant)=(yyvsp[(2) - (2)].constant);}
}
break;
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;
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;
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;
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;
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;
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;
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2171 "parser.y"
+#line 2189 "parser.y"
{
memset(&(yyval.params),0,sizeof((yyval.params)));
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2174 "parser.y"
+#line 2192 "parser.y"
{
(yyval.params)=(yyvsp[(1) - (1)].params);
}
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;
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;
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));
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));
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);
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);
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2212 "parser.y"
+#line 2230 "parser.y"
{(yyval.token)=(yyvsp[(1) - (1)].token);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2213 "parser.y"
+#line 2231 "parser.y"
{(yyval.token)=(yyvsp[(1) - (1)].token);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2214 "parser.y"
+#line 2232 "parser.y"
{(yyval.token)=0;}
}
break;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2218 "parser.y"
+#line 2236 "parser.y"
{
PASS1 old_state();
PASS2
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);
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2242 "parser.y"
+#line 2261 "parser.y"
{
PASS1 old_state();
PASS2
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2260 "parser.y"
+#line 2279 "parser.y"
{
PASS1 (yyval.classinfo)=0;
PASS2
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2268 "parser.y"
+#line 2287 "parser.y"
{
PASS1 (yyval.classinfo)=0;
PASS2
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2282 "parser.y"
+#line 2301 "parser.y"
{(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2283 "parser.y"
+#line 2302 "parser.y"
{(yyval.classinfo)=registry_getanytype();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2284 "parser.y"
+#line 2303 "parser.y"
{(yyval.classinfo)=registry_getanytype();}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2293 "parser.y"
+#line 2312 "parser.y"
{(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2294 "parser.y"
+#line 2313 "parser.y"
{(yyval.classinfo)=0;}
}
break;
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;
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;
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;
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;
}
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);
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();
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;
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");
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) {
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2424 "parser.y"
+#line 2443 "parser.y"
{
(yyval.code) = abc_returnvoid(0);
}
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));
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2434 "parser.y"
+#line 2453 "parser.y"
{(yyval.value)=(yyvsp[(1) - (1)].value);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2435 "parser.y"
+#line 2454 "parser.y"
{(yyval.value) = (yyvsp[(1) - (1)].value);}
}
break;
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);
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);
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2448 "parser.y"
+#line 2467 "parser.y"
{(yyval.value) = (yyvsp[(1) - (1)].value);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2452 "parser.y"
+#line 2471 "parser.y"
{(yyval.value) = (yyvsp[(1) - (1)].value);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2454 "parser.y"
+#line 2473 "parser.y"
{(yyval.value) = (yyvsp[(1) - (1)].value);}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2456 "parser.y"
+#line 2475 "parser.y"
{(yyval.value) = (yyvsp[(1) - (1)].value);}
}
break;
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, ""};
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
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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);
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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);
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);
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);
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;
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);
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;
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;
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);
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);
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;
}
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 2681 "parser.y"
+#line 2700 "parser.y"
{(yyval.value)=(yyvsp[(2) - (3)].value);}
}
break;
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)) {
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);
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);
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;
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;
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);
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;
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);
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)) {
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);
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);
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);
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);
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);
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);
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;
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);
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);
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;
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)) {
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)) {
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)) {
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)) {
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;
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;
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;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 3043 "parser.y"
+#line 3062 "parser.y"
{(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 3044 "parser.y"
+#line 3063 "parser.y"
{(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 3045 "parser.y"
+#line 3064 "parser.y"
{(yyval.code)=0;}
}
break;
if(as3_pass==2) {
/* Line 1464 of skeleton.m4 */
-#line 3047 "parser.y"
+#line 3066 "parser.y"
{(yyval.token)=0;}
}
break;
/* Line 1464 of skeleton.m4 */
-#line 7170 "parser.tab.c"
+#line 7189 "parser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
/* 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
#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
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
#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 )
* 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
*/
#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; \
}
#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; \
}
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 );
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;
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.
#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
}
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
}
else syntaxerror("String incorrectly terminated");
- avm2_lval.str = string_unescape(s, len);
+ a3_lval.str = string_unescape(s, len);
}
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;
}
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)
}
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)
}
static inline int setfloat(double v)
{
- avm2_lval.number_float = v;
+ a3_lval.number_float = v;
return T_FLOAT;
}
static inline int handlefloat()
{
char*s = nrbuf();
- avm2_lval.number_float = atof(s);
+ a3_lval.number_float = atof(s);
return T_FLOAT;
}
static inline int handleint()
{
char*s = nrbuf();
- char l = (avm2_text[0]=='-');
+ char l = (as3_text[0]=='-');
char*max = l?"1073741824":"2147483647";
- if(avm2_leng-l>10) {
+ if(as3_leng-l>10) {
as3_warning("integer overflow: %s (converted to Number)", s);
return handlefloat();
}
- if(avm2_leng-l==10) {
+ if(as3_leng-l==10) {
int t;
- for(t=0;t<avm2_leng-l;t++) {
- if(avm2_text[l+t]>max[t]) {
+ for(t=0;t<as3_leng-l;t++) {
+ if(as3_text[l+t]>max[t]) {
as3_warning("integer overflow: %s (converted to Number)", s);
return handlefloat();
}
- else if(avm2_text[l+t]<max[t])
+ else if(as3_text[l+t]<max[t])
break;
}
}
- if(avm2_text[0]=='-') {
+ if(as3_text[0]=='-') {
int v = atoi(s);
return setint(v);
} else {
unsigned int v = 0;
int t;
- for(t=0;t<avm2_leng;t++) {
+ for(t=0;t<as3_leng;t++) {
v*=10;
- v+=avm2_text[t]-'0';
+ v+=as3_text[t]-'0';
}
return setuint(v);
}
static inline int handlehexfloat()
{
- char l = (avm2_text[0]=='-')+2;
+ char l = (as3_text[0]=='-')+2;
double d=0;
char dot=0;
double base=1;
int t;
- for(t=l;t<avm2_leng;t++) {
- char c = avm2_text[t];
+ for(t=l;t<as3_leng;t++) {
+ char c = as3_text[t];
if(c=='.') {
dot=1;
continue;
}
static inline int handlehex()
{
- char l = (avm2_text[0]=='-')+2;
- int len = avm2_leng;
+ char l = (as3_text[0]=='-')+2;
+ int len = as3_leng;
if(len-l>8) {
char*s = nrbuf();
unsigned int v = 0;
for(t=l;t<len;t++) {
v<<=4;
- char c = avm2_text[t];
+ char c = as3_text[t];
if(c>='0' && c<='9')
v|=(c&15);
else if((c>='a' && c<='f') || (c>='A' && c<='F'))
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) {
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;
}
/* count the number of lines+columns consumed by this token */
static inline void l() {
int t;
- for(t=0;t<avm2_leng;t++) {
- if(avm2_text[t]=='\n') {
+ for(t=0;t<as3_leng;t++) {
+ if(as3_text[t]=='\n') {
current_line++;
current_column=0;
} else {
}
/* count the number of columns consumed by this token */
static inline void c() {
- current_column+=avm2_leng;
+ current_column+=as3_leng;
}
//Boolean {c();return m(KW_BOOLEAN);}
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int avm2_lex_destroy (void );
+int as3_lex_destroy (void );
-int avm2_get_debug (void );
+int as3_get_debug (void );
-void avm2_set_debug (int debug_flag );
+void as3_set_debug (int debug_flag );
-YY_EXTRA_TYPE avm2_get_extra (void );
+YY_EXTRA_TYPE as3_get_extra (void );
-void avm2_set_extra (YY_EXTRA_TYPE user_defined );
+void as3_set_extra (YY_EXTRA_TYPE user_defined );
-FILE *avm2_get_in (void );
+FILE *as3_get_in (void );
-void avm2_set_in (FILE * in_str );
+void as3_set_in (FILE * in_str );
-FILE *avm2_get_out (void );
+FILE *as3_get_out (void );
-void avm2_set_out (FILE * out_str );
+void as3_set_out (FILE * out_str );
-int avm2_get_leng (void );
+int as3_get_leng (void );
-char *avm2_get_text (void );
+char *as3_get_text (void );
-int avm2_get_lineno (void );
+int as3_get_lineno (void );
-void avm2_set_lineno (int line_number );
+void as3_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int avm2_wrap (void );
+extern "C" int as3_wrap (void );
#else
-extern int avm2_wrap (void );
+extern int as3_wrap (void );
#endif
#endif
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( avm2_text, avm2_leng, 1, avm2_out )
+#define ECHO fwrite( as3_text, as3_leng, 1, as3_out )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
int c = '*'; \
int n; \
for ( n = 0; n < max_size && \
- (c = getc( avm2_in )) != EOF && c != '\n'; ++n ) \
+ (c = getc( as3_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( avm2_in ) ) \
+ if ( c == EOF && ferror( as3_in ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, avm2_in))==0 && ferror(avm2_in)) \
+ while ( (result = fread(buf, 1, max_size, as3_in))==0 && ferror(as3_in)) \
{ \
if( errno != EINTR) \
{ \
break; \
} \
errno=0; \
- clearerr(avm2_in); \
+ clearerr(as3_in); \
} \
}\
\
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int avm2_lex (void);
+extern int as3_lex (void);
-#define YY_DECL int avm2_lex (void)
+#define YY_DECL int as3_lex (void)
#endif /* !YY_DECL */
-/* Code executed at the beginning of each rule, after avm2_text and avm2_leng
+/* Code executed at the beginning of each rule, after as3_text and as3_leng
* have been set up.
*/
#ifndef YY_USER_ACTION
#endif
#define YY_RULE_SETUP \
- if ( avm2_leng > 0 ) \
+ if ( as3_leng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
- (avm2_text[avm2_leng - 1] == '\n'); \
+ (as3_text[as3_leng - 1] == '\n'); \
YY_USER_ACTION
/** The main scanner function which does all the work.
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
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:
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
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();
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
{
/* 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;
}
{
(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
"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
*
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. */
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- avm2_restart(avm2_in );
+ as3_restart(as3_in );
}
else
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()" );
}
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 )
*/
/* 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) )
}
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');
*
* @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;
}
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);
}
*
* @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 )
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 */
/* 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){
* @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;
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
* @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. */
(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;
}
* 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;
}
}
/* 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;
* 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*));
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*));
*
* @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;
/* 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;
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;
/* 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.
#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 )
/** 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;
/* 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;
}
#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
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"
-int avm2_wrap()
+int as3_wrap()
{
return 1;
}