2 /* A Bison parser, made by GNU Bison 2.4. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4"
52 #define YYSKELETON_NAME "./skeleton.m4"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse a3_parse
69 #define yyerror a3_error
70 #define yylval a3_lval
71 #define yychar a3_char
72 #define yydebug a3_debug
73 #define yynerrs a3_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 198 of skeleton.m4 */
87 #include "tokenizer.h"
97 /* Line 198 of skeleton.m4 */
98 #line 99 "parser.tab.c"
100 /* Enabling traces. */
105 /* Enabling verbose error messages. */
106 #ifdef YYERROR_VERBOSE
107 # undef YYERROR_VERBOSE
108 # define YYERROR_VERBOSE 1
110 # define YYERROR_VERBOSE 1
113 /* Enabling the token table. */
114 #ifndef YYTOKEN_TABLE
115 # define YYTOKEN_TABLE 0
122 /* Put the tokens into the symbol table, so that GDB and other debuggers
220 below_semicolon = 353,
221 below_assignment = 354,
223 minusminus_prefix = 357,
224 plusplus_prefix = 358,
227 above_identifier = 361,
235 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
237 /* Line 223 of skeleton.m4 */
242 /* Line 223 of skeleton.m4 */
245 enum yytokentype token;
247 classinfo_t*classinfo;
248 classinfo_list_t*classinfo_list;
250 slotinfo_list_t*slotinfo_list;
253 unsigned int number_uint;
257 //typedcode_list_t*value_list;
258 codeandnumber_t value_list;
264 for_start_t for_start;
265 abc_exception_t *exception;
268 namespace_decl_t* namespace_decl;
270 abc_exception_list_t *l;
276 /* Line 223 of skeleton.m4 */
277 #line 278 "parser.tab.c"
279 # define YYSTYPE_IS_TRIVIAL 1
280 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
281 # define YYSTYPE_IS_DECLARED 1
285 /* Copy the second part of user declarations. */
287 /* Line 273 of skeleton.m4 */
291 static int a3_error(char*s)
293 syntaxerror("%s", s);
294 return 0; //make gcc happy
298 static char* concat2(const char* t1, const char* t2)
302 char*text = malloc(l1+l2+1);
303 memcpy(text , t1, l1);
304 memcpy(text+l1, t2, l2);
308 static char* concat3(const char* t1, const char* t2, const char* t3)
313 char*text = malloc(l1+l2+l3+1);
314 memcpy(text , t1, l1);
315 memcpy(text+l1, t2, l2);
316 memcpy(text+l1+l2, t3, l3);
321 typedef struct _import {
325 DECLARE_LIST(import);
327 DECLARE(methodstate);
328 DECLARE_LIST(methodstate);
330 typedef struct _classstate {
336 methodstate_t*static_init;
338 //code_t*static_init;
340 char has_constructor;
343 struct _methodstate {
353 dict_t*unresolved_variables;
356 char uses_parent_function;
362 int var_index; // for inner methods
363 int slot_index; // for inner methods
364 char is_a_slot; // for inner methods
369 abc_exception_list_t*exceptions;
371 methodstate_list_t*innerfunctions;
374 typedef struct _state {
379 import_list_t*wildcard_imports;
380 dict_t*import_toplevel_packages;
383 namespace_list_t*active_namespace_urls;
385 char has_own_imports;
386 char new_vars; // e.g. transition between two functions
389 methodstate_t*method;
398 typedef struct _global {
402 dict_t*file2token2info;
405 static global_t*global = 0;
406 static state_t* state = 0;
410 #define MULTINAME(m,x) \
414 registry_fill_multiname(&m, &m##_ns, (slotinfo_t*)(x));
416 #define MEMBER_MULTINAME(m,f,n) \
420 if((m##_ns.access = ((slotinfo_t*)(f))->access)==ACCESS_NAMESPACE) \
421 m##_ns.name = ((slotinfo_t*)(f))->package; \
426 m.namespace_set = 0; \
427 m.name = ((slotinfo_t*)(f))->name; \
429 m.type = MULTINAME; \
431 m.namespace_set = &nopackage_namespace_set; \
435 /* warning: list length of namespace set is undefined */
436 #define MULTINAME_LATE(m, access, package) \
437 namespace_t m##_ns = {access, package}; \
438 namespace_set_t m##_nsset; \
439 namespace_list_t m##_l;m##_l.next = 0; \
440 m##_nsset.namespaces = &m##_l; \
441 m##_nsset = m##_nsset; \
442 m##_l.namespace = &m##_ns; \
443 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
445 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
446 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
447 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
448 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
449 static namespace_list_t nl4 = {&ns4,0};
450 static namespace_list_t nl3 = {&ns3,&nl4};
451 static namespace_list_t nl2 = {&ns2,&nl3};
452 static namespace_list_t nl1 = {&ns1,&nl2};
453 static namespace_set_t nopackage_namespace_set = {&nl1};
455 dict_t*conditionals=0;
456 void as3_set_definition(const char*c)
459 conditionals = dict_new();
460 if(!dict_contains(conditionals,c))
461 dict_put(conditionals,c,0);
464 static void new_state()
467 state_t*oldstate = state;
469 memcpy(s, state, sizeof(state_t)); //shallow copy
471 s->imports = dict_new();
473 if(!s->import_toplevel_packages) {
474 s->import_toplevel_packages = dict_new();
478 state->has_own_imports = 0;
479 state->vars = dict_new();
480 state->old = oldstate;
483 trie_remember(active_namespaces);
486 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
488 static void state_has_imports()
490 state->wildcard_imports = list_clone(state->wildcard_imports);
491 state->imports = dict_clone(state->imports);
492 state->has_own_imports = 1;
494 static void import_toplevel(const char*package)
496 char* s = strdup(package);
498 dict_put(state->import_toplevel_packages, s, 0);
499 char*x = strrchr(s, '.');
507 static void state_destroy(state_t*state)
509 if(state->has_own_imports) {
510 list_free(state->wildcard_imports);
511 dict_destroy(state->imports);state->imports=0;
513 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
514 dict_destroy(state->imports);state->imports=0;
518 for(t=0;t<state->vars->hashsize;t++) {
519 dictentry_t*e =state->vars->slots[t];
521 free(e->data);e->data=0;
525 dict_destroy(state->vars);state->vars=0;
528 list_free(state->active_namespace_urls)
529 state->active_namespace_urls = 0;
534 static void old_state()
536 trie_rollback(active_namespaces);
538 if(!state || !state->old)
539 syntaxerror("invalid nesting");
540 state_t*leaving = state;
544 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
545 free(leaving->method);
548 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
553 state_destroy(leaving);
556 static code_t* method_header(methodstate_t*m);
557 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
558 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0);
561 static char* internal_filename_package = 0;
562 void initialize_file(char*filename)
565 syntaxerror("invalid call to initialize_file during parsing of another file");
568 active_namespaces = trie_new();
571 state->package = internal_filename_package = strdup(filename);
573 global->token2info = dict_lookup(global->file2token2info,
574 current_filename // use long version
576 if(!global->token2info) {
577 global->token2info = dict_new2(&ptr_type);
578 dict_put(global->file2token2info, current_filename, global->token2info);
582 state->method = rfx_calloc(sizeof(methodstate_t));
583 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
584 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
586 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
587 function_initvars(state->method, 0, 0, 1);
588 global->init = abc_initscript(global->file);
594 if(!state || state->level!=1) {
595 syntaxerror("unexpected end of file in pass %d", as3_pass);
599 code_t*header = method_header(state->method);
600 code_t*c = wrap_function(header, 0, global->init->method->body->code);
601 global->init->method->body->code = c;
602 free(state->method);state->method=0;
605 //free(state->package);state->package=0; // used in registry
606 state_destroy(state);state=0;
609 void initialize_parser()
611 global = rfx_calloc(sizeof(global_t));
612 global->file = abc_file_new();
613 global->file->flags &= ~ABCFILE_LAZY;
614 global->file2token2info = dict_new();
615 global->token2info = 0;
618 void* finish_parser()
620 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
622 global->token2info=0;
628 static void xx_scopetest()
630 /* findpropstrict doesn't just return a scope object- it
631 also makes it "active" somehow. Push local_0 on the
632 scope stack and read it back with findpropstrict, it'll
633 contain properties like "trace". Trying to find the same
634 property on a "vanilla" local_0 yields only a "undefined" */
635 //c = abc_findpropstrict(c, "[package]::trace");
637 /*c = abc_getlocal_0(c);
638 c = abc_findpropstrict(c, "[package]::trace");
640 c = abc_setlocal_1(c);
642 c = abc_pushbyte(c, 0);
643 c = abc_setlocal_2(c);
645 code_t*xx = c = abc_label(c);
646 c = abc_findpropstrict(c, "[package]::trace");
647 c = abc_pushstring(c, "prop:");
648 c = abc_hasnext2(c, 1, 2);
650 c = abc_setlocal_3(c);
651 c = abc_callpropvoid(c, "[package]::trace", 2);
652 c = abc_getlocal_3(c);
654 c = abc_iftrue(c,xx);*/
657 typedef struct _variable {
662 methodstate_t*is_inner_method;
665 static variable_t* find_variable(state_t*s, char*name)
669 v = dict_lookup(s->vars, name);
671 if(s->new_vars) break;
676 static variable_t* find_slot(state_t*s, const char*name)
678 if(s->method && s->method->slots)
679 return dict_lookup(s->method->slots, name);
683 static variable_t* find_variable_safe(state_t*s, char*name)
685 variable_t* v = find_variable(s, name);
687 syntaxerror("undefined variable: %s", name);
690 static char variable_exists(char*name)
692 return dict_contains(state->vars, name);
694 code_t*defaultvalue(code_t*c, classinfo_t*type);
696 static int alloc_local()
698 return state->method->variable_count++;
701 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
704 variable_t*v = find_slot(state, name);
710 v->index = alloc_local();
715 dict_put(state->vars, name, v);
719 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
721 return new_variable2(name, type, init, maybeslot)->index;
724 #define TEMPVARNAME "__as3_temp__"
725 static int gettempvar()
727 variable_t*v = find_variable(state, TEMPVARNAME);
730 return new_variable(TEMPVARNAME, 0, 0, 0);
733 code_t* var_block(code_t*body)
739 for(t=0;t<state->vars->hashsize;t++) {
740 dictentry_t*e = state->vars->slots[t];
742 variable_t*v = (variable_t*)e->data;
743 if(v->type && v->init) {
744 c = defaultvalue(c, v->type);
745 c = abc_setlocal(c, v->index);
746 k = abc_kill(k, v->index);
756 if(x->opcode== OPCODE___BREAK__ ||
757 x->opcode== OPCODE___CONTINUE__) {
758 /* link kill code before break/continue */
759 code_t*e = code_dup(k);
760 code_t*s = code_start(e);
772 c = code_append(c, body);
773 c = code_append(c, k);
777 void unknown_variable(char*name)
779 if(!state->method->unresolved_variables)
780 state->method->unresolved_variables = dict_new();
781 if(!dict_contains(state->method->unresolved_variables, name))
782 dict_put(state->method->unresolved_variables, name, 0);
785 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
787 static void parsererror(const char*file, int line, const char*f)
789 syntaxerror("internal error in %s, %s:%d", f, file, line);
793 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
795 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
796 c = abc_getlocal_0(c);
797 c = abc_pushscope(c);
800 /* FIXME: this alloc_local() causes variable indexes to be
801 different in pass2 than in pass1 */
802 if(!m->activation_var)
803 m->activation_var = alloc_local();
805 c = abc_newactivation(c);
807 c = abc_pushscope(c);
808 c = abc_setlocal(c, m->activation_var);
810 c = abc_getlocal(c, m->activation_var);
811 c = abc_pushscope(c);
817 static code_t* method_header(methodstate_t*m)
821 c = add_scope_code(c, m, 1);
823 methodstate_list_t*l = m->innerfunctions;
825 parserassert(l->methodstate->abc);
826 if(m->uses_slots && l->methodstate->is_a_slot) {
827 c = abc_getscopeobject(c, 1);
828 c = abc_newfunction(c, l->methodstate->abc);
830 c = abc_setlocal(c, l->methodstate->var_index);
831 c = abc_setslot(c, l->methodstate->slot_index);
833 c = abc_newfunction(c, l->methodstate->abc);
834 c = abc_setlocal(c, l->methodstate->var_index);
836 free(l->methodstate);l->methodstate=0;
840 c = code_append(c, m->header);
843 if(m->is_constructor && !m->has_super) {
844 // call default constructor
845 c = abc_getlocal_0(c);
846 c = abc_constructsuper(c, 0);
850 /* all parameters that are used by inner functions
851 need to be copied from local to slot */
852 parserassert(m->activation_var);
853 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
854 if(v->is_parameter) {
855 c = abc_getlocal(c, m->activation_var);
856 c = abc_getlocal(c, v->index);
857 c = abc_setslot(c, v->index);
861 list_free(m->innerfunctions);
862 m->innerfunctions = 0;
867 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
869 c = code_append(c, header);
870 c = code_append(c, var_block(body));
871 /* append return if necessary */
872 if(!c || (c->opcode != OPCODE_RETURNVOID &&
873 c->opcode != OPCODE_RETURNVALUE)) {
874 c = abc_returnvoid(c);
880 static void startpackage(char*name)
883 /*printf("entering package \"%s\"\n", name);*/
884 state->package = strdup(name);
886 static void endpackage()
888 /*printf("leaving package \"%s\"\n", state->package);*/
890 //used e.g. in classinfo_register:
891 //free(state->package);state->package=0;
896 #define FLAG_PUBLIC 256
897 #define FLAG_PROTECTED 512
898 #define FLAG_PRIVATE 1024
899 #define FLAG_PACKAGEINTERNAL 2048
900 #define FLAG_NAMESPACE 4096
902 static namespace_t modifiers2access(modifiers_t*mod)
907 if(mod->flags&FLAG_NAMESPACE) {
908 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
909 syntaxerror("invalid combination of access levels and namespaces");
910 ns.access = ACCESS_NAMESPACE;
912 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
914 /* shouldn't happen- the tokenizer only reports something as a namespace
915 if it was already registered */
916 trie_dump(active_namespaces);
917 syntaxerror("unknown namespace: %s", mod->ns);
920 } else if(mod->flags&FLAG_PUBLIC) {
921 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
922 syntaxerror("invalid combination of access levels");
923 ns.access = ACCESS_PACKAGE;
924 } else if(mod->flags&FLAG_PRIVATE) {
925 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
926 syntaxerror("invalid combination of access levels");
927 ns.access = ACCESS_PRIVATE;
928 } else if(mod->flags&FLAG_PROTECTED) {
929 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
930 syntaxerror("invalid combination of access levels");
931 ns.access = ACCESS_PROTECTED;
933 ns.access = ACCESS_PACKAGEINTERNAL;
937 static slotinfo_t* find_class(const char*name);
939 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
941 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
944 void add_active_url(const char*url)
948 list_append(state->active_namespace_urls, n);
951 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
956 index = new_variable("this", 0, 0, 0);
957 else if(!m->is_global)
958 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
960 index = new_variable("globalscope", 0, 0, 0);
963 parserassert(!index);
967 /* as variables and slots share the same number, make sure
968 that those variable indices are reserved. It's up to the
969 optimizer to later shuffle the variables down to lower
971 m->variable_count = m->uses_slots;
976 for(p=params->list;p;p=p->next) {
977 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
982 methodstate_list_t*l = m->innerfunctions;
984 methodstate_t*m = l->methodstate;
986 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
987 m->var_index = v->index;
988 m->slot_index = v->index;
989 v->is_inner_method = m;
995 m->scope_code = add_scope_code(m->scope_code, m, 0);
998 if(as3_pass==2 && m->slots) {
999 /* exchange unresolved identifiers with the actual objects */
1000 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
1001 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
1002 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
1003 if(!type || type->kind != INFOTYPE_CLASS) {
1004 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1013 char*as3_globalclass=0;
1014 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1017 syntaxerror("inner classes now allowed");
1022 classinfo_list_t*mlist=0;
1024 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1025 syntaxerror("invalid modifier(s)");
1027 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1028 syntaxerror("public and internal not supported at the same time.");
1030 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1031 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1032 // all classes extend object
1033 extends = registry_getobjectclass();
1036 /* create the class name, together with the proper attributes */
1040 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1041 access = ACCESS_PRIVATE; package = internal_filename_package;
1042 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1043 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1044 } else if(state->package!=internal_filename_package) {
1045 access = ACCESS_PACKAGE; package = state->package;
1047 syntaxerror("public classes only allowed inside a package");
1051 state->cls = rfx_calloc(sizeof(classstate_t));
1052 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1053 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1054 /* notice: we make no effort to initialize the top variable (local0) here,
1055 even though it has special meaning. We just rely on the facat
1056 that pass 1 won't do anything with variables */
1058 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1060 /* set current method to constructor- all code within the class-level (except
1061 static variable initializations) will be executed during construction time */
1062 state->method = state->cls->init;
1064 if(registry_find(package, classname)) {
1065 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1067 /* build info struct */
1068 int num_interfaces = (list_length(implements));
1069 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1070 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1073 classinfo_list_t*l = implements;
1074 for(l=implements;l;l=l->next) {
1075 state->cls->info->interfaces[pos++] = l->classinfo;
1080 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1082 state->method = state->cls->init;
1083 parserassert(state->cls && state->cls->info);
1085 function_initvars(state->cls->init, 0, 0, 1);
1086 function_initvars(state->cls->static_init, 0, 0, 0);
1088 if(extends && (extends->flags & FLAG_FINAL))
1089 syntaxerror("Can't extend final class '%s'", extends->name);
1092 while(state->cls->info->interfaces[pos]) {
1093 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1094 syntaxerror("'%s' is not an interface",
1095 state->cls->info->interfaces[pos]->name);
1099 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
1100 state->cls->info->superclass = extends;
1102 /* generate the abc code for this class */
1103 MULTINAME(classname2,state->cls->info);
1104 multiname_t*extends2 = sig2mname(extends);
1106 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1107 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1108 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1109 if(state->cls->info->flags&FLAG_INTERFACE) {
1110 abc_class_interface(state->cls->abc);
1113 abc_class_protectedNS(state->cls->abc, classname);
1115 for(mlist=implements;mlist;mlist=mlist->next) {
1116 MULTINAME(m, mlist->classinfo);
1117 abc_class_add_interface(state->cls->abc, &m);
1120 /* write the construction code for this class to the global init
1122 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1124 abc_method_body_t*m = global->init->method->body;
1125 __ getglobalscope(m);
1126 classinfo_t*s = extends;
1131 //TODO: take a look at the current scope stack, maybe
1132 // we can re-use something
1137 multiname_t*s2 = sig2mname(s);
1139 multiname_destroy(s2);
1141 __ pushscope(m); count++;
1142 m->code = m->code->prev->prev; // invert
1144 /* continue appending after last op end */
1145 while(m->code && m->code->next) m->code = m->code->next;
1147 /* TODO: if this is one of *our* classes, we can also
1148 do a getglobalscope/getslot <nr> (which references
1149 the init function's slots) */
1151 __ getlex2(m, extends2);
1153 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1154 stack is not the superclass */
1155 __ pushscope(m);count++;
1158 /* notice: we get a verify error #1107 if the top element on the scope
1159 stack is not the global object */
1161 __ pushscope(m);count++;
1163 __ newclass(m,state->cls->abc);
1167 __ setslot(m, slotindex);
1168 multiname_destroy(extends2);
1170 /* flash.display.MovieClip handling */
1172 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1173 if(state->package && state->package[0]) {
1174 as3_globalclass = concat3(state->package, ".", classname);
1176 as3_globalclass = strdup(classname);
1182 static int slotstate_varconst = 0;
1183 static modifiers_t*slotstate_flags = 0;
1184 static void setslotstate(modifiers_t* flags, int varconst)
1186 slotstate_varconst = varconst;
1187 slotstate_flags = flags;
1189 if(flags && flags->flags&FLAG_STATIC) {
1190 state->method = state->cls->static_init;
1192 state->method = state->cls->init;
1195 parserassert(state->method);
1199 static void endclass()
1202 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1204 c = abc_getlocal_0(c);
1205 c = abc_constructsuper(c, 0);
1206 state->cls->init->header = code_append(state->cls->init->header, c);
1207 state->cls->has_constructor=1;
1209 if(state->cls->init) {
1210 if(state->cls->info->flags&FLAG_INTERFACE) {
1211 if(state->cls->init->header)
1212 syntaxerror("interface can not have class-level code");
1214 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1215 code_t*c = method_header(state->cls->init);
1216 m->body->code = wrap_function(c, 0, m->body->code);
1219 if(state->cls->static_init) {
1220 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1221 code_t*c = method_header(state->cls->static_init);
1222 m->body->code = wrap_function(c, 0, m->body->code);
1229 void check_code_for_break(code_t*c)
1232 if(c->opcode == OPCODE___BREAK__) {
1233 char*name = string_cstr(c->data[0]);
1234 syntaxerror("Unresolved \"break %s\"", name);
1236 if(c->opcode == OPCODE___CONTINUE__) {
1237 char*name = string_cstr(c->data[0]);
1238 syntaxerror("Unresolved \"continue %s\"", name);
1240 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1241 char*name = string_cstr(c->data[0]);
1242 syntaxerror("Can't reference a package (%s) as such", name);
1249 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1252 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1253 if(TYPE_IS_NUMBER(t)) {
1254 xassert(c->type == CONSTANT_FLOAT
1255 || c->type == CONSTANT_INT
1256 || c->type == CONSTANT_UINT);
1257 } else if(TYPE_IS_UINT(t)) {
1258 xassert(c->type == CONSTANT_UINT ||
1259 (c->type == CONSTANT_INT && c->i>=0));
1260 } else if(TYPE_IS_INT(t)) {
1261 xassert(c->type == CONSTANT_INT);
1262 } else if(TYPE_IS_BOOLEAN(t)) {
1263 xassert(c->type == CONSTANT_TRUE
1264 || c->type == CONSTANT_FALSE);
1268 static void check_override(memberinfo_t*m, int flags)
1272 if(m->parent == state->cls->info)
1273 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1275 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1276 if(m->access==ACCESS_PRIVATE)
1278 if(m->flags & FLAG_FINAL)
1279 syntaxerror("can't override final member %s", m->name);
1281 /* allow this. it's no issue.
1282 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1283 syntaxerror("can't override static member %s", m->name);*/
1285 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1286 syntaxerror("can't override non-static member %s with static declaration", m->name);
1288 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1289 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1290 if(m->kind == INFOTYPE_METHOD)
1291 syntaxerror("can't override without explicit 'override' declaration");
1293 syntaxerror("can't override '%s'", m->name);
1298 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1300 methodinfo_t*minfo = 0;
1301 namespace_t ns = modifiers2access(mod);
1304 minfo = methodinfo_register_global(ns.access, state->package, name);
1305 minfo->return_type = 0; // save this for pass 2
1306 } else if(getset != KW_GET && getset != KW_SET) {
1308 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1310 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1312 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1313 minfo->return_type = 0; // save this for pass 2
1314 // getslot on a member slot only returns "undefined", so no need
1315 // to actually store these
1316 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1318 //class getter/setter
1319 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1321 if(getset == KW_GET) {
1323 } else if(params->list && params->list->param && !params->list->next) {
1324 type = params->list->param->type;
1326 syntaxerror("setter function needs to take exactly one argument");
1327 // not sure wether to look into superclasses here, too
1328 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1330 if(minfo->kind!=INFOTYPE_SLOT)
1331 syntaxerror("class already contains a method called '%s'", name);
1332 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1333 syntaxerror("class already contains a field called '%s'", name);
1334 if(minfo->subtype & gs)
1335 syntaxerror("getter/setter for '%s' already defined", name);
1336 /* make a setter or getter into a getset */
1337 minfo->subtype |= gs;
1340 FIXME: this check needs to be done in pass 2
1342 if((!minfo->return_type != !type) ||
1343 (minfo->return_type && type &&
1344 !strcmp(minfo->return_type->name, type->name))) {
1345 syntaxerror("different type in getter and setter: %s and %s",
1346 minfo->return_type?minfo->return_type->name:"*",
1347 type?type->name:"*");
1350 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1351 minfo->kind = INFOTYPE_SLOT; //hack
1352 minfo->subtype = gs;
1353 minfo->return_type = 0;
1355 /* can't assign a slot as getter and setter might have different slots */
1356 //minfo->slot = slot;
1358 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1359 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1360 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1365 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1367 //parserassert(state->method && state->method->info);
1369 methodstate_t*parent_method = state->method;
1372 return_type = 0; // not valid in pass 1
1376 state->new_vars = 1;
1379 state->method = rfx_calloc(sizeof(methodstate_t));
1380 state->method->inner = 1;
1381 state->method->variable_count = 0;
1382 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1384 NEW(methodinfo_t,minfo);
1385 minfo->kind = INFOTYPE_METHOD;
1386 minfo->access = ACCESS_PACKAGEINTERNAL;
1388 state->method->info = minfo;
1391 list_append(parent_method->innerfunctions, state->method);
1393 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1395 function_initvars(state->method, params, 0, 1);
1399 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1400 state->method->variable_count = 0;
1401 parserassert(state->method);
1403 state->method->info->return_type = return_type;
1404 function_initvars(state->method, params, 0, 1);
1408 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1409 params_t*params, classinfo_t*return_type)
1411 if(state->method && state->method->info) {
1412 syntaxerror("not able to start another method scope");
1415 state->new_vars = 1;
1418 state->method = rfx_calloc(sizeof(methodstate_t));
1419 state->method->has_super = 0;
1422 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1424 state->method->is_global = 1;
1425 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1427 if(state->method->is_constructor)
1428 name = "__as3_constructor__";
1430 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1432 function_initvars(state->method, params, mod->flags, 1);
1434 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1438 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1439 state->method->variable_count = 0;
1440 parserassert(state->method);
1443 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1444 check_override(m, mod->flags);
1448 state->cls->has_constructor |= state->method->is_constructor;
1451 state->method->info->return_type = return_type;
1452 function_initvars(state->method, params, mod->flags, 1);
1456 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1457 params_t*params, classinfo_t*return_type, code_t*body)
1460 // store inner methods in variables
1461 function_initvars(state->method, 0, 0, 0);
1463 methodstate_list_t*ml = state->method->innerfunctions;
1465 dict_t*xvars = dict_new();
1468 methodstate_t*m = ml->methodstate;
1469 parserassert(m->inner);
1470 if(m->unresolved_variables) {
1471 dict_t*d = m->unresolved_variables;
1473 for(t=0;t<d->hashsize;t++) {
1474 dictentry_t*l = d->slots[t];
1476 /* check parent method's variables */
1478 if((v=find_variable(state, l->key))) {
1479 m->uses_parent_function = 1;
1480 state->method->uses_slots = 1;
1481 dict_put(xvars, l->key, 0);
1488 dict_destroy(m->unresolved_variables);
1489 m->unresolved_variables = 0;
1494 if(state->method->uses_slots) {
1495 state->method->slots = dict_new();
1497 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1498 if(!name) syntaxerror("internal error");
1499 if(v->index && dict_contains(xvars, name)) {
1502 if(v->is_inner_method) {
1503 v->is_inner_method->is_a_slot = 1;
1506 dict_put(state->method->slots, name, v);
1509 state->method->uses_slots = i;
1510 dict_destroy(state->vars);state->vars = 0;
1517 /*if(state->method->uses_parent_function){
1518 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1523 multiname_t*type2 = sig2mname(return_type);
1525 if(state->method->inner) {
1526 f = state->method->abc;
1527 abc_method_init(f, global->file, type2, 1);
1528 } else if(state->method->is_constructor) {
1529 f = abc_class_getconstructor(state->cls->abc, type2);
1530 } else if(!state->method->is_global) {
1531 namespace_t mname_ns = modifiers2access(mod);
1532 multiname_t mname = {QNAME, &mname_ns, 0, name};
1534 if(mod->flags&FLAG_STATIC)
1535 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1537 f = abc_class_method(state->cls->abc, type2, &mname);
1538 slot = f->trait->slot_id;
1540 namespace_t mname_ns = {state->method->info->access, state->package};
1541 multiname_t mname = {QNAME, &mname_ns, 0, name};
1543 f = abc_method_new(global->file, type2, 1);
1544 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1545 //abc_code_t*c = global->init->method->body->code;
1547 //flash doesn't seem to allow us to access function slots
1548 //state->method->info->slot = slot;
1550 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1551 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1552 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1553 if(params->varargs) f->flags |= METHOD_NEED_REST;
1557 for(p=params->list;p;p=p->next) {
1558 if(params->varargs && !p->next) {
1559 break; //varargs: omit last parameter in function signature
1561 multiname_t*m = sig2mname(p->param->type);
1562 list_append(f->parameters, m);
1563 if(p->param->value) {
1564 check_constant_against_type(p->param->type, p->param->value);
1565 opt=1;list_append(f->optional_parameters, p->param->value);
1567 syntaxerror("non-optional parameter not allowed after optional parameters");
1570 if(state->method->slots) {
1571 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1573 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1574 multiname_t*type = sig2mname(v->type);
1575 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1576 t->slot_id = v->index;
1581 check_code_for_break(body);
1583 /* Seems this works now.
1584 if(state->method->exceptions && state->method->uses_slots) {
1585 as3_warning("try/catch and activation not supported yet within the same method");
1589 f->body->code = body;
1590 f->body->exceptions = state->method->exceptions;
1591 } else { //interface
1593 syntaxerror("interface methods can't have a method body");
1603 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1608 void breakjumpsto(code_t*c, char*name, code_t*jump)
1611 if(c->opcode == OPCODE___BREAK__) {
1612 string_t*name2 = c->data[0];
1613 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1614 c->opcode = OPCODE_JUMP;
1621 void continuejumpsto(code_t*c, char*name, code_t*jump)
1624 if(c->opcode == OPCODE___CONTINUE__) {
1625 string_t*name2 = c->data[0];
1626 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1627 c->opcode = OPCODE_JUMP;
1635 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1636 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1637 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1639 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1641 if(!type1 || !type2)
1642 return registry_getanytype();
1643 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1644 return registry_getanytype();
1647 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1656 return registry_getanytype();
1658 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1663 return abc_coerce_a(c);
1667 // cast an "any" type to a specific type. subject to
1668 // runtime exceptions
1669 return abc_coerce2(c, &m);
1672 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1673 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1674 // allow conversion between number types
1675 return abc_coerce2(c, &m);
1677 //printf("%s.%s\n", from.package, from.name);
1678 //printf("%s.%s\n", to.package, to.name);
1680 classinfo_t*supertype = from;
1682 if(supertype == to) {
1683 // target type is one of from's superclasses
1684 return abc_coerce2(c, &m);
1687 while(supertype->interfaces[t]) {
1688 if(supertype->interfaces[t]==to) {
1689 // target type is one of from's interfaces
1690 return abc_coerce2(c, &m);
1694 supertype = supertype->superclass;
1696 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1698 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1700 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1703 as3_error("can't convert type %s%s%s to %s%s%s",
1704 from->package, from->package?".":"", from->name,
1705 to->package, to->package?".":"", to->name);
1710 code_t*defaultvalue(code_t*c, classinfo_t*type)
1712 if(TYPE_IS_INT(type)) {
1713 c = abc_pushbyte(c, 0);
1714 } else if(TYPE_IS_UINT(type)) {
1715 c = abc_pushuint(c, 0);
1716 } else if(TYPE_IS_FLOAT(type)) {
1718 } else if(TYPE_IS_BOOLEAN(type)) {
1719 c = abc_pushfalse(c);
1721 //c = abc_pushundefined(c);
1723 c = abc_pushnull(c);
1725 c = abc_coerce2(c, &m);
1730 char is_pushundefined(code_t*c)
1732 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1735 static const char* get_package_from_name(const char*name)
1737 /* try explicit imports */
1738 dictentry_t* e = dict_get_slot(state->imports, name);
1740 if(!strcmp(e->key, name)) {
1741 slotinfo_t*c = (slotinfo_t*)e->data;
1742 if(c) return c->package;
1748 static namespace_list_t*get_current_imports()
1750 namespace_list_t*searchlist = 0;
1752 list_append(searchlist, namespace_new_package(state->package));
1754 import_list_t*l = state->wildcard_imports;
1756 namespace_t*ns = namespace_new_package(l->import->package);
1757 list_append(searchlist, ns);
1760 list_append(searchlist, namespace_new_package(""));
1761 list_append(searchlist, namespace_new_package(internal_filename_package));
1765 static slotinfo_t* find_class(const char*name)
1769 c = registry_find(state->package, name);
1772 /* try explicit imports */
1773 dictentry_t* e = dict_get_slot(state->imports, name);
1776 if(!strcmp(e->key, name)) {
1777 c = (slotinfo_t*)e->data;
1783 /* try package.* imports */
1784 import_list_t*l = state->wildcard_imports;
1786 //printf("does package %s contain a class %s?\n", l->import->package, name);
1787 c = registry_find(l->import->package, name);
1792 /* try global package */
1793 c = registry_find("", name);
1796 /* try local "filename" package */
1797 c = registry_find(internal_filename_package, name);
1802 typedcode_t push_class(slotinfo_t*a)
1807 if(a->access == ACCESS_PACKAGEINTERNAL &&
1808 strcmp(a->package, state->package) &&
1809 strcmp(a->package, internal_filename_package)
1811 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1812 infotypename(a), a->name, a->package, state->package);
1815 if(a->kind != INFOTYPE_CLASS) {
1817 x.c = abc_findpropstrict2(x.c, &m);
1818 x.c = abc_getproperty2(x.c, &m);
1819 if(a->kind == INFOTYPE_METHOD) {
1820 methodinfo_t*f = (methodinfo_t*)a;
1821 x.t = TYPE_FUNCTION(f);
1823 varinfo_t*v = (varinfo_t*)a;
1827 classinfo_t*c = (classinfo_t*)a;
1829 x.c = abc_getglobalscope(x.c);
1830 x.c = abc_getslot(x.c, c->slot);
1833 x.c = abc_getlex2(x.c, &m);
1835 x.t = TYPE_CLASS(c);
1840 static char is_getlocal(code_t*c)
1842 if(!c || c->prev || c->next)
1844 return(c->opcode == OPCODE_GETLOCAL
1845 || c->opcode == OPCODE_GETLOCAL_0
1846 || c->opcode == OPCODE_GETLOCAL_1
1847 || c->opcode == OPCODE_GETLOCAL_2
1848 || c->opcode == OPCODE_GETLOCAL_3);
1850 static int getlocalnr(code_t*c)
1852 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1853 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1854 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1855 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1856 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1857 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1861 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1865 [prefix code] [read instruction]
1869 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1871 if(in && in->opcode == OPCODE_COERCE_A) {
1872 in = code_cutlast(in);
1875 syntaxerror("internal error");
1877 /* chop off read instruction */
1881 prefix = r->prev;r->prev = 0;
1887 char use_temp_var = readbefore;
1889 /* generate the write instruction, and maybe append a dup to the prefix code */
1890 code_t* write = abc_nop(0);
1891 if(r->opcode == OPCODE_GETPROPERTY) {
1892 write->opcode = OPCODE_SETPROPERTY;
1893 multiname_t*m = (multiname_t*)r->data[0];
1894 write->data[0] = multiname_clone(m);
1895 if(m->type == QNAME || m->type == MULTINAME) {
1897 prefix = abc_dup(prefix); // we need the object, too
1900 } else if(m->type == MULTINAMEL) {
1902 /* dupping two values on the stack requires 5 operations and one register-
1903 couldn't adobe just have given us a dup2? */
1904 int temp = gettempvar();
1905 prefix = abc_setlocal(prefix, temp);
1906 prefix = abc_dup(prefix);
1907 prefix = abc_getlocal(prefix, temp);
1908 prefix = abc_swap(prefix);
1909 prefix = abc_getlocal(prefix, temp);
1911 prefix = abc_kill(prefix, temp);
1915 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1917 } else if(r->opcode == OPCODE_GETSLOT) {
1918 write->opcode = OPCODE_SETSLOT;
1919 write->data[0] = r->data[0];
1921 prefix = abc_dup(prefix); // we need the object, too
1924 } else if(r->opcode == OPCODE_GETLOCAL) {
1925 write->opcode = OPCODE_SETLOCAL;
1926 write->data[0] = r->data[0];
1927 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1928 write->opcode = OPCODE_SETLOCAL_0;
1929 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1930 write->opcode = OPCODE_SETLOCAL_1;
1931 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1932 write->opcode = OPCODE_SETLOCAL_2;
1933 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1934 write->opcode = OPCODE_SETLOCAL_3;
1935 } else if(r->opcode == OPCODE_GETSUPER) {
1936 write->opcode = OPCODE_SETSUPER;
1937 multiname_t*m = (multiname_t*)r->data[0];
1938 write->data[0] = multiname_clone(m);
1941 syntaxerror("illegal lvalue: can't assign a value to this expression");
1948 /* with getproperty/getslot, we have to be extra careful not
1949 to execute the read code twice, as it might have side-effects
1950 (e.g. if the property is in fact a setter/getter combination)
1952 So read the value, modify it, and write it again,
1953 using prefix only once and making sure (by using a temporary
1954 register) that the return value is what we just wrote */
1955 temp = gettempvar();
1956 c = code_append(c, prefix);
1957 c = code_append(c, r);
1960 c = abc_setlocal(c, temp);
1962 c = code_append(c, middlepart);
1965 c = abc_setlocal(c, temp);
1967 c = code_append(c, write);
1968 c = abc_getlocal(c, temp);
1969 c = abc_kill(c, temp);
1971 /* if we're allowed to execute the read code twice *and*
1972 the middlepart doesn't modify the code, things are easier.
1974 code_t* r2 = code_dup(r);
1975 //c = code_append(c, prefix);
1976 parserassert(!prefix);
1977 c = code_append(c, r);
1978 c = code_append(c, middlepart);
1979 c = code_append(c, write);
1980 c = code_append(c, r2);
1983 /* even smaller version: overwrite the value without reading
1987 c = code_append(c, prefix);
1990 c = code_append(c, middlepart);
1991 c = code_append(c, write);
1992 c = code_append(c, r);
1995 temp = gettempvar();
1997 c = code_append(c, prefix);
1999 c = code_append(c, middlepart);
2001 c = abc_setlocal(c, temp);
2002 c = code_append(c, write);
2003 c = abc_getlocal(c, temp);
2004 c = abc_kill(c, temp);
2010 char is_break_or_jump(code_t*c)
2014 if(c->opcode == OPCODE_JUMP ||
2015 c->opcode == OPCODE___BREAK__ ||
2016 c->opcode == OPCODE___CONTINUE__ ||
2017 c->opcode == OPCODE_THROW ||
2018 c->opcode == OPCODE_RETURNVOID ||
2019 c->opcode == OPCODE_RETURNVALUE) {
2025 #define IS_FINALLY_TARGET(op) \
2026 ((op) == OPCODE___CONTINUE__ || \
2027 (op) == OPCODE___BREAK__ || \
2028 (op) == OPCODE_RETURNVOID || \
2029 (op) == OPCODE_RETURNVALUE || \
2030 (op) == OPCODE___RETHROW__)
2032 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
2034 #define NEED_EXTRA_STACK_ARG
2035 code_t*finally_label = abc_nop(0);
2036 NEW(lookupswitch_t, l);
2042 code_t*prev = i->prev;
2043 if(IS_FINALLY_TARGET(i->opcode)) {
2046 if(i->opcode == OPCODE___RETHROW__ ||
2047 i->opcode == OPCODE_RETURNVALUE) {
2048 if(i->opcode == OPCODE___RETHROW__)
2049 i->opcode = OPCODE_THROW;
2051 p = abc_coerce_a(p);
2052 p = abc_setlocal(p, tempvar);
2054 p = abc_pushbyte(p, count++);
2055 p = abc_jump(p, finally_label);
2056 code_t*target = p = abc_label(p);
2057 #ifdef NEED_EXTRA_STACK_ARG
2061 p = abc_getlocal(p, tempvar);
2064 p->next = i;i->prev = p;
2065 list_append(l->targets, target);
2071 c = abc_pushbyte(c, -1);
2072 c = code_append(c, finally_label);
2073 c = code_append(c, finally);
2075 #ifdef NEED_EXTRA_STACK_ARG
2078 c = abc_lookupswitch(c, l);
2079 c = l->def = abc_label(c);
2080 #ifdef NEED_EXTRA_STACK_ARG
2087 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
2091 code_t*prev = i->prev;
2092 if(IS_FINALLY_TARGET(i->opcode)) {
2093 if(i->opcode == OPCODE___RETHROW__)
2094 i->opcode = OPCODE_THROW;
2095 code_t*end = code_dup(finally);
2096 code_t*start = code_start(end);
2097 if(prev) prev->next = start;
2104 return code_append(c, finally);
2107 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
2113 int num_insertion_points=0;
2115 if(IS_FINALLY_TARGET(i->opcode))
2116 num_insertion_points++;
2123 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2128 int simple_version_cost = (1+num_insertion_points)*code_size;
2129 int lookup_version_cost = 4*num_insertion_points + 5;
2131 if(cantdup || simple_version_cost > lookup_version_cost) {
2132 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
2133 return insert_finally_lookup(c, finally, tempvar);
2135 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
2136 return insert_finally_simple(c, finally, tempvar);
2140 #define PASS1 }} if(as3_pass == 1) {{
2141 #define PASS1END }} if(as3_pass == 2) {{
2142 #define PASS2 }} if(as3_pass == 2) {{
2143 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
2144 #define PASS12END }} if(as3_pass == 2) {{
2145 #define PASS_ALWAYS }} {{
2149 /* Line 273 of skeleton.m4 */
2150 #line 2151 "parser.tab.c"
2157 typedef YYTYPE_UINT8 yytype_uint8;
2159 typedef unsigned char yytype_uint8;
2163 typedef YYTYPE_INT8 yytype_int8;
2164 #elif (defined __STDC__ || defined __C99__FUNC__ \
2165 || defined __cplusplus || defined _MSC_VER)
2166 typedef signed char yytype_int8;
2168 typedef short int yytype_int8;
2171 #ifdef YYTYPE_UINT16
2172 typedef YYTYPE_UINT16 yytype_uint16;
2174 typedef unsigned short int yytype_uint16;
2178 typedef YYTYPE_INT16 yytype_int16;
2180 typedef short int yytype_int16;
2184 # ifdef __SIZE_TYPE__
2185 # define YYSIZE_T __SIZE_TYPE__
2186 # elif defined size_t
2187 # define YYSIZE_T size_t
2188 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2189 || defined __cplusplus || defined _MSC_VER)
2190 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2191 # define YYSIZE_T size_t
2193 # define YYSIZE_T unsigned int
2197 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2202 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2203 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2207 # define YY_(msgid) msgid
2211 /* Suppress unused-variable warnings by "using" E. */
2212 #if ! defined lint || defined __GNUC__
2213 # define YYUSE(e) ((void) (e))
2215 # define YYUSE(e) /* empty */
2218 /* Identity function, used to suppress warnings about constant conditions. */
2220 # define YYID(n) (n)
2222 #if (defined __STDC__ || defined __C99__FUNC__ \
2223 || defined __cplusplus || defined _MSC_VER)
2236 #if ! defined yyoverflow || YYERROR_VERBOSE
2238 /* The parser invokes alloca or malloc; define the necessary symbols. */
2240 # ifdef YYSTACK_USE_ALLOCA
2241 # if YYSTACK_USE_ALLOCA
2243 # define YYSTACK_ALLOC __builtin_alloca
2244 # elif defined __BUILTIN_VA_ARG_INCR
2245 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2247 # define YYSTACK_ALLOC __alloca
2248 # elif defined _MSC_VER
2249 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2250 # define alloca _alloca
2252 # define YYSTACK_ALLOC alloca
2253 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2254 || defined __cplusplus || defined _MSC_VER)
2255 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2257 # define _STDLIB_H 1
2264 # ifdef YYSTACK_ALLOC
2265 /* Pacify GCC's `empty if-body' warning. */
2266 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2267 # ifndef YYSTACK_ALLOC_MAXIMUM
2268 /* The OS might guarantee only one guard page at the bottom of the stack,
2269 and a page size can be as small as 4096 bytes. So we cannot safely
2270 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2271 to allow for a few compiler-allocated temporary stack slots. */
2272 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2275 # define YYSTACK_ALLOC YYMALLOC
2276 # define YYSTACK_FREE YYFREE
2277 # ifndef YYSTACK_ALLOC_MAXIMUM
2278 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2280 # if (defined __cplusplus && ! defined _STDLIB_H \
2281 && ! ((defined YYMALLOC || defined malloc) \
2282 && (defined YYFREE || defined free)))
2283 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2285 # define _STDLIB_H 1
2289 # define YYMALLOC malloc
2290 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2291 || defined __cplusplus || defined _MSC_VER)
2292 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2296 # define YYFREE free
2297 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2298 || defined __cplusplus || defined _MSC_VER)
2299 void free (void *); /* INFRINGES ON USER NAME SPACE */
2303 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2306 #if (! defined yyoverflow \
2307 && (! defined __cplusplus \
2308 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2310 /* A type that is properly aligned for any stack member. */
2313 yytype_int16 yyss_alloc;
2317 /* The size of the maximum gap between one aligned stack and the next. */
2318 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2320 /* The size of an array large to enough to hold all stacks, each with
2322 # define YYSTACK_BYTES(N) \
2323 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2324 + YYSTACK_GAP_MAXIMUM)
2326 /* Copy COUNT objects from FROM to TO. The source and destination do
2329 # if defined __GNUC__ && 1 < __GNUC__
2330 # define YYCOPY(To, From, Count) \
2331 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2333 # define YYCOPY(To, From, Count) \
2337 for (yyi = 0; yyi < (Count); yyi++) \
2338 (To)[yyi] = (From)[yyi]; \
2344 /* Relocate STACK from its old location to the new one. The
2345 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2346 elements in the stack, and YYPTR gives the new location of the
2347 stack. Advance YYPTR to a properly aligned location for the next
2349 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2352 YYSIZE_T yynewbytes; \
2353 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2354 Stack = &yyptr->Stack_alloc; \
2355 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2356 yyptr += yynewbytes / sizeof (*yyptr); \
2362 /* YYFINAL -- State number of the termination state. */
2364 /* YYLAST -- Last index in YYTABLE. */
2367 /* YYNTOKENS -- Number of terminals. */
2368 #define YYNTOKENS 134
2369 /* YYNNTS -- Number of nonterminals. */
2371 /* YYNRULES -- Number of rules. */
2372 #define YYNRULES 309
2373 /* YYNRULES -- Number of states. */
2374 #define YYNSTATES 521
2376 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2377 #define YYUNDEFTOK 2
2378 #define YYMAXUTOK 363
2380 #define YYTRANSLATE(YYX) \
2381 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2383 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2384 static const yytype_uint8 yytranslate[] =
2386 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2389 2, 2, 2, 118, 2, 2, 2, 116, 108, 2,
2390 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2391 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2392 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2395 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2398 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2411 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2412 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2413 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2414 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2415 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2416 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2417 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2418 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2419 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2420 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2421 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2426 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2428 static const yytype_uint16 yyprhs[] =
2430 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2431 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2432 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2433 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2434 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2435 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2436 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2437 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2438 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2439 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2440 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2441 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2442 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2443 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2444 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2445 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2446 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2447 468, 470, 472, 474, 476, 478, 480, 482, 484, 485,
2448 487, 490, 495, 499, 501, 506, 509, 511, 513, 514,
2449 515, 528, 530, 531, 532, 543, 545, 549, 551, 553,
2450 555, 559, 561, 563, 565, 568, 569, 570, 574, 575,
2451 577, 579, 581, 584, 587, 588, 593, 598, 603, 606,
2452 608, 611, 613, 615, 619, 621, 623, 625, 627, 629,
2453 631, 633, 635, 637, 639, 641, 643, 645, 647, 649,
2454 651, 653, 655, 659, 663, 667, 671, 675, 679, 683,
2455 687, 691, 695, 698, 701, 705, 709, 713, 717, 721,
2456 725, 729, 733, 737, 741, 745, 749, 753, 757, 761,
2457 766, 769, 771, 775, 778, 783, 787, 788, 790, 794,
2458 800, 804, 808, 812, 816, 820, 824, 828, 832, 836,
2459 840, 844, 848, 854, 857, 860, 863, 866, 870, 873,
2460 878, 884, 888, 894, 898, 900, 903, 908, 913, 916
2463 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2464 static const yytype_int16 yyrhs[] =
2466 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2467 137, 138, -1, 186, -1, 198, -1, 196, -1, 217,
2468 -1, 207, -1, 147, -1, 148, 126, 136, 132, -1,
2469 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2470 198, -1, 196, -1, 217, -1, 207, -1, 147, -1,
2471 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2472 143, 145, -1, 145, -1, 189, -1, 159, -1, 160,
2473 -1, 161, -1, 163, -1, 171, -1, 154, -1, 183,
2474 -1, 179, -1, 239, -1, 247, -1, 246, -1, 126,
2475 143, 132, -1, 126, 132, -1, 99, -1, 144, -1,
2476 150, -1, 165, -1, 166, -1, 236, -1, 181, -1,
2477 148, 126, 143, 132, -1, 145, 99, -1, 145, -1,
2478 144, -1, 3, 89, 3, -1, 102, 237, -1, -1,
2479 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2480 152, -1, 3, 227, 149, -1, -1, 65, 146, -1,
2481 -1, 64, 122, 155, 238, 133, 146, 153, -1, -1,
2482 150, -1, 239, -1, 46, 3, 227, -1, 3, -1,
2483 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2484 238, 99, 239, 133, 146, -1, 158, 157, 68, 238,
2485 133, 146, -1, -1, 14, 122, 162, 238, 133, 146,
2486 -1, -1, 15, 164, 146, 14, 122, 238, 133, -1,
2487 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2488 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2489 168, 169, -1, 34, 240, 105, 142, -1, 62, 105,
2490 142, -1, -1, 16, 122, 172, 240, 133, 126, 167,
2491 132, -1, -1, 33, 122, 3, 227, 133, 174, 126,
2492 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2493 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2494 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2495 37, 238, -1, 37, -1, 39, 122, 238, 133, -1,
2496 182, 146, -1, 3, -1, 19, -1, 4, -1, 185,
2497 127, 184, -1, 184, -1, -1, 19, 185, 126, 187,
2498 139, 132, -1, -1, 19, 126, 188, 139, 132, -1,
2499 41, 223, -1, 41, 185, 127, 115, -1, -1, 191,
2500 -1, 192, -1, 191, 192, -1, 21, -1, 22, -1,
2501 20, -1, 38, -1, 47, -1, 49, -1, 48, -1,
2502 26, -1, 24, -1, 4, -1, -1, 54, 224, -1,
2503 -1, 54, 225, -1, -1, 17, 225, -1, -1, 190,
2504 31, 3, 193, 195, 126, 197, 200, 132, -1, -1,
2505 190, 44, 3, 194, 126, 199, 203, 132, -1, -1,
2506 201, -1, 202, -1, 201, 202, -1, 99, -1, 148,
2507 126, 200, 132, -1, 207, -1, 217, -1, 144, -1,
2508 -1, 204, -1, 205, -1, 204, 205, -1, 99, -1,
2509 46, 3, -1, 190, 27, 216, 3, 122, 213, 133,
2510 227, -1, 46, -1, 32, -1, -1, 190, 206, 208,
2511 209, -1, 210, -1, 209, 100, 210, -1, 3, 227,
2512 149, -1, -1, 102, 212, -1, 10, -1, 8, -1,
2513 9, -1, 12, -1, 5, -1, 56, -1, 55, -1,
2514 45, -1, 3, -1, -1, 214, -1, 93, 215, -1,
2515 214, 100, 93, 215, -1, 214, 100, 215, -1, 215,
2516 -1, 3, 105, 226, 211, -1, 3, 211, -1, 51,
2517 -1, 35, -1, -1, -1, 190, 27, 216, 3, 122,
2518 213, 133, 227, 126, 218, 142, 132, -1, 3, -1,
2519 -1, -1, 27, 219, 122, 213, 133, 227, 126, 221,
2520 142, 132, -1, 184, -1, 185, 127, 184, -1, 223,
2521 -1, 222, -1, 224, -1, 225, 100, 224, -1, 224,
2522 -1, 115, -1, 36, -1, 105, 226, -1, -1, -1,
2523 122, 229, 133, -1, -1, 230, -1, 231, -1, 237,
2524 -1, 230, 100, -1, 231, 237, -1, -1, 25, 240,
2525 232, 228, -1, 240, 122, 229, 133, -1, 53, 122,
2526 229, 133, -1, 63, 240, -1, 42, -1, 42, 238,
2527 -1, 240, -1, 240, -1, 238, 100, 240, -1, 238,
2528 -1, 220, -1, 241, -1, 244, -1, 233, -1, 235,
2529 -1, 234, -1, 6, -1, 10, -1, 11, -1, 8,
2530 -1, 9, -1, 12, -1, 5, -1, 29, -1, 56,
2531 -1, 55, -1, 45, -1, 240, 109, 240, -1, 240,
2532 110, 240, -1, 240, 75, 240, -1, 240, 76, 240,
2533 -1, 240, 71, 240, -1, 240, 72, 240, -1, 240,
2534 74, 240, -1, 240, 73, 240, -1, 240, 87, 240,
2535 -1, 240, 88, 240, -1, 118, 240, -1, 117, 240,
2536 -1, 240, 108, 240, -1, 240, 107, 240, -1, 240,
2537 106, 240, -1, 240, 96, 240, -1, 240, 95, 240,
2538 -1, 240, 94, 240, -1, 240, 114, 240, -1, 240,
2539 116, 240, -1, 240, 113, 240, -1, 240, 112, 240,
2540 -1, 240, 115, 240, -1, 240, 68, 240, -1, 240,
2541 69, 240, -1, 240, 40, 240, -1, 240, 67, 240,
2542 -1, 43, 122, 240, 133, -1, 36, 240, -1, 36,
2543 -1, 122, 238, 133, -1, 112, 240, -1, 240, 124,
2544 240, 125, -1, 124, 229, 125, -1, -1, 243, -1,
2545 237, 105, 237, -1, 243, 100, 237, 105, 237, -1,
2546 70, 242, 132, -1, 240, 80, 240, -1, 240, 79,
2547 240, -1, 240, 85, 240, -1, 240, 84, 240, -1,
2548 240, 86, 240, -1, 240, 78, 240, -1, 240, 77,
2549 240, -1, 240, 83, 240, -1, 240, 81, 240, -1,
2550 240, 82, 240, -1, 240, 102, 240, -1, 240, 104,
2551 240, 105, 240, -1, 240, 91, -1, 240, 90, -1,
2552 91, 240, -1, 90, 240, -1, 53, 127, 3, -1,
2553 128, 3, -1, 240, 127, 128, 3, -1, 240, 127,
2554 3, 89, 3, -1, 240, 92, 3, -1, 240, 127,
2555 122, 240, 133, -1, 240, 127, 3, -1, 3, -1,
2556 18, 3, -1, 18, 3, 102, 3, -1, 18, 3,
2557 102, 5, -1, 190, 245, -1, 23, 18, 224, -1
2560 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2561 static const yytype_uint16 yyrline[] =
2563 0, 2130, 2130, 2132, 2132, 2133, 2134, 2136, 2137, 2138,
2564 2139, 2140, 2141, 2142, 2143, 2145, 2145, 2146, 2147, 2149,
2565 2150, 2151, 2152, 2153, 2154, 2155, 2157, 2158, 2160, 2161,
2566 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173,
2567 2174, 2175, 2176, 2177, 2180, 2181, 2182, 2183, 2184, 2185,
2568 2186, 2187, 2191, 2192, 2196, 2203, 2215, 2216, 2220, 2221,
2569 2223, 2224, 2226, 2287, 2288, 2291, 2291, 2310, 2311, 2312,
2570 2317, 2321, 2326, 2327, 2329, 2349, 2397, 2397, 2416, 2416,
2571 2431, 2434, 2437, 2440, 2444, 2445, 2446, 2447, 2448, 2449,
2572 2451, 2462, 2465, 2465, 2496, 2496, 2521, 2521, 2537, 2538,
2573 2539, 2540, 2548, 2557, 2557, 2606, 2610, 2621, 2631, 2648,
2574 2649, 2650, 2652, 2653, 2655, 2655, 2657, 2657, 2660, 2674,
2575 2690, 2691, 2692, 2693, 2700, 2701, 2702, 2703, 2704, 2705,
2576 2706, 2707, 2708, 2709, 2713, 2714, 2716, 2717, 2719, 2720,
2577 2724, 2722, 2730, 2728, 2737, 2738, 2739, 2740, 2741, 2742,
2578 2743, 2744, 2746, 2752, 2753, 2754, 2755, 2756, 2757, 2760,
2579 2773, 2773, 2775, 2775, 2777, 2778, 2780, 2865, 2866, 2868,
2580 2869, 2870, 2871, 2872, 2874, 2875, 2876, 2877, 2889, 2893,
2581 2899, 2905, 2913, 2918, 2924, 2932, 2940, 2941, 2942, 2945,
2582 2944, 2961, 2962, 2964, 2963, 2987, 3006, 3020, 3021, 3023,
2583 3024, 3026, 3027, 3028, 3037, 3038, 3042, 3043, 3045, 3046,
2584 3047, 3049, 3053, 3054, 3059, 3060, 3096, 3142, 3163, 3184,
2585 3187, 3194, 3195, 3196, 3202, 3208, 3209, 3210, 3211, 3212,
2586 3214, 3216, 3233, 3238, 3241, 3244, 3247, 3250, 3253, 3256,
2587 3259, 3262, 3266, 3269, 3272, 3275, 3278, 3281, 3284, 3287,
2588 3291, 3302, 3320, 3325, 3330, 3335, 3340, 3345, 3349, 3353,
2589 3358, 3362, 3366, 3375, 3384, 3394, 3399, 3411, 3417, 3422,
2590 3428, 3434, 3438, 3440, 3451, 3460, 3467, 3468, 3470, 3476,
2591 3485, 3492, 3504, 3510, 3516, 3522, 3528, 3534, 3540, 3546,
2592 3559, 3570, 3577, 3590, 3617, 3631, 3645, 3659, 3674, 3681,
2593 3688, 3695, 3702, 3717, 3774, 3883, 3890, 3897, 3904, 3919
2597 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2598 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2599 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2600 static const char *const yytname[] =
2602 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2603 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2604 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2605 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2606 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2607 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2608 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2609 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2610 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2611 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2612 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2613 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2614 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2615 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2616 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2617 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2618 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2619 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2620 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2621 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2622 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2623 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2624 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2625 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2626 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2627 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2628 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2629 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2630 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2631 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2632 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2633 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2634 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH_HEAD",
2635 "WITH", "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9",
2636 "IMPORT", "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2637 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2638 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2639 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2640 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2641 "ONE_SLOT", "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2642 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2643 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2644 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2645 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2646 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2647 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2648 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2649 "NAMESPACE_ID", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2654 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2656 static const yytype_uint16 yytoknum[] =
2658 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2659 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2660 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2661 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2662 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2663 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2664 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2665 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2666 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2667 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2668 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2669 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2670 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2675 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2676 static const yytype_uint8 yyr1[] =
2678 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2679 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2680 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2681 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2682 144, 144, 144, 144, 145, 145, 145, 145, 145, 145,
2683 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2684 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2685 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2686 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2687 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2688 178, 178, 178, 180, 179, 181, 181, 182, 183, 184,
2689 184, 184, 185, 185, 187, 186, 188, 186, 189, 189,
2690 190, 190, 191, 191, 192, 192, 192, 192, 192, 192,
2691 192, 192, 192, 192, 193, 193, 194, 194, 195, 195,
2692 197, 196, 199, 198, 200, 200, 201, 201, 202, 202,
2693 202, 202, 202, 203, 203, 204, 204, 205, 205, 205,
2694 206, 206, 208, 207, 209, 209, 210, 211, 211, 212,
2695 212, 212, 212, 212, 212, 212, 212, 212, 213, 213,
2696 213, 213, 214, 214, 215, 215, 216, 216, 216, 218,
2697 217, 219, 219, 221, 220, 222, 223, 224, 224, 225,
2698 225, 226, 226, 226, 227, 227, 228, 228, 229, 229,
2699 229, 230, 231, 230, 232, 233, 234, 234, 235, 236,
2700 236, 237, 238, 238, 239, 240, 240, 240, 240, 240,
2701 240, 240, 241, 241, 241, 241, 241, 241, 241, 241,
2702 241, 241, 240, 240, 240, 240, 240, 240, 240, 240,
2703 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2704 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2705 240, 240, 240, 240, 240, 240, 242, 242, 243, 243,
2706 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2707 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2708 240, 240, 240, 240, 244, 245, 245, 245, 246, 247
2711 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2712 static const yytype_uint8 yyr2[] =
2714 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2715 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2716 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2717 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2718 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2719 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2720 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2721 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2722 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2723 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2724 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2725 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2726 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2727 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2728 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2729 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2730 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2731 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
2732 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2733 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2734 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2735 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2736 2, 1, 1, 3, 1, 1, 1, 1, 1, 1,
2737 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2738 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
2739 3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
2740 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
2741 2, 1, 3, 2, 4, 3, 0, 1, 3, 5,
2742 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2743 3, 3, 5, 2, 2, 2, 2, 3, 2, 4,
2744 5, 3, 5, 3, 1, 2, 4, 4, 2, 3
2747 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2748 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2749 means the default is an error. */
2750 static const yytype_uint16 yydefact[] =
2752 120, 304, 133, 237, 231, 234, 235, 232, 233, 236,
2753 0, 0, 78, 0, 0, 126, 124, 125, 0, 132,
2754 0, 131, 192, 238, 271, 127, 0, 0, 0, 241,
2755 128, 130, 129, 0, 0, 240, 239, 0, 0, 276,
2756 0, 0, 14, 0, 0, 0, 0, 208, 120, 0,
2757 0, 2, 120, 5, 54, 12, 0, 36, 67, 31,
2758 32, 33, 34, 35, 38, 120, 37, 7, 30, 0,
2759 121, 122, 9, 8, 11, 10, 225, 228, 230, 229,
2760 224, 39, 222, 226, 227, 41, 40, 0, 0, 72,
2761 76, 120, 92, 109, 111, 110, 116, 113, 0, 0,
2762 304, 214, 191, 0, 270, 0, 0, 118, 0, 103,
2763 208, 0, 218, 65, 0, 221, 0, 277, 296, 295,
2764 273, 253, 252, 0, 0, 209, 210, 211, 82, 0,
2765 106, 219, 0, 80, 44, 43, 120, 45, 29, 0,
2766 46, 47, 48, 50, 0, 49, 298, 1, 6, 120,
2767 304, 0, 68, 0, 0, 69, 53, 108, 0, 188,
2768 0, 161, 0, 160, 162, 308, 123, 0, 0, 0,
2769 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2770 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2771 294, 293, 0, 0, 0, 0, 0, 0, 0, 0,
2772 0, 0, 0, 0, 0, 0, 0, 0, 208, 0,
2773 0, 55, 73, 0, 0, 0, 120, 114, 0, 195,
2774 0, 198, 197, 309, 206, 178, 0, 0, 0, 27,
2775 0, 297, 0, 0, 280, 0, 272, 275, 212, 213,
2776 83, 205, 59, 60, 105, 220, 58, 81, 42, 28,
2777 120, 0, 205, 0, 0, 52, 305, 187, 186, 0,
2778 134, 136, 0, 223, 267, 268, 265, 266, 246, 247,
2779 249, 248, 244, 245, 287, 286, 282, 281, 289, 290,
2780 288, 284, 283, 285, 250, 251, 301, 259, 258, 257,
2781 291, 0, 256, 255, 254, 242, 243, 263, 262, 260,
2782 264, 261, 0, 0, 303, 0, 0, 0, 0, 0,
2783 25, 0, 120, 17, 23, 0, 20, 19, 22, 21,
2784 120, 112, 0, 208, 215, 167, 0, 0, 179, 183,
2785 107, 119, 196, 269, 0, 26, 217, 0, 278, 0,
2786 0, 57, 0, 120, 13, 57, 0, 0, 0, 0,
2787 0, 138, 0, 0, 205, 163, 164, 0, 216, 274,
2788 0, 0, 299, 120, 0, 0, 117, 18, 120, 0,
2789 0, 0, 0, 185, 180, 205, 0, 0, 120, 0,
2790 203, 202, 201, 204, 0, 62, 61, 51, 0, 120,
2791 306, 307, 178, 135, 0, 0, 199, 137, 142, 57,
2792 0, 292, 300, 302, 77, 0, 84, 0, 115, 207,
2793 177, 173, 170, 171, 169, 172, 176, 175, 174, 168,
2794 167, 0, 0, 182, 0, 0, 98, 102, 100, 104,
2795 63, 279, 56, 0, 75, 0, 139, 140, 0, 120,
2796 166, 165, 79, 0, 0, 0, 85, 88, 86, 24,
2797 184, 193, 181, 96, 0, 99, 101, 120, 66, 120,
2798 205, 120, 200, 0, 157, 0, 0, 120, 155, 0,
2799 27, 93, 89, 87, 27, 27, 205, 64, 74, 0,
2800 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2801 188, 143, 156, 27, 91, 0, 0, 0, 189, 120,
2802 141, 147, 0, 90, 194, 97, 94, 27, 0, 0,
2803 0, 0, 149, 178, 27, 190, 0, 0, 205, 95,
2807 /* YYDEFGOTO[NTERM-NUM]. */
2808 static const yytype_int16 yydefgoto[] =
2810 -1, 50, 51, 52, 53, 311, 312, 313, 334, 335,
2811 137, 138, 157, 314, 139, 385, 140, 246, 243, 458,
2812 57, 232, 153, 154, 58, 59, 60, 61, 213, 62,
2813 91, 141, 142, 445, 446, 447, 448, 63, 215, 426,
2814 510, 427, 475, 428, 429, 64, 229, 143, 65, 66,
2815 219, 220, 67, 320, 216, 68, 144, 70, 71, 351,
2816 353, 395, 316, 461, 317, 439, 484, 485, 486, 466,
2817 467, 468, 164, 318, 262, 355, 356, 373, 419, 327,
2818 328, 329, 259, 319, 507, 103, 76, 474, 221, 222,
2819 382, 397, 383, 341, 324, 124, 125, 126, 224, 77,
2820 78, 79, 145, 127, 80, 81, 82, 83, 116, 117,
2824 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2826 #define YYPACT_NINF -403
2827 static const yytype_int16 yypact[] =
2829 1674, -70, -403, -403, -403, -403, -403, -403, -403, -403,
2830 -15, -72, -403, -52, 19, -403, -403, -403, 80, -403,
2831 2094, -403, 99, -403, 2164, -403, -16, 42, -5, -403,
2832 -403, -403, -403, -1, 5, -403, -403, 2094, 13, 2094,
2833 2094, 2094, -403, 2094, 2094, 2094, 2094, 2094, 634, 123,
2834 128, -403, 504, -403, -403, -403, 8, -403, 2024, -403,
2835 -403, -403, -403, -403, -403, 1926, -403, -403, -403, 240,
2836 361, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2837 38, -403, 2569, -403, -403, -403, -403, 137, 20, -403,
2838 -403, 1926, -403, -403, -403, -403, -403, -403, -87, 42,
2839 -403, -67, -403, 21, -48, 2094, 79, -403, 2094, -403,
2840 2094, 138, -48, -403, 43, 2569, 76, 107, -48, -48,
2841 604, -48, -48, -29, 84, 110, 2094, -403, 210, 211,
2842 2094, 2094, 211, 212, -403, -403, 764, -403, -403, 85,
2843 -403, -403, -403, -403, 209, -403, -403, -403, -403, 1024,
2844 158, 232, -403, 139, 171, -403, 141, -403, 238, 12,
2845 239, -403, 247, -403, -403, -403, -403, 2094, 2094, 2094,
2846 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2847 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2848 -403, -403, 249, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2849 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2850 11, -403, -403, 2094, 229, 2094, 1154, -403, 42, 133,
2851 135, -403, -403, -403, 142, 15, -10, 90, 2189, 1800,
2852 130, -403, 2094, 2094, -403, 2094, -403, -403, -403, -403,
2853 -403, 161, 169, -403, 38, 38, 169, -403, -403, -403,
2854 1926, 149, 161, 2094, 2094, -403, 168, -403, -403, 280,
2855 231, 233, 286, 2569, 1016, 496, 496, 496, 322, 322,
2856 322, 322, 1016, 1016, 2569, 2569, 2569, 2569, 2569, 2569,
2857 2569, 2569, 2569, 2569, 2630, 2691, -403, 368, 368, 368,
2858 2569, 2386, 2752, 2813, 2874, 1016, 1016, 604, 604, -48,
2859 -48, -48, 157, 2447, 202, 2094, 291, 14, 173, 2260,
2860 -403, 165, 1284, -403, -403, 172, -403, -403, -403, -403,
2861 1154, -403, 42, 2094, -403, -43, 296, 167, 201, -403,
2862 -403, -403, 175, -403, 174, 1800, -403, 44, -403, 200,
2863 63, 207, 211, 894, -403, -27, -11, 46, 113, 189,
2864 42, 298, 42, 190, 161, 217, -403, 2094, -403, -403,
2865 315, 2323, -403, 1926, 2094, 193, -403, -403, 1154, 192,
2866 194, 75, 63, -403, -403, 161, 26, 96, 1926, 2094,
2867 -403, -403, -403, -403, 2094, -403, -403, -403, 2094, 1926,
2868 -403, -403, 15, -403, 42, 199, -403, 230, -403, 207,
2869 286, 2569, -403, -403, -403, 103, 24, 197, -403, -403,
2870 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2871 234, 205, 296, -403, 206, 213, -403, -403, 96, -403,
2872 268, -403, -403, 204, -403, 215, 230, -403, 42, 208,
2873 -403, -403, -403, 2094, 236, 214, 24, -403, -403, -403,
2874 -403, -403, -403, -403, 335, -403, -403, 1926, -403, 1926,
2875 161, 1414, -403, 339, -403, 316, 219, 227, -403, 2508,
2876 1800, -403, -403, -403, 1800, 1800, 161, -403, -403, 223,
2877 -403, -403, 226, 250, 221, 1544, -403, -403, -403, -403,
2878 12, -403, -403, 1800, -403, 222, 224, 225, -403, 1414,
2879 -403, -403, 354, -403, -403, -403, -403, 1800, 228, 241,
2880 235, 243, -403, 15, 1800, -403, 244, 246, 161, -403,
2884 /* YYPGOTO[NTERM-NUM]. */
2885 static const yytype_int16 yypgoto[] =
2887 -403, -403, 218, -403, 312, -299, -403, 61, -402, -31,
2888 1, -55, -85, 48, 2, -23, 321, 251, 58, -403,
2889 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2890 -403, -403, -403, -403, -403, -62, -60, -403, -403, -40,
2891 -403, -36, -403, -403, -403, -403, -403, -403, -403, -403,
2892 6, 50, -403, -403, -403, -403, 0, -403, 331, -403,
2893 -403, -403, 49, -403, 51, -403, -96, -403, -80, -403,
2894 -403, -61, -403, 3, -403, -403, 7, 9, -403, -376,
2895 -403, -311, -79, 4, -403, -403, -403, -403, -403, 388,
2896 -91, 25, 52, -239, -403, -98, -403, -403, -403, -403,
2897 -403, -403, -403, -34, -9, -49, -13, -403, -403, -403,
2898 -403, -403, -403, -403
2901 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2902 positive, shift that token. If negative, reduce the rule which
2903 number is the opposite. If zero, do what YYDEFACT says.
2904 If YYTABLE_NINF, syntax error. */
2905 #define YYTABLE_NINF -155
2906 static const yytype_int16 yytable[] =
2908 69, 54, 56, 74, 75, 114, 214, 101, 223, 155,
2909 156, 104, 230, 345, 304, 374, 435, 136, 325, 87,
2910 97, 369, 93, 94, 112, 192, 115, 118, 119, 325,
2911 120, 121, 122, 97, 115, 88, 156, 123, 95, 217,
2912 218, -70, 190, 191, 192, 93, 94, 257, 55, 72,
2913 90, 73, 69, 54, 56, 74, 75, 209, 443, 371,
2914 210, 95, 372, 258, 98, 423, 93, 94, 494, 407,
2915 92, 167, 495, 496, 208, 384, 209, 106, 410, 210,
2916 411, 249, 95, 412, 413, 414, 444, 415, 388, 167,
2917 167, 503, 239, 93, 94, 228, 226, 115, 99, 380,
2918 55, 72, 102, 73, 236, 511, 105, 89, 326, 95,
2919 302, 452, 517, 115, 167, 399, 390, 108, 391, 422,
2920 416, 244, 245, 330, 424, 109, 146, 110, 147, 425,
2921 417, 418, 111, 305, 149, 113, 421, 516, 167, 306,
2922 211, 231, 212, 225, 167, 96, 167, 363, 233, 69,
2923 54, 56, 74, 75, 263, 264, 265, 266, 267, 268,
2924 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
2925 279, 280, 281, 282, 283, 284, 285, 378, 381, 389,
2926 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
2927 297, 298, 299, 300, 301, 115, 303, 55, 72, 338,
2928 73, 339, 309, 167, 307, 331, 227, 235, 234, 237,
2929 238, 250, 2, 240, 241, 247, 69, 54, 315, 343,
2930 115, 479, 115, 337, 321, 370, -71, 158, 15, 16,
2931 17, 2, 19, 332, 21, 252, 442, 497, 253, 254,
2932 255, 256, 260, 308, 346, 347, 25, 15, 16, 17,
2933 261, 19, 286, 21, 463, 30, 31, 32, 158, 393,
2934 -113, 396, 322, 336, 323, 25, 340, 159, 158, 342,
2935 348, 160, 161, 463, 30, 31, 32, 159, 404, 520,
2936 249, 344, 161, 349, 162, 350, 163, 352, 249, 354,
2937 358, 360, 361, 430, 362, 364, 163, 366, 368, 325,
2938 375, 376, -112, 396, 434, 379, 377, 464, 156, 384,
2939 115, 392, 69, 54, 315, 394, 398, 400, 402, 406,
2940 69, 54, 315, 156, 408, 437, 464, 409, 332, 449,
2941 438, 451, 453, 457, 156, 454, 371, 459, 476, 433,
2942 -153, 470, 489, 490, 401, 431, 471, 462, 460, 498,
2943 432, 491, 499, 500, 504, 405, 505, 509, 506, -154,
2944 512, 514, 168, 513, 148, 2, 115, 251, 69, 54,
2945 315, 115, 477, 367, 478, 515, 440, 518, 519, 152,
2946 242, 15, 16, 17, 472, 19, 473, 21, 455, 169,
2947 170, 171, 456, -155, -155, -155, -155, 176, 177, 25,
2948 386, 166, 156, 508, 156, 501, 492, 441, 30, 31,
2949 32, 502, 190, 191, 192, 107, 193, 194, 195, 436,
2950 0, 0, 0, 0, 420, 0, 0, 0, 0, 450,
2951 469, 201, 202, 0, 203, 204, 205, 206, 207, 465,
2952 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
2953 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
2954 192, 483, 481, 482, 487, 488, 0, 465, 0, 0,
2955 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2956 203, 204, 205, 206, 207, 483, 481, 482, 487, 488,
2957 208, 0, 209, 0, 0, 210, 0, 0, 0, 483,
2958 481, 482, 487, 488, -4, 0, 0, 1, 2, 3,
2959 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2960 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2961 21, 0, 0, 23, 0, 0, 168, 0, 0, 0,
2962 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2963 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2964 36, 0, 0, -155, -155, -155, 0, 37, 38, 0,
2965 0, 176, 177, 0, 39, 0, 0, 0, 0, 0,
2966 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2967 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2968 0, 0, 0, 42, 0, 201, 202, 0, 203, 204,
2969 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2970 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2971 48, 0, 49, 0, 0, 0, -4, 1, 2, 3,
2972 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2973 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2974 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2975 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2976 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2977 36, 0, 0, 0, 190, 191, 192, 37, 38, 0,
2978 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2979 0, 0, 0, 0, 0, 0, 0, 0, 205, 206,
2980 207, 0, 0, 0, 40, 41, 208, 0, 209, 0,
2981 0, 210, 0, 134, 0, 0, 0, 0, 0, 0,
2982 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2983 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2984 48, 0, 49, 0, 0, 0, 135, 1, 2, 3,
2985 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2986 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2987 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2988 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2989 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2990 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2991 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2992 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2993 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2994 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2995 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2996 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2997 48, 0, 49, 0, 0, 0, 248, 1, 2, 3,
2998 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2999 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3000 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
3001 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
3002 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3003 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3004 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3005 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3006 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3007 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
3008 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3009 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3010 48, 0, 49, 0, 0, 0, 387, 1, 2, 3,
3011 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3012 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3013 21, 0, 0, 23, 0, 0, -155, 0, 0, 0,
3014 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3015 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3016 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3017 0, -155, -155, 0, 39, 0, 0, 0, 0, 0,
3018 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
3019 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
3020 0, 0, 0, 42, 0, -155, -155, 0, 203, 204,
3021 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
3022 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
3023 48, 0, 49, 0, 0, 0, -3, 1, 2, 3,
3024 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3025 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3026 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3027 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3028 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3029 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3030 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3031 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3032 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3033 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3034 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3035 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3036 48, 0, 49, 0, 0, 0, -15, 1, 2, 3,
3037 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3038 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3039 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3040 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3041 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3042 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3043 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3044 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3045 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3046 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3047 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3048 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3049 48, 0, 49, 0, 0, 0, -16, 1, 2, 3,
3050 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3051 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3052 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3053 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3054 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3055 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3056 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3057 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3058 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3059 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3060 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3061 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3062 48, 0, 49, 0, 0, 0, -144, 1, 2, 3,
3063 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3064 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3065 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3066 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3067 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3068 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3069 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3070 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3071 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3072 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3073 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3074 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3075 48, 0, 49, 0, -3, 0, -145, 1, 2, 3,
3076 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3077 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3078 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3079 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3080 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3081 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3082 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3083 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3084 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3085 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
3086 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3087 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3088 48, 0, 49, 1, 2, 3, 4, 0, 5, 6,
3089 7, 8, 9, 10, 11, 12, 13, 0, -120, 0,
3090 15, 16, 17, 18, 19, 20, 21, 22, 0, 23,
3091 128, 0, 129, 0, 0, 0, 24, 130, 25, 26,
3092 0, 27, 131, 28, 0, 29, 132, 30, 31, 32,
3093 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3094 0, 0, 0, 37, 38, 0, 133, 0, 0, 0,
3095 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3096 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3097 40, 41, 0, 0, 0, 0, 0, 0, 0, 134,
3098 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3099 0, 0, 43, 0, 0, 0, 0, 44, 45, 0,
3100 0, 0, 46, 0, 47, 0, 48, 0, 49, 1,
3101 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3102 11, 12, 13, 0, 0, 0, 15, 16, 17, 18,
3103 19, 20, 21, 22, 0, 23, 128, 0, 129, 0,
3104 0, 0, 24, 130, 25, 26, 0, 27, 131, 28,
3105 0, 29, 132, 30, 31, 32, 0, 0, 33, 34,
3106 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3107 38, 0, 133, 0, 0, 0, 39, 0, 0, 0,
3108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3109 0, 0, 0, 0, 0, 0, 40, 41, 0, 0,
3110 0, 0, 0, 0, 0, 134, 0, 150, 0, 3,
3111 4, 0, 5, 6, 7, 8, 9, 0, 43, 0,
3112 0, 0, 0, 44, 45, 0, 0, 0, 46, 20,
3113 47, 22, 48, 23, 49, 0, 129, 0, 0, 0,
3114 24, 0, 0, 0, 0, 0, 0, 28, 0, 29,
3115 151, 0, 0, 0, 0, 0, 0, 34, 0, 35,
3116 36, 0, 0, 0, 0, 0, 0, 37, 0, 0,
3117 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3118 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3119 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3120 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3121 24, 0, 0, 0, 0, 0, 43, 28, 0, 29,
3122 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3123 36, 0, 49, 0, 0, 0, 0, 37, 0, 0,
3124 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3125 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3126 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3127 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3128 0, 0, 0, 0, 0, 0, 43, 0, 0, 29,
3129 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3130 36, 0, 49, 0, 0, 0, 0, 0, 0, 168,
3131 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3133 0, 0, 0, 0, 40, 41, 169, 170, 171, 0,
3134 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3135 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3136 191, 192, 0, 193, 194, 195, 46, 0, 47, 0,
3137 0, 196, 49, 197, 0, 198, 199, 200, 201, 202,
3138 168, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3139 0, 208, 0, 209, 0, 0, 210, 0, 0, 0,
3140 0, 0, 333, 0, 0, 0, 0, 169, 170, 171,
3141 0, 172, 173, 174, 175, 176, 177, 178, 179, 180,
3142 181, 182, 183, 184, 185, 186, 187, 188, 189, 0,
3143 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3144 0, 0, 196, 168, 197, 0, 198, 199, 200, 201,
3145 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3146 0, 0, 208, 0, 209, 0, 0, 210, 0, 0,
3147 169, 170, 171, 365, 172, 173, 174, 175, 176, 177,
3148 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
3149 188, 189, 0, 190, 191, 192, 0, 193, 194, 195,
3150 0, 0, 0, 0, 0, 196, 168, 197, 0, 198,
3151 199, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3152 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3153 210, 0, 0, 169, 170, 171, 403, 172, 173, 174,
3154 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
3155 185, 186, 187, 188, 189, 0, 190, 191, 192, 0,
3156 193, 194, 195, 0, 0, 0, 0, 168, 196, 0,
3157 197, 357, 198, 199, 200, 201, 202, 0, 203, 204,
3158 205, 206, 207, 0, 0, 0, 0, 0, 208, 0,
3159 209, 0, 0, 210, 169, 170, 171, 0, 172, 173,
3160 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
3161 184, 185, 186, 187, 188, 189, 0, 190, 191, 192,
3162 0, 193, 194, 195, 0, 0, 0, 0, 168, 196,
3163 0, 197, 0, 198, 199, 200, 201, 202, 0, 203,
3164 204, 205, 206, 207, 0, 0, 0, 0, 0, 208,
3165 0, 209, 359, 0, 210, 169, 170, 171, 0, 172,
3166 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3167 183, 184, 185, 186, 187, 188, 189, 0, 190, 191,
3168 192, 0, 193, 194, 195, 0, 0, 0, 0, 168,
3169 196, 0, 197, 493, 198, 199, 200, 201, 202, 0,
3170 203, 204, 205, 206, 207, 0, 0, 0, 0, 0,
3171 208, 0, 209, 0, 0, 210, 169, 170, 171, 0,
3172 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3173 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3174 191, 192, 0, 193, 194, 195, 0, 0, 0, 0,
3175 168, 196, 0, 197, 0, 198, 199, 200, 201, 202,
3176 0, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3177 0, 208, 0, 209, 0, 0, 210, 169, 170, 171,
3178 0, 172, 173, 174, 175, 176, 177, 0, 0, 0,
3179 0, 0, 0, 0, 0, 0, 0, 0, 189, 0,
3180 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3181 0, 168, 0, 0, 0, 0, 198, 199, 200, 201,
3182 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3183 0, 0, 208, 0, 209, 0, 0, 210, 169, 170,
3184 171, 0, 172, 173, 174, 175, 176, 177, 0, 0,
3185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3186 0, 190, 191, 192, 0, 193, 194, 195, 0, 0,
3187 0, 0, 168, 0, 0, 0, 0, 198, 199, 200,
3188 201, 202, 0, 203, 204, 205, 206, 207, 0, 0,
3189 0, 0, 0, 208, 0, 209, 0, 0, 210, 169,
3190 170, 171, 0, 172, 173, 174, 175, 176, 177, 0,
3191 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3192 0, 0, 190, 191, 192, 0, 193, 194, 195, 0,
3193 0, 0, 0, 168, 0, 0, 0, 0, 0, 199,
3194 200, 201, 202, 0, 203, 204, 205, 206, 207, 0,
3195 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
3196 169, 170, 171, 0, 172, 173, 174, 175, 176, 177,
3197 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3198 0, 0, 0, 190, 191, 192, 0, 193, 194, 195,
3199 0, 0, 0, 0, 168, 0, 0, 0, 0, 0,
3200 0, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3201 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3202 210, 169, 170, 171, 0, 172, 173, 174, 175, 176,
3203 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3204 0, 0, 0, 0, 190, 191, 192, 0, 193, 194,
3205 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3206 0, 0, -155, 201, 202, 0, 203, 204, 205, 206,
3207 207, 0, 0, 0, 0, 0, 208, 0, 209, 0,
3211 static const yytype_int16 yycheck[] =
3213 0, 0, 0, 0, 0, 39, 91, 20, 99, 58,
3214 65, 24, 110, 252, 3, 326, 392, 48, 3, 89,
3215 14, 320, 3, 4, 37, 92, 39, 40, 41, 3,
3216 43, 44, 45, 27, 47, 50, 91, 46, 19, 126,
3217 127, 68, 90, 91, 92, 3, 4, 35, 0, 0,
3218 122, 0, 52, 52, 52, 52, 52, 124, 34, 102,
3219 127, 19, 105, 51, 14, 376, 3, 4, 470, 368,
3220 122, 100, 474, 475, 122, 102, 124, 27, 3, 127,
3221 5, 136, 19, 8, 9, 10, 62, 12, 99, 100,
3222 100, 493, 126, 3, 4, 108, 105, 110, 18, 36,
3223 52, 52, 3, 52, 133, 507, 122, 122, 93, 19,
3224 208, 422, 514, 126, 100, 354, 3, 122, 5, 93,
3225 45, 130, 131, 133, 28, 126, 3, 122, 0, 33,
3226 55, 56, 127, 122, 126, 122, 375, 513, 100, 128,
3227 3, 3, 122, 122, 100, 126, 100, 133, 105, 149,
3228 149, 149, 149, 149, 167, 168, 169, 170, 171, 172,
3229 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3230 183, 184, 185, 186, 187, 188, 189, 133, 115, 133,
3231 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3232 203, 204, 205, 206, 207, 208, 209, 149, 149, 233,
3233 149, 235, 215, 100, 213, 115, 127, 100, 132, 125,
3234 100, 126, 4, 3, 3, 3, 216, 216, 216, 250,
3235 233, 460, 235, 232, 218, 323, 68, 18, 20, 21,
3236 22, 4, 24, 227, 26, 3, 133, 476, 99, 68,
3237 99, 3, 3, 14, 253, 254, 38, 20, 21, 22,
3238 3, 24, 3, 26, 46, 47, 48, 49, 18, 350,
3239 127, 352, 127, 133, 122, 38, 105, 27, 18, 100,
3240 102, 31, 32, 46, 47, 48, 49, 27, 363, 518,
3241 335, 132, 32, 3, 44, 54, 46, 54, 343, 3,
3242 133, 89, 305, 378, 3, 122, 46, 132, 126, 3,
3243 133, 100, 127, 394, 389, 105, 132, 99, 363, 102,
3244 323, 122, 312, 312, 312, 17, 126, 100, 3, 126,
3245 320, 320, 320, 378, 132, 126, 99, 133, 322, 132,
3246 100, 126, 126, 65, 389, 122, 102, 133, 3, 388,
3247 132, 105, 3, 27, 357, 379, 132, 438, 133, 126,
3248 384, 132, 126, 132, 132, 364, 132, 3, 133, 132,
3249 132, 126, 40, 122, 52, 4, 379, 149, 368, 368,
3250 368, 384, 457, 312, 459, 132, 399, 133, 132, 58,
3251 129, 20, 21, 22, 446, 24, 446, 26, 428, 67,
3252 68, 69, 428, 71, 72, 73, 74, 75, 76, 38,
3253 342, 70, 457, 499, 459, 485, 467, 400, 47, 48,
3254 49, 490, 90, 91, 92, 27, 94, 95, 96, 394,
3255 -1, -1, -1, -1, 372, -1, -1, -1, -1, 420,
3256 443, 109, 110, -1, 112, 113, 114, 115, 116, 439,
3257 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3258 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3259 92, 461, 461, 461, 461, 461, -1, 467, -1, -1,
3260 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3261 112, 113, 114, 115, 116, 485, 485, 485, 485, 485,
3262 122, -1, 124, -1, -1, 127, -1, -1, -1, 499,
3263 499, 499, 499, 499, 0, -1, -1, 3, 4, 5,
3264 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3265 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3266 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3267 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3268 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3269 56, -1, -1, 67, 68, 69, -1, 63, 64, -1,
3270 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3271 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3272 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3273 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3274 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3275 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3276 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3277 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3278 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3279 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3280 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3281 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3282 56, -1, -1, -1, 90, 91, 92, 63, 64, -1,
3283 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3284 -1, -1, -1, -1, -1, -1, -1, -1, 114, 115,
3285 116, -1, -1, -1, 90, 91, 122, -1, 124, -1,
3286 -1, 127, -1, 99, -1, -1, -1, -1, -1, -1,
3287 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3288 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3289 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3290 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3291 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3292 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3293 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3294 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3295 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3296 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3297 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3298 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3299 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3300 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3301 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3302 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3303 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3304 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3305 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3306 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3307 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3308 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3309 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3310 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3311 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3312 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3313 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3314 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3315 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3316 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3317 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3318 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3319 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3320 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3321 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3322 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3323 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3324 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3325 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3326 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3327 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3328 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3329 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3330 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3331 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3332 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3333 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3334 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3335 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3337 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3338 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3339 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3340 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3341 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3342 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3343 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3344 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3345 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3346 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3347 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3348 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3349 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3350 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3351 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3352 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3353 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3354 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3355 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3356 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3357 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3358 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3359 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3360 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3361 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3362 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3363 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3364 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3365 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3366 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3367 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3368 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3369 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3370 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3371 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3372 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3373 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3374 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3375 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3376 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3377 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3378 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3379 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3380 126, -1, 128, -1, 0, -1, 132, 3, 4, 5,
3381 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3382 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3383 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3384 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3385 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3386 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3387 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3388 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3389 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3390 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3391 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3392 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3393 126, -1, 128, 3, 4, 5, 6, -1, 8, 9,
3394 10, 11, 12, 13, 14, 15, 16, -1, 18, -1,
3395 20, 21, 22, 23, 24, 25, 26, 27, -1, 29,
3396 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3397 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3398 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3399 -1, -1, -1, 63, 64, -1, 66, -1, -1, -1,
3400 70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3401 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3402 90, 91, -1, -1, -1, -1, -1, -1, -1, 99,
3403 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3404 -1, -1, 112, -1, -1, -1, -1, 117, 118, -1,
3405 -1, -1, 122, -1, 124, -1, 126, -1, 128, 3,
3406 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3407 14, 15, 16, -1, -1, -1, 20, 21, 22, 23,
3408 24, 25, 26, 27, -1, 29, 30, -1, 32, -1,
3409 -1, -1, 36, 37, 38, 39, -1, 41, 42, 43,
3410 -1, 45, 46, 47, 48, 49, -1, -1, 52, 53,
3411 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3412 64, -1, 66, -1, -1, -1, 70, -1, -1, -1,
3413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3414 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
3415 -1, -1, -1, -1, -1, 99, -1, 3, -1, 5,
3416 6, -1, 8, 9, 10, 11, 12, -1, 112, -1,
3417 -1, -1, -1, 117, 118, -1, -1, -1, 122, 25,
3418 124, 27, 126, 29, 128, -1, 32, -1, -1, -1,
3419 36, -1, -1, -1, -1, -1, -1, 43, -1, 45,
3420 46, -1, -1, -1, -1, -1, -1, 53, -1, 55,
3421 56, -1, -1, -1, -1, -1, -1, 63, -1, -1,
3422 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3423 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3424 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3425 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3426 36, -1, -1, -1, -1, -1, 112, 43, -1, 45,
3427 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3428 56, -1, 128, -1, -1, -1, -1, 63, -1, -1,
3429 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3430 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3431 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3432 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3433 -1, -1, -1, -1, -1, -1, 112, -1, -1, 45,
3434 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3435 56, -1, 128, -1, -1, -1, -1, -1, -1, 40,
3436 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3437 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3438 -1, -1, -1, -1, 90, 91, 67, 68, 69, -1,
3439 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3440 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3441 91, 92, -1, 94, 95, 96, 122, -1, 124, -1,
3442 -1, 102, 128, 104, -1, 106, 107, 108, 109, 110,
3443 40, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3444 -1, 122, -1, 124, -1, -1, 127, -1, -1, -1,
3445 -1, -1, 133, -1, -1, -1, -1, 67, 68, 69,
3446 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
3447 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
3448 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3449 -1, -1, 102, 40, 104, -1, 106, 107, 108, 109,
3450 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3451 -1, -1, 122, -1, 124, -1, -1, 127, -1, -1,
3452 67, 68, 69, 133, 71, 72, 73, 74, 75, 76,
3453 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3454 87, 88, -1, 90, 91, 92, -1, 94, 95, 96,
3455 -1, -1, -1, -1, -1, 102, 40, 104, -1, 106,
3456 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3457 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3458 127, -1, -1, 67, 68, 69, 133, 71, 72, 73,
3459 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3460 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3461 94, 95, 96, -1, -1, -1, -1, 40, 102, -1,
3462 104, 105, 106, 107, 108, 109, 110, -1, 112, 113,
3463 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3464 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3465 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3466 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3467 -1, 94, 95, 96, -1, -1, -1, -1, 40, 102,
3468 -1, 104, -1, 106, 107, 108, 109, 110, -1, 112,
3469 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3470 -1, 124, 125, -1, 127, 67, 68, 69, -1, 71,
3471 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3472 82, 83, 84, 85, 86, 87, 88, -1, 90, 91,
3473 92, -1, 94, 95, 96, -1, -1, -1, -1, 40,
3474 102, -1, 104, 105, 106, 107, 108, 109, 110, -1,
3475 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3476 122, -1, 124, -1, -1, 127, 67, 68, 69, -1,
3477 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3478 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3479 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3480 40, 102, -1, 104, -1, 106, 107, 108, 109, 110,
3481 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3482 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3483 -1, 71, 72, 73, 74, 75, 76, -1, -1, -1,
3484 -1, -1, -1, -1, -1, -1, -1, -1, 88, -1,
3485 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3486 -1, 40, -1, -1, -1, -1, 106, 107, 108, 109,
3487 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3488 -1, -1, 122, -1, 124, -1, -1, 127, 67, 68,
3489 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3490 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3491 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3492 -1, -1, 40, -1, -1, -1, -1, 106, 107, 108,
3493 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3494 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3495 68, 69, -1, 71, 72, 73, 74, 75, 76, -1,
3496 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3497 -1, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3498 -1, -1, -1, 40, -1, -1, -1, -1, -1, 107,
3499 108, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3500 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3501 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3502 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3503 -1, -1, -1, 90, 91, 92, -1, 94, 95, 96,
3504 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
3505 -1, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3506 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3507 127, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3508 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3509 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3510 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3511 -1, -1, 108, 109, 110, -1, 112, 113, 114, 115,
3512 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3516 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3517 symbol of state STATE-NUM. */
3518 static const yytype_uint8 yystos[] =
3520 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3521 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3522 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3523 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3524 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3525 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3526 160, 161, 163, 171, 179, 182, 183, 186, 189, 190,
3527 191, 192, 196, 198, 207, 217, 220, 233, 234, 235,
3528 238, 239, 240, 241, 244, 246, 247, 89, 50, 122,
3529 122, 164, 122, 3, 4, 19, 126, 184, 185, 18,
3530 3, 240, 3, 219, 240, 122, 185, 223, 122, 126,
3531 122, 127, 240, 122, 237, 240, 242, 243, 240, 240,
3532 240, 240, 240, 238, 229, 230, 231, 237, 30, 32,
3533 37, 42, 46, 66, 99, 132, 143, 144, 145, 148,
3534 150, 165, 166, 181, 190, 236, 3, 0, 138, 126,
3535 3, 46, 150, 156, 157, 239, 145, 146, 18, 27,
3536 31, 32, 44, 46, 206, 245, 192, 100, 40, 67,
3537 68, 69, 71, 72, 73, 74, 75, 76, 77, 78,
3538 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3539 90, 91, 92, 94, 95, 96, 102, 104, 106, 107,
3540 108, 109, 110, 112, 113, 114, 115, 116, 122, 124,
3541 127, 3, 122, 162, 146, 172, 188, 126, 127, 184,
3542 185, 222, 223, 224, 232, 122, 238, 127, 240, 180,
3543 229, 3, 155, 105, 132, 100, 133, 125, 100, 237,
3544 3, 3, 151, 152, 238, 238, 151, 3, 132, 145,
3545 126, 136, 3, 99, 68, 99, 3, 35, 51, 216,
3546 3, 3, 208, 240, 240, 240, 240, 240, 240, 240,
3547 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3548 240, 240, 240, 240, 240, 240, 3, 240, 240, 240,
3549 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3550 240, 240, 229, 240, 3, 122, 128, 238, 14, 240,
3551 99, 139, 140, 141, 147, 148, 196, 198, 207, 217,
3552 187, 184, 127, 122, 228, 3, 93, 213, 214, 215,
3553 133, 115, 184, 133, 142, 143, 133, 238, 237, 237,
3554 105, 227, 100, 143, 132, 227, 238, 238, 102, 3,
3555 54, 193, 54, 194, 3, 209, 210, 105, 133, 125,
3556 89, 240, 3, 133, 122, 133, 132, 141, 126, 139,
3557 229, 102, 105, 211, 215, 133, 100, 132, 133, 105,
3558 36, 115, 224, 226, 102, 149, 152, 132, 99, 133,
3559 3, 5, 122, 224, 17, 195, 224, 225, 126, 227,
3560 100, 240, 3, 133, 146, 238, 126, 139, 132, 133,
3561 3, 5, 8, 9, 10, 12, 45, 55, 56, 212,
3562 226, 227, 93, 215, 28, 33, 173, 175, 177, 178,
3563 146, 237, 237, 239, 146, 213, 225, 126, 100, 199,
3564 149, 210, 133, 34, 62, 167, 168, 169, 170, 132,
3565 211, 126, 215, 126, 122, 173, 175, 65, 153, 133,
3566 133, 197, 224, 46, 99, 190, 203, 204, 205, 240,
3567 105, 132, 169, 170, 221, 176, 3, 146, 146, 227,
3568 99, 144, 148, 190, 200, 201, 202, 207, 217, 3,
3569 27, 132, 205, 105, 142, 142, 142, 227, 126, 126,
3570 132, 202, 216, 142, 132, 132, 133, 218, 200, 3,
3571 174, 142, 132, 122, 126, 132, 213, 142, 133, 132,
3575 #define yyerrok (yyerrstatus = 0)
3576 #define yyclearin (yychar = YYEMPTY)
3577 #define YYEMPTY (-2)
3580 #define YYACCEPT goto yyacceptlab
3581 #define YYABORT goto yyabortlab
3582 #define YYERROR goto yyerrorlab
3585 /* Like YYERROR except do call yyerror. This remains here temporarily
3586 to ease the transition to the new meaning of YYERROR, for GCC.
3587 Once GCC version 2 has supplanted version 1, this can go. */
3589 #define YYFAIL goto yyerrlab
3591 #define YYRECOVERING() (!!yyerrstatus)
3593 #define YYBACKUP(Token, Value) \
3595 if (yychar == YYEMPTY && yylen == 1) \
3599 yytoken = YYTRANSLATE (yychar); \
3605 yyerror (YY_("syntax error: cannot back up")); \
3612 #define YYERRCODE 256
3615 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3616 If N is 0, then set CURRENT to the empty location which ends
3617 the previous symbol: RHS[0] (always defined). */
3619 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3620 #ifndef YYLLOC_DEFAULT
3621 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3625 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3626 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3627 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3628 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3632 (Current).first_line = (Current).last_line = \
3633 YYRHSLOC (Rhs, 0).last_line; \
3634 (Current).first_column = (Current).last_column = \
3635 YYRHSLOC (Rhs, 0).last_column; \
3641 /* YY_LOCATION_PRINT -- Print the location on the stream.
3642 This macro was not mandated originally: define only if we know
3643 we won't break user code: when these are the locations we know. */
3645 #ifndef YY_LOCATION_PRINT
3646 # if YYLTYPE_IS_TRIVIAL
3647 # define YY_LOCATION_PRINT(File, Loc) \
3648 fprintf (File, "%d.%d-%d.%d", \
3649 (Loc).first_line, (Loc).first_column, \
3650 (Loc).last_line, (Loc).last_column)
3652 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3657 /* YYLEX -- calling `yylex' with the right arguments. */
3660 # define YYLEX yylex (YYLEX_PARAM)
3662 # define YYLEX yylex ()
3665 /* Enable debugging if requested. */
3669 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3670 # define YYFPRINTF fprintf
3673 # define YYDPRINTF(Args) \
3679 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3683 YYFPRINTF (stderr, "%s ", Title); \
3684 yy_symbol_print (stderr, \
3686 YYFPRINTF (stderr, "\n"); \
3691 /*--------------------------------.
3692 | Print this symbol on YYOUTPUT. |
3693 `--------------------------------*/
3696 #if (defined __STDC__ || defined __C99__FUNC__ \
3697 || defined __cplusplus || defined _MSC_VER)
3699 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3702 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3705 YYSTYPE const * const yyvaluep;
3711 if (yytype < YYNTOKENS)
3712 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3724 /*--------------------------------.
3725 | Print this symbol on YYOUTPUT. |
3726 `--------------------------------*/
3728 #if (defined __STDC__ || defined __C99__FUNC__ \
3729 || defined __cplusplus || defined _MSC_VER)
3731 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3734 yy_symbol_print (yyoutput, yytype, yyvaluep)
3737 YYSTYPE const * const yyvaluep;
3740 if (yytype < YYNTOKENS)
3741 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3743 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3745 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3746 YYFPRINTF (yyoutput, ")");
3749 /*------------------------------------------------------------------.
3750 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3752 `------------------------------------------------------------------*/
3754 #if (defined __STDC__ || defined __C99__FUNC__ \
3755 || defined __cplusplus || defined _MSC_VER)
3757 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3760 yy_stack_print (yybottom, yytop)
3761 yytype_int16 *yybottom;
3762 yytype_int16 *yytop;
3765 YYFPRINTF (stderr, "Stack now");
3766 for (; yybottom <= yytop; yybottom++)
3768 int yybot = *yybottom;
3769 YYFPRINTF (stderr, " %d", yybot);
3771 YYFPRINTF (stderr, "\n");
3774 # define YY_STACK_PRINT(Bottom, Top) \
3777 yy_stack_print ((Bottom), (Top)); \
3781 /*------------------------------------------------.
3782 | Report that the YYRULE is going to be reduced. |
3783 `------------------------------------------------*/
3785 #if (defined __STDC__ || defined __C99__FUNC__ \
3786 || defined __cplusplus || defined _MSC_VER)
3788 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3791 yy_reduce_print (yyvsp, yyrule)
3796 int yynrhs = yyr2[yyrule];
3798 unsigned long int yylno = yyrline[yyrule];
3799 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3801 /* The symbols being reduced. */
3802 for (yyi = 0; yyi < yynrhs; yyi++)
3804 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3805 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3806 &(yyvsp[(yyi + 1) - (yynrhs)])
3808 YYFPRINTF (stderr, "\n");
3812 # define YY_REDUCE_PRINT(Rule) \
3815 yy_reduce_print (yyvsp, Rule); \
3818 /* Nonzero means print parse trace. It is left uninitialized so that
3819 multiple parsers can coexist. */
3821 #else /* !YYDEBUG */
3822 # define YYDPRINTF(Args)
3823 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3824 # define YY_STACK_PRINT(Bottom, Top)
3825 # define YY_REDUCE_PRINT(Rule)
3826 #endif /* !YYDEBUG */
3829 /* YYINITDEPTH -- initial size of the parser's stacks. */
3831 # define YYINITDEPTH 200
3834 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3835 if the built-in stack extension method is used).
3837 Do not make this value too large; the results are undefined if
3838 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3839 evaluated with infinite-precision integer arithmetic. */
3842 # define YYMAXDEPTH 10000
3850 # if defined __GLIBC__ && defined _STRING_H
3851 # define yystrlen strlen
3853 /* Return the length of YYSTR. */
3854 #if (defined __STDC__ || defined __C99__FUNC__ \
3855 || defined __cplusplus || defined _MSC_VER)
3857 yystrlen (const char *yystr)
3865 for (yylen = 0; yystr[yylen]; yylen++)
3873 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3874 # define yystpcpy stpcpy
3876 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3878 #if (defined __STDC__ || defined __C99__FUNC__ \
3879 || defined __cplusplus || defined _MSC_VER)
3881 yystpcpy (char *yydest, const char *yysrc)
3884 yystpcpy (yydest, yysrc)
3890 const char *yys = yysrc;
3892 while ((*yyd++ = *yys++) != '\0')
3901 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3902 quotes and backslashes, so that it's suitable for yyerror. The
3903 heuristic is that double-quoting is unnecessary unless the string
3904 contains an apostrophe, a comma, or backslash (other than
3905 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3906 null, do not copy; instead, return the length of what the result
3909 yytnamerr (char *yyres, const char *yystr)
3914 char const *yyp = yystr;
3921 goto do_not_strip_quotes;
3925 goto do_not_strip_quotes;
3938 do_not_strip_quotes: ;
3942 return yystrlen (yystr);
3944 return yystpcpy (yyres, yystr) - yyres;
3948 /* Copy into YYRESULT an error message about the unexpected token
3949 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3950 including the terminating null byte. If YYRESULT is null, do not
3951 copy anything; just return the number of bytes that would be
3952 copied. As a special case, return 0 if an ordinary "syntax error"
3953 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3954 size calculation. */
3956 yysyntax_error (char *yyresult, int yystate, int yychar)
3958 int yyn = yypact[yystate];
3960 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3964 int yytype = YYTRANSLATE (yychar);
3965 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3966 YYSIZE_T yysize = yysize0;
3968 int yysize_overflow = 0;
3969 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3970 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3974 /* This is so xgettext sees the translatable formats that are
3975 constructed on the fly. */
3976 YY_("syntax error, unexpected %s");
3977 YY_("syntax error, unexpected %s, expecting %s");
3978 YY_("syntax error, unexpected %s, expecting %s or %s");
3979 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3980 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3984 static char const yyunexpected[] = "syntax error, unexpected %s";
3985 static char const yyexpecting[] = ", expecting %s";
3986 static char const yyor[] = " or %s";
3987 char yyformat[sizeof yyunexpected
3988 + sizeof yyexpecting - 1
3989 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3990 * (sizeof yyor - 1))];
3991 char const *yyprefix = yyexpecting;
3993 /* Start YYX at -YYN if negative to avoid negative indexes in
3995 int yyxbegin = yyn < 0 ? -yyn : 0;
3997 /* Stay within bounds of both yycheck and yytname. */
3998 int yychecklim = YYLAST - yyn + 1;
3999 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4002 yyarg[0] = yytname[yytype];
4003 yyfmt = yystpcpy (yyformat, yyunexpected);
4005 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4006 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4008 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4012 yyformat[sizeof yyunexpected - 1] = '\0';
4015 yyarg[yycount++] = yytname[yyx];
4016 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4017 yysize_overflow |= (yysize1 < yysize);
4019 yyfmt = yystpcpy (yyfmt, yyprefix);
4023 yyf = YY_(yyformat);
4024 yysize1 = yysize + yystrlen (yyf);
4025 yysize_overflow |= (yysize1 < yysize);
4028 if (yysize_overflow)
4029 return YYSIZE_MAXIMUM;
4033 /* Avoid sprintf, as that infringes on the user's name space.
4034 Don't have undefined behavior even if the translation
4035 produced a string with the wrong number of "%s"s. */
4036 char *yyp = yyresult;
4038 while ((*yyp = *yyf) != '\0')
4040 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4042 yyp += yytnamerr (yyp, yyarg[yyi++]);
4055 #endif /* YYERROR_VERBOSE */
4058 /*-----------------------------------------------.
4059 | Release the memory associated to this symbol. |
4060 `-----------------------------------------------*/
4063 #if (defined __STDC__ || defined __C99__FUNC__ \
4064 || defined __cplusplus || defined _MSC_VER)
4066 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4069 yydestruct (yymsg, yytype, yyvaluep)
4079 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4089 /* Prevent warnings from -Wmissing-prototypes. */
4090 #ifdef YYPARSE_PARAM
4091 #if defined __STDC__ || defined __cplusplus
4092 int yyparse (void *YYPARSE_PARAM);
4096 #else /* ! YYPARSE_PARAM */
4097 #if defined __STDC__ || defined __cplusplus
4102 #endif /* ! YYPARSE_PARAM */
4105 /* The lookahead symbol. */
4108 /* The semantic value of the lookahead symbol. */
4111 /* Number of syntax errors so far. */
4116 /*-------------------------.
4117 | yyparse or yypush_parse. |
4118 `-------------------------*/
4120 #ifdef YYPARSE_PARAM
4121 #if (defined __STDC__ || defined __C99__FUNC__ \
4122 || defined __cplusplus || defined _MSC_VER)
4124 yyparse (void *YYPARSE_PARAM)
4127 yyparse (YYPARSE_PARAM)
4128 void *YYPARSE_PARAM;
4130 #else /* ! YYPARSE_PARAM */
4131 #if (defined __STDC__ || defined __C99__FUNC__ \
4132 || defined __cplusplus || defined _MSC_VER)
4145 /* Number of tokens to shift before error messages enabled. */
4148 /* The stacks and their tools:
4149 `yyss': related to states.
4150 `yyvs': related to semantic values.
4152 Refer to the stacks thru separate pointers, to allow yyoverflow
4153 to reallocate them elsewhere. */
4155 /* The state stack. */
4156 yytype_int16 yyssa[YYINITDEPTH];
4158 yytype_int16 *yyssp;
4160 /* The semantic value stack. */
4161 YYSTYPE yyvsa[YYINITDEPTH];
4165 YYSIZE_T yystacksize;
4169 /* Lookahead token as an internal (translated) token number. */
4171 /* The variables used to return semantic value and location from the
4176 /* Buffer for error messages, and its allocated size. */
4178 char *yymsg = yymsgbuf;
4179 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4182 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4184 /* The number of symbols on the RHS of the reduced rule.
4185 Keep to zero when no symbol should be popped. */
4191 yystacksize = YYINITDEPTH;
4193 YYDPRINTF ((stderr, "Starting parse\n"));
4198 yychar = YYEMPTY; /* Cause a token to be read. */
4200 /* Initialize stack pointers.
4201 Waste one element of value and location stack
4202 so that they stay on the same level as the state stack.
4203 The wasted elements are never initialized. */
4209 /*------------------------------------------------------------.
4210 | yynewstate -- Push a new state, which is found in yystate. |
4211 `------------------------------------------------------------*/
4213 /* In all cases, when you get here, the value and location stacks
4214 have just been pushed. So pushing a state here evens the stacks. */
4220 if (yyss + yystacksize - 1 <= yyssp)
4222 /* Get the current used size of the three stacks, in elements. */
4223 YYSIZE_T yysize = yyssp - yyss + 1;
4227 /* Give user a chance to reallocate the stack. Use copies of
4228 these so that the &'s don't force the real ones into
4230 YYSTYPE *yyvs1 = yyvs;
4231 yytype_int16 *yyss1 = yyss;
4233 /* Each stack pointer address is followed by the size of the
4234 data in use in that stack, in bytes. This used to be a
4235 conditional around just the two extra args, but that might
4236 be undefined if yyoverflow is a macro. */
4237 yyoverflow (YY_("memory exhausted"),
4238 &yyss1, yysize * sizeof (*yyssp),
4239 &yyvs1, yysize * sizeof (*yyvsp),
4245 #else /* no yyoverflow */
4246 # ifndef YYSTACK_RELOCATE
4247 goto yyexhaustedlab;
4249 /* Extend the stack our own way. */
4250 if (YYMAXDEPTH <= yystacksize)
4251 goto yyexhaustedlab;
4253 if (YYMAXDEPTH < yystacksize)
4254 yystacksize = YYMAXDEPTH;
4257 yytype_int16 *yyss1 = yyss;
4258 union yyalloc *yyptr =
4259 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4261 goto yyexhaustedlab;
4262 YYSTACK_RELOCATE (yyss_alloc, yyss);
4263 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4264 # undef YYSTACK_RELOCATE
4266 YYSTACK_FREE (yyss1);
4269 #endif /* no yyoverflow */
4271 yyssp = yyss + yysize - 1;
4272 yyvsp = yyvs + yysize - 1;
4274 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4275 (unsigned long int) yystacksize));
4277 if (yyss + yystacksize - 1 <= yyssp)
4281 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4283 if (yystate == YYFINAL)
4293 /* Do appropriate processing given the current state. Read a
4294 lookahead token if we need one and don't already have one. */
4296 /* First try to decide what to do without reference to lookahead token. */
4297 yyn = yypact[yystate];
4298 if (yyn == YYPACT_NINF)
4301 /* Not known => get a lookahead token if don't already have one. */
4303 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4304 if (yychar == YYEMPTY)
4306 YYDPRINTF ((stderr, "Reading a token: "));
4310 if (yychar <= YYEOF)
4312 yychar = yytoken = YYEOF;
4313 YYDPRINTF ((stderr, "Now at end of input.\n"));
4317 yytoken = YYTRANSLATE (yychar);
4318 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4321 /* If the proper action on seeing token YYTOKEN is to reduce or to
4322 detect an error, take that action. */
4324 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4329 if (yyn == 0 || yyn == YYTABLE_NINF)
4335 /* Count tokens shifted since error; after three, turn off error
4340 /* Shift the lookahead token. */
4341 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4343 /* Discard the shifted token. */
4352 /*-----------------------------------------------------------.
4353 | yydefault -- do the default action for the current state. |
4354 `-----------------------------------------------------------*/
4356 yyn = yydefact[yystate];
4362 /*-----------------------------.
4363 | yyreduce -- Do a reduction. |
4364 `-----------------------------*/
4366 /* yyn is the number of a rule to reduce with. */
4369 /* If YYLEN is nonzero, implement the default value of the action:
4372 Otherwise, the following line sets YYVAL to garbage.
4373 This behavior is undocumented and Bison
4374 users should not rely upon it. Assigning to YYVAL
4375 unconditionally makes the parser a bit smaller, and it avoids a
4376 GCC warning that YYVAL may be used uninitialized. */
4377 yyval = yyvsp[1-yylen];
4380 YY_REDUCE_PRINT (yyn);
4387 /* Line 1464 of skeleton.m4 */
4388 #line 2142 "parser.y"
4389 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4398 /* Line 1464 of skeleton.m4 */
4399 #line 2154 "parser.y"
4400 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4409 /* Line 1464 of skeleton.m4 */
4410 #line 2157 "parser.y"
4411 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4420 /* Line 1464 of skeleton.m4 */
4421 #line 2158 "parser.y"
4422 {(yyval.code)=code_new();}
4431 /* Line 1464 of skeleton.m4 */
4432 #line 2160 "parser.y"
4433 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4442 /* Line 1464 of skeleton.m4 */
4443 #line 2161 "parser.y"
4444 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4453 /* Line 1464 of skeleton.m4 */
4454 #line 2176 "parser.y"
4455 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4464 /* Line 1464 of skeleton.m4 */
4465 #line 2177 "parser.y"
4475 /* Line 1464 of skeleton.m4 */
4476 #line 2180 "parser.y"
4486 /* Line 1464 of skeleton.m4 */
4487 #line 2187 "parser.y"
4488 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4497 /* Line 1464 of skeleton.m4 */
4498 #line 2191 "parser.y"
4499 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4508 /* Line 1464 of skeleton.m4 */
4509 #line 2192 "parser.y"
4510 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4519 /* Line 1464 of skeleton.m4 */
4520 #line 2196 "parser.y"
4522 code_t**cc = &global->init->method->body->code;
4523 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4533 /* Line 1464 of skeleton.m4 */
4534 #line 2203 "parser.y"
4537 (yyval.number_int)=as3_pass;
4538 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4539 if(!conditionals || !dict_contains(conditionals, key)) {
4552 /* Line 1464 of skeleton.m4 */
4553 #line 2215 "parser.y"
4554 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4563 /* Line 1464 of skeleton.m4 */
4564 #line 2216 "parser.y"
4565 {(yyval.value).c=abc_pushundefined(0);
4566 (yyval.value).t=TYPE_ANY;
4576 /* Line 1464 of skeleton.m4 */
4577 #line 2220 "parser.y"
4578 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4587 /* Line 1464 of skeleton.m4 */
4588 #line 2221 "parser.y"
4589 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4598 /* Line 1464 of skeleton.m4 */
4599 #line 2223 "parser.y"
4600 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4609 /* Line 1464 of skeleton.m4 */
4610 #line 2224 "parser.y"
4611 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4620 /* Line 1464 of skeleton.m4 */
4621 #line 2227 "parser.y"
4624 if(variable_exists((yyvsp[(1) - (3)].id)))
4625 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4627 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4630 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4631 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4632 (yyvsp[(2) - (3)].classinfo)->name);
4637 if(state->method->uses_slots) {
4638 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4640 // this variable is stored in a slot
4642 v->type = (yyvsp[(2) - (3)].classinfo);
4648 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4651 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4653 if((yyvsp[(2) - (3)].classinfo)) {
4654 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4655 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4656 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4658 code_free((yyvsp[(3) - (3)].value).c);
4659 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4662 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4663 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4664 (yyval.code) = abc_coerce_a((yyval.code));
4666 // don't do anything
4667 code_free((yyvsp[(3) - (3)].value).c);
4668 code_free((yyval.code));
4674 (yyval.code) = abc_setslot((yyval.code), index);
4676 (yyval.code) = abc_setlocal((yyval.code), index);
4687 /* Line 1464 of skeleton.m4 */
4688 #line 2287 "parser.y"
4689 {(yyval.code) = code_new();}
4698 /* Line 1464 of skeleton.m4 */
4699 #line 2288 "parser.y"
4700 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4709 /* Line 1464 of skeleton.m4 */
4710 #line 2291 "parser.y"
4711 {PASS12 new_state();}
4720 /* Line 1464 of skeleton.m4 */
4721 #line 2291 "parser.y"
4724 (yyval.code) = code_new();
4725 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4726 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4728 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4729 if((yyvsp[(7) - (7)].code)) {
4730 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4732 myif->branch = (yyval.code) = abc_nop((yyval.code));
4733 if((yyvsp[(7) - (7)].code)) {
4734 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4735 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4737 (yyval.code) = var_block((yyval.code));
4748 /* Line 1464 of skeleton.m4 */
4749 #line 2310 "parser.y"
4750 {(yyval.code)=code_new();}
4759 /* Line 1464 of skeleton.m4 */
4760 #line 2317 "parser.y"
4762 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4763 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4773 /* Line 1464 of skeleton.m4 */
4774 #line 2321 "parser.y"
4777 (yyval.id)=(yyvsp[(1) - (1)].id);
4787 /* Line 1464 of skeleton.m4 */
4788 #line 2326 "parser.y"
4789 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4798 /* Line 1464 of skeleton.m4 */
4799 #line 2327 "parser.y"
4800 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4809 /* Line 1464 of skeleton.m4 */
4810 #line 2329 "parser.y"
4812 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4813 (yyval.code) = code_new();
4814 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4815 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4816 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4817 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4818 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4819 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4820 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4821 (yyval.code) = abc_jump((yyval.code), loopstart);
4822 code_t*out = (yyval.code) = abc_nop((yyval.code));
4823 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4824 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4827 (yyval.code) = var_block((yyval.code));
4838 /* Line 1464 of skeleton.m4 */
4839 #line 2349 "parser.y"
4841 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4843 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4846 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4847 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4848 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4849 int array = new_variable(tmp1name, 0, 0, 0);
4851 (yyval.code) = code_new();
4852 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4853 (yyval.code) = abc_coerce_a((yyval.code));
4854 (yyval.code) = abc_setlocal((yyval.code), array);
4855 (yyval.code) = abc_pushbyte((yyval.code), 0);
4856 (yyval.code) = abc_setlocal((yyval.code), it);
4858 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4860 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4861 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4862 (yyval.code) = abc_getlocal((yyval.code), array);
4863 (yyval.code) = abc_getlocal((yyval.code), it);
4864 if(!(yyvsp[(1) - (6)].for_start).each)
4865 (yyval.code) = abc_nextname((yyval.code));
4867 (yyval.code) = abc_nextvalue((yyval.code));
4868 (yyval.code) = converttype((yyval.code), 0, var->type);
4869 (yyval.code) = abc_setlocal((yyval.code), var->index);
4871 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4872 (yyval.code) = abc_jump((yyval.code), loopstart);
4874 code_t*out = (yyval.code) = abc_nop((yyval.code));
4875 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4876 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4880 (yyval.code) = var_block((yyval.code));
4895 /* Line 1464 of skeleton.m4 */
4896 #line 2397 "parser.y"
4897 {PASS12 new_state();}
4906 /* Line 1464 of skeleton.m4 */
4907 #line 2397 "parser.y"
4910 (yyval.code) = code_new();
4912 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4913 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4914 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4915 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4916 myjmp->branch = cont;
4917 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4918 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4919 code_t*out = (yyval.code) = abc_nop((yyval.code));
4920 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4921 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4923 (yyval.code) = var_block((yyval.code));
4934 /* Line 1464 of skeleton.m4 */
4935 #line 2416 "parser.y"
4936 {PASS12 new_state();}
4945 /* Line 1464 of skeleton.m4 */
4946 #line 2416 "parser.y"
4948 (yyval.code) = code_new();
4949 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4950 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4951 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4952 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4953 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4954 code_t*out = (yyval.code) = abc_nop((yyval.code));
4955 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4956 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4958 (yyval.code) = var_block((yyval.code));
4969 /* Line 1464 of skeleton.m4 */
4970 #line 2431 "parser.y"
4972 (yyval.code) = abc___break__(0, "");
4982 /* Line 1464 of skeleton.m4 */
4983 #line 2434 "parser.y"
4985 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4995 /* Line 1464 of skeleton.m4 */
4996 #line 2437 "parser.y"
4998 (yyval.code) = abc___continue__(0, "");
5008 /* Line 1464 of skeleton.m4 */
5009 #line 2440 "parser.y"
5011 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5021 /* Line 1464 of skeleton.m4 */
5022 #line 2444 "parser.y"
5032 /* Line 1464 of skeleton.m4 */
5033 #line 2445 "parser.y"
5034 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5043 /* Line 1464 of skeleton.m4 */
5044 #line 2446 "parser.y"
5045 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5054 /* Line 1464 of skeleton.m4 */
5055 #line 2447 "parser.y"
5056 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5065 /* Line 1464 of skeleton.m4 */
5066 #line 2448 "parser.y"
5067 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5076 /* Line 1464 of skeleton.m4 */
5077 #line 2449 "parser.y"
5078 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5087 /* Line 1464 of skeleton.m4 */
5088 #line 2451 "parser.y"
5090 (yyval.code) = abc_getlocal(0, state->switch_var);
5091 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
5092 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5093 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5094 if((yyval.code)->opcode != OPCODE___BREAK__) {
5095 (yyval.code) = abc___fallthrough__((yyval.code), "");
5097 code_t*e = (yyval.code) = abc_nop((yyval.code));
5108 /* Line 1464 of skeleton.m4 */
5109 #line 2462 "parser.y"
5111 (yyval.code) = (yyvsp[(3) - (3)].code);
5121 /* Line 1464 of skeleton.m4 */
5122 #line 2465 "parser.y"
5123 {PASS12 new_state();state->switch_var=alloc_local();}
5132 /* Line 1464 of skeleton.m4 */
5133 #line 2465 "parser.y"
5135 (yyval.code)=(yyvsp[(4) - (8)].value).c;
5136 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5137 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5139 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5140 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5142 code_t*c = (yyval.code),*lastblock=0;
5144 if(c->opcode == OPCODE_IFNE) {
5145 if(!c->next) syntaxerror("internal error in fallthrough handling");
5147 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5149 c->opcode = OPCODE_JUMP;
5150 c->branch = lastblock;
5152 /* fall through end of switch */
5153 c->opcode = OPCODE_NOP;
5159 (yyval.code) = var_block((yyval.code));
5170 /* Line 1464 of skeleton.m4 */
5171 #line 2496 "parser.y"
5172 {PASS12 new_state();
5173 state->exception_name=(yyvsp[(3) - (5)].id);
5174 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5175 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5185 /* Line 1464 of skeleton.m4 */
5186 #line 2501 "parser.y"
5188 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5189 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5191 NEW(abc_exception_t, e)
5192 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5193 e->var_name = multiname_clone(&name);
5194 (yyval.exception) = e;
5197 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5198 e->target = c = abc_nop(0);
5199 c = abc_setlocal(c, i);
5200 c = code_append(c, code_dup(state->method->scope_code));
5201 c = code_append(c, (yyvsp[(8) - (9)].code));
5215 /* Line 1464 of skeleton.m4 */
5216 #line 2521 "parser.y"
5217 {PASS12 new_state();state->exception_name=0;}
5226 /* Line 1464 of skeleton.m4 */
5227 #line 2521 "parser.y"
5229 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5230 if(!(yyvsp[(4) - (5)].code)) {
5231 (yyval.exception)=0;
5233 NEW(abc_exception_t, e)
5234 e->exc_type = 0; //all exceptions
5235 e->var_name = 0; //no name
5238 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5239 (yyval.exception) = e;
5251 /* Line 1464 of skeleton.m4 */
5252 #line 2537 "parser.y"
5253 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5262 /* Line 1464 of skeleton.m4 */
5263 #line 2538 "parser.y"
5264 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5273 /* Line 1464 of skeleton.m4 */
5274 #line 2539 "parser.y"
5275 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5284 /* Line 1464 of skeleton.m4 */
5285 #line 2540 "parser.y"
5287 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5288 (yyval.catch_list).finally = 0;
5289 if((yyvsp[(2) - (2)].exception)) {
5290 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5291 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5302 /* Line 1464 of skeleton.m4 */
5303 #line 2548 "parser.y"
5305 (yyval.catch_list).l=list_new();
5306 (yyval.catch_list).finally = 0;
5307 if((yyvsp[(1) - (1)].exception)) {
5308 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5309 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5320 /* Line 1464 of skeleton.m4 */
5321 #line 2557 "parser.y"
5322 {PASS12 new_state();
5323 state->method->has_exceptions=1;
5324 state->method->late_binding=1;//for invariant scope_code
5334 /* Line 1464 of skeleton.m4 */
5335 #line 2560 "parser.y"
5337 code_t*out = abc_nop(0);
5339 code_t*start = abc_nop(0);
5340 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5341 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5342 (yyval.code) = abc_jump((yyval.code), out);
5344 code_t*end = (yyval.code) = abc_nop((yyval.code));
5347 if((yyvsp[(6) - (6)].catch_list).finally)
5348 tmp = new_variable("__finally__", 0, 0, 0);
5350 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5353 abc_exception_t*e = l->abc_exception;
5355 (yyval.code) = code_append((yyval.code), e->target);
5356 (yyval.code) = abc_jump((yyval.code), out);
5358 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5360 e->target = (yyval.code) = abc_nop((yyval.code));
5361 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5362 (yyval.code) = abc___rethrow__((yyval.code));
5370 (yyval.code) = code_append((yyval.code), out);
5372 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5374 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5376 (yyval.code) = var_block((yyval.code));
5387 /* Line 1464 of skeleton.m4 */
5388 #line 2606 "parser.y"
5390 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5391 (yyval.code)=abc_throw((yyval.code));
5401 /* Line 1464 of skeleton.m4 */
5402 #line 2610 "parser.y"
5404 if(!state->exception_name)
5405 syntaxerror("re-throw only possible within a catch block");
5406 variable_t*v = find_variable(state, state->exception_name);
5407 (yyval.code)=code_new();
5408 (yyval.code)=abc_getlocal((yyval.code), v->index);
5409 (yyval.code)=abc_throw((yyval.code));
5419 /* Line 1464 of skeleton.m4 */
5420 #line 2621 "parser.y"
5423 if(state->method->has_exceptions) {
5424 int v = alloc_local();
5425 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5426 state->method->scope_code = abc_pushwith(state->method->scope_code);
5427 (yyval.value_list).number = v;
5429 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5439 /* Line 1464 of skeleton.m4 */
5440 #line 2631 "parser.y"
5442 /* remove getlocal;pushwith from scope code again */
5443 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5445 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5446 if(state->method->has_exceptions) {
5447 (yyval.code) = abc_dup((yyval.code));
5448 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5450 (yyval.code) = abc_pushwith((yyval.code));
5451 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5452 (yyval.code) = abc_popscope((yyval.code));
5463 /* Line 1464 of skeleton.m4 */
5464 #line 2649 "parser.y"
5465 {PASS12 (yyval.id)="package";}
5474 /* Line 1464 of skeleton.m4 */
5475 #line 2650 "parser.y"
5476 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5485 /* Line 1464 of skeleton.m4 */
5486 #line 2652 "parser.y"
5487 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5496 /* Line 1464 of skeleton.m4 */
5497 #line 2653 "parser.y"
5498 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5507 /* Line 1464 of skeleton.m4 */
5508 #line 2655 "parser.y"
5509 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5518 /* Line 1464 of skeleton.m4 */
5519 #line 2656 "parser.y"
5520 {PASS12 endpackage();(yyval.code)=0;}
5529 /* Line 1464 of skeleton.m4 */
5530 #line 2657 "parser.y"
5531 {PASS12 startpackage("");}
5540 /* Line 1464 of skeleton.m4 */
5541 #line 2658 "parser.y"
5542 {PASS12 endpackage();(yyval.code)=0;}
5551 /* Line 1464 of skeleton.m4 */
5552 #line 2660 "parser.y"
5555 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5556 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5557 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5559 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5561 syntaxerror("Couldn't import class\n");
5562 state_has_imports();
5563 dict_put(state->imports, c->name, c);
5564 import_toplevel(c->package);
5575 /* Line 1464 of skeleton.m4 */
5576 #line 2674 "parser.y"
5579 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5580 as3_schedule_package((yyvsp[(2) - (4)].id));
5584 i->package = (yyvsp[(2) - (4)].id);
5585 state_has_imports();
5586 list_append(state->wildcard_imports, i);
5587 import_toplevel(i->package);
5598 /* Line 1464 of skeleton.m4 */
5599 #line 2690 "parser.y"
5600 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5609 /* Line 1464 of skeleton.m4 */
5610 #line 2691 "parser.y"
5611 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5620 /* Line 1464 of skeleton.m4 */
5621 #line 2692 "parser.y"
5622 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5631 /* Line 1464 of skeleton.m4 */
5632 #line 2693 "parser.y"
5635 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5636 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5637 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5648 /* Line 1464 of skeleton.m4 */
5649 #line 2700 "parser.y"
5650 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5659 /* Line 1464 of skeleton.m4 */
5660 #line 2701 "parser.y"
5661 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5670 /* Line 1464 of skeleton.m4 */
5671 #line 2702 "parser.y"
5672 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5681 /* Line 1464 of skeleton.m4 */
5682 #line 2703 "parser.y"
5683 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5692 /* Line 1464 of skeleton.m4 */
5693 #line 2704 "parser.y"
5694 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5703 /* Line 1464 of skeleton.m4 */
5704 #line 2705 "parser.y"
5705 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5714 /* Line 1464 of skeleton.m4 */
5715 #line 2706 "parser.y"
5716 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5725 /* Line 1464 of skeleton.m4 */
5726 #line 2707 "parser.y"
5727 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5736 /* Line 1464 of skeleton.m4 */
5737 #line 2708 "parser.y"
5738 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5747 /* Line 1464 of skeleton.m4 */
5748 #line 2709 "parser.y"
5749 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5750 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5760 /* Line 1464 of skeleton.m4 */
5761 #line 2713 "parser.y"
5762 {PASS12 (yyval.classinfo)=0;}
5771 /* Line 1464 of skeleton.m4 */
5772 #line 2714 "parser.y"
5773 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5782 /* Line 1464 of skeleton.m4 */
5783 #line 2716 "parser.y"
5784 {PASS12 (yyval.classinfo_list)=list_new();}
5793 /* Line 1464 of skeleton.m4 */
5794 #line 2717 "parser.y"
5795 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5804 /* Line 1464 of skeleton.m4 */
5805 #line 2719 "parser.y"
5806 {PASS12 (yyval.classinfo_list)=list_new();}
5815 /* Line 1464 of skeleton.m4 */
5816 #line 2720 "parser.y"
5817 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5826 /* Line 1464 of skeleton.m4 */
5827 #line 2724 "parser.y"
5828 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5837 /* Line 1464 of skeleton.m4 */
5838 #line 2726 "parser.y"
5839 {PASS12 endclass();(yyval.code)=0;}
5848 /* Line 1464 of skeleton.m4 */
5849 #line 2730 "parser.y"
5850 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5851 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5860 /* Line 1464 of skeleton.m4 */
5861 #line 2733 "parser.y"
5862 {PASS12 endclass();(yyval.code)=0;}
5871 /* Line 1464 of skeleton.m4 */
5872 #line 2742 "parser.y"
5873 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
5882 /* Line 1464 of skeleton.m4 */
5883 #line 2746 "parser.y"
5885 code_t*c = state->cls->static_init->header;
5886 c = code_append(c, (yyvsp[(1) - (1)].code));
5887 state->cls->static_init->header = c;
5897 /* Line 1464 of skeleton.m4 */
5898 #line 2757 "parser.y"
5900 syntaxerror("variable declarations not allowed in interfaces");
5910 /* Line 1464 of skeleton.m4 */
5911 #line 2760 "parser.y"
5914 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5915 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5916 syntaxerror("invalid method modifiers: interface methods always need to be public");
5918 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5919 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5920 list_deep_free((yyvsp[(6) - (8)].params).list);
5930 /* Line 1464 of skeleton.m4 */
5931 #line 2775 "parser.y"
5932 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5941 /* Line 1464 of skeleton.m4 */
5942 #line 2775 "parser.y"
5943 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5952 /* Line 1464 of skeleton.m4 */
5953 #line 2777 "parser.y"
5954 {PASS12 (yyval.code)=0;}
5963 /* Line 1464 of skeleton.m4 */
5964 #line 2778 "parser.y"
5965 {PASS12 (yyval.code)=0;}
5974 /* Line 1464 of skeleton.m4 */
5975 #line 2781 "parser.y"
5978 int flags = slotstate_flags->flags;
5979 namespace_t ns = modifiers2access(slotstate_flags);
5983 varinfo_t* info = 0;
5985 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
5987 check_override(i, flags);
5989 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
5991 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
5993 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
5995 if(ns.name && ns.name[0]) {
5996 syntaxerror("namespaces not allowed on package-level variables");
5998 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6001 info->type = (yyvsp[(2) - (3)].classinfo);
6002 info->flags = flags;
6004 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6008 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6011 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
6013 trait_list_t**traits;
6017 ns.name = state->package;
6018 traits = &global->init->traits;
6019 code = &global->init->method->body->code;
6020 } else if(flags&FLAG_STATIC) {
6022 traits = &state->cls->abc->static_traits;
6023 code = &state->cls->static_init->header;
6025 // instance variable
6026 traits = &state->cls->abc->traits;
6027 code = &state->cls->init->header;
6031 if((yyvsp[(2) - (3)].classinfo)) {
6032 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6033 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
6035 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
6037 info->slot = t->slot_id;
6039 /* initalization code (if needed) */
6041 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
6042 c = abc_getlocal_0(c);
6043 c = code_append(c, (yyvsp[(3) - (3)].value).c);
6044 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
6045 c = abc_setslot(c, t->slot_id);
6048 *code = code_append(*code, c);
6050 if(slotstate_varconst==KW_CONST) {
6051 t->kind= TRAIT_CONST;
6065 /* Line 1464 of skeleton.m4 */
6066 #line 2865 "parser.y"
6067 {(yyval.constant)=0;}
6076 /* Line 1464 of skeleton.m4 */
6077 #line 2866 "parser.y"
6078 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
6087 /* Line 1464 of skeleton.m4 */
6088 #line 2868 "parser.y"
6089 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
6098 /* Line 1464 of skeleton.m4 */
6099 #line 2869 "parser.y"
6100 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6109 /* Line 1464 of skeleton.m4 */
6110 #line 2870 "parser.y"
6111 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
6120 /* Line 1464 of skeleton.m4 */
6121 #line 2871 "parser.y"
6122 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6131 /* Line 1464 of skeleton.m4 */
6132 #line 2872 "parser.y"
6133 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6142 /* Line 1464 of skeleton.m4 */
6143 #line 2874 "parser.y"
6144 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6153 /* Line 1464 of skeleton.m4 */
6154 #line 2875 "parser.y"
6155 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6164 /* Line 1464 of skeleton.m4 */
6165 #line 2876 "parser.y"
6166 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6175 /* Line 1464 of skeleton.m4 */
6176 #line 2877 "parser.y"
6178 if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) {
6179 (yyval.constant) = constant_new_float(__builtin_nan(""));
6181 as3_warning("Couldn't evaluate constant value of %s", (yyvsp[(1) - (1)].id));
6182 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
6193 /* Line 1464 of skeleton.m4 */
6194 #line 2889 "parser.y"
6197 memset(&(yyval.params),0,sizeof((yyval.params)));
6207 /* Line 1464 of skeleton.m4 */
6208 #line 2893 "parser.y"
6211 (yyval.params)=(yyvsp[(1) - (1)].params);
6221 /* Line 1464 of skeleton.m4 */
6222 #line 2899 "parser.y"
6225 memset(&(yyval.params),0,sizeof((yyval.params)));
6226 (yyval.params).varargs=1;
6227 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6237 /* Line 1464 of skeleton.m4 */
6238 #line 2905 "parser.y"
6241 (yyval.params) =(yyvsp[(1) - (4)].params);
6242 (yyval.params).varargs=1;
6243 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6253 /* Line 1464 of skeleton.m4 */
6254 #line 2913 "parser.y"
6257 (yyval.params) = (yyvsp[(1) - (3)].params);
6258 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6268 /* Line 1464 of skeleton.m4 */
6269 #line 2918 "parser.y"
6272 memset(&(yyval.params),0,sizeof((yyval.params)));
6273 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6283 /* Line 1464 of skeleton.m4 */
6284 #line 2924 "parser.y"
6287 (yyval.param) = rfx_calloc(sizeof(param_t));
6288 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6289 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6291 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6301 /* Line 1464 of skeleton.m4 */
6302 #line 2932 "parser.y"
6305 (yyval.param) = rfx_calloc(sizeof(param_t));
6306 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6307 (yyval.param)->type = TYPE_ANY;
6309 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6319 /* Line 1464 of skeleton.m4 */
6320 #line 2942 "parser.y"
6321 {PASS12 (yyval.token)=0;}
6330 /* Line 1464 of skeleton.m4 */
6331 #line 2945 "parser.y"
6332 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6341 /* Line 1464 of skeleton.m4 */
6342 #line 2946 "parser.y"
6345 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6347 if(!state->method->info) syntaxerror("internal error");
6349 code_t*c = method_header(state->method);
6350 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6352 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6354 list_deep_free((yyvsp[(6) - (12)].params).list);
6365 /* Line 1464 of skeleton.m4 */
6366 #line 2962 "parser.y"
6367 {PASS12 (yyval.id)=0;}
6376 /* Line 1464 of skeleton.m4 */
6377 #line 2964 "parser.y"
6378 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6387 /* Line 1464 of skeleton.m4 */
6388 #line 2965 "parser.y"
6391 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6393 methodinfo_t*f = state->method->info;
6394 if(!f || !f->kind) syntaxerror("internal error");
6396 code_t*c = method_header(state->method);
6397 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6399 int index = state->method->var_index;
6400 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6402 (yyval.value).c = abc_getlocal(0, index);
6403 (yyval.value).t = TYPE_FUNCTION(f);
6405 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6415 /* Line 1464 of skeleton.m4 */
6416 #line 2987 "parser.y"
6418 PASS1 NEW(unresolvedinfo_t,c);
6419 memset(c, 0, sizeof(*c));
6420 c->kind = INFOTYPE_UNRESOLVED;
6421 c->name = (yyvsp[(1) - (1)].id);
6422 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6424 c->nsset = get_current_imports();
6425 /* make the compiler look for this class in the current directory,
6427 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6429 (yyval.classinfo) = (classinfo_t*)c;
6431 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6432 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6433 (yyval.classinfo) = (classinfo_t*)s;
6443 /* Line 1464 of skeleton.m4 */
6444 #line 3006 "parser.y"
6446 PASS1 NEW(unresolvedinfo_t,c);
6447 memset(c, 0, sizeof(*c));
6448 c->kind = INFOTYPE_UNRESOLVED;
6449 c->package = (yyvsp[(1) - (3)].id);
6450 c->name = (yyvsp[(3) - (3)].id);
6451 (yyval.classinfo) = (classinfo_t*)c;
6453 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6454 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6455 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6456 (yyval.classinfo) = (classinfo_t*)s;
6466 /* Line 1464 of skeleton.m4 */
6467 #line 3023 "parser.y"
6468 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6477 /* Line 1464 of skeleton.m4 */
6478 #line 3024 "parser.y"
6479 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6488 /* Line 1464 of skeleton.m4 */
6489 #line 3026 "parser.y"
6490 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6499 /* Line 1464 of skeleton.m4 */
6500 #line 3027 "parser.y"
6501 {PASS12 (yyval.classinfo)=registry_getanytype();}
6510 /* Line 1464 of skeleton.m4 */
6511 #line 3028 "parser.y"
6512 {PASS12 (yyval.classinfo)=registry_getanytype();}
6521 /* Line 1464 of skeleton.m4 */
6522 #line 3037 "parser.y"
6523 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6532 /* Line 1464 of skeleton.m4 */
6533 #line 3038 "parser.y"
6534 {PASS12 (yyval.classinfo)=0;}
6543 /* Line 1464 of skeleton.m4 */
6544 #line 3042 "parser.y"
6545 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6554 /* Line 1464 of skeleton.m4 */
6555 #line 3043 "parser.y"
6556 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6565 /* Line 1464 of skeleton.m4 */
6566 #line 3045 "parser.y"
6567 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6576 /* Line 1464 of skeleton.m4 */
6577 #line 3049 "parser.y"
6578 {(yyval.value_list).number=1;
6579 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6589 /* Line 1464 of skeleton.m4 */
6590 #line 3053 "parser.y"
6591 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6600 /* Line 1464 of skeleton.m4 */
6601 #line 3054 "parser.y"
6603 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6604 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6614 /* Line 1464 of skeleton.m4 */
6615 #line 3060 "parser.y"
6617 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6618 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6620 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6621 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6622 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6623 (yyval.value).c = code_cutlast((yyval.value).c);
6624 (yyval.value).c = code_append((yyval.value).c, paramcode);
6625 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6626 multiname_destroy(name);
6627 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6628 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6629 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6630 multiname_t*name = t->name;
6631 (yyval.value).c = code_cutlast((yyval.value).c);
6632 (yyval.value).c = code_append((yyval.value).c, paramcode);
6633 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6635 (yyval.value).c = code_append((yyval.value).c, paramcode);
6636 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6639 (yyval.value).t = TYPE_ANY;
6640 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6641 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6643 (yyval.value).c = abc_coerce_a((yyval.value).c);
6644 (yyval.value).t = TYPE_ANY;
6655 /* Line 1464 of skeleton.m4 */
6656 #line 3096 "parser.y"
6659 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6660 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6661 (yyval.value).c = code_cutlast((yyval.value).c);
6663 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6665 (yyval.value).t = TYPE_ANY;
6666 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6667 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6668 (yyval.value).c = code_cutlast((yyval.value).c);
6669 (yyval.value).c = code_append((yyval.value).c, paramcode);
6670 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6671 multiname_destroy(name);
6672 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6673 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6674 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6675 if(t->kind!=TRAIT_METHOD) {
6676 //ok: flash allows to assign closures to members.
6678 multiname_t*name = t->name;
6679 (yyval.value).c = code_cutlast((yyval.value).c);
6680 (yyval.value).c = code_append((yyval.value).c, paramcode);
6681 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6682 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6683 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6684 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6685 (yyval.value).c = code_cutlast((yyval.value).c);
6686 (yyval.value).c = code_append((yyval.value).c, paramcode);
6687 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6688 multiname_destroy(name);
6690 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6691 (yyval.value).c = code_append((yyval.value).c, paramcode);
6692 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6695 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6696 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6698 (yyval.value).c = abc_coerce_a((yyval.value).c);
6699 (yyval.value).t = TYPE_ANY;
6710 /* Line 1464 of skeleton.m4 */
6711 #line 3142 "parser.y"
6713 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6714 if(!state->method) syntaxerror("super() not allowed outside of a function");
6715 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6717 (yyval.value).c = code_new();
6718 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6720 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6722 this is dependent on the control path, check this somewhere else
6723 if(state->method->has_super)
6724 syntaxerror("constructor may call super() only once");
6726 state->method->has_super = 1;
6728 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6729 (yyval.value).c = abc_pushundefined((yyval.value).c);
6730 (yyval.value).t = TYPE_ANY;
6740 /* Line 1464 of skeleton.m4 */
6741 #line 3163 "parser.y"
6743 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6744 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6745 (yyval.value).c = code_cutlast((yyval.value).c);
6747 multiname_t*name = 0;
6748 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6749 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6750 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6751 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6752 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6753 (yyval.value).c = code_cutlast((yyval.value).c);
6754 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6756 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6757 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6758 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6760 (yyval.value).t = TYPE_BOOLEAN;
6770 /* Line 1464 of skeleton.m4 */
6771 #line 3184 "parser.y"
6773 (yyval.code) = abc_returnvoid(0);
6783 /* Line 1464 of skeleton.m4 */
6784 #line 3187 "parser.y"
6786 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6787 (yyval.code) = abc_returnvalue((yyval.code));
6797 /* Line 1464 of skeleton.m4 */
6798 #line 3194 "parser.y"
6799 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6808 /* Line 1464 of skeleton.m4 */
6809 #line 3195 "parser.y"
6810 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6819 /* Line 1464 of skeleton.m4 */
6820 #line 3196 "parser.y"
6822 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6823 (yyval.value).c = cut_last_push((yyval.value).c);
6824 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6825 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6835 /* Line 1464 of skeleton.m4 */
6836 #line 3202 "parser.y"
6838 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6848 /* Line 1464 of skeleton.m4 */
6849 #line 3208 "parser.y"
6850 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6859 /* Line 1464 of skeleton.m4 */
6860 #line 3210 "parser.y"
6861 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6870 /* Line 1464 of skeleton.m4 */
6871 #line 3211 "parser.y"
6872 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6881 /* Line 1464 of skeleton.m4 */
6882 #line 3212 "parser.y"
6883 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6892 /* Line 1464 of skeleton.m4 */
6893 #line 3216 "parser.y"
6895 (yyval.value).c = 0;
6896 namespace_t ns = {ACCESS_PACKAGE, ""};
6897 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6898 if(!(yyvsp[(1) - (1)].regexp).options) {
6899 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6900 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6901 (yyval.value).c = abc_construct((yyval.value).c, 1);
6903 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6904 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6905 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6906 (yyval.value).c = abc_construct((yyval.value).c, 2);
6908 (yyval.value).t = TYPE_REGEXP;
6918 /* Line 1464 of skeleton.m4 */
6919 #line 3233 "parser.y"
6920 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6921 //MULTINAME(m, registry_getintclass());
6922 //$$.c = abc_coerce2($$.c, &m); // FIXME
6923 (yyval.value).t = TYPE_INT;
6933 /* Line 1464 of skeleton.m4 */
6934 #line 3238 "parser.y"
6935 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6936 (yyval.value).t = TYPE_INT;
6946 /* Line 1464 of skeleton.m4 */
6947 #line 3241 "parser.y"
6948 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6949 (yyval.value).t = TYPE_INT;
6959 /* Line 1464 of skeleton.m4 */
6960 #line 3244 "parser.y"
6961 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6962 (yyval.value).t = TYPE_UINT;
6972 /* Line 1464 of skeleton.m4 */
6973 #line 3247 "parser.y"
6974 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6975 (yyval.value).t = TYPE_FLOAT;
6985 /* Line 1464 of skeleton.m4 */
6986 #line 3250 "parser.y"
6987 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6988 (yyval.value).t = TYPE_STRING;
6998 /* Line 1464 of skeleton.m4 */
6999 #line 3253 "parser.y"
7000 {(yyval.value).c = abc_pushundefined(0);
7001 (yyval.value).t = TYPE_ANY;
7011 /* Line 1464 of skeleton.m4 */
7012 #line 3256 "parser.y"
7013 {(yyval.value).c = abc_pushtrue(0);
7014 (yyval.value).t = TYPE_BOOLEAN;
7024 /* Line 1464 of skeleton.m4 */
7025 #line 3259 "parser.y"
7026 {(yyval.value).c = abc_pushfalse(0);
7027 (yyval.value).t = TYPE_BOOLEAN;
7037 /* Line 1464 of skeleton.m4 */
7038 #line 3262 "parser.y"
7039 {(yyval.value).c = abc_pushnull(0);
7040 (yyval.value).t = TYPE_NULL;
7050 /* Line 1464 of skeleton.m4 */
7051 #line 3266 "parser.y"
7052 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c);
7053 (yyval.value).t = TYPE_BOOLEAN;
7063 /* Line 1464 of skeleton.m4 */
7064 #line 3269 "parser.y"
7065 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
7066 (yyval.value).t = TYPE_BOOLEAN;
7076 /* Line 1464 of skeleton.m4 */
7077 #line 3272 "parser.y"
7078 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c);
7079 (yyval.value).t = TYPE_BOOLEAN;
7089 /* Line 1464 of skeleton.m4 */
7090 #line 3275 "parser.y"
7091 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
7092 (yyval.value).t = TYPE_BOOLEAN;
7102 /* Line 1464 of skeleton.m4 */
7103 #line 3278 "parser.y"
7104 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
7105 (yyval.value).t = TYPE_BOOLEAN;
7115 /* Line 1464 of skeleton.m4 */
7116 #line 3281 "parser.y"
7117 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
7118 (yyval.value).t = TYPE_BOOLEAN;
7128 /* Line 1464 of skeleton.m4 */
7129 #line 3284 "parser.y"
7130 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c);
7131 (yyval.value).t = TYPE_BOOLEAN;
7141 /* Line 1464 of skeleton.m4 */
7142 #line 3287 "parser.y"
7143 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c);
7144 (yyval.value).t = TYPE_BOOLEAN;
7154 /* Line 1464 of skeleton.m4 */
7155 #line 3291 "parser.y"
7156 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
7157 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7158 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7159 (yyval.value).c = abc_dup((yyval.value).c);
7160 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
7161 (yyval.value).c = cut_last_push((yyval.value).c);
7162 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7163 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7164 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7165 jmp->branch = label;
7175 /* Line 1464 of skeleton.m4 */
7176 #line 3302 "parser.y"
7178 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
7179 /*printf("%08x:\n",$1.t);
7180 code_dump($1.c, 0, 0, "", stdout);
7181 printf("%08x:\n",$3.t);
7182 code_dump($3.c, 0, 0, "", stdout);
7183 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
7184 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7185 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7186 (yyval.value).c = abc_dup((yyval.value).c);
7187 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7188 (yyval.value).c = cut_last_push((yyval.value).c);
7189 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7190 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7191 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7192 jmp->branch = label;
7202 /* Line 1464 of skeleton.m4 */
7203 #line 3320 "parser.y"
7204 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7205 (yyval.value).c = abc_not((yyval.value).c);
7206 (yyval.value).t = TYPE_BOOLEAN;
7216 /* Line 1464 of skeleton.m4 */
7217 #line 3325 "parser.y"
7218 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7219 (yyval.value).c = abc_bitnot((yyval.value).c);
7220 (yyval.value).t = TYPE_INT;
7230 /* Line 1464 of skeleton.m4 */
7231 #line 3330 "parser.y"
7232 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7233 (yyval.value).c = abc_bitand((yyval.value).c);
7234 (yyval.value).t = TYPE_INT;
7244 /* Line 1464 of skeleton.m4 */
7245 #line 3335 "parser.y"
7246 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7247 (yyval.value).c = abc_bitxor((yyval.value).c);
7248 (yyval.value).t = TYPE_INT;
7258 /* Line 1464 of skeleton.m4 */
7259 #line 3340 "parser.y"
7260 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7261 (yyval.value).c = abc_bitor((yyval.value).c);
7262 (yyval.value).t = TYPE_INT;
7272 /* Line 1464 of skeleton.m4 */
7273 #line 3345 "parser.y"
7274 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7275 (yyval.value).c = abc_rshift((yyval.value).c);
7276 (yyval.value).t = TYPE_INT;
7286 /* Line 1464 of skeleton.m4 */
7287 #line 3349 "parser.y"
7288 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7289 (yyval.value).c = abc_urshift((yyval.value).c);
7290 (yyval.value).t = TYPE_INT;
7300 /* Line 1464 of skeleton.m4 */
7301 #line 3353 "parser.y"
7302 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7303 (yyval.value).c = abc_lshift((yyval.value).c);
7304 (yyval.value).t = TYPE_INT;
7314 /* Line 1464 of skeleton.m4 */
7315 #line 3358 "parser.y"
7316 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7317 (yyval.value).c = abc_divide((yyval.value).c);
7318 (yyval.value).t = TYPE_NUMBER;
7328 /* Line 1464 of skeleton.m4 */
7329 #line 3362 "parser.y"
7330 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7331 (yyval.value).c = abc_modulo((yyval.value).c);
7332 (yyval.value).t = TYPE_NUMBER;
7342 /* Line 1464 of skeleton.m4 */
7343 #line 3366 "parser.y"
7344 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7345 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7346 (yyval.value).c = abc_add_i((yyval.value).c);
7347 (yyval.value).t = TYPE_INT;
7349 (yyval.value).c = abc_add((yyval.value).c);
7350 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7361 /* Line 1464 of skeleton.m4 */
7362 #line 3375 "parser.y"
7363 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7364 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7365 (yyval.value).c = abc_subtract_i((yyval.value).c);
7366 (yyval.value).t = TYPE_INT;
7368 (yyval.value).c = abc_subtract((yyval.value).c);
7369 (yyval.value).t = TYPE_NUMBER;
7380 /* Line 1464 of skeleton.m4 */
7381 #line 3384 "parser.y"
7382 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7383 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7384 (yyval.value).c = abc_multiply_i((yyval.value).c);
7385 (yyval.value).t = TYPE_INT;
7387 (yyval.value).c = abc_multiply((yyval.value).c);
7388 (yyval.value).t = TYPE_NUMBER;
7399 /* Line 1464 of skeleton.m4 */
7400 #line 3394 "parser.y"
7401 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7402 (yyval.value).c = abc_in((yyval.value).c);
7403 (yyval.value).t = TYPE_BOOLEAN;
7413 /* Line 1464 of skeleton.m4 */
7414 #line 3399 "parser.y"
7415 {char use_astype=0; // flash player's astype works differently than astypelate
7416 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7417 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7418 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7419 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7421 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7422 (yyval.value).c = abc_astypelate((yyval.value).c);
7423 (yyval.value).t = TYPE_ANY;
7434 /* Line 1464 of skeleton.m4 */
7435 #line 3412 "parser.y"
7436 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7437 (yyval.value).c = abc_instanceof((yyval.value).c);
7438 (yyval.value).t = TYPE_BOOLEAN;
7448 /* Line 1464 of skeleton.m4 */
7449 #line 3417 "parser.y"
7450 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7451 (yyval.value).c = abc_istypelate((yyval.value).c);
7452 (yyval.value).t = TYPE_BOOLEAN;
7462 /* Line 1464 of skeleton.m4 */
7463 #line 3422 "parser.y"
7465 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7466 (yyval.value).c = abc_typeof((yyval.value).c);
7467 (yyval.value).t = TYPE_STRING;
7477 /* Line 1464 of skeleton.m4 */
7478 #line 3428 "parser.y"
7480 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7481 (yyval.value).c = abc_pushundefined((yyval.value).c);
7482 (yyval.value).t = TYPE_ANY;
7492 /* Line 1464 of skeleton.m4 */
7493 #line 3434 "parser.y"
7494 { (yyval.value).c = abc_pushundefined(0);
7495 (yyval.value).t = TYPE_ANY;
7505 /* Line 1464 of skeleton.m4 */
7506 #line 3438 "parser.y"
7507 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7516 /* Line 1464 of skeleton.m4 */
7517 #line 3440 "parser.y"
7519 (yyval.value)=(yyvsp[(2) - (2)].value);
7520 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7521 (yyval.value).c=abc_negate_i((yyval.value).c);
7522 (yyval.value).t = TYPE_INT;
7524 (yyval.value).c=abc_negate((yyval.value).c);
7525 (yyval.value).t = TYPE_NUMBER;
7536 /* Line 1464 of skeleton.m4 */
7537 #line 3451 "parser.y"
7539 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7540 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7542 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7543 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7544 (yyval.value).t = 0; // array elements have unknown type
7554 /* Line 1464 of skeleton.m4 */
7555 #line 3460 "parser.y"
7557 (yyval.value).c = code_new();
7558 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7559 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).number);
7560 (yyval.value).t = registry_getarrayclass();
7570 /* Line 1464 of skeleton.m4 */
7571 #line 3467 "parser.y"
7572 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7581 /* Line 1464 of skeleton.m4 */
7582 #line 3468 "parser.y"
7583 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7592 /* Line 1464 of skeleton.m4 */
7593 #line 3470 "parser.y"
7595 (yyval.value_list).cc = 0;
7596 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7597 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7598 (yyval.value_list).number = 2;
7608 /* Line 1464 of skeleton.m4 */
7609 #line 3476 "parser.y"
7611 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7612 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7613 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7614 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7624 /* Line 1464 of skeleton.m4 */
7625 #line 3485 "parser.y"
7627 (yyval.value).c = code_new();
7628 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7629 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).number/2);
7630 (yyval.value).t = registry_getobjectclass();
7640 /* Line 1464 of skeleton.m4 */
7641 #line 3492 "parser.y"
7643 code_t*c = (yyvsp[(3) - (3)].value).c;
7644 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7645 c=abc_multiply_i(c);
7649 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
7650 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7651 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7661 /* Line 1464 of skeleton.m4 */
7662 #line 3504 "parser.y"
7664 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
7665 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
7666 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7667 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7677 /* Line 1464 of skeleton.m4 */
7678 #line 3510 "parser.y"
7680 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
7681 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
7682 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7683 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7693 /* Line 1464 of skeleton.m4 */
7694 #line 3516 "parser.y"
7696 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7697 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7698 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7699 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7709 /* Line 1464 of skeleton.m4 */
7710 #line 3522 "parser.y"
7712 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7713 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7714 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7715 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7725 /* Line 1464 of skeleton.m4 */
7726 #line 3528 "parser.y"
7728 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7729 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7730 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7731 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7741 /* Line 1464 of skeleton.m4 */
7742 #line 3534 "parser.y"
7744 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
7745 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7746 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7747 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7757 /* Line 1464 of skeleton.m4 */
7758 #line 3540 "parser.y"
7760 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7761 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7762 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7763 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7773 /* Line 1464 of skeleton.m4 */
7774 #line 3546 "parser.y"
7776 code_t*c = (yyvsp[(3) - (3)].value).c;
7778 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7782 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7785 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7786 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7796 /* Line 1464 of skeleton.m4 */
7797 #line 3559 "parser.y"
7798 { code_t*c = (yyvsp[(3) - (3)].value).c;
7799 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7800 c=abc_subtract_i(c);
7803 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7806 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7807 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7817 /* Line 1464 of skeleton.m4 */
7818 #line 3570 "parser.y"
7820 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7821 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7822 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7823 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7833 /* Line 1464 of skeleton.m4 */
7834 #line 3577 "parser.y"
7836 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7837 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7838 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7839 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7840 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7841 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7842 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7843 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7844 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7845 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7855 /* Line 1464 of skeleton.m4 */
7856 #line 3590 "parser.y"
7858 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7859 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7860 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7861 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7862 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7863 (yyval.value).c = abc_getlocal(0, nr);
7864 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7865 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7866 (yyval.value).c = abc_getlocal(0, nr);
7867 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7868 } else syntaxerror("internal error");
7870 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7871 c=abc_increment_i(c);
7877 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7878 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7879 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7890 /* Line 1464 of skeleton.m4 */
7891 #line 3617 "parser.y"
7893 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7894 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7895 c=abc_decrement_i(c);
7901 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7902 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7903 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7913 /* Line 1464 of skeleton.m4 */
7914 #line 3631 "parser.y"
7916 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7917 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7918 c=abc_increment_i(c);
7924 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7925 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7926 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7936 /* Line 1464 of skeleton.m4 */
7937 #line 3645 "parser.y"
7939 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7940 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7941 c=abc_decrement_i(c);
7947 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7948 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7949 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7959 /* Line 1464 of skeleton.m4 */
7960 #line 3660 "parser.y"
7961 { if(!state->cls->info)
7962 syntaxerror("super keyword not allowed outside a class");
7963 classinfo_t*t = state->cls->info->superclass;
7964 if(!t) t = TYPE_OBJECT;
7966 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7968 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7969 (yyval.value).c = 0;
7970 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7971 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7972 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7982 /* Line 1464 of skeleton.m4 */
7983 #line 3674 "parser.y"
7986 (yyval.value).c = abc_pushundefined(0);
7987 (yyval.value).t = 0;
7988 as3_warning("ignored @ operator");
7998 /* Line 1464 of skeleton.m4 */
7999 #line 3681 "parser.y"
8001 // child attribute TODO
8002 (yyval.value).c = abc_pushundefined(0);
8003 (yyval.value).t = 0;
8004 as3_warning("ignored .@ operator");
8014 /* Line 1464 of skeleton.m4 */
8015 #line 3688 "parser.y"
8017 // namespace declaration TODO
8018 (yyval.value).c = abc_pushundefined(0);
8019 (yyval.value).t = 0;
8020 as3_warning("ignored :: operator");
8030 /* Line 1464 of skeleton.m4 */
8031 #line 3695 "parser.y"
8034 (yyval.value).c = abc_pushundefined(0);
8035 (yyval.value).t = 0;
8036 as3_warning("ignored .. operator");
8046 /* Line 1464 of skeleton.m4 */
8047 #line 3702 "parser.y"
8050 (yyval.value).c = abc_pushundefined(0);
8051 (yyval.value).t = 0;
8052 as3_warning("ignored .() operator");
8062 /* Line 1464 of skeleton.m4 */
8063 #line 3717 "parser.y"
8065 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
8066 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
8068 if(TYPE_IS_CLASS(t) && t->data) {
8073 if(t->subtype==INFOTYPE_UNRESOLVED) {
8074 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8076 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8078 if(f && !is_static != !(f->flags&FLAG_STATIC))
8080 if(f && f->slot && !noslot) {
8081 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8084 as3_warning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8087 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8088 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8090 /* determine type */
8091 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8092 if(!(yyval.value).t)
8093 (yyval.value).c = abc_coerce_a((yyval.value).c);
8094 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
8095 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
8096 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8098 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8100 (yyval.value) = push_class(a);
8101 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8102 registry_ispackage(package2)) {
8103 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
8104 (yyval.value).c->data[0] = string_new4(package2);
8105 (yyval.value).t = 0;
8107 syntaxerror("couldn't resolve %s", package2);
8110 /* when resolving a property on an unknown type, we do know the
8111 name of the property (and don't seem to need the package), but
8112 we need to make avm2 try out all access modes */
8113 as3_warning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8114 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8115 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8116 (yyval.value).c = abc_coerce_a((yyval.value).c);
8117 (yyval.value).t = registry_getanytype();
8128 /* Line 1464 of skeleton.m4 */
8129 #line 3774 "parser.y"
8132 /* Queue unresolved identifiers for checking against the parent
8133 function's variables.
8134 We consider everything which is not a local variable "unresolved".
8135 This encompasses class names, members of the surrounding class
8136 etc. which is *correct* because local variables of the parent function
8139 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
8140 unknown_variable((yyvsp[(1) - (1)].id));
8143 /* let the compiler know that it might want to check the current directory/package
8144 for this identifier- maybe there's a file $1.as defining $1. */
8145 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8148 (yyval.value).t = 0;
8149 (yyval.value).c = 0;
8154 /* look at variables */
8155 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
8156 // $1 is a local variable
8157 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
8158 (yyval.value).t = v->type;
8161 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
8162 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
8163 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
8164 (yyval.value).t = v->type;
8168 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
8170 /* look at current class' members */
8171 if(!state->method->inner &&
8173 (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
8174 (f->flags&FLAG_STATIC) >= i_am_static)
8176 // $1 is a function in this class
8177 int var_is_static = (f->flags&FLAG_STATIC);
8179 if(f->kind == INFOTYPE_METHOD) {
8180 (yyval.value).t = TYPE_FUNCTION(f);
8182 (yyval.value).t = f->type;
8184 if(var_is_static && !i_am_static) {
8185 /* access to a static member from a non-static location.
8186 do this via findpropstrict:
8187 there doesn't seem to be any non-lookup way to access
8188 static properties of a class */
8189 state->method->late_binding = 1;
8190 (yyval.value).t = f->type;
8191 namespace_t ns = {f->access, f->package};
8192 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8193 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8194 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8196 } else if(f->slot>0) {
8197 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8198 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8201 namespace_t ns = {f->access, f->package};
8202 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8203 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8204 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8209 /* look at actual classes, in the current package and imported */
8210 if((a = find_class((yyvsp[(1) - (1)].id)))) {
8211 (yyval.value) = push_class(a);
8215 /* look through package prefixes */
8216 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) ||
8217 registry_ispackage((yyvsp[(1) - (1)].id))) {
8218 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
8219 (yyval.value).t = 0;
8223 /* unknown object, let the avm2 resolve it */
8225 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
8226 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
8227 state->method->late_binding = 1;
8229 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
8231 (yyval.value).t = 0;
8232 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8233 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8244 /* Line 1464 of skeleton.m4 */
8245 #line 3883 "parser.y"
8248 NEW(namespace_decl_t,n);
8249 n->name = (yyvsp[(2) - (2)].id);
8250 n->url = (yyvsp[(2) - (2)].id);
8251 (yyval.namespace_decl)=n;
8261 /* Line 1464 of skeleton.m4 */
8262 #line 3890 "parser.y"
8265 NEW(namespace_decl_t,n);
8266 n->name = (yyvsp[(2) - (4)].id);
8267 n->url = (yyvsp[(4) - (4)].id);
8268 (yyval.namespace_decl)=n;
8278 /* Line 1464 of skeleton.m4 */
8279 #line 3897 "parser.y"
8282 NEW(namespace_decl_t,n);
8283 n->name = (yyvsp[(2) - (4)].id);
8284 n->url = (yyvsp[(4) - (4)].str).str;
8285 (yyval.namespace_decl)=n;
8295 /* Line 1464 of skeleton.m4 */
8296 #line 3904 "parser.y"
8299 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8301 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8302 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8303 var->type = TYPE_NAMESPACE;
8305 ns.access = ACCESS_NAMESPACE;
8306 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8307 var->value = constant_new_namespace(&ns);
8319 /* Line 1464 of skeleton.m4 */
8320 #line 3919 "parser.y"
8323 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8325 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8326 if(s->kind == INFOTYPE_UNRESOLVED) {
8327 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8329 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8332 if(!s || s->kind != INFOTYPE_SLOT)
8333 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8334 if(!s->value || !NS_TYPE(s->value->type))
8335 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8336 url = s->value->ns->name;
8338 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8339 add_active_url(url);
8348 /* Line 1464 of skeleton.m4 */
8349 #line 8350 "parser.tab.c"
8352 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8356 YY_STACK_PRINT (yyss, yyssp);
8360 /* Now `shift' the result of the reduction. Determine what state
8361 that goes to, based on the state we popped back to and the rule
8362 number reduced by. */
8366 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8367 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8368 yystate = yytable[yystate];
8370 yystate = yydefgoto[yyn - YYNTOKENS];
8375 /*------------------------------------.
8376 | yyerrlab -- here on detecting error |
8377 `------------------------------------*/
8379 /* If not already recovering from an error, report this error. */
8383 #if ! YYERROR_VERBOSE
8384 yyerror (YY_("syntax error"));
8387 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8388 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8390 YYSIZE_T yyalloc = 2 * yysize;
8391 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8392 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8393 if (yymsg != yymsgbuf)
8394 YYSTACK_FREE (yymsg);
8395 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8397 yymsg_alloc = yyalloc;
8401 yymsg_alloc = sizeof yymsgbuf;
8405 if (0 < yysize && yysize <= yymsg_alloc)
8407 (void) yysyntax_error (yymsg, yystate, yychar);
8412 yyerror (YY_("syntax error"));
8414 goto yyexhaustedlab;
8422 if (yyerrstatus == 3)
8424 /* If just tried and failed to reuse lookahead token after an
8425 error, discard it. */
8427 if (yychar <= YYEOF)
8429 /* Return failure if at end of input. */
8430 if (yychar == YYEOF)
8435 yydestruct ("Error: discarding",
8441 /* Else will try to reuse lookahead token after shifting the error
8446 /*---------------------------------------------------.
8447 | yyerrorlab -- error raised explicitly by YYERROR. |
8448 `---------------------------------------------------*/
8451 /* Pacify compilers like GCC when the user code never invokes
8452 YYERROR and the label yyerrorlab therefore never appears in user
8454 if (/*CONSTCOND*/ 0)
8457 /* Do not reclaim the symbols of the rule which action triggered
8461 YY_STACK_PRINT (yyss, yyssp);
8466 /*-------------------------------------------------------------.
8467 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8468 `-------------------------------------------------------------*/
8470 yyerrstatus = 3; /* Each real token shifted decrements this. */
8474 yyn = yypact[yystate];
8475 if (yyn != YYPACT_NINF)
8478 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8486 /* Pop the current state because it cannot handle the error token. */
8491 yydestruct ("Error: popping",
8492 yystos[yystate], yyvsp);
8495 YY_STACK_PRINT (yyss, yyssp);
8501 /* Shift the error token. */
8502 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8508 /*-------------------------------------.
8509 | yyacceptlab -- YYACCEPT comes here. |
8510 `-------------------------------------*/
8515 /*-----------------------------------.
8516 | yyabortlab -- YYABORT comes here. |
8517 `-----------------------------------*/
8522 #if !defined(yyoverflow) || YYERROR_VERBOSE
8523 /*-------------------------------------------------.
8524 | yyexhaustedlab -- memory exhaustion comes here. |
8525 `-------------------------------------------------*/
8527 yyerror (YY_("memory exhausted"));
8533 if (yychar != YYEMPTY)
8534 yydestruct ("Cleanup: discarding lookahead",
8536 /* Do not reclaim the symbols of the rule which action triggered
8537 this YYABORT or YYACCEPT. */
8539 YY_STACK_PRINT (yyss, yyssp);
8540 while (yyssp != yyss)
8542 yydestruct ("Cleanup: popping",
8543 yystos[*yyssp], yyvsp);
8548 YYSTACK_FREE (yyss);
8551 if (yymsg != yymsgbuf)
8552 YYSTACK_FREE (yymsg);
8554 /* Make sure YYID is used. */
8555 return YYID (yyresult);