From a1dde8db3bde6aa26562dadae696d5d54ef752d2 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Tue, 7 Apr 2009 17:01:18 +0200 Subject: [PATCH] as3: compile-time constants now work --- lib/as3/builtin.c | 10 +- lib/as3/import.c | 11 + lib/as3/mklib.c | 6 +- lib/as3/ok/const.as | 2 +- lib/as3/parser.tab.c | 991 ++++++++++++++++++++++++++------------------------ lib/as3/parser.y | 130 ++++--- lib/as3/registry.c | 14 +- lib/as3/registry.h | 7 +- 8 files changed, 623 insertions(+), 548 deletions(-) diff --git a/lib/as3/builtin.c b/lib/as3/builtin.c index 00c612c..2f34665 100644 --- a/lib/as3/builtin.c +++ b/lib/as3/builtin.c @@ -2549,7 +2549,7 @@ static varinfo_t flash_text_engine_TextBlock_tabStops = {0x01, 0x00, 0x80, 0x16, static methodinfo_t flash_text_engine_TextBlock_dump = {0x02, 0x00, 0x80, 0x16, "", "dump", 0, &_String, &flash_text_engine_TextBlock, 0}; static namespace_t flash_utils_flash_proxy_constant_ns = {0x08, "http://www.adobe.com/2006/actionscript/flash/proxy"}; static constant_t flash_utils_flash_proxy_constant = {type: 8, &flash_utils_flash_proxy_constant_ns}; -static varinfo_t flash_utils_flash_proxy = {0x01, 0x00, 0x82, 0x16, "flash.utils", "flash_proxy", 0, 0, 0, &flash_utils_flash_proxy_constant}; +static varinfo_t flash_utils_flash_proxy = {0x01, 0x00, 0xa2, 0x16, "flash.utils", "flash_proxy", 0, 0, 0, &flash_utils_flash_proxy_constant}; static classinfo_t flash_display_MorphShape = {0x03, 0x00, 0x81, 0x16, "flash.display", "MorphShape", 0, &flash_display_DisplayObject, interfaces: {0}}; static classinfo_t flash_text_TextDisplayMode = {0x03, 0x00, 0x81, 0x16, "flash.text", "TextDisplayMode", 0, &_Object, interfaces: {0}}; static classinfo_t flash_net_URLLoaderDataFormat = {0x03, 0x00, 0x81, 0x16, "flash.net", "URLLoaderDataFormat", 0, &_Object, interfaces: {0}}; @@ -3735,7 +3735,7 @@ static varinfo_t flash_media_SoundTransform_leftToLeft = {0x01, 0x00, 0x80, 0x16 static varinfo_t flash_media_SoundTransform_rightToRight = {0x01, 0x00, 0x80, 0x16, "", "rightToRight", 0, 0, &flash_media_SoundTransform, 0}; static namespace_t _AS3_constant_ns = {0x08, "http://adobe.com/AS3/2006/builtin"}; static constant_t _AS3_constant = {type: 8, &_AS3_constant_ns}; -static varinfo_t _AS3 = {0x01, 0x00, 0x82, 0x16, "", "AS3", 0, 0, 0, &_AS3_constant}; +static varinfo_t _AS3 = {0x01, 0x00, 0xa2, 0x16, "", "AS3", 0, 0, 0, &_AS3_constant}; static classinfo_t flash_net_LocalConnection = {0x03, 0x00, 0x80, 0x16, "flash.net", "LocalConnection", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_net_LocalConnection_client = {0x01, 0x00, 0x80, 0x16, "", "client", 0, 0, &flash_net_LocalConnection, 0}; static methodinfo_t flash_net_LocalConnection_allowDomain = {0x02, 0x00, 0x80, 0x16, "", "allowDomain", 0, 0, &flash_net_LocalConnection, 0}; @@ -3796,7 +3796,7 @@ static varinfo_t flash_display_GraphicsBitmapFill_smooth = {0x01, 0x00, 0x80, 0x static varinfo_t flash_display_GraphicsBitmapFill_repeat = {0x01, 0x00, 0x80, 0x16, "", "repeat", 0, &_Boolean, &flash_display_GraphicsBitmapFill, 0}; static varinfo_t flash_display_GraphicsBitmapFill_bitmapData = {0x01, 0x00, 0x80, 0x16, "", "bitmapData", 0, &flash_display_BitmapData, &flash_display_GraphicsBitmapFill, 0}; static varinfo_t flash_display_GraphicsBitmapFill_matrix = {0x01, 0x00, 0x80, 0x16, "", "matrix", 0, &flash_geom_Matrix, &flash_display_GraphicsBitmapFill, 0}; -static varinfo_t _undefined = {0x01, 0x00, 0x82, 0x16, "", "undefined", 0, 0, 0, 0}; +static varinfo_t _undefined = {0x01, 0x00, 0xa2, 0x16, "", "undefined", 0, 0, 0, 0}; static classinfo_t flash_display_SimpleButton = {0x03, 0x00, 0x80, 0x16, "flash.display", "SimpleButton", 0, &flash_display_InteractiveObject, interfaces: {0}}; static varinfo_t flash_display_SimpleButton_overState = {0x01, 0x00, 0x80, 0x16, "", "overState", 0, 0, &flash_display_SimpleButton, 0}; static varinfo_t flash_display_SimpleButton_downState = {0x01, 0x00, 0x80, 0x16, "", "downState", 0, 0, &flash_display_SimpleButton, 0}; @@ -3957,7 +3957,7 @@ static methodinfo_t flash_display_BitmapData_applyFilter = {0x02, 0x00, 0x80, 0x static methodinfo_t flash_display_BitmapData_dispose = {0x02, 0x00, 0x80, 0x16, "", "dispose", 0, 0, &flash_display_BitmapData, 0}; static classinfo_t flash_text_engine_LigatureLevel = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "LigatureLevel", 0, &_Object, interfaces: {0}}; static constant_t _Infinity_constant = {type: 6}; -static varinfo_t _Infinity = {0x01, 0x00, 0x82, 0x16, "", "Infinity", 0, &_Number, 0, &_Infinity_constant}; +static varinfo_t _Infinity = {0x01, 0x00, 0xa2, 0x16, "", "Infinity", 0, &_Number, 0, &_Infinity_constant}; static classinfo_t flash_text_engine_FontDescription = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "FontDescription", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_text_engine_FontDescription_isFontCompatible = {0x02, 0x00, 0x82, 0x16, "", "isFontCompatible", 0, &_Boolean, &flash_text_engine_FontDescription, 0}; static varinfo_t flash_text_engine_FontDescription_renderingMode = {0x01, 0x00, 0x80, 0x16, "", "renderingMode", 0, 0, &flash_text_engine_FontDescription, 0}; @@ -4024,7 +4024,7 @@ static varinfo_t flash_text_engine_TextJustifier_locale = {0x01, 0x00, 0x80, 0x1 static methodinfo_t flash_text_engine_TextJustifier_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_text_engine_TextJustifier, &flash_text_engine_TextJustifier, 0}; static classinfo_t flash_display_StageAlign = {0x03, 0x00, 0x81, 0x16, "flash.display", "StageAlign", 0, &_Object, interfaces: {0}}; static constant_t _NaN_constant = {type: 6}; -static varinfo_t _NaN = {0x01, 0x00, 0x82, 0x16, "", "NaN", 0, &_Number, 0, &_NaN_constant}; +static varinfo_t _NaN = {0x01, 0x00, 0xa2, 0x16, "", "NaN", 0, &_Number, 0, &_NaN_constant}; static classinfo_t _ReferenceError = {0x03, 0x00, 0x88, 0x16, "", "ReferenceError", 0, &_Error, interfaces: {0}}; static classinfo_t flash_display_Shape = {0x03, 0x00, 0x80, 0x16, "flash.display", "Shape", 0, &flash_display_DisplayObject, interfaces: {0}}; static varinfo_t flash_display_Shape_graphics = {0x01, 0x00, 0x80, 0x16, "", "graphics", 0, 0, &flash_display_Shape, 0}; diff --git a/lib/as3/import.c b/lib/as3/import.c index fb3c7de..c93826f 100644 --- a/lib/as3/import.c +++ b/lib/as3/import.c @@ -199,6 +199,16 @@ static void import_code(void*_abc, char*filename, int pass) trait->kind == TRAIT_GETTER) { s = (memberinfo_t*)varinfo_register_onclass(c, access, ns, name); s->type = resolve_class(filename, "type", trait->type_name); +#if 0 // some variables are apparently both a static const and a slot + // needs split of static/non-static first + } else if(trait->kind == TRAIT_CONST) { + varinfo_t*v = (varinfo_t*)varinfo_register_onclass(c, access, ns, name); + v->type = resolve_class(filename, "type", trait->type_name); + v->flags |= FLAG_CONST; + /* leave this alone for now- it blows up the file too much + v->value = constant_clone(trait->value);*/ + s = (memberinfo_t*)v; +#endif } else { goto cont; } @@ -252,6 +262,7 @@ static void import_code(void*_abc, char*filename, int pass) varinfo_t*v = varinfo_register_global(access, package, name); v->type = resolve_class(filename, "type", trait->type_name); v->value = constant_clone(trait->value); + v->flags |= trait->kind==TRAIT_CONST?FLAG_CONST:0; m = (memberinfo_t*)v; } m->flags |= FLAG_BUILTIN; diff --git a/lib/as3/mklib.c b/lib/as3/mklib.c index feafada..b243ffc 100644 --- a/lib/as3/mklib.c +++ b/lib/as3/mklib.c @@ -122,7 +122,7 @@ char*mktype(slotinfo_t*s) return "classinfo_t"; } else if(s->kind == INFOTYPE_METHOD) { return "methodinfo_t"; - } else if(s->kind == INFOTYPE_SLOT) { + } else if(s->kind == INFOTYPE_VAR) { return "varinfo_t"; } } @@ -200,7 +200,7 @@ void write_constant(FILE*fi, constant_t*value, char*id, char*prefix) void write_slotinfo(FILE*fi, slotinfo_t*s, char*id, char*prefix) { - if(s->kind == INFOTYPE_SLOT) { + if(s->kind == INFOTYPE_VAR) { varinfo_t*v = (varinfo_t*)s; if(v->value) { write_constant(fi, v->value, id, prefix); @@ -239,7 +239,7 @@ void write_slotinfo(FILE*fi, slotinfo_t*s, char*id, char*prefix) fprintf(fi, "0"); // params TODO fprintf(fi, "};\n"); } - if(s->kind == INFOTYPE_SLOT) { + if(s->kind == INFOTYPE_VAR) { varinfo_t*m = (varinfo_t*)s; fprintf(fi, "%s, ", mkptr(m->type)); fprintf(fi, "%s, ", mkptr(m->parent)); diff --git a/lib/as3/ok/const.as b/lib/as3/ok/const.as index 2ff88be..70aa9c2 100644 --- a/lib/as3/ok/const.as +++ b/lib/as3/ok/const.as @@ -9,7 +9,7 @@ package { static const ok4:String = "ok 4/6"; const ok5:String = "ok 5/6"; - static const ok6:String = "ok 6/6"; + static const ok6:String = "ok "+"6/6"; function Main() { trace(ok1); diff --git a/lib/as3/parser.tab.c b/lib/as3/parser.tab.c index 0ccd08f..1c5735e 100644 --- a/lib/as3/parser.tab.c +++ b/lib/as3/parser.tab.c @@ -288,7 +288,7 @@ tokenunion /* Copy the second part of user declarations. */ /* Line 273 of skeleton.m4 */ -#line 269 "parser.y" +#line 270 "parser.y" static int a3_error(char*s) @@ -1281,7 +1281,7 @@ static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, c // not sure wether to look into superclasses here, too minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1); if(minfo) { - if(minfo->kind!=INFOTYPE_SLOT) + if(minfo->kind!=INFOTYPE_VAR) syntaxerror("class already contains a method called '%s'", name); if(!(minfo->subtype & (SUBTYPE_GETSET))) syntaxerror("class already contains a field called '%s'", name); @@ -1302,7 +1302,7 @@ static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, c }*/ } else { minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name); - minfo->kind = INFOTYPE_SLOT; //hack + minfo->kind = INFOTYPE_VAR; //hack minfo->subtype = gs; minfo->return_type = 0; } @@ -1902,7 +1902,7 @@ code_t* insert_finally(code_t*c, code_t*finally, int tempvar) /* Unqualified %code blocks. */ /* Line 274 of skeleton.m4 */ -#line 1966 "parser.y" +#line 1967 "parser.y" char is_subtype_of(classinfo_t*type, classinfo_t*supertype) { @@ -1911,7 +1911,7 @@ code_t* insert_finally(code_t*c, code_t*finally, int tempvar) /* Line 274 of skeleton.m4 */ -#line 2415 "parser.y" +#line 2416 "parser.y" static void state_has_imports() { @@ -1934,7 +1934,7 @@ code_t* insert_finally(code_t*c, code_t*finally, int tempvar) /* Line 274 of skeleton.m4 */ -#line 2548 "parser.y" +#line 2549 "parser.y" static int slotstate_varconst = 0; static modifiers_t*slotstate_flags = 0; @@ -1955,7 +1955,7 @@ code_t* insert_finally(code_t*c, code_t*finally, int tempvar) /* Line 274 of skeleton.m4 */ -#line 3399 "parser.y" +#line 3431 "parser.y" void add_active_url(const char*url) { @@ -2329,7 +2329,7 @@ static const yytype_int16 yyrhs[] = 45, 3, -1, 189, 25, 215, 3, 121, 212, 132, 226, -1, 45, -1, 31, -1, -1, 189, 205, 207, 208, -1, 209, -1, 208, 100, 209, -1, 3, 226, - 148, -1, -1, 102, 211, -1, 8, -1, 9, -1, + 148, -1, -1, 102, 242, -1, 8, -1, 9, -1, 10, -1, 5, -1, 55, -1, 54, -1, 44, -1, 27, -1, 28, -1, -1, 213, -1, 93, 214, -1, 213, 100, 93, 214, -1, 213, 100, 214, -1, 214, @@ -2347,8 +2347,8 @@ static const yytype_int16 yyrhs[] = -1, 242, -1, 238, -1, 242, -1, 238, 100, 242, -1, 242, -1, 239, 100, 242, -1, -1, 241, -1, 236, 104, 236, -1, 241, 100, 236, 104, 236, -1, - 219, -1, 244, -1, 243, -1, 232, -1, 234, -1, - 233, -1, 211, -1, 6, -1, 123, 228, 124, -1, + 219, -1, 243, -1, 232, -1, 234, -1, 233, -1, + 244, -1, 211, -1, 6, -1, 123, 228, 124, -1, 69, 240, 131, -1, 242, 108, 242, -1, 242, 109, 242, -1, 242, 74, 242, -1, 242, 75, 242, -1, 242, 70, 242, -1, 242, 71, 242, -1, 242, 73, @@ -2380,37 +2380,37 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1881, 1881, 1883, 1883, 1884, 1885, 1887, 1888, 1889, - 1890, 1891, 1892, 1893, 1894, 1896, 1896, 1897, 1898, 1900, - 1901, 1902, 1903, 1904, 1905, 1906, 1908, 1909, 1911, 1912, - 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, - 1925, 1926, 1927, 1928, 1931, 1932, 1933, 1934, 1935, 1936, - 1937, 1938, 1942, 1943, 1947, 1954, 1973, 1974, 1976, 1977, - 1979, 1980, 1982, 2042, 2043, 2046, 2046, 2065, 2066, 2067, - 2072, 2076, 2081, 2082, 2084, 2104, 2152, 2152, 2171, 2171, - 2186, 2189, 2192, 2195, 2199, 2200, 2201, 2202, 2203, 2204, - 2206, 2217, 2220, 2220, 2251, 2251, 2276, 2276, 2292, 2293, - 2294, 2295, 2303, 2312, 2312, 2361, 2365, 2376, 2386, 2403, - 2404, 2405, 2407, 2408, 2410, 2410, 2412, 2412, 2435, 2449, - 2465, 2466, 2467, 2468, 2475, 2476, 2477, 2478, 2479, 2480, - 2481, 2482, 2483, 2484, 2488, 2489, 2491, 2492, 2494, 2495, - 2499, 2497, 2505, 2503, 2512, 2513, 2514, 2515, 2516, 2517, - 2518, 2519, 2521, 2527, 2528, 2529, 2530, 2531, 2532, 2535, - 2567, 2567, 2569, 2569, 2571, 2572, 2574, 2666, 2667, 2670, - 2671, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2695, 2699, - 2705, 2711, 2719, 2724, 2730, 2738, 2746, 2747, 2748, 2751, - 2750, 2767, 2768, 2770, 2769, 2793, 2812, 2826, 2827, 2829, - 2830, 2832, 2833, 2834, 2843, 2844, 2848, 2849, 2851, 2852, - 2853, 2855, 2859, 2860, 2865, 2866, 2903, 2950, 2971, 2993, - 2996, 3003, 3006, 3009, 3012, 3015, 3018, 3023, 3024, 3026, - 3032, 3041, 3042, 3043, 3044, 3045, 3046, 3048, 3053, 3073, - 3083, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, - 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, - 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, - 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, - 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3139, 3140, 3141, - 3142, 3144, 3159, 3165, 3171, 3177, 3183, 3196, 3254, 3363, - 3370, 3377, 3384, 3408 + 0, 1882, 1882, 1884, 1884, 1885, 1886, 1888, 1889, 1890, + 1891, 1892, 1893, 1894, 1895, 1897, 1897, 1898, 1899, 1901, + 1902, 1903, 1904, 1905, 1906, 1907, 1909, 1910, 1912, 1913, + 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, + 1926, 1927, 1928, 1929, 1932, 1933, 1934, 1935, 1936, 1937, + 1938, 1939, 1943, 1944, 1948, 1955, 1974, 1975, 1977, 1978, + 1980, 1981, 1983, 2043, 2044, 2047, 2047, 2066, 2067, 2068, + 2073, 2077, 2082, 2083, 2085, 2105, 2153, 2153, 2172, 2172, + 2187, 2190, 2193, 2196, 2200, 2201, 2202, 2203, 2204, 2205, + 2207, 2218, 2221, 2221, 2252, 2252, 2277, 2277, 2293, 2294, + 2295, 2296, 2304, 2313, 2313, 2362, 2366, 2377, 2387, 2404, + 2405, 2406, 2408, 2409, 2411, 2411, 2413, 2413, 2436, 2450, + 2466, 2467, 2468, 2469, 2476, 2477, 2478, 2479, 2480, 2481, + 2482, 2483, 2484, 2485, 2489, 2490, 2492, 2493, 2495, 2496, + 2500, 2498, 2506, 2504, 2513, 2514, 2515, 2516, 2517, 2518, + 2519, 2520, 2522, 2528, 2529, 2530, 2531, 2532, 2533, 2536, + 2568, 2568, 2570, 2570, 2572, 2573, 2575, 2669, 2670, 2678, + 2679, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2703, 2707, + 2713, 2719, 2727, 2732, 2738, 2746, 2754, 2755, 2756, 2759, + 2758, 2775, 2776, 2778, 2777, 2801, 2820, 2834, 2835, 2837, + 2838, 2840, 2841, 2842, 2851, 2852, 2856, 2857, 2859, 2860, + 2861, 2863, 2867, 2868, 2873, 2874, 2911, 2958, 2979, 3001, + 3004, 3011, 3014, 3017, 3020, 3023, 3026, 3031, 3032, 3034, + 3040, 3049, 3050, 3051, 3052, 3053, 3054, 3056, 3061, 3081, + 3091, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, + 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, + 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, + 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, + 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3147, 3148, 3149, + 3150, 3152, 3167, 3173, 3179, 3185, 3191, 3204, 3262, 3395, + 3402, 3409, 3416, 3440 }; #endif @@ -2577,8 +2577,8 @@ static const yytype_uint16 yydefact[] = 0, 14, 0, 0, 0, 0, 208, 120, 0, 0, 2, 120, 5, 54, 12, 0, 36, 67, 31, 32, 33, 34, 35, 38, 120, 37, 7, 30, 0, 121, - 122, 9, 8, 11, 237, 10, 231, 234, 236, 235, - 39, 225, 233, 232, 41, 40, 0, 0, 72, 76, + 122, 9, 8, 11, 237, 10, 231, 233, 235, 234, + 39, 225, 232, 236, 41, 40, 0, 0, 72, 76, 120, 92, 109, 111, 110, 116, 113, 0, 0, 298, 214, 191, 0, 269, 0, 0, 118, 0, 103, 208, 0, 218, 65, 0, 0, 228, 221, 290, 289, 272, @@ -2643,78 +2643,78 @@ static const yytype_int16 yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -406 +#define YYPACT_NINF -429 static const yytype_int16 yypact[] = { - 1661, -65, -406, -406, -406, -406, -406, -406, -10, -85, - -406, -59, 54, -406, -406, -406, 66, -406, 2104, -406, - 101, -406, -406, 2159, -406, -9, 89, -6, -406, -406, - -406, -406, -3, -51, -406, -406, 2104, 7, 2104, 2104, - 2104, -406, 2104, 2104, 2104, 2104, 2104, 629, 120, 130, - -406, 500, -406, -406, -406, -1, -406, 2034, -406, -406, - -406, -406, -406, -406, 1911, -406, -406, -406, 225, 344, - -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, - 31, 2613, -406, -406, -406, -406, 129, 12, -406, -406, - 1911, -406, -406, -406, -406, -406, -406, -81, 89, -406, - -54, -406, 18, 119, 2104, 8, -406, 2104, -406, 2104, - 132, 119, -406, 36, 5, 43, 2613, 119, 119, 595, - 119, 119, -53, 2613, 21, 46, 2104, -406, 144, 145, - 2104, 2104, 145, 177, -406, -406, 758, -406, -406, 77, - -406, -406, -406, -406, 188, -406, -406, -406, -406, 1016, - 140, 209, -406, 115, 148, 31, 117, -406, 217, 14, - 223, -406, 224, -406, -406, -406, -406, 2104, 2104, 2104, + 1661, -24, -429, -429, -429, -429, -429, -429, -10, -55, + -429, -51, 54, -429, -429, -429, 72, -429, 2104, -429, + 102, -429, -429, 2159, -429, -6, 123, 7, -429, -429, + -429, -429, -2, -85, -429, -429, 2104, 8, 2104, 2104, + 2104, -429, 2104, 2104, 2104, 2104, 2104, 629, 121, 130, + -429, 500, -429, -429, -429, 6, -429, 2034, -429, -429, + -429, -429, -429, -429, 1911, -429, -429, -429, 225, 428, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + 32, 2613, -429, -429, -429, -429, 131, 12, -429, -429, + 1911, -429, -429, -429, -429, -429, -429, -78, 123, -429, + -47, -429, 14, 119, 2104, 19, -429, 2104, -429, 2104, + 133, 119, -429, 35, 71, 43, 2613, 119, 119, 267, + 119, 119, -63, 2613, 22, 47, 2104, -429, 145, 177, + 2104, 2104, 177, 201, -429, -429, 758, -429, -429, 82, + -429, -429, -429, -429, 196, -429, -429, -429, -429, 1016, + 147, 212, -429, 117, 153, 32, 127, -429, 224, 10, + 227, -429, 228, -429, -429, -429, -429, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, - 2104, -406, -406, 227, 2104, 2104, 2104, 2104, 2104, 2104, + 2104, -429, -429, 231, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, 2104, - 2104, 17, -406, -406, 2104, 219, 2104, 1145, -406, 89, - 108, 109, -406, -406, -406, 116, 15, 104, 139, 64, - 2217, 1786, 114, -406, 2104, 2104, -406, 2104, 2104, -406, - -406, -406, -406, -406, 153, 158, -406, -406, -406, 158, - -406, -406, -406, 1911, 128, 153, 2104, 2104, -406, 160, - -406, -406, 257, 211, 216, 269, 2613, 492, 328, 328, + 2104, 17, -429, -429, 2104, 223, 2104, 1145, -429, 123, + 110, 111, -429, -429, -429, 118, 15, 114, 157, 64, + 2217, 1786, 126, -429, 2104, 2104, -429, 2104, 2104, -429, + -429, -429, -429, -429, 155, 160, -429, -429, -429, 160, + -429, -429, -429, 1911, 138, 155, 2104, 2104, -429, 162, + -429, -429, 259, 219, 220, 275, 2613, 492, 328, 328, 328, 2979, 2979, 2979, 2979, 492, 492, 2613, 2613, 2613, 2613, 2613, 2613, 2613, 2613, 2613, 2613, 2613, 2674, 2735, - -406, 354, 354, 354, 2613, 2430, 2796, 2857, 2918, 492, - 492, 595, 595, 119, 119, 119, 141, 2491, 189, 2104, - 276, 150, 159, 2288, -406, 155, 1274, -406, -406, 162, - -406, -406, -406, -406, 1145, -406, 89, 2104, -406, -19, - 281, 157, 190, -406, -406, -406, 165, -406, 163, 1786, - -406, 161, -406, 191, 2613, 86, 195, 145, 887, -406, - -24, 199, 167, 124, 180, 89, 290, 89, 184, 153, - 210, -406, 2104, -406, -406, 310, 2359, -406, 1911, 2104, - 194, -406, -406, 1145, 192, 183, 32, 86, -406, -406, - 153, 16, 94, 1911, 2104, -406, -406, -406, -406, 2104, - -406, -406, -406, 2104, 1911, -406, -406, 15, -406, 89, - 197, -406, 220, -406, 195, 269, 2613, -406, -406, -406, - 201, 13, 203, -406, -406, -406, 234, 212, 281, -406, - 214, 222, -406, -406, 94, -406, 277, -406, 2613, -37, - -406, 208, 220, -406, 89, 229, -406, -406, -406, 2104, - 240, 215, 13, -406, -406, -406, -406, -406, -406, -406, - 342, -406, -406, 1911, -406, 1911, 153, 1403, -406, 347, - -406, 326, 221, 284, -406, 2552, 1786, -406, -406, -406, - 1786, 1786, 153, -406, -406, 228, -406, -406, 232, 236, - 230, 1532, -406, -406, -406, -406, 14, -406, -406, 1786, - -406, 238, 246, 226, -406, 1403, -406, -406, 351, -406, - -406, -406, -406, 1786, 247, 244, 254, 249, -406, 15, - 1786, -406, 250, 253, 153, -406, -406 + -429, -28, -28, -28, 2613, 2430, 2796, 2857, 2918, 492, + 492, 267, 267, 119, 119, 119, 148, 2491, 190, 2104, + 279, 152, 165, 2288, -429, 156, 1274, -429, -429, 164, + -429, -429, -429, -429, 1145, -429, 123, 2104, -429, 18, + 287, 159, 193, -429, -429, -429, 168, -429, 166, 1786, + -429, 163, -429, 194, 2613, 86, 197, 177, 887, -429, + -43, 202, 173, 99, 188, 123, 295, 123, 195, 155, + 213, -429, 2104, -429, -429, 312, 2359, -429, 1911, 2104, + 198, -429, -429, 1145, 191, 187, 2104, 86, -429, -429, + 155, 16, 80, 1911, 2104, -429, -429, -429, -429, 2104, + -429, -429, -429, 2104, 1911, -429, -429, 15, -429, 123, + 208, -429, 234, -429, 197, 275, 2613, -429, -429, -429, + 204, 13, 206, -429, -429, 2613, 237, 215, 287, -429, + 216, 222, -429, -429, 80, -429, 280, -429, 2613, -60, + -429, 214, 234, -429, 123, 229, -429, -429, -429, 2104, + 241, 217, 13, -429, -429, -429, -429, -429, -429, -429, + 347, -429, -429, 1911, -429, 1911, 155, 1403, -429, 348, + -429, 327, 230, 284, -429, 2552, 1786, -429, -429, -429, + 1786, 1786, 155, -429, -429, 239, -429, -429, 240, 236, + 235, 1532, -429, -429, -429, -429, 10, -429, -429, 1786, + -429, 238, 246, 221, -429, 1403, -429, -429, 351, -429, + -429, -429, -429, 1786, 247, 258, 243, 253, -429, 15, + 1786, -429, 254, 256, 155, -429, -429 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -406, -406, 237, -406, 308, -296, -406, 69, -405, -30, - 1, -56, -83, 49, 2, -17, 331, 260, 51, -406, - -406, -406, -406, -406, -406, -406, -406, -406, -406, -406, - -406, -406, -406, -406, -406, -49, -42, -406, -406, -23, - -406, -20, -406, -406, -406, -406, -406, -406, -406, -406, - 9, 76, -406, -406, -406, -406, 0, -406, 336, -406, - -406, -406, 50, -406, 56, -406, -89, -406, -74, -406, - -406, -55, -406, 3, -406, -406, 6, -7, 34, -384, - -406, -308, -73, 4, -406, -406, -406, -406, -406, 386, - -92, 22, 37, -243, -406, -95, -406, -406, -406, -406, - -406, -406, -406, -29, -115, 371, -46, -406, -406, -13, - -406, -406, -406, -406, -406 + -429, -429, 242, -429, 311, -296, -429, 69, -428, -30, + 1, -56, -83, 49, 2, -15, 335, 269, 53, -429, + -429, -429, -429, -429, -429, -429, -429, -429, -429, -429, + -429, -429, -429, -429, -429, -41, -38, -429, -429, -19, + -429, -18, -429, -429, -429, -429, -429, -429, -429, -429, + 9, 66, -429, -429, -429, -429, 0, -429, 338, -429, + -429, -429, 50, -429, 56, -429, -87, -429, -72, -429, + -429, -53, -429, 3, -429, -429, 11, -5, -429, -384, + -429, -308, -74, 4, -429, -429, -429, -429, -429, 387, + -92, 26, 37, -243, -429, -95, -429, -429, -429, -429, + -429, -429, -429, -29, -115, 372, -46, -429, -429, -13, + -429, -429, -429, -429, -429 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -2726,53 +2726,53 @@ static const yytype_int16 yytable[] = { 68, 53, 55, 73, 75, 100, 224, 215, 156, 113, 103, 155, 350, 431, 232, 247, 248, 136, 329, 329, - 308, 96, 379, 111, 86, 116, 117, 118, 374, 119, - 120, 121, 123, 116, 156, 96, 89, 3, 193, 87, - 5, 6, 7, -70, 218, 219, 439, 238, 260, 54, - 71, 68, 53, 55, 73, 75, 72, 92, 93, 21, - 22, 490, 91, 167, 261, 491, 492, 92, 93, 210, - 109, 94, 211, 419, 440, 110, 28, 412, 389, 239, - 252, 94, 98, 376, 499, 377, 34, 35, 97, 92, - 93, 123, 92, 93, 230, 455, 116, 242, 507, 311, - 54, 71, 105, 94, 101, 513, 94, 72, 330, 418, - 448, 88, 104, 116, 306, 107, 404, 123, 123, 341, - 420, 385, 108, 146, 149, 512, 421, 395, 112, 396, - 147, 167, 212, 213, 229, 233, 236, 417, 309, 226, - 235, 351, 352, 237, 310, 240, 241, 243, 244, 68, + 308, 96, 379, 111, -70, 116, 117, 118, 374, 119, + 120, 121, 123, 116, 156, 96, 109, 238, 490, 87, + 167, 110, 491, 492, 260, 193, 439, 218, 219, 54, + 71, 68, 53, 55, 73, 75, 72, 92, 93, 389, + 261, 499, 191, 192, 193, 86, 89, 92, 93, 239, + 91, 94, 455, 419, 440, 507, 210, 412, 97, 211, + 252, 94, 513, 204, 205, 206, 207, 208, 98, 92, + 93, 123, 105, 209, 230, 210, 116, 242, 211, 311, + 54, 71, 395, 94, 396, 101, 420, 72, 330, 418, + 448, 88, 421, 116, 306, 104, 404, 123, 123, 341, + 376, 385, 377, 108, 146, 512, 92, 93, 107, 112, + 147, 149, 167, 213, 212, 226, 233, 417, 309, 235, + 94, 351, 352, 237, 310, 229, 240, 241, 243, 68, 53, 55, 73, 75, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 335, 95, - 250, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 244, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 116, 307, 54, 71, - 386, 123, 253, 313, 158, 72, 342, -71, 343, 191, - 192, 193, 255, 475, 256, 257, 258, 68, 53, 319, - 259, 123, 116, 348, 116, 344, 263, 264, 325, 493, - 290, 312, 375, 2, -113, 326, 334, 327, 336, 238, - 209, 158, 210, 123, 123, 211, 340, 13, 14, 15, - 159, 17, 158, 19, 410, 160, 161, 345, 347, 349, - 354, 159, 353, 398, 355, 401, 24, 161, 162, 357, - 163, 516, 359, 363, 459, 29, 30, 31, 365, 367, - 369, 163, 368, 252, 329, 409, 371, 373, 2, 380, - 381, -112, 252, 383, 382, 384, 366, 389, 393, 394, - 426, 397, 13, 14, 15, 399, 17, 401, 19, 403, - 405, 430, 156, 407, 116, 414, 68, 53, 319, 411, - 434, 24, 433, 413, 68, 53, 319, 156, 460, 459, - 29, 30, 31, 438, 445, 336, 376, 447, 156, 449, - 456, 453, 458, 450, 466, 472, 467, 429, 2, 406, - 485, 486, 487, 494, 505, 427, 123, 495, 502, 148, - -153, 496, 13, 14, 15, 509, 17, 168, 19, 500, - 473, 116, 474, 68, 53, 319, 428, 501, 508, 510, - 511, 24, 514, 460, 515, 372, 254, 436, 152, 245, - 29, 30, 31, 468, -155, -155, -155, 156, 391, 156, - 469, 451, 176, 177, 452, 166, 504, 497, 488, 446, - 415, 437, 106, 498, 416, -154, 122, 0, 191, 192, - 193, 432, 194, 195, 196, 0, 465, 0, 0, 0, - 0, 0, 0, 0, 0, 461, 202, 203, 0, 204, - 205, 206, 207, 208, 191, 192, 193, 0, 0, 209, - 0, 210, 0, 0, 211, 0, 0, 479, 477, 478, - 483, 484, 0, 461, 0, 204, 205, 206, 207, 208, - 0, 0, 0, 0, 0, 209, 0, 210, 0, 0, - 211, 479, 477, 478, 483, 484, 0, 0, 0, 0, + 386, 123, 236, 313, 250, 72, 342, 253, 343, 191, + 192, 193, 158, 475, -71, 255, 256, 68, 53, 319, + 257, 123, 116, 348, 116, 344, 258, 259, 325, 493, + 263, 264, 375, 2, 290, 312, -113, 326, 336, 327, + 209, 158, 210, 123, 123, 211, 334, 13, 14, 15, + 159, 17, 158, 19, 410, 160, 161, 238, 340, 345, + 347, 159, 354, 398, 353, 401, 24, 161, 162, 349, + 163, 516, 355, 357, 459, 29, 30, 31, 359, 365, + 363, 163, 367, 252, 368, 409, 369, 371, 2, 373, + 329, 380, 252, 381, -112, 383, 366, 382, 384, 389, + 426, 393, 13, 14, 15, 394, 17, 401, 19, 397, + 399, 430, 156, 405, 116, 407, 68, 53, 319, 414, + 403, 24, 413, 411, 68, 53, 319, 156, 460, 459, + 29, 30, 31, 433, 434, 336, 438, 445, 156, 376, + 447, 449, 458, 450, 453, 466, 456, 429, 467, 406, + 472, 485, 486, 502, 505, 427, 123, 191, 192, 193, + -153, 487, 148, 415, 494, 495, 496, 168, 510, 500, + 473, 116, 474, 68, 53, 319, 428, 501, 508, 509, + 206, 207, 208, 460, 511, 372, 514, 515, 209, 436, + 210, 254, 152, 211, -155, -155, -155, 156, 245, 156, + 391, 468, 176, 177, 469, 451, 452, 166, 504, 497, + 488, 446, 498, 106, 416, -154, 437, 122, 191, 192, + 193, 0, 194, 195, 196, 432, 465, 0, 0, 0, + 0, 0, 2, 0, 0, 461, 202, 203, 0, 204, + 205, 206, 207, 208, 0, 0, 13, 14, 15, 209, + 17, 210, 19, 0, 211, 0, 0, 479, 477, 478, + 483, 484, 0, 461, 0, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, + 0, 479, 477, 478, 483, 484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 479, 477, 478, 483, 484, -4, 0, 0, 1, 2, 3, 4, 0, 5, 6, 7, 8, 9, 10, 11, 0, 0, 12, 13, 14, @@ -2792,11 +2792,11 @@ static const yytype_int16 yytable[] = 16, 17, 18, 19, 20, 0, 21, 22, 128, 0, 129, 0, 0, 0, 23, 130, 24, 25, 0, 26, 131, 27, 0, 28, 132, 29, 30, 31, 0, 0, - 32, 33, 0, 34, 35, 191, 192, 193, 0, 0, + 32, 33, 0, 34, 35, 0, 0, 0, 0, 0, 0, 36, 37, 0, 133, 0, 0, 0, 38, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 206, 207, - 208, 0, 0, 0, 0, 0, 209, 0, 210, 39, - 40, 211, 0, 0, 0, 0, 0, 0, 134, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 40, 0, 0, 0, 0, 0, 0, 0, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 43, 44, 0, 0, 0, 45, 0, 46, 0, 47, 0, 48, 0, 0, 0, @@ -3041,53 +3041,53 @@ static const yytype_int16 yycheck[] = { 0, 0, 0, 0, 0, 18, 98, 90, 64, 38, 23, 57, 255, 397, 109, 130, 131, 47, 3, 3, - 3, 12, 330, 36, 89, 38, 39, 40, 324, 42, - 43, 44, 45, 46, 90, 26, 121, 5, 92, 49, - 8, 9, 10, 67, 125, 126, 33, 100, 34, 0, - 0, 51, 51, 51, 51, 51, 0, 3, 4, 27, - 28, 466, 121, 100, 50, 470, 471, 3, 4, 123, - 121, 17, 126, 381, 61, 126, 44, 373, 102, 132, - 136, 17, 16, 102, 489, 104, 54, 55, 12, 3, - 4, 104, 3, 4, 107, 132, 109, 126, 503, 214, - 51, 51, 26, 17, 3, 510, 17, 51, 93, 93, - 418, 121, 121, 126, 209, 121, 359, 130, 131, 234, - 26, 35, 125, 3, 125, 509, 32, 3, 121, 5, - 0, 100, 3, 121, 126, 3, 131, 380, 121, 121, - 104, 256, 257, 100, 127, 124, 100, 3, 3, 149, + 3, 12, 330, 36, 67, 38, 39, 40, 324, 42, + 43, 44, 45, 46, 90, 26, 121, 100, 466, 49, + 100, 126, 470, 471, 34, 92, 33, 125, 126, 0, + 0, 51, 51, 51, 51, 51, 0, 3, 4, 102, + 50, 489, 90, 91, 92, 89, 121, 3, 4, 132, + 121, 17, 132, 381, 61, 503, 123, 373, 12, 126, + 136, 17, 510, 111, 112, 113, 114, 115, 16, 3, + 4, 104, 26, 121, 107, 123, 109, 126, 126, 214, + 51, 51, 3, 17, 5, 3, 26, 51, 93, 93, + 418, 121, 32, 126, 209, 121, 359, 130, 131, 234, + 102, 35, 104, 125, 3, 509, 3, 4, 121, 121, + 0, 125, 100, 121, 3, 121, 3, 380, 121, 104, + 17, 256, 257, 100, 127, 126, 124, 100, 3, 149, 149, 149, 149, 149, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 114, 125, 3, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 149, 149, - 114, 214, 125, 216, 16, 149, 235, 67, 237, 90, - 91, 92, 3, 456, 99, 67, 99, 217, 217, 217, - 3, 234, 235, 253, 237, 238, 3, 3, 219, 472, - 3, 12, 327, 4, 126, 126, 132, 121, 229, 100, + 114, 214, 131, 216, 3, 149, 235, 125, 237, 90, + 91, 92, 16, 456, 67, 3, 99, 217, 217, 217, + 67, 234, 235, 253, 237, 238, 99, 3, 219, 472, + 3, 3, 327, 4, 3, 12, 126, 126, 229, 121, 121, 16, 123, 256, 257, 126, 132, 18, 19, 20, - 25, 22, 16, 24, 369, 30, 31, 104, 100, 131, - 3, 25, 102, 355, 53, 357, 37, 31, 43, 53, - 45, 514, 3, 132, 45, 46, 47, 48, 89, 3, - 121, 45, 132, 339, 3, 368, 131, 125, 4, 132, - 100, 126, 348, 132, 131, 104, 309, 102, 99, 132, - 383, 121, 18, 19, 20, 15, 22, 399, 24, 125, - 100, 394, 368, 3, 327, 132, 316, 316, 316, 125, - 100, 37, 125, 131, 324, 324, 324, 383, 99, 45, - 46, 47, 48, 132, 131, 326, 102, 125, 394, 125, - 132, 64, 434, 121, 104, 3, 131, 393, 4, 362, - 3, 25, 131, 125, 3, 384, 369, 125, 132, 51, - 131, 131, 18, 19, 20, 121, 22, 39, 24, 131, - 453, 384, 455, 373, 373, 373, 389, 131, 131, 125, - 131, 37, 132, 99, 131, 316, 149, 404, 57, 129, - 46, 47, 48, 442, 66, 67, 68, 453, 347, 455, - 442, 424, 74, 75, 424, 69, 495, 481, 463, 416, - 376, 405, 26, 486, 377, 131, 45, -1, 90, 91, - 92, 399, 94, 95, 96, -1, 439, -1, -1, -1, - -1, -1, -1, -1, -1, 435, 108, 109, -1, 111, - 112, 113, 114, 115, 90, 91, 92, -1, -1, 121, - -1, 123, -1, -1, 126, -1, -1, 457, 457, 457, - 457, 457, -1, 463, -1, 111, 112, 113, 114, 115, - -1, -1, -1, -1, -1, 121, -1, 123, -1, -1, - 126, 481, 481, 481, 481, 481, -1, -1, -1, -1, + 25, 22, 16, 24, 369, 30, 31, 100, 132, 104, + 100, 25, 3, 355, 102, 357, 37, 31, 43, 131, + 45, 514, 53, 53, 45, 46, 47, 48, 3, 89, + 132, 45, 3, 339, 132, 368, 121, 131, 4, 125, + 3, 132, 348, 100, 126, 132, 309, 131, 104, 102, + 383, 99, 18, 19, 20, 132, 22, 399, 24, 121, + 15, 394, 368, 100, 327, 3, 316, 316, 316, 132, + 125, 37, 131, 125, 324, 324, 324, 383, 99, 45, + 46, 47, 48, 125, 100, 326, 132, 131, 394, 102, + 125, 125, 434, 121, 64, 104, 132, 393, 131, 362, + 3, 3, 25, 132, 3, 384, 369, 90, 91, 92, + 131, 131, 51, 376, 125, 125, 131, 39, 125, 131, + 453, 384, 455, 373, 373, 373, 389, 131, 131, 121, + 113, 114, 115, 99, 131, 316, 132, 131, 121, 404, + 123, 149, 57, 126, 66, 67, 68, 453, 129, 455, + 347, 442, 74, 75, 442, 424, 424, 69, 495, 481, + 463, 416, 486, 26, 377, 131, 405, 45, 90, 91, + 92, -1, 94, 95, 96, 399, 439, -1, -1, -1, + -1, -1, 4, -1, -1, 435, 108, 109, -1, 111, + 112, 113, 114, 115, -1, -1, 18, 19, 20, 121, + 22, 123, 24, -1, 126, -1, -1, 457, 457, 457, + 457, 457, -1, 463, -1, 37, -1, -1, -1, -1, + -1, -1, -1, -1, 46, 47, 48, -1, -1, -1, + -1, 481, 481, 481, 481, 481, -1, -1, -1, -1, -1, -1, -1, -1, -1, 495, 495, 495, 495, 495, 0, -1, -1, 3, 4, 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, -1, -1, 17, 18, 19, @@ -3107,11 +3107,11 @@ static const yytype_int16 yycheck[] = 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, 31, -1, -1, -1, 35, 36, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, -1, - 51, 52, -1, 54, 55, 90, 91, 92, -1, -1, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, -1, 62, 63, -1, 65, -1, -1, -1, 69, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 113, 114, - 115, -1, -1, -1, -1, -1, 121, -1, 123, 90, - 91, 126, -1, -1, -1, -1, -1, -1, 99, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, + 91, -1, -1, -1, -1, -1, -1, -1, 99, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, -1, -1, 116, 117, -1, -1, -1, 121, -1, 123, -1, 125, -1, 127, -1, -1, -1, @@ -3397,7 +3397,7 @@ static const yytype_uint8 yystos[] = 132, 100, 131, 132, 104, 35, 114, 223, 225, 102, 148, 151, 131, 99, 132, 3, 5, 121, 223, 15, 194, 223, 224, 125, 226, 100, 242, 3, 132, 145, - 237, 125, 138, 131, 132, 211, 225, 226, 93, 214, + 237, 125, 138, 131, 132, 242, 225, 226, 93, 214, 26, 32, 172, 174, 176, 177, 145, 236, 242, 239, 145, 212, 224, 125, 100, 198, 148, 209, 132, 33, 61, 166, 167, 168, 169, 131, 210, 125, 214, 125, @@ -4223,7 +4223,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1893 "parser.y" +#line 1894 "parser.y" {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} } break; @@ -4234,7 +4234,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1905 "parser.y" +#line 1906 "parser.y" {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} } break; @@ -4245,7 +4245,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1908 "parser.y" +#line 1909 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4256,7 +4256,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1909 "parser.y" +#line 1910 "parser.y" {(yyval.code)=code_new();} } break; @@ -4267,7 +4267,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1911 "parser.y" +#line 1912 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; @@ -4278,7 +4278,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1912 "parser.y" +#line 1913 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4289,7 +4289,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1927 "parser.y" +#line 1928 "parser.y" {(yyval.code)=(yyvsp[(2) - (3)].code);} } break; @@ -4300,7 +4300,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1928 "parser.y" +#line 1929 "parser.y" {(yyval.code)=0;} } break; @@ -4311,7 +4311,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1931 "parser.y" +#line 1932 "parser.y" {(yyval.code)=0;} } break; @@ -4322,7 +4322,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1938 "parser.y" +#line 1939 "parser.y" {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} } break; @@ -4333,7 +4333,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1942 "parser.y" +#line 1943 "parser.y" {(yyval.code)=(yyvsp[(1) - (2)].code);} } break; @@ -4344,7 +4344,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1943 "parser.y" +#line 1944 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4355,7 +4355,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1947 "parser.y" +#line 1948 "parser.y" { code_t**cc = &global->init->method->body->code; *cc = code_append(*cc, (yyvsp[(1) - (1)].code)); @@ -4369,7 +4369,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1954 "parser.y" +#line 1955 "parser.y" { PASS12 (yyval.number_int)=as3_pass; @@ -4388,7 +4388,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1973 "parser.y" +#line 1974 "parser.y" {(yyval.node)=(yyvsp[(2) - (2)].node);} } break; @@ -4399,7 +4399,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1974 "parser.y" +#line 1975 "parser.y" {(yyval.node)=mkdummynode();} } break; @@ -4410,7 +4410,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1976 "parser.y" +#line 1977 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -4421,7 +4421,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1977 "parser.y" +#line 1978 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -4432,7 +4432,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1979 "parser.y" +#line 1980 "parser.y" {(yyval.code) = (yyvsp[(1) - (1)].code);} } break; @@ -4443,7 +4443,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1980 "parser.y" +#line 1981 "parser.y" {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));} } break; @@ -4454,7 +4454,7 @@ yyreduce: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1983 "parser.y" +#line 1984 "parser.y" { PASS12 if(variable_exists((yyvsp[(1) - (3)].id))) @@ -4520,7 +4520,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2042 "parser.y" +#line 2043 "parser.y" {(yyval.code) = code_new();} } break; @@ -4531,7 +4531,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2043 "parser.y" +#line 2044 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; @@ -4542,7 +4542,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2046 "parser.y" +#line 2047 "parser.y" {PASS12 new_state();} } break; @@ -4553,7 +4553,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2046 "parser.y" +#line 2047 "parser.y" { (yyval.code) = code_new(); @@ -4581,7 +4581,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2065 "parser.y" +#line 2066 "parser.y" {(yyval.code)=code_new();} } break; @@ -4592,7 +4592,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2072 "parser.y" +#line 2073 "parser.y" { PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0); PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0); @@ -4606,7 +4606,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2076 "parser.y" +#line 2077 "parser.y" { PASS12 (yyval.id)=(yyvsp[(1) - (1)].id); @@ -4620,7 +4620,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2081 "parser.y" +#line 2082 "parser.y" {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;} } break; @@ -4631,7 +4631,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2082 "parser.y" +#line 2083 "parser.y" {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;} } break; @@ -4642,7 +4642,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2084 "parser.y" +#line 2085 "parser.y" { if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement"); (yyval.code) = code_new(); @@ -4671,7 +4671,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2104 "parser.y" +#line 2105 "parser.y" { variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id)); if(!var) { @@ -4728,7 +4728,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2152 "parser.y" +#line 2153 "parser.y" {PASS12 new_state();} } break; @@ -4739,7 +4739,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2152 "parser.y" +#line 2153 "parser.y" { (yyval.code) = code_new(); @@ -4767,7 +4767,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2171 "parser.y" +#line 2172 "parser.y" {PASS12 new_state();} } break; @@ -4778,7 +4778,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2171 "parser.y" +#line 2172 "parser.y" { (yyval.code) = code_new(); code_t*loopstart = (yyval.code) = abc_label((yyval.code)); @@ -4802,7 +4802,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2186 "parser.y" +#line 2187 "parser.y" { (yyval.code) = abc___break__(0, ""); } @@ -4815,7 +4815,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2189 "parser.y" +#line 2190 "parser.y" { (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id)); } @@ -4828,7 +4828,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2192 "parser.y" +#line 2193 "parser.y" { (yyval.code) = abc___continue__(0, ""); } @@ -4841,7 +4841,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2195 "parser.y" +#line 2196 "parser.y" { (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id)); } @@ -4854,7 +4854,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2199 "parser.y" +#line 2200 "parser.y" {(yyval.code)=0;} } break; @@ -4865,7 +4865,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2200 "parser.y" +#line 2201 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4876,7 +4876,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2201 "parser.y" +#line 2202 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4887,7 +4887,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2202 "parser.y" +#line 2203 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; @@ -4898,7 +4898,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2203 "parser.y" +#line 2204 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; @@ -4909,7 +4909,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2204 "parser.y" +#line 2205 "parser.y" {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));} } break; @@ -4920,7 +4920,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2206 "parser.y" +#line 2207 "parser.y" { (yyval.code) = abc_getlocal(0, state->switch_var); (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c); @@ -4941,7 +4941,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2217 "parser.y" +#line 2218 "parser.y" { (yyval.code) = (yyvsp[(3) - (3)].code); } @@ -4954,7 +4954,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2220 "parser.y" +#line 2221 "parser.y" {PASS12 new_state();state->switch_var=alloc_local();} } break; @@ -4965,7 +4965,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2220 "parser.y" +#line 2221 "parser.y" { (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c; (yyval.code) = abc_setlocal((yyval.code), state->switch_var); @@ -5003,7 +5003,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2251 "parser.y" +#line 2252 "parser.y" {PASS12 new_state(); state->exception_name=(yyvsp[(3) - (5)].id); PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0); @@ -5018,7 +5018,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2256 "parser.y" +#line 2257 "parser.y" { namespace_t name_ns = {ACCESS_PACKAGE, ""}; multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)}; @@ -5048,7 +5048,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2276 "parser.y" +#line 2277 "parser.y" {PASS12 new_state();state->exception_name=0;} } break; @@ -5059,7 +5059,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2276 "parser.y" +#line 2277 "parser.y" { (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code)); if(!(yyvsp[(4) - (5)].code)) { @@ -5084,7 +5084,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2292 "parser.y" +#line 2293 "parser.y" {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));} } break; @@ -5095,7 +5095,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2293 "parser.y" +#line 2294 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));} } break; @@ -5106,7 +5106,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2294 "parser.y" +#line 2295 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);} } break; @@ -5117,7 +5117,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2295 "parser.y" +#line 2296 "parser.y" { (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list); (yyval.catch_list).finally = 0; @@ -5135,7 +5135,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2303 "parser.y" +#line 2304 "parser.y" { (yyval.catch_list).l=list_new(); (yyval.catch_list).finally = 0; @@ -5153,7 +5153,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2312 "parser.y" +#line 2313 "parser.y" {PASS12 new_state(); state->method->has_exceptions=1; state->method->late_binding=1;//for invariant scope_code @@ -5167,7 +5167,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2315 "parser.y" +#line 2316 "parser.y" { code_t*out = abc_nop(0); @@ -5220,7 +5220,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2361 "parser.y" +#line 2362 "parser.y" { (yyval.code)=(yyvsp[(2) - (2)].value).c; (yyval.code)=abc_throw((yyval.code)); @@ -5234,7 +5234,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2365 "parser.y" +#line 2366 "parser.y" { if(!state->exception_name) syntaxerror("re-throw only possible within a catch block"); @@ -5252,7 +5252,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2376 "parser.y" +#line 2377 "parser.y" { new_state(); if(state->method->has_exceptions) { @@ -5272,7 +5272,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2386 "parser.y" +#line 2387 "parser.y" { /* remove getlocal;pushwith from scope code again */ state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code)); @@ -5296,7 +5296,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2404 "parser.y" +#line 2405 "parser.y" {PASS12 (yyval.id)="package";} } break; @@ -5307,7 +5307,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2405 "parser.y" +#line 2406 "parser.y" {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);} } break; @@ -5318,7 +5318,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2407 "parser.y" +#line 2408 "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; @@ -5329,7 +5329,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2408 "parser.y" +#line 2409 "parser.y" {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));} } break; @@ -5340,7 +5340,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2410 "parser.y" +#line 2411 "parser.y" {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;} } break; @@ -5351,7 +5351,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2411 "parser.y" +#line 2412 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; @@ -5362,7 +5362,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2412 "parser.y" +#line 2413 "parser.y" {PASS12 startpackage("");} } break; @@ -5373,7 +5373,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2413 "parser.y" +#line 2414 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; @@ -5384,7 +5384,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2435 "parser.y" +#line 2436 "parser.y" { PASS12 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name); @@ -5408,7 +5408,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2449 "parser.y" +#line 2450 "parser.y" { PASS12 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) { @@ -5431,7 +5431,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2465 "parser.y" +#line 2466 "parser.y" {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;} } break; @@ -5442,7 +5442,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2466 "parser.y" +#line 2467 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; @@ -5453,7 +5453,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2467 "parser.y" +#line 2468 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; @@ -5464,7 +5464,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2468 "parser.y" +#line 2469 "parser.y" { PASS12 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags; @@ -5481,7 +5481,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2475 "parser.y" +#line 2476 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;} } break; @@ -5492,7 +5492,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2476 "parser.y" +#line 2477 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;} } break; @@ -5503,7 +5503,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2477 "parser.y" +#line 2478 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;} } break; @@ -5514,7 +5514,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2478 "parser.y" +#line 2479 "parser.y" {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;} } break; @@ -5525,7 +5525,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2479 "parser.y" +#line 2480 "parser.y" {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;} } break; @@ -5536,7 +5536,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2480 "parser.y" +#line 2481 "parser.y" {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;} } break; @@ -5547,7 +5547,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2481 "parser.y" +#line 2482 "parser.y" {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;} } break; @@ -5558,7 +5558,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2482 "parser.y" +#line 2483 "parser.y" {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;} } break; @@ -5569,7 +5569,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2483 "parser.y" +#line 2484 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;} } break; @@ -5580,7 +5580,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2484 "parser.y" +#line 2485 "parser.y" {PASS12 (yyval.flags).flags=FLAG_NAMESPACE; (yyval.flags).ns=(yyvsp[(1) - (1)].id); } @@ -5593,7 +5593,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2488 "parser.y" +#line 2489 "parser.y" {PASS12 (yyval.classinfo)=0;} } break; @@ -5604,7 +5604,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2489 "parser.y" +#line 2490 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; @@ -5615,7 +5615,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2491 "parser.y" +#line 2492 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; @@ -5626,7 +5626,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2492 "parser.y" +#line 2493 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; @@ -5637,7 +5637,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2494 "parser.y" +#line 2495 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; @@ -5648,7 +5648,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2495 "parser.y" +#line 2496 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; @@ -5659,7 +5659,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2499 "parser.y" +#line 2500 "parser.y" {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));} } break; @@ -5670,7 +5670,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2501 "parser.y" +#line 2502 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; @@ -5681,7 +5681,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2505 "parser.y" +#line 2506 "parser.y" {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE; startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));} } @@ -5693,7 +5693,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2508 "parser.y" +#line 2509 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; @@ -5704,7 +5704,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2517 "parser.y" +#line 2518 "parser.y" {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} } break; @@ -5715,7 +5715,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2521 "parser.y" +#line 2522 "parser.y" { code_t*c = state->cls->static_init->header; c = code_append(c, (yyvsp[(1) - (1)].code)); @@ -5730,7 +5730,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2532 "parser.y" +#line 2533 "parser.y" { syntaxerror("variable declarations not allowed in interfaces"); } @@ -5743,7 +5743,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2535 "parser.y" +#line 2536 "parser.y" { PASS12 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC; @@ -5763,7 +5763,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2569 "parser.y" +#line 2570 "parser.y" {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));} } break; @@ -5774,7 +5774,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2569 "parser.y" +#line 2570 "parser.y" {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);} } break; @@ -5785,7 +5785,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2571 "parser.y" +#line 2572 "parser.y" {PASS12 (yyval.code)=0;} } break; @@ -5796,7 +5796,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2572 "parser.y" +#line 2573 "parser.y" {PASS12 (yyval.code)=0;} } break; @@ -5807,7 +5807,7 @@ PASS2 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2575 "parser.y" +#line 2576 "parser.y" { PASS12 int flags = slotstate_flags->flags; @@ -5876,6 +5876,7 @@ PASS12 /* compile time constant */ t->value = malloc(sizeof(constant_t)); memcpy(t->value, &cval, sizeof(constant_t)); + info->value = constant_clone(t->value); } else { typedcode_t v = node_read((yyvsp[(3) - (3)].node)); /* initalization code (if needed) */ @@ -5891,6 +5892,7 @@ PASS12 if(slotstate_varconst==KW_CONST) { t->kind= TRAIT_CONST; + info->flags |= FLAG_CONST; } } @@ -5905,7 +5907,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2666 "parser.y" +#line 2669 "parser.y" {(yyval.constant)=0;} } break; @@ -5916,8 +5918,13 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2667 "parser.y" - {(yyval.constant)=(yyvsp[(2) - (2)].constant);} +#line 2670 "parser.y" + { + (yyval.constant) = malloc(sizeof(constant_t)); + *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node)); + if((yyval.constant)->type == CONSTANT_UNKNOWN) + syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)"); +} } break; @@ -5927,7 +5934,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2670 "parser.y" +#line 2678 "parser.y" {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));} } break; @@ -5938,7 +5945,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2671 "parser.y" +#line 2679 "parser.y" { (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint)); } @@ -5951,7 +5958,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2674 "parser.y" +#line 2682 "parser.y" {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));} } break; @@ -5962,7 +5969,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2675 "parser.y" +#line 2683 "parser.y" {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);} } break; @@ -5973,7 +5980,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2676 "parser.y" +#line 2684 "parser.y" {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));} } break; @@ -5984,7 +5991,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2677 "parser.y" +#line 2685 "parser.y" {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));} } break; @@ -5995,7 +6002,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2678 "parser.y" +#line 2686 "parser.y" {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));} } break; @@ -6006,7 +6013,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2679 "parser.y" +#line 2687 "parser.y" {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));} } break; @@ -6017,7 +6024,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2680 "parser.y" +#line 2688 "parser.y" {(yyval.constant) = constant_new_float(__builtin_nan(""));} } break; @@ -6028,7 +6035,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2695 "parser.y" +#line 2703 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6042,7 +6049,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2699 "parser.y" +#line 2707 "parser.y" { PASS12 (yyval.params)=(yyvsp[(1) - (1)].params); @@ -6056,7 +6063,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2705 "parser.y" +#line 2713 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6072,7 +6079,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2711 "parser.y" +#line 2719 "parser.y" { PASS12 (yyval.params) =(yyvsp[(1) - (4)].params); @@ -6088,7 +6095,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2719 "parser.y" +#line 2727 "parser.y" { PASS12 (yyval.params) = (yyvsp[(1) - (3)].params); @@ -6103,7 +6110,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2724 "parser.y" +#line 2732 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6118,7 +6125,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2730 "parser.y" +#line 2738 "parser.y" { PASS12 (yyval.param) = rfx_calloc(sizeof(param_t)); @@ -6136,7 +6143,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2738 "parser.y" +#line 2746 "parser.y" { PASS12 (yyval.param) = rfx_calloc(sizeof(param_t)); @@ -6154,7 +6161,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2748 "parser.y" +#line 2756 "parser.y" {PASS12 (yyval.token)=0;} } break; @@ -6165,7 +6172,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2751 "parser.y" +#line 2759 "parser.y" {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));} } break; @@ -6176,7 +6183,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2752 "parser.y" +#line 2760 "parser.y" { PASS1 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0); @@ -6200,7 +6207,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2768 "parser.y" +#line 2776 "parser.y" {PASS12 (yyval.id)=0;} } break; @@ -6211,7 +6218,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2770 "parser.y" +#line 2778 "parser.y" {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));} } break; @@ -6222,7 +6229,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2771 "parser.y" +#line 2779 "parser.y" { PASS1 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0); @@ -6250,7 +6257,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2793 "parser.y" +#line 2801 "parser.y" { PASS1 NEW(unresolvedinfo_t,c); memset(c, 0, sizeof(*c)); @@ -6278,7 +6285,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2812 "parser.y" +#line 2820 "parser.y" { PASS1 NEW(unresolvedinfo_t,c); memset(c, 0, sizeof(*c)); @@ -6301,7 +6308,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2829 "parser.y" +#line 2837 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));} } break; @@ -6312,7 +6319,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2830 "parser.y" +#line 2838 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));} } break; @@ -6323,7 +6330,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2832 "parser.y" +#line 2840 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);} } break; @@ -6334,7 +6341,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2833 "parser.y" +#line 2841 "parser.y" {PASS12 (yyval.classinfo)=TYPE_ANY;} } break; @@ -6345,7 +6352,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2834 "parser.y" +#line 2842 "parser.y" {PASS12 (yyval.classinfo)=TYPE_ANY;} } break; @@ -6356,7 +6363,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2843 "parser.y" +#line 2851 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; @@ -6367,7 +6374,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2844 "parser.y" +#line 2852 "parser.y" {PASS12 (yyval.classinfo)=0;} } break; @@ -6378,7 +6385,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2848 "parser.y" +#line 2856 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; @@ -6389,7 +6396,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2849 "parser.y" +#line 2857 "parser.y" {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);} } break; @@ -6400,7 +6407,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2851 "parser.y" +#line 2859 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; @@ -6411,7 +6418,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2855 "parser.y" +#line 2863 "parser.y" {(yyval.value_list).number=1; (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c; } @@ -6424,7 +6431,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2859 "parser.y" +#line 2867 "parser.y" {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);} } break; @@ -6435,7 +6442,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2860 "parser.y" +#line 2868 "parser.y" { (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1; (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c); @@ -6449,7 +6456,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2866 "parser.y" +#line 2874 "parser.y" { typedcode_t v = node_read((yyvsp[(2) - (4)].node)); (yyval.value).c = v.c; @@ -6491,7 +6498,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2903 "parser.y" +#line 2911 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (4)].node)); @@ -6547,7 +6554,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2950 "parser.y" +#line 2958 "parser.y" { if(!state->cls) syntaxerror("super() not allowed outside of a class"); if(!state->method) syntaxerror("super() not allowed outside of a function"); @@ -6577,7 +6584,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2971 "parser.y" +#line 2979 "parser.y" { typedcode_t v = node_read((yyvsp[(2) - (2)].node)); (yyval.value).c = v.c; @@ -6608,7 +6615,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2993 "parser.y" +#line 3001 "parser.y" { (yyval.code) = abc_returnvoid(0); } @@ -6621,7 +6628,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2996 "parser.y" +#line 3004 "parser.y" { (yyval.code) = (yyvsp[(2) - (2)].value).c; (yyval.code) = abc_returnvalue((yyval.code)); @@ -6635,7 +6642,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3003 "parser.y" +#line 3011 "parser.y" { (yyval.value) = node_read((yyvsp[(1) - (1)].node)); } @@ -6648,7 +6655,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3006 "parser.y" +#line 3014 "parser.y" { (yyval.value) = node_read((yyvsp[(1) - (1)].node)); } @@ -6661,7 +6668,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3009 "parser.y" +#line 3017 "parser.y" { (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node)); } @@ -6674,7 +6681,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3012 "parser.y" +#line 3020 "parser.y" { (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } @@ -6687,7 +6694,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3015 "parser.y" +#line 3023 "parser.y" { (yyval.code) = node_exec((yyvsp[(1) - (1)].node)); } @@ -6700,7 +6707,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3018 "parser.y" +#line 3026 "parser.y" { (yyval.code) = (yyvsp[(1) - (3)].code); (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node))); @@ -6714,7 +6721,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3023 "parser.y" +#line 3031 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; @@ -6725,7 +6732,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3024 "parser.y" +#line 3032 "parser.y" {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);} } break; @@ -6736,7 +6743,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3026 "parser.y" +#line 3034 "parser.y" { (yyval.value_list).cc = 0; (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c); @@ -6752,7 +6759,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3032 "parser.y" +#line 3040 "parser.y" { (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc; (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2; @@ -6768,7 +6775,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3041 "parser.y" +#line 3049 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; @@ -6779,7 +6786,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3042 "parser.y" +#line 3050 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; @@ -6790,7 +6797,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3043 "parser.y" +#line 3051 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; @@ -6801,7 +6808,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3044 "parser.y" +#line 3052 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; @@ -6812,7 +6819,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3045 "parser.y" +#line 3053 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; @@ -6823,8 +6830,8 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3046 "parser.y" - {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} +#line 3054 "parser.y" + {(yyval.node) = (yyvsp[(1) - (1)].node);} } break; @@ -6834,7 +6841,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3048 "parser.y" +#line 3056 "parser.y" { (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant)); } @@ -6847,7 +6854,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3053 "parser.y" +#line 3061 "parser.y" { typedcode_t v; v.c = 0; @@ -6875,7 +6882,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3073 "parser.y" +#line 3081 "parser.y" { typedcode_t v; v.c = code_new(); @@ -6893,7 +6900,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3083 "parser.y" +#line 3091 "parser.y" { typedcode_t v; v.c = code_new(); @@ -6911,7 +6918,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3092 "parser.y" +#line 3100 "parser.y" {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6922,7 +6929,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3093 "parser.y" +#line 3101 "parser.y" {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6933,7 +6940,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3094 "parser.y" +#line 3102 "parser.y" {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6944,7 +6951,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3095 "parser.y" +#line 3103 "parser.y" {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6955,7 +6962,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3096 "parser.y" +#line 3104 "parser.y" {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6966,7 +6973,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3097 "parser.y" +#line 3105 "parser.y" {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6977,7 +6984,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3098 "parser.y" +#line 3106 "parser.y" {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6988,7 +6995,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3099 "parser.y" +#line 3107 "parser.y" {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -6999,7 +7006,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3100 "parser.y" +#line 3108 "parser.y" {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -7010,7 +7017,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3101 "parser.y" +#line 3109 "parser.y" {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; @@ -7021,7 +7028,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3102 "parser.y" +#line 3110 "parser.y" {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));} } break; @@ -7032,7 +7039,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3103 "parser.y" +#line 3111 "parser.y" {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));} } break; @@ -7043,7 +7050,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3104 "parser.y" +#line 3112 "parser.y" {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7054,7 +7061,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3105 "parser.y" +#line 3113 "parser.y" {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7065,7 +7072,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3106 "parser.y" +#line 3114 "parser.y" {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7076,7 +7083,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3107 "parser.y" +#line 3115 "parser.y" {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7087,7 +7094,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3108 "parser.y" +#line 3116 "parser.y" {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7098,7 +7105,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3109 "parser.y" +#line 3117 "parser.y" {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7109,7 +7116,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3110 "parser.y" +#line 3118 "parser.y" {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7120,7 +7127,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3111 "parser.y" +#line 3119 "parser.y" {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7131,7 +7138,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3112 "parser.y" +#line 3120 "parser.y" {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7142,7 +7149,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3113 "parser.y" +#line 3121 "parser.y" {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7153,7 +7160,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3114 "parser.y" +#line 3122 "parser.y" {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7164,7 +7171,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3115 "parser.y" +#line 3123 "parser.y" {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7175,7 +7182,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3116 "parser.y" +#line 3124 "parser.y" {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7186,7 +7193,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3117 "parser.y" +#line 3125 "parser.y" {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7197,7 +7204,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3118 "parser.y" +#line 3126 "parser.y" {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7208,7 +7215,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3119 "parser.y" +#line 3127 "parser.y" {(yyval.node) = mknode1(&node_typeof, (yyvsp[(3) - (4)].node));} } break; @@ -7219,7 +7226,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3120 "parser.y" +#line 3128 "parser.y" {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));} } break; @@ -7230,7 +7237,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3121 "parser.y" +#line 3129 "parser.y" { (yyval.node) = mkconstnode(constant_new_undefined());} } break; @@ -7241,7 +7248,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3122 "parser.y" +#line 3130 "parser.y" { (yyval.node)=(yyvsp[(2) - (3)].node);} } break; @@ -7252,7 +7259,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3123 "parser.y" +#line 3131 "parser.y" {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));} } break; @@ -7263,7 +7270,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3124 "parser.y" +#line 3132 "parser.y" {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));} } break; @@ -7274,7 +7281,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3125 "parser.y" +#line 3133 "parser.y" {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7285,7 +7292,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3126 "parser.y" +#line 3134 "parser.y" {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7296,7 +7303,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3127 "parser.y" +#line 3135 "parser.y" {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7307,7 +7314,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3128 "parser.y" +#line 3136 "parser.y" {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7318,7 +7325,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3129 "parser.y" +#line 3137 "parser.y" {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7329,7 +7336,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3130 "parser.y" +#line 3138 "parser.y" { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7340,7 +7347,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3131 "parser.y" +#line 3139 "parser.y" { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7351,7 +7358,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3132 "parser.y" +#line 3140 "parser.y" { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7362,7 +7369,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3133 "parser.y" +#line 3141 "parser.y" { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7373,7 +7380,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3134 "parser.y" +#line 3142 "parser.y" { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7384,7 +7391,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3135 "parser.y" +#line 3143 "parser.y" { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7395,7 +7402,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3136 "parser.y" +#line 3144 "parser.y" { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; @@ -7406,7 +7413,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3137 "parser.y" +#line 3145 "parser.y" { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));} } break; @@ -7417,7 +7424,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3139 "parser.y" +#line 3147 "parser.y" { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));} } break; @@ -7428,7 +7435,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3140 "parser.y" +#line 3148 "parser.y" { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));} } break; @@ -7439,7 +7446,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3141 "parser.y" +#line 3149 "parser.y" {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); } } break; @@ -7450,7 +7457,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3142 "parser.y" +#line 3150 "parser.y" {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); } } break; @@ -7461,7 +7468,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3145 "parser.y" +#line 3153 "parser.y" { if(!state->cls->info) syntaxerror("super keyword not allowed outside a class"); classinfo_t*t = state->cls->info->superclass; @@ -7484,7 +7491,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3159 "parser.y" +#line 3167 "parser.y" { // attribute TODO (yyval.node) = mkdummynode(); @@ -7499,7 +7506,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3165 "parser.y" +#line 3173 "parser.y" { // child attribute TODO (yyval.node) = mkdummynode(); @@ -7514,7 +7521,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3171 "parser.y" +#line 3179 "parser.y" { // namespace declaration TODO (yyval.node) = mkdummynode(); @@ -7529,7 +7536,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3177 "parser.y" +#line 3185 "parser.y" { // descendants TODO (yyval.node) = mkdummynode(); @@ -7544,7 +7551,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3183 "parser.y" +#line 3191 "parser.y" { // filter TODO (yyval.node) = mkdummynode(); @@ -7559,7 +7566,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3196 "parser.y" +#line 3204 "parser.y" { typedcode_t v1 = node_read((yyvsp[(1) - (3)].node)); (yyval.value).c = v1.c; @@ -7626,7 +7633,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3254 "parser.y" +#line 3262 "parser.y" { PASS1 /* Queue unresolved identifiers for checking against the parent @@ -7645,8 +7652,11 @@ PASS12 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id)); PASS2 - (yyval.value).t = 0; - (yyval.value).c = 0; + typedcode_t o; + o.t = 0; + o.c = 0; + (yyval.node) = 0; + slotinfo_t*a = 0; memberinfo_t*f = 0; @@ -7654,14 +7664,16 @@ PASS12 /* look at variables */ if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) { // $1 is a local variable - (yyval.value).c = abc_getlocal((yyval.value).c, v->index); - (yyval.value).t = v->type; + o.c = abc_getlocal(o.c, v->index); + o.t = v->type; + (yyval.node) = mkcodenode(o); break; } if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) { - (yyval.value).c = abc_getscopeobject((yyval.value).c, 1); - (yyval.value).c = abc_getslot((yyval.value).c, v->index); - (yyval.value).t = v->type; + o.c = abc_getscopeobject(o.c, 1); + o.c = abc_getslot(o.c, v->index); + o.t = v->type; + (yyval.node) = mkcodenode(o); break; } @@ -7670,53 +7682,70 @@ PASS12 /* look at current class' members */ if(!state->method->inner && state->cls && - (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) && - (f->flags&FLAG_STATIC) >= i_am_static) + (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1))) { - // $1 is a function in this class + // $1 is a member or attribute in this class int var_is_static = (f->flags&FLAG_STATIC); - if(f->kind == INFOTYPE_METHOD) { - (yyval.value).t = TYPE_FUNCTION(f); - } else { - (yyval.value).t = f->type; - } - if(var_is_static && !i_am_static) { - /* access to a static member from a non-static location. - do this via findpropstrict: - there doesn't seem to be any non-lookup way to access - static properties of a class */ - state->method->late_binding = 1; - (yyval.value).t = f->type; - namespace_t ns = {f->access, f->package}; - multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)}; - (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m); - (yyval.value).c = abc_getproperty2((yyval.value).c, &m); - break; - } else if(f->slot>0) { - (yyval.value).c = abc_getlocal_0((yyval.value).c); - (yyval.value).c = abc_getslot((yyval.value).c, f->slot); - break; - } else { - namespace_t ns = {f->access, f->package}; - multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)}; - (yyval.value).c = abc_getlocal_0((yyval.value).c); - (yyval.value).c = abc_getproperty2((yyval.value).c, &m); - break; + if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) { + /* if the variable is a constant (and we know what is evaluates to), we + can just use the value itself */ + varinfo_t*v = (varinfo_t*)f; + if(v->value) { + (yyval.node) = mkconstnode(v->value); + break; + } + } + + if(var_is_static >= i_am_static) { + if(f->kind == INFOTYPE_METHOD) { + o.t = TYPE_FUNCTION(f); + } else { + o.t = f->type; + } + + if(var_is_static && !i_am_static) { + /* access to a static member from a non-static location. + do this via findpropstrict: + there doesn't seem to be any non-lookup way to access + static properties of a class */ + state->method->late_binding = 1; + o.t = f->type; + namespace_t ns = {f->access, f->package}; + multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)}; + o.c = abc_findpropstrict2(o.c, &m); + o.c = abc_getproperty2(o.c, &m); + (yyval.node) = mkcodenode(o); + break; + } else if(f->slot>0) { + o.c = abc_getlocal_0(o.c); + o.c = abc_getslot(o.c, f->slot); + (yyval.node) = mkcodenode(o); + break; + } else { + namespace_t ns = {f->access, f->package}; + multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)}; + o.c = abc_getlocal_0(o.c); + o.c = abc_getproperty2(o.c, &m); + (yyval.node) = mkcodenode(o); + break; + } } } /* look at actual classes, in the current package and imported */ if((a = find_class((yyvsp[(1) - (1)].id)))) { - (yyval.value) = push_class(a); + o = push_class(a); + (yyval.node) = mkcodenode(o); break; } /* look through package prefixes */ if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) || registry_ispackage((yyvsp[(1) - (1)].id))) { - (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id)); - (yyval.value).t = 0; + o.c = abc___pushpackage__(o.c, (yyvsp[(1) - (1)].id)); + o.t = 0; + (yyval.node) = mkcodenode(o); //? break; } @@ -7728,9 +7757,11 @@ PASS12 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)}; - (yyval.value).t = 0; - (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m); - (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + o.t = 0; + o.c = abc_findpropstrict2(o.c, &m); + o.c = abc_getproperty2(o.c, &m); + (yyval.node) = mkcodenode(o); + break; } } } @@ -7742,7 +7773,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3363 "parser.y" +#line 3395 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -7759,7 +7790,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3370 "parser.y" +#line 3402 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -7776,7 +7807,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3377 "parser.y" +#line 3409 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -7793,7 +7824,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3384 "parser.y" +#line 3416 "parser.y" { PASS12 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url); @@ -7817,7 +7848,7 @@ PASS12 if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3408 "parser.y" +#line 3440 "parser.y" { PASS12 const char*url = (yyvsp[(3) - (3)].classinfo)->name; @@ -7829,7 +7860,7 @@ PASS12 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name); } - if(!s || s->kind != INFOTYPE_SLOT) + if(!s || s->kind != INFOTYPE_VAR) syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1); if(!s->value || !NS_TYPE(s->value->type)) syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name); @@ -7846,7 +7877,7 @@ PASS12 /* Line 1464 of skeleton.m4 */ -#line 7850 "parser.tab.c" +#line 7881 "parser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/lib/as3/parser.y b/lib/as3/parser.y index f16d850..633f0bb 100644 --- a/lib/as3/parser.y +++ b/lib/as3/parser.y @@ -194,6 +194,7 @@ extern int a3_lex(); %type MAYBEEXPRESSION %type DELETE %type E COMMA_EXPRESSION +%type VAR_READ %type FOR FOR_IN IF WHILE DO_WHILE MAYBEELSE BREAK RETURN CONTINUE TRY %type INNERFUNCTION %type USE_NAMESPACE @@ -217,7 +218,7 @@ extern int a3_lex(); %type TYPE //%type VARIABLE -%type VAR_READ MEMBER +%type MEMBER %type NEW //%type T_IDENTIFIER %type FUNCTIONCALL @@ -1258,7 +1259,7 @@ static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, c // not sure wether to look into superclasses here, too minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1); if(minfo) { - if(minfo->kind!=INFOTYPE_SLOT) + if(minfo->kind!=INFOTYPE_VAR) syntaxerror("class already contains a method called '%s'", name); if(!(minfo->subtype & (SUBTYPE_GETSET))) syntaxerror("class already contains a field called '%s'", name); @@ -1279,7 +1280,7 @@ static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, c }*/ } else { minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name); - minfo->kind = INFOTYPE_SLOT; //hack + minfo->kind = INFOTYPE_VAR; //hack minfo->subtype = gs; minfo->return_type = 0; } @@ -2640,6 +2641,7 @@ PASS12 /* compile time constant */ t->value = malloc(sizeof(constant_t)); memcpy(t->value, &cval, sizeof(constant_t)); + info->value = constant_clone(t->value); } else { typedcode_t v = node_read($3); /* initalization code (if needed) */ @@ -2655,6 +2657,7 @@ PASS12 if(slotstate_varconst==KW_CONST) { t->kind= TRAIT_CONST; + info->flags |= FLAG_CONST; } } @@ -2664,7 +2667,12 @@ PASS12 /* ------------ constants -------------------------------------- */ MAYBECONSTANT: {$$=0;} -MAYBECONSTANT: '=' CONSTANT {$$=$2;} +MAYBECONSTANT: '=' E { + $$ = malloc(sizeof(constant_t)); + *$$ = node_eval($2); + if($$->type == CONSTANT_UNKNOWN) + syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)"); +} //CONSTANT : T_NAMESPACE {$$ = constant_new_namespace($1);} CONSTANT : T_INT {$$ = constant_new_int($1);} @@ -3039,11 +3047,11 @@ EXPRPAIR_LIST : EXPRPAIR_LIST ',' NONCOMMAEXPRESSION ':' NONCOMMAEXPRESSION { // ----------------------- expression evaluation ------------------------------------- E : INNERFUNCTION %prec prec_none {$$ = mkcodenode($1);} -E : VAR_READ %prec T_IDENTIFIER {$$ = mkcodenode($1);} E : MEMBER %prec '.' {$$ = mkcodenode($1);} E : NEW {$$ = mkcodenode($1);} E : DELETE {$$ = mkcodenode($1);} E : FUNCTIONCALL {$$ = mkcodenode($1);} +E : VAR_READ %prec T_IDENTIFIER {$$ = $1;} E : CONSTANT { $$ = mkconstnode($1); @@ -3269,8 +3277,11 @@ VAR_READ : T_IDENTIFIER { as3_schedule_class_noerror(state->package, $1); PASS2 - $$.t = 0; - $$.c = 0; + typedcode_t o; + o.t = 0; + o.c = 0; + $$ = 0; + slotinfo_t*a = 0; memberinfo_t*f = 0; @@ -3278,14 +3289,16 @@ VAR_READ : T_IDENTIFIER { /* look at variables */ if((v = find_variable(state, $1))) { // $1 is a local variable - $$.c = abc_getlocal($$.c, v->index); - $$.t = v->type; + o.c = abc_getlocal(o.c, v->index); + o.t = v->type; + $$ = mkcodenode(o); break; } if((v = find_slot(state, $1))) { - $$.c = abc_getscopeobject($$.c, 1); - $$.c = abc_getslot($$.c, v->index); - $$.t = v->type; + o.c = abc_getscopeobject(o.c, 1); + o.c = abc_getslot(o.c, v->index); + o.t = v->type; + $$ = mkcodenode(o); break; } @@ -3294,53 +3307,70 @@ VAR_READ : T_IDENTIFIER { /* look at current class' members */ if(!state->method->inner && state->cls && - (f = findmember_nsset(state->cls->info, $1, 1)) && - (f->flags&FLAG_STATIC) >= i_am_static) + (f = findmember_nsset(state->cls->info, $1, 1))) { - // $1 is a function in this class + // $1 is a member or attribute in this class int var_is_static = (f->flags&FLAG_STATIC); - if(f->kind == INFOTYPE_METHOD) { - $$.t = TYPE_FUNCTION(f); - } else { - $$.t = f->type; - } - if(var_is_static && !i_am_static) { - /* access to a static member from a non-static location. - do this via findpropstrict: - there doesn't seem to be any non-lookup way to access - static properties of a class */ - state->method->late_binding = 1; - $$.t = f->type; - namespace_t ns = {f->access, f->package}; - multiname_t m = {QNAME, &ns, 0, $1}; - $$.c = abc_findpropstrict2($$.c, &m); - $$.c = abc_getproperty2($$.c, &m); - break; - } else if(f->slot>0) { - $$.c = abc_getlocal_0($$.c); - $$.c = abc_getslot($$.c, f->slot); - break; - } else { - namespace_t ns = {f->access, f->package}; - multiname_t m = {QNAME, &ns, 0, $1}; - $$.c = abc_getlocal_0($$.c); - $$.c = abc_getproperty2($$.c, &m); - break; + if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) { + /* if the variable is a constant (and we know what is evaluates to), we + can just use the value itself */ + varinfo_t*v = (varinfo_t*)f; + if(v->value) { + $$ = mkconstnode(v->value); + break; + } + } + + if(var_is_static >= i_am_static) { + if(f->kind == INFOTYPE_METHOD) { + o.t = TYPE_FUNCTION(f); + } else { + o.t = f->type; + } + + if(var_is_static && !i_am_static) { + /* access to a static member from a non-static location. + do this via findpropstrict: + there doesn't seem to be any non-lookup way to access + static properties of a class */ + state->method->late_binding = 1; + o.t = f->type; + namespace_t ns = {f->access, f->package}; + multiname_t m = {QNAME, &ns, 0, $1}; + o.c = abc_findpropstrict2(o.c, &m); + o.c = abc_getproperty2(o.c, &m); + $$ = mkcodenode(o); + break; + } else if(f->slot>0) { + o.c = abc_getlocal_0(o.c); + o.c = abc_getslot(o.c, f->slot); + $$ = mkcodenode(o); + break; + } else { + namespace_t ns = {f->access, f->package}; + multiname_t m = {QNAME, &ns, 0, $1}; + o.c = abc_getlocal_0(o.c); + o.c = abc_getproperty2(o.c, &m); + $$ = mkcodenode(o); + break; + } } } /* look at actual classes, in the current package and imported */ if((a = find_class($1))) { - $$ = push_class(a); + o = push_class(a); + $$ = mkcodenode(o); break; } /* look through package prefixes */ if(dict_contains(state->import_toplevel_packages, $1) || registry_ispackage($1)) { - $$.c = abc___pushpackage__($$.c, $1); - $$.t = 0; + o.c = abc___pushpackage__(o.c, $1); + o.t = 0; + $$ = mkcodenode(o); //? break; } @@ -3352,9 +3382,11 @@ VAR_READ : T_IDENTIFIER { multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, $1}; - $$.t = 0; - $$.c = abc_findpropstrict2($$.c, &m); - $$.c = abc_getproperty2($$.c, &m); + o.t = 0; + o.c = abc_findpropstrict2(o.c, &m); + o.c = abc_getproperty2(o.c, &m); + $$ = mkcodenode(o); + break; } } @@ -3416,7 +3448,7 @@ USE_NAMESPACE : "use" "namespace" CLASS_SPEC { syntaxerror("Couldn't resolve namespace %s", $3->name); } - if(!s || s->kind != INFOTYPE_SLOT) + if(!s || s->kind != INFOTYPE_VAR) syntaxerror("%s.%s is not a public namespace (%d)", $3->package, $3->name, s?s->kind:-1); if(!s->value || !NS_TYPE(s->value->type)) syntaxerror("%s.%s is not a namespace", $3->package, $3->name); diff --git a/lib/as3/registry.c b/lib/as3/registry.c index b541b45..4d18680 100644 --- a/lib/as3/registry.c +++ b/lib/as3/registry.c @@ -97,7 +97,7 @@ static void schedule_for_resolve(slotinfo_t*s) } static void resolve_on_slot(slotinfo_t*_member) { - if(_member->kind == INFOTYPE_SLOT) { + if(_member->kind == INFOTYPE_VAR) { varinfo_t*member = (varinfo_t*)_member; member->type = (classinfo_t*)registry_resolve((slotinfo_t*)member->type); } else if(_member->kind == INFOTYPE_METHOD) { @@ -129,7 +129,7 @@ void registry_resolve_all() slotinfo_t*_s = unresolved->slotinfo; if(_s->kind == INFOTYPE_CLASS) { resolve_on_class(_s); - } else if(_s->kind == INFOTYPE_METHOD || _s->kind == INFOTYPE_SLOT) { + } else if(_s->kind == INFOTYPE_METHOD || _s->kind == INFOTYPE_VAR) { resolve_on_slot(_s); } else { fprintf(stderr, "Internal Error: object %s.%s has bad type\n", _s->package, _s->name); @@ -170,7 +170,7 @@ methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name) { NEW(varinfo_t,m); - m->kind = INFOTYPE_SLOT; + m->kind = INFOTYPE_VAR; m->access = access; m->name = name; m->package = ns; @@ -195,7 +195,7 @@ methodinfo_t* methodinfo_register_global(U8 access, const char*package, const ch varinfo_t* varinfo_register_global(U8 access, const char*package, const char*name) { NEW(varinfo_t, m); - m->kind = INFOTYPE_SLOT; + m->kind = INFOTYPE_VAR; m->flags = FLAG_STATIC; m->access = access; m->package = package; @@ -347,7 +347,7 @@ classinfo_t* slotinfo_asclass(slotinfo_t*f) { } else if(f->kind == INFOTYPE_CLASS) { c->name = "Class"; c->superclass = registry_getobjectclass(); - } else if(f->kind == INFOTYPE_SLOT) { + } else if(f->kind == INFOTYPE_VAR) { c->name = "Object"; } else { c->name = "undefined"; @@ -364,7 +364,7 @@ classinfo_t* slotinfo_gettype(slotinfo_t*f) if(f) { if(f->kind == INFOTYPE_METHOD) { return slotinfo_asclass(f); - } else if(f->kind == INFOTYPE_SLOT) { + } else if(f->kind == INFOTYPE_VAR) { varinfo_t*v = (varinfo_t*)f; return v->type; } else @@ -461,7 +461,7 @@ namespace_t access2namespace(U8 access, char*package) char* infotypename(slotinfo_t*s) { if(s->kind == INFOTYPE_CLASS) return "class"; - else if(s->kind == INFOTYPE_SLOT) return "member"; + else if(s->kind == INFOTYPE_VAR) return "member"; else if(s->kind == INFOTYPE_METHOD) return "method"; else return "object"; } diff --git a/lib/as3/registry.h b/lib/as3/registry.h index 8075ab6..1e62660 100644 --- a/lib/as3/registry.h +++ b/lib/as3/registry.h @@ -43,12 +43,13 @@ DECLARE_LIST(slotinfo); #define FLAG_STATIC 2 #define FLAG_OVERRIDE 8 #define FLAG_NATIVE 16 +#define FLAG_CONST 32 /* class flags */ #define FLAG_DYNAMIC 8 #define FLAG_INTERFACE 16 -#define INFOTYPE_SLOT 1 +#define INFOTYPE_VAR 1 #define INFOTYPE_METHOD 2 #define INFOTYPE_CLASS 3 #define INFOTYPE_UNRESOLVED 4 @@ -90,7 +91,7 @@ struct _memberinfo { }; classinfo_t*parent; }; -struct _methodinfo { +struct _methodinfo /*extends memberinfo*/ { U8 kind,subtype,flags,access; const char*package; const char*name; @@ -99,7 +100,7 @@ struct _methodinfo { classinfo_t*parent; classinfo_list_t*params; }; -struct _varinfo { +struct _varinfo /*extends memberinfo*/ { U8 kind,subtype,flags,access; const char*package; const char*name; -- 1.7.10.4