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 */
88 #include "tokenizer.h"
100 /* Line 198 of skeleton.m4 */
101 #line 102 "parser.tab.c"
103 /* Enabling traces. */
108 /* Enabling verbose error messages. */
109 #ifdef YYERROR_VERBOSE
110 # undef YYERROR_VERBOSE
111 # define YYERROR_VERBOSE 1
113 # define YYERROR_VERBOSE 1
116 /* Enabling the token table. */
117 #ifndef YYTOKEN_TABLE
118 # define YYTOKEN_TABLE 0
125 /* Put the tokens into the symbol table, so that GDB and other debuggers
188 KW_DEFAULT_XML = 318,
225 below_semicolon = 355,
226 below_assignment = 356,
229 minusminus_prefix = 359,
230 plusplus_prefix = 360,
233 above_identifier = 363,
241 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
243 /* Line 223 of skeleton.m4 */
248 /* Line 223 of skeleton.m4 */
251 enum yytokentype token;
253 classinfo_t*classinfo;
254 classinfo_list_t*classinfo_list;
256 slotinfo_list_t*slotinfo_list;
259 unsigned int number_uint;
263 //typedcode_list_t*value_list;
264 codeandnumber_t value_list;
270 for_start_t for_start;
271 abc_exception_t *exception;
274 namespace_decl_t* namespace_decl;
277 abc_exception_list_t *l;
283 /* Line 223 of skeleton.m4 */
284 #line 285 "parser.tab.c"
286 # define YYSTYPE_IS_TRIVIAL 1
287 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
288 # define YYSTYPE_IS_DECLARED 1
292 /* Copy the second part of user declarations. */
294 /* Line 273 of skeleton.m4 */
298 static int a3_error(char*s)
300 syntaxerror("%s", s);
301 return 0; //make gcc happy
304 static void parsererror(const char*file, int line, const char*f)
306 syntaxerror("internal error in %s, %s:%d", f, file, line);
309 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
312 static char* concat2(const char* t1, const char* t2)
316 char*text = malloc(l1+l2+1);
317 memcpy(text , t1, l1);
318 memcpy(text+l1, t2, l2);
322 static char* concat3(const char* t1, const char* t2, const char* t3)
327 char*text = malloc(l1+l2+l3+1);
328 memcpy(text , t1, l1);
329 memcpy(text+l1, t2, l2);
330 memcpy(text+l1+l2, t3, l3);
335 typedef struct _import {
338 DECLARE_LIST(import);
340 DECLARE(methodstate);
341 DECLARE_LIST(methodstate);
343 typedef struct _classstate {
349 methodstate_t*static_init;
351 //code_t*static_init;
352 parsedclass_t*dependencies;
354 char has_constructor;
357 struct _methodstate {
368 dict_t*unresolved_variables;
371 char uses_parent_function;
379 int var_index; // for inner methods
380 int slot_index; // for inner methods
381 char is_a_slot; // for inner methods
386 abc_exception_list_t*exceptions;
388 methodstate_list_t*innerfunctions;
391 typedef struct _state {
396 import_list_t*wildcard_imports;
397 dict_t*import_toplevel_packages;
400 namespace_list_t*active_namespace_urls;
402 char has_own_imports;
403 char new_vars; // e.g. transition between two functions
404 char xmlfilter; // are we inside a xmlobj..() filter?
407 methodstate_t*method;
414 dict_t*allvars; // also contains variables from sublevels
417 typedef struct _global {
420 parsedclass_list_t*classes;
421 abc_script_t*classinit;
423 abc_script_t*init; //package-level code
426 dict_t*file2token2info;
429 static global_t*global = 0;
430 static state_t* state = 0;
434 /* protected handling here is a big hack: we just assume the protectedns
435 is package:class. the correct approach would be to add the proper
436 namespace to all protected members in the registry, even though that
437 would slow down searching */
438 #define MEMBER_MULTINAME(m,f,n) \
442 m##_ns.access = ((slotinfo_t*)(f))->access; \
443 if(m##_ns.access == ACCESS_NAMESPACE) \
444 m##_ns.name = ((slotinfo_t*)(f))->package; \
445 else if(m##_ns.access == ACCESS_PROTECTED && (f)->parent) \
446 m##_ns.name = concat3((f)->parent->package,":",(f)->parent->name); \
451 m.namespace_set = 0; \
452 m.name = ((slotinfo_t*)(f))->name; \
454 m.type = MULTINAME; \
456 m.namespace_set = &nopackage_namespace_set; \
460 /* warning: list length of namespace set is undefined */
461 #define MULTINAME_LATE(m, access, package) \
462 namespace_t m##_ns = {access, package}; \
463 namespace_set_t m##_nsset; \
464 namespace_list_t m##_l;m##_l.next = 0; \
465 m##_nsset.namespaces = &m##_l; \
466 m##_nsset = m##_nsset; \
467 m##_l.namespace = &m##_ns; \
468 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
470 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
471 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
472 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
473 static namespace_t stdns = {ACCESS_PACKAGE, ""};
474 static namespace_list_t nl4 = {&stdns,0};
475 static namespace_list_t nl3 = {&ns3,&nl4};
476 static namespace_list_t nl2 = {&ns2,&nl3};
477 static namespace_list_t nl1 = {&ns1,&nl2};
478 static namespace_set_t nopackage_namespace_set = {&nl1};
480 static dict_t*definitions=0;
481 void as3_set_define(const char*c)
484 definitions = dict_new();
485 if(!dict_contains(definitions,c))
486 dict_put(definitions,c,0);
489 static void new_state()
492 state_t*oldstate = state;
494 memcpy(s, state, sizeof(state_t)); //shallow copy
496 s->imports = dict_new();
498 if(!s->import_toplevel_packages) {
499 s->import_toplevel_packages = dict_new();
503 state->has_own_imports = 0;
504 state->vars = dict_new();
505 state->old = oldstate;
508 trie_remember(active_namespaces);
511 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
514 static void state_destroy(state_t*state)
516 if(state->has_own_imports) {
517 list_free(state->wildcard_imports);
518 dict_destroy(state->imports);state->imports=0;
520 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
521 dict_destroy(state->imports);state->imports=0;
524 dict_destroy(state->vars);state->vars=0;
526 if(state->new_vars && state->allvars) {
527 parserassert(!state->old || state->old->allvars != state->allvars);
528 DICT_ITERATE_DATA(state->allvars, void*, data) {
531 dict_destroy(state->allvars);
534 list_free(state->active_namespace_urls)
535 state->active_namespace_urls = 0;
540 static void old_state()
542 trie_rollback(active_namespaces);
544 if(!state || !state->old)
545 syntaxerror("invalid nesting");
546 state_t*leaving = state;
550 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
551 free(leaving->method);
554 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
559 state_destroy(leaving);
562 static code_t* method_header(methodstate_t*m);
563 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
564 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0);
567 static char* internal_filename_package = 0;
568 void initialize_file(char*filename)
571 syntaxerror("invalid call to initialize_file during parsing of another file");
574 active_namespaces = trie_new();
577 state->package = internal_filename_package = strdup(filename);
578 state->allvars = dict_new();
580 global->token2info = dict_lookup(global->file2token2info,
581 current_filename // use long version
583 if(!global->token2info) {
584 global->token2info = dict_new2(&ptr_type);
585 dict_put(global->file2token2info, current_filename, global->token2info);
589 state->method = rfx_calloc(sizeof(methodstate_t));
590 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
591 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
593 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
595 syntaxerror("internal error: skewed tokencount");
596 function_initvars(state->method, 0, 0, 0, 1);
597 global->init = abc_initscript(global->file);
603 if(!state || state->level!=1) {
604 syntaxerror("unexpected end of file in pass %d", as3_pass);
608 dict_del(global->file2token2info, current_filename);
609 code_t*header = method_header(state->method);
610 code_t*c = wrap_function(header, 0, global->init->method->body->code);
611 global->init->method->body->code = abc_returnvoid(c);
612 free(state->method);state->method=0;
615 //free(state->package);state->package=0; // used in registry
616 state_destroy(state);state=0;
619 void initialize_parser()
621 global = rfx_calloc(sizeof(global_t));
622 global->file = abc_file_new();
623 global->file->flags &= ~ABCFILE_LAZY;
624 global->file2token2info = dict_new();
625 global->token2info = 0;
626 global->classinit = abc_initscript(global->file);
629 void* finish_parser()
631 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
632 global->token2info=0;
634 initcode_add_classlist(global->classinit, global->classes);
639 typedef struct _variable {
644 methodstate_t*is_inner_method;
647 static variable_t* find_variable(state_t*s, char*name)
652 v = dict_lookup(s->vars, name);
654 if(s->new_vars) break;
657 return dict_lookup(top->allvars, name);
659 static variable_t* find_slot(state_t*s, const char*name)
661 if(s->method && s->method->slots)
662 return dict_lookup(s->method->slots, name);
666 static variable_t* find_variable_safe(state_t*s, char*name)
668 variable_t* v = find_variable(s, name);
670 syntaxerror("undefined variable: %s", name);
674 static char variable_exists(char*name)
676 return dict_contains(state->vars, name);
679 static code_t*defaultvalue(code_t*c, classinfo_t*type)
681 if(TYPE_IS_INT(type)) {
682 c = abc_pushbyte(c, 0);
683 } else if(TYPE_IS_UINT(type)) {
684 c = abc_pushuint(c, 0);
685 } else if(TYPE_IS_FLOAT(type)) {
687 } else if(TYPE_IS_BOOLEAN(type)) {
688 c = abc_pushfalse(c);
690 //c = abc_pushundefined(c);
691 syntaxerror("internal error: can't generate default value for * type");
695 c = abc_coerce2(c, &m);
700 static int alloc_local()
702 return state->method->variable_count++;
705 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
708 variable_t*v = find_slot(state, name);
716 v->index = alloc_local();
721 dict_put(state->vars, name, v);
722 dict_put(state->allvars, name, v);
727 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
729 return new_variable2(name, type, init, maybeslot)->index;
732 #define TEMPVARNAME "__as3_temp__"
735 variable_t*v = find_variable(state, TEMPVARNAME);
740 i = new_variable(TEMPVARNAME, 0, 0, 0);
745 static code_t* var_block(code_t*body)
751 DICT_ITERATE_DATA(state->vars, variable_t*, v) {
752 if(v->type && v->init) {
753 c = defaultvalue(c, v->type);
754 c = abc_setlocal(c, v->index);
755 k = abc_kill(k, v->index);
763 if(x->opcode== OPCODE___BREAK__ ||
764 x->opcode== OPCODE___CONTINUE__) {
765 /* link kill code before break/continue */
766 code_t*e = code_dup(k);
767 code_t*s = code_start(e);
779 c = code_append(c, body);
780 c = code_append(c, k);
784 static void unknown_variable(char*name)
786 if(!state->method->unresolved_variables)
787 state->method->unresolved_variables = dict_new();
788 if(!dict_contains(state->method->unresolved_variables, name))
789 dict_put(state->method->unresolved_variables, name, 0);
792 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
794 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
795 c = abc_getlocal_0(c);
796 c = abc_pushscope(c);
799 /* FIXME: this alloc_local() causes variable indexes to be
800 different in pass2 than in pass1 */
801 if(!m->activation_var) {
802 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);
879 static void startpackage(char*name)
882 state->package = strdup(name);
884 static void endpackage()
886 //used e.g. in classinfo_register:
887 //free(state->package);state->package=0;
891 #define FLAG_PUBLIC 256
892 #define FLAG_PROTECTED 512
893 #define FLAG_PRIVATE 1024
894 #define FLAG_PACKAGEINTERNAL 2048
895 #define FLAG_NAMESPACE 4096
897 static namespace_t modifiers2access(modifiers_t*mod)
902 if(mod->flags&FLAG_NAMESPACE) {
903 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
904 syntaxerror("invalid combination of access levels and namespaces");
905 ns.access = ACCESS_NAMESPACE;
907 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
909 /* shouldn't happen- the tokenizer only reports something as a namespace
910 if it was already registered */
911 trie_dump(active_namespaces);
912 syntaxerror("unknown namespace: %s", mod->ns);
915 } else if(mod->flags&FLAG_PUBLIC) {
916 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
917 syntaxerror("invalid combination of access levels");
918 ns.access = ACCESS_PACKAGE;
919 } else if(mod->flags&FLAG_PRIVATE) {
920 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
921 syntaxerror("invalid combination of access levels");
922 ns.access = ACCESS_PRIVATE;
923 } else if(mod->flags&FLAG_PROTECTED) {
924 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
925 syntaxerror("invalid combination of access levels");
926 ns.access = ACCESS_PROTECTED;
928 ns.access = ACCESS_PACKAGEINTERNAL;
932 static slotinfo_t* find_class(const char*name);
934 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
936 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
939 static void innerfunctions2vars(methodstate_t*m)
941 methodstate_list_t*l = m->innerfunctions;
943 methodstate_t*m = l->methodstate;
945 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 0);
946 m->var_index = v->index;
948 m->slot_index = m->is_a_slot;
949 v->is_inner_method = m;
954 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
959 index = new_variable("this", 0, 0, 0);
960 else if(!m->is_global)
961 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
963 index = new_variable("globalscope", 0, 0, 0);
964 parserassert(!index);
969 for(p=params->list;p;p=p->next) {
970 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
973 if(as3_pass==2 && m->need_arguments) {
974 /* arguments can never be used by an innerfunction (the inner functions
975 have their own arguments var), so it's ok to not initialize this until
976 pass 2. (We don't know whether we need it before, anyway) */
977 variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0);
978 m->need_arguments = v->index;
982 innerfunctions2vars(m);
985 m->scope_code = add_scope_code(m->scope_code, m, 0);
987 /* exchange unresolved identifiers with the actual objects */
988 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
989 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
990 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
991 if(!type || type->kind != INFOTYPE_CLASS) {
992 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1002 char*as3_globalclass=0;
1003 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1006 syntaxerror("inner classes now allowed");
1011 classinfo_list_t*mlist=0;
1013 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1014 syntaxerror("invalid modifier(s)");
1016 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1017 syntaxerror("public and internal not supported at the same time.");
1019 if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC))
1020 syntaxerror("protected and static not supported at the same time.");
1022 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1023 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1024 // all classes extend object
1025 extends = registry_getobjectclass();
1028 /* create the class name, together with the proper attributes */
1032 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1033 access = ACCESS_PRIVATE; package = internal_filename_package;
1034 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1035 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1036 } else if(state->package!=internal_filename_package) {
1037 access = ACCESS_PACKAGE; package = state->package;
1039 syntaxerror("public classes only allowed inside a package");
1043 state->cls = rfx_calloc(sizeof(classstate_t));
1044 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1045 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1046 state->cls->static_init->is_static=FLAG_STATIC;
1047 state->cls->static_init->variable_count=1;
1048 /* notice: we make no effort to initialize the top variable (local0) here,
1049 even though it has special meaning. We just rely on the fact
1050 that pass 1 won't do anything with variables */
1052 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1054 /* set current method to constructor- all code within the class-level (except
1055 static variable initializations) will be executed during construction time */
1056 state->method = state->cls->init;
1058 if(registry_find(package, classname)) {
1059 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1061 /* build info struct */
1062 int num_interfaces = (list_length(implements));
1063 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1064 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1065 state->cls->info->superclass = extends;
1068 classinfo_list_t*l = implements;
1069 for(l=implements;l;l=l->next) {
1070 state->cls->info->interfaces[pos++] = l->classinfo;
1075 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1077 state->method = state->cls->init;
1078 parserassert(state->cls && state->cls->info);
1080 function_initvars(state->cls->init, 0, 0, 0, 1);
1081 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1083 if(extends && (extends->flags & FLAG_FINAL))
1084 syntaxerror("Can't extend final class '%s'", extends->name);
1087 while(state->cls->info->interfaces[pos]) {
1088 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1089 syntaxerror("'%s' is not an interface",
1090 state->cls->info->interfaces[pos]->name);
1094 /* generate the abc code for this class */
1095 MULTINAME(classname2,state->cls->info);
1096 multiname_t*extends2 = sig2mname(extends);
1098 /* don't add the class to the class index just yet- that will be done later
1100 state->cls->abc = abc_class_new(0, &classname2, extends2);
1101 state->cls->abc->file = global->file;
1103 multiname_destroy(extends2);
1104 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1105 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1106 if(state->cls->info->flags&FLAG_INTERFACE) {
1107 abc_class_interface(state->cls->abc);
1110 for(mlist=implements;mlist;mlist=mlist->next) {
1111 MULTINAME(m, mlist->classinfo);
1112 abc_class_add_interface(state->cls->abc, &m);
1115 state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc);
1116 list_append(global->classes, state->cls->dependencies);
1118 /* flash.display.MovieClip handling */
1119 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1120 if(state->package && state->package[0]) {
1121 as3_globalclass = concat3(state->package, ".", classname);
1123 as3_globalclass = strdup(classname);
1129 static void endclass()
1132 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1134 c = abc_getlocal_0(c);
1135 c = abc_constructsuper(c, 0);
1136 state->cls->init->header = code_append(state->cls->init->header, c);
1137 state->cls->has_constructor=1;
1139 if(state->cls->init) {
1140 if(state->cls->info->flags&FLAG_INTERFACE) {
1141 if(state->cls->init->header)
1142 syntaxerror("interface can not have class-level code");
1144 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1145 code_t*c = method_header(state->cls->init);
1146 m->body->code = wrap_function(c, 0, m->body->code);
1149 if(state->cls->static_init) {
1150 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1151 code_t*c = method_header(state->cls->static_init);
1152 m->body->code = wrap_function(c, 0, m->body->code);
1155 trait_list_t*trait = state->cls->abc->traits;
1156 /* switch all protected members to the protected ns of this class */
1158 trait_t*t = trait->trait;
1159 if(t->name->ns->access == ACCESS_PROTECTED) {
1160 if(!state->cls->abc->protectedNS) {
1161 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1162 state->cls->abc->protectedNS = namespace_new_protected(n);
1163 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1165 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1167 trait = trait->next;
1174 void check_code_for_break(code_t*c)
1177 if(c->opcode == OPCODE___BREAK__) {
1178 char*name = string_cstr(c->data[0]);
1179 syntaxerror("Unresolved \"break %s\"", name);
1181 if(c->opcode == OPCODE___CONTINUE__) {
1182 char*name = string_cstr(c->data[0]);
1183 syntaxerror("Unresolved \"continue %s\"", name);
1185 if(c->opcode == OPCODE___RETHROW__) {
1186 syntaxerror("Unresolved \"rethrow\"");
1188 if(c->opcode == OPCODE___FALLTHROUGH__) {
1189 syntaxerror("Unresolved \"fallthrough\"");
1191 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1192 char*name = string_cstr(c->data[0]);
1193 syntaxerror("Can't reference a package (%s) as such", name);
1199 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1201 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1202 if(TYPE_IS_NUMBER(t)) {
1203 xassert(c->type == CONSTANT_FLOAT
1204 || c->type == CONSTANT_INT
1205 || c->type == CONSTANT_UINT);
1206 } else if(TYPE_IS_UINT(t)) {
1207 xassert(c->type == CONSTANT_UINT ||
1208 (c->type == CONSTANT_INT && c->i>=0));
1209 } else if(TYPE_IS_INT(t)) {
1210 xassert(c->type == CONSTANT_INT);
1211 } else if(TYPE_IS_BOOLEAN(t)) {
1212 xassert(c->type == CONSTANT_TRUE
1213 || c->type == CONSTANT_FALSE);
1217 static void check_override(memberinfo_t*m, int flags)
1221 if(m->parent == state->cls->info)
1222 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1224 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1225 if(m->access==ACCESS_PRIVATE)
1227 if(m->flags & FLAG_FINAL)
1228 syntaxerror("can't override final member %s", m->name);
1230 /* allow this. it's no issue.
1231 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1232 syntaxerror("can't override static member %s", m->name);*/
1234 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1235 syntaxerror("can't override non-static member %s with static declaration", m->name);
1237 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1238 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1239 if(m->kind == INFOTYPE_METHOD)
1240 syntaxerror("can't override without explicit 'override' declaration");
1242 syntaxerror("can't override '%s'", m->name);
1247 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1249 methodinfo_t*minfo = 0;
1250 namespace_t ns = modifiers2access(mod);
1253 minfo = methodinfo_register_global(ns.access, state->package, name);
1254 minfo->return_type = return_type;
1255 } else if(getset != KW_GET && getset != KW_SET) {
1257 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1259 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1261 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1262 minfo->return_type = return_type;
1263 // getslot on a member slot only returns "undefined", so no need
1264 // to actually store these
1265 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1267 //class getter/setter
1268 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1270 if(getset == KW_GET) {
1272 } else if(params->list && params->list->param && !params->list->next) {
1273 type = params->list->param->type;
1275 syntaxerror("setter function needs to take exactly one argument");
1276 // not sure wether to look into superclasses here, too
1277 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1279 if(minfo->kind!=INFOTYPE_VAR)
1280 syntaxerror("class already contains a method called '%s'", name);
1281 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1282 syntaxerror("class already contains a field called '%s'", name);
1283 if(minfo->subtype & gs)
1284 syntaxerror("getter/setter for '%s' already defined", name);
1285 /* make a setter or getter into a getset */
1286 minfo->subtype |= gs;
1289 FIXME: this check needs to be done in pass 2
1291 if((!minfo->return_type != !type) ||
1292 (minfo->return_type && type &&
1293 !strcmp(minfo->return_type->name, type->name))) {
1294 syntaxerror("different type in getter and setter: %s and %s",
1295 minfo->return_type?minfo->return_type->name:"*",
1296 type?type->name:"*");
1299 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1300 minfo->kind = INFOTYPE_VAR; //hack
1301 minfo->subtype = gs;
1302 minfo->return_type = type;
1305 /* can't assign a slot as getter and setter might have different slots */
1306 //minfo->slot = slot;
1308 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1309 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1310 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1315 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1317 //parserassert(state->method && state->method->info);
1319 methodstate_t*parent_method = state->method;
1322 return_type = 0; // not valid in pass 1
1326 state->new_vars = 1;
1327 state->allvars = dict_new();
1330 state->method = rfx_calloc(sizeof(methodstate_t));
1331 state->method->inner = 1;
1332 state->method->is_static = parent_method->is_static;
1333 state->method->variable_count = 0;
1334 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1336 NEW(methodinfo_t,minfo);
1337 minfo->kind = INFOTYPE_METHOD;
1338 minfo->access = ACCESS_PACKAGEINTERNAL;
1340 state->method->info = minfo;
1343 list_append(parent_method->innerfunctions, state->method);
1345 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1347 function_initvars(state->method, 1, params, 0, 1);
1351 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1352 state->method->variable_count = 0;
1353 parserassert(state->method);
1355 state->method->info->return_type = return_type;
1356 function_initvars(state->method, 1, params, 0, 1);
1360 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1361 params_t*params, classinfo_t*return_type)
1363 if(state->method && state->method->info) {
1364 syntaxerror("not able to start another method scope");
1367 state->new_vars = 1;
1368 state->allvars = dict_new();
1371 state->method = rfx_calloc(sizeof(methodstate_t));
1372 state->method->has_super = 0;
1373 state->method->is_static = mod->flags&FLAG_STATIC;
1376 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1378 state->method->is_global = 1;
1379 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1381 if(state->method->is_constructor)
1382 name = "__as3_constructor__";
1384 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1386 function_initvars(state->method, 1, params, mod->flags, 1);
1388 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1392 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1393 state->method->variable_count = 0;
1394 parserassert(state->method);
1397 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1398 check_override(m, mod->flags);
1402 state->cls->has_constructor |= state->method->is_constructor;
1405 function_initvars(state->method, 1, params, mod->flags, 1);
1409 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1410 params_t*params, classinfo_t*return_type, code_t*body)
1413 innerfunctions2vars(state->method);
1415 methodstate_list_t*ml = state->method->innerfunctions;
1417 dict_t*xvars = dict_new();
1420 methodstate_t*m = ml->methodstate;
1421 parserassert(m->inner);
1422 if(m->unresolved_variables) {
1423 dict_t*d = m->unresolved_variables;
1425 DICT_ITERATE_KEY(d, char*, id) {
1426 /* check parent method's variables */
1428 if((v=find_variable(state, id))) {
1429 m->uses_parent_function = 1;
1430 state->method->uses_slots = 1;
1431 dict_put(xvars, id, 0);
1434 dict_destroy(m->unresolved_variables);m->unresolved_variables = 0;
1439 if(state->method->uses_slots) {
1440 state->method->slots = dict_new();
1442 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1443 if(!name) syntaxerror("internal error");
1444 if(v->index && dict_contains(xvars, name)) {
1447 if(v->is_inner_method) {
1448 v->is_inner_method->is_a_slot = i;
1451 dict_put(state->method->slots, name, v);
1454 state->method->uses_slots = i;
1455 dict_destroy(state->vars);state->vars = 0;
1456 parserassert(state->new_vars);
1457 dict_destroy(state->allvars);state->allvars = 0;
1464 /*if(state->method->uses_parent_function){
1465 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1470 multiname_t*type2 = sig2mname(return_type);
1472 if(state->method->inner) {
1473 f = state->method->abc;
1474 abc_method_init(f, global->file, type2, 1);
1475 } else if(state->method->is_constructor) {
1476 f = abc_class_getconstructor(state->cls->abc, type2);
1477 } else if(!state->method->is_global) {
1478 namespace_t ns = modifiers2access(mod);
1479 multiname_t mname = {QNAME, &ns, 0, name};
1480 if(mod->flags&FLAG_STATIC)
1481 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1483 f = abc_class_method(state->cls->abc, type2, &mname);
1484 slot = f->trait->slot_id;
1486 namespace_t mname_ns = {state->method->info->access, state->package};
1487 multiname_t mname = {QNAME, &mname_ns, 0, name};
1489 f = abc_method_new(global->file, type2, 1);
1490 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1491 //abc_code_t*c = global->init->method->body->code;
1493 //flash doesn't seem to allow us to access function slots
1494 //state->method->info->slot = slot;
1496 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1497 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1498 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1499 if(params->varargs) f->flags |= METHOD_NEED_REST;
1500 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1504 for(p=params->list;p;p=p->next) {
1505 if(params->varargs && !p->next) {
1506 break; //varargs: omit last parameter in function signature
1508 multiname_t*m = sig2mname(p->param->type);
1509 list_append(f->parameters, m);
1510 if(p->param->value) {
1511 check_constant_against_type(p->param->type, p->param->value);
1512 opt=1;list_append(f->optional_parameters, p->param->value);
1514 syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name);
1517 if(state->method->slots) {
1518 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1520 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1521 multiname_t*type = sig2mname(v->type);
1522 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1523 t->slot_id = v->index;
1528 check_code_for_break(body);
1530 /* Seems this works now.
1531 if(state->method->exceptions && state->method->uses_slots) {
1532 as3_warning("try/catch and activation not supported yet within the same method");
1536 f->body->code = body;
1537 f->body->exceptions = state->method->exceptions;
1538 } else { //interface
1540 syntaxerror("interface methods can't have a method body");
1550 void breakjumpsto(code_t*c, char*name, code_t*jump)
1553 if(c->opcode == OPCODE___BREAK__) {
1554 string_t*name2 = c->data[0];
1555 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1556 c->opcode = OPCODE_JUMP;
1563 void continuejumpsto(code_t*c, char*name, code_t*jump)
1566 if(c->opcode == OPCODE___CONTINUE__) {
1567 string_t*name2 = c->data[0];
1568 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1569 c->opcode = OPCODE_JUMP;
1577 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1582 return abc_coerce_a(c);
1586 // cast an "any" type to a specific type. subject to
1587 // runtime exceptions
1588 return abc_coerce2(c, &m);
1591 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1592 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1593 // allow conversion between number types
1594 if(TYPE_IS_UINT(to))
1595 return abc_convert_u(c);
1596 else if(TYPE_IS_INT(to))
1597 return abc_convert_i(c);
1598 else if(TYPE_IS_NUMBER(to))
1599 return abc_convert_d(c);
1600 return abc_coerce2(c, &m);
1603 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1606 if(TYPE_IS_BOOLEAN(to))
1607 return abc_convert_b(c);
1608 if(TYPE_IS_STRING(to))
1609 return abc_convert_s(c);
1610 if(TYPE_IS_OBJECT(to))
1611 return abc_convert_o(c);
1613 classinfo_t*supertype = from;
1615 if(supertype == to) {
1616 // target type is one of from's superclasses
1617 return abc_coerce2(c, &m);
1620 while(supertype->interfaces[t]) {
1621 if(supertype->interfaces[t]==to) {
1622 // target type is one of from's interfaces
1623 return abc_coerce2(c, &m);
1627 supertype = supertype->superclass;
1629 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1631 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1633 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1636 as3_error("can't convert type %s%s%s to %s%s%s",
1637 from->package, from->package[0]?".":"", from->name,
1638 to->package, to->package[0]?".":"", to->name);
1642 /* move to ast.c todo end */
1644 char is_pushundefined(code_t*c)
1646 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1649 static const char* get_package_from_name(const char*name)
1651 /* try explicit imports */
1652 dictentry_t* e = dict_get_slot(state->imports, name);
1654 if(!strcmp(e->key, name)) {
1655 slotinfo_t*c = (slotinfo_t*)e->data;
1656 if(c) return c->package;
1662 static namespace_list_t*get_current_imports()
1664 namespace_list_t*searchlist = 0;
1666 list_append(searchlist, namespace_new_package(state->package));
1668 import_list_t*l = state->wildcard_imports;
1670 namespace_t*ns = namespace_new_package(l->import->package);
1671 list_append(searchlist, ns);
1674 list_append(searchlist, namespace_new_package(""));
1675 list_append(searchlist, namespace_new_package(internal_filename_package));
1679 static slotinfo_t* find_class(const char*name)
1683 c = registry_find(state->package, name);
1686 /* try explicit imports */
1687 dictentry_t* e = dict_get_slot(state->imports, name);
1690 if(!strcmp(e->key, name)) {
1691 c = (slotinfo_t*)e->data;
1697 /* try package.* imports */
1698 import_list_t*l = state->wildcard_imports;
1700 //printf("does package %s contain a class %s?\n", l->import->package, name);
1701 c = registry_find(l->import->package, name);
1706 /* try global package */
1707 c = registry_find("", name);
1710 /* try local "filename" package */
1711 c = registry_find(internal_filename_package, name);
1716 typedcode_t push_class(slotinfo_t*a)
1721 if(a->access == ACCESS_PACKAGEINTERNAL &&
1722 strcmp(a->package, state->package) &&
1723 strcmp(a->package, internal_filename_package)
1725 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1726 infotypename(a), a->name, a->package, state->package);
1730 if(a->kind != INFOTYPE_CLASS) {
1732 x.c = abc_findpropstrict2(x.c, &m);
1733 x.c = abc_getproperty2(x.c, &m);
1734 if(a->kind == INFOTYPE_METHOD) {
1735 methodinfo_t*f = (methodinfo_t*)a;
1736 x.t = TYPE_FUNCTION(f);
1738 varinfo_t*v = (varinfo_t*)a;
1743 if(state->cls && state->method == state->cls->static_init) {
1744 /* we're in the static initializer.
1745 record the fact that we're using this class here */
1746 parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a);
1748 classinfo_t*c = (classinfo_t*)a;
1750 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1751 x.c = abc_getglobalscope(x.c);
1752 x.c = abc_getslot(x.c, c->slot);
1755 x.c = abc_getlex2(x.c, &m);
1757 x.t = TYPE_CLASS(c);
1763 char is_break_or_jump(code_t*c)
1767 if(c->opcode == OPCODE_JUMP ||
1768 c->opcode == OPCODE___BREAK__ ||
1769 c->opcode == OPCODE___CONTINUE__ ||
1770 c->opcode == OPCODE_THROW ||
1771 c->opcode == OPCODE_RETURNVOID ||
1772 c->opcode == OPCODE_RETURNVALUE) {
1778 #define IS_FINALLY_TARGET(op) \
1779 ((op) == OPCODE___CONTINUE__ || \
1780 (op) == OPCODE___BREAK__ || \
1781 (op) == OPCODE_RETURNVOID || \
1782 (op) == OPCODE_RETURNVALUE || \
1783 (op) == OPCODE___RETHROW__)
1785 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1787 #define NEED_EXTRA_STACK_ARG
1788 code_t*finally_label = abc_nop(0);
1789 NEW(lookupswitch_t, l);
1795 code_t*prev = i->prev;
1796 if(IS_FINALLY_TARGET(i->opcode)) {
1799 if(i->opcode == OPCODE___RETHROW__ ||
1800 i->opcode == OPCODE_RETURNVALUE) {
1801 if(i->opcode == OPCODE___RETHROW__)
1802 i->opcode = OPCODE_THROW;
1804 p = abc_coerce_a(p);
1805 p = abc_setlocal(p, tempvar);
1807 p = abc_pushbyte(p, count++);
1808 p = abc_jump(p, finally_label);
1809 code_t*target = p = abc_label(p);
1810 #ifdef NEED_EXTRA_STACK_ARG
1814 p = abc_getlocal(p, tempvar);
1817 p->next = i;i->prev = p;
1818 list_append(l->targets, target);
1824 c = abc_pushbyte(c, -1);
1825 c = code_append(c, finally_label);
1826 c = code_append(c, finally);
1828 #ifdef NEED_EXTRA_STACK_ARG
1831 c = abc_lookupswitch(c, l);
1832 c = l->def = abc_label(c);
1833 #ifdef NEED_EXTRA_STACK_ARG
1840 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1844 code_t*prev = i->prev;
1845 if(IS_FINALLY_TARGET(i->opcode)) {
1846 if(i->opcode == OPCODE___RETHROW__)
1847 i->opcode = OPCODE_THROW;
1848 code_t*end = code_dup(finally);
1849 code_t*start = code_start(end);
1850 if(prev) prev->next = start;
1857 return code_append(c, finally);
1860 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1866 int num_insertion_points=0;
1868 if(IS_FINALLY_TARGET(i->opcode))
1869 num_insertion_points++;
1876 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1881 int simple_version_cost = (1+num_insertion_points)*code_size;
1882 int lookup_version_cost = 4*num_insertion_points + 5;
1884 if(cantdup || simple_version_cost > lookup_version_cost) {
1885 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1886 return insert_finally_lookup(c, finally, tempvar);
1888 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1889 return insert_finally_simple(c, finally, tempvar);
1893 #define PASS1 }} if(as3_pass == 1) {{
1894 #define PASS1END }} if(as3_pass == 2) {{
1895 #define PASS2 }} if(as3_pass == 2) {{
1896 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1897 #define PASS12END }} if(as3_pass == 2) {{
1898 #define PASS_ALWAYS }} {{
1902 /* Line 273 of skeleton.m4 */
1903 #line 1904 "parser.tab.c"
1904 /* Unqualified %code blocks. */
1906 /* Line 274 of skeleton.m4 */
1907 #line 1981 "parser.y"
1909 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1915 /* Line 274 of skeleton.m4 */
1916 #line 2431 "parser.y"
1918 static void state_has_imports()
1920 state->wildcard_imports = list_clone(state->wildcard_imports);
1921 state->imports = dict_clone(state->imports);
1922 state->has_own_imports = 1;
1924 static void import_toplevel(const char*package)
1926 char* s = strdup(package);
1928 dict_put(state->import_toplevel_packages, s, 0);
1929 char*x = strrchr(s, '.');
1938 /* Line 274 of skeleton.m4 */
1939 #line 2564 "parser.y"
1941 static int slotstate_varconst = 0;
1942 static modifiers_t*slotstate_flags = 0;
1943 static void setslotstate(modifiers_t* flags, int varconst)
1945 slotstate_varconst = varconst;
1946 slotstate_flags = flags;
1949 if(flags->flags&FLAG_STATIC) {
1950 state->method = state->cls->static_init;
1952 state->method = state->cls->init;
1955 // reset to "default" state (all in class code is static by default) */
1956 state->method = state->cls->static_init;
1959 parserassert(state->method);
1962 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
1964 int flags = modifiers->flags;
1965 namespace_t ns = modifiers2access(modifiers);
1968 multiname_t mname = {QNAME, &ns, 0, name};
1970 trait_list_t**traits;
1974 ns.name = state->package;
1975 traits = &global->init->traits;
1976 code = &global->init->method->body->code;
1977 } else if(flags&FLAG_STATIC) {
1979 traits = &state->cls->abc->static_traits;
1980 code = &state->cls->static_init->header;
1982 // instance variable
1983 traits = &state->cls->abc->traits;
1984 code = &state->cls->init->header;
1986 if(ns.access == ACCESS_PROTECTED) {
1987 ns.name = concat3(state->cls->info->package,":",state->cls->info->name);
1993 *m = *multiname_clone(&mname);
1995 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
1999 /* Line 274 of skeleton.m4 */
2000 #line 2748 "parser.y"
2002 static int xml_level = 0;
2005 /* Line 274 of skeleton.m4 */
2006 #line 3527 "parser.y"
2008 node_t* resolve_identifier(char*name)
2018 /* look at variables */
2019 if((v = find_variable(state, name))) {
2020 // name is a local variable
2021 o.c = abc_getlocal(o.c, v->index);
2023 return mkcodenode(o);
2025 if((v = find_slot(state, name))) {
2026 o.c = abc_getscopeobject(o.c, 1);
2027 o.c = abc_getslot(o.c, v->index);
2029 return mkcodenode(o);
2032 int i_am_static = state->method->is_static;
2034 /* look at current class' members */
2035 if(!state->method->inner &&
2036 !state->xmlfilter &&
2038 (f = findmember_nsset(state->cls->info, name, 1)))
2040 // name is a member or attribute in this class
2041 int var_is_static = (f->flags&FLAG_STATIC);
2043 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2044 /* if the variable is a constant (and we know what is evaluates to), we
2045 can just use the value itself */
2046 varinfo_t*v = (varinfo_t*)f;
2048 return mkconstnode(v->value);
2052 if(var_is_static >= i_am_static) {
2053 if(f->kind == INFOTYPE_METHOD) {
2054 o.t = TYPE_FUNCTION(f);
2059 if(var_is_static && !i_am_static) {
2060 /* access to a static member from a non-static location.
2061 do this via findpropstrict:
2062 there doesn't seem to be any non-lookup way to access
2063 static properties of a class */
2064 state->method->late_binding = 1;
2066 namespace_t ns = {f->access, f->package};
2067 multiname_t m = {QNAME, &ns, 0, name};
2068 o.c = abc_findpropstrict2(o.c, &m);
2069 o.c = abc_getproperty2(o.c, &m);
2070 return mkcodenode(o);
2071 } else if(f->slot>0) {
2072 o.c = abc_getlocal_0(o.c);
2073 o.c = abc_getslot(o.c, f->slot);
2074 return mkcodenode(o);
2076 MEMBER_MULTINAME(m, f, name);
2077 o.c = abc_getlocal_0(o.c);
2078 o.c = abc_getproperty2(o.c, &m);
2079 return mkcodenode(o);
2084 /* look at actual classes, in the current package and imported */
2085 if(!state->xmlfilter && (a = find_class(name))) {
2086 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2087 o.c = abc_getlocal_0(0);
2088 o.t = TYPE_CLASS((classinfo_t*)a);
2092 return mkcodenode(o);
2095 /* look through package prefixes */
2096 if(!state->xmlfilter &&
2097 (dict_contains(state->import_toplevel_packages, name) ||
2098 registry_ispackage(name))) {
2099 o.c = abc___pushpackage__(o.c, name);
2101 return mkcodenode(o); //?
2104 /* unknown object, let the avm2 resolve it */
2106 if(!state->method->inner && !state->xmlfilter) {
2107 /* we really should make inner functions aware of the class context */
2108 as3_warning("Couldn't resolve '%s', doing late binding", name);
2110 state->method->late_binding = 1;
2112 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2115 o.c = abc_findpropstrict2(o.c, &m);
2116 o.c = abc_getproperty2(o.c, &m);
2117 return mkcodenode(o);
2122 /* Line 274 of skeleton.m4 */
2123 #line 3669 "parser.y"
2125 void add_active_url(const char*url)
2129 list_append(state->active_namespace_urls, n);
2134 /* Line 274 of skeleton.m4 */
2135 #line 2136 "parser.tab.c"
2142 typedef YYTYPE_UINT8 yytype_uint8;
2144 typedef unsigned char yytype_uint8;
2148 typedef YYTYPE_INT8 yytype_int8;
2149 #elif (defined __STDC__ || defined __C99__FUNC__ \
2150 || defined __cplusplus || defined _MSC_VER)
2151 typedef signed char yytype_int8;
2153 typedef short int yytype_int8;
2156 #ifdef YYTYPE_UINT16
2157 typedef YYTYPE_UINT16 yytype_uint16;
2159 typedef unsigned short int yytype_uint16;
2163 typedef YYTYPE_INT16 yytype_int16;
2165 typedef short int yytype_int16;
2169 # ifdef __SIZE_TYPE__
2170 # define YYSIZE_T __SIZE_TYPE__
2171 # elif defined size_t
2172 # define YYSIZE_T size_t
2173 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2174 || defined __cplusplus || defined _MSC_VER)
2175 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2176 # define YYSIZE_T size_t
2178 # define YYSIZE_T unsigned int
2182 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2187 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2188 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2192 # define YY_(msgid) msgid
2196 /* Suppress unused-variable warnings by "using" E. */
2197 #if ! defined lint || defined __GNUC__
2198 # define YYUSE(e) ((void) (e))
2200 # define YYUSE(e) /* empty */
2203 /* Identity function, used to suppress warnings about constant conditions. */
2205 # define YYID(n) (n)
2207 #if (defined __STDC__ || defined __C99__FUNC__ \
2208 || defined __cplusplus || defined _MSC_VER)
2221 #if ! defined yyoverflow || YYERROR_VERBOSE
2223 /* The parser invokes alloca or malloc; define the necessary symbols. */
2225 # ifdef YYSTACK_USE_ALLOCA
2226 # if YYSTACK_USE_ALLOCA
2228 # define YYSTACK_ALLOC __builtin_alloca
2229 # elif defined __BUILTIN_VA_ARG_INCR
2230 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2232 # define YYSTACK_ALLOC __alloca
2233 # elif defined _MSC_VER
2234 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2235 # define alloca _alloca
2237 # define YYSTACK_ALLOC alloca
2238 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2239 || defined __cplusplus || defined _MSC_VER)
2240 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2242 # define _STDLIB_H 1
2249 # ifdef YYSTACK_ALLOC
2250 /* Pacify GCC's `empty if-body' warning. */
2251 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2252 # ifndef YYSTACK_ALLOC_MAXIMUM
2253 /* The OS might guarantee only one guard page at the bottom of the stack,
2254 and a page size can be as small as 4096 bytes. So we cannot safely
2255 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2256 to allow for a few compiler-allocated temporary stack slots. */
2257 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2260 # define YYSTACK_ALLOC YYMALLOC
2261 # define YYSTACK_FREE YYFREE
2262 # ifndef YYSTACK_ALLOC_MAXIMUM
2263 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2265 # if (defined __cplusplus && ! defined _STDLIB_H \
2266 && ! ((defined YYMALLOC || defined malloc) \
2267 && (defined YYFREE || defined free)))
2268 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2270 # define _STDLIB_H 1
2274 # define YYMALLOC malloc
2275 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2276 || defined __cplusplus || defined _MSC_VER)
2277 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2281 # define YYFREE free
2282 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2283 || defined __cplusplus || defined _MSC_VER)
2284 void free (void *); /* INFRINGES ON USER NAME SPACE */
2288 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2291 #if (! defined yyoverflow \
2292 && (! defined __cplusplus \
2293 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2295 /* A type that is properly aligned for any stack member. */
2298 yytype_int16 yyss_alloc;
2302 /* The size of the maximum gap between one aligned stack and the next. */
2303 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2305 /* The size of an array large to enough to hold all stacks, each with
2307 # define YYSTACK_BYTES(N) \
2308 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2309 + YYSTACK_GAP_MAXIMUM)
2311 /* Copy COUNT objects from FROM to TO. The source and destination do
2314 # if defined __GNUC__ && 1 < __GNUC__
2315 # define YYCOPY(To, From, Count) \
2316 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2318 # define YYCOPY(To, From, Count) \
2322 for (yyi = 0; yyi < (Count); yyi++) \
2323 (To)[yyi] = (From)[yyi]; \
2329 /* Relocate STACK from its old location to the new one. The
2330 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2331 elements in the stack, and YYPTR gives the new location of the
2332 stack. Advance YYPTR to a properly aligned location for the next
2334 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2337 YYSIZE_T yynewbytes; \
2338 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2339 Stack = &yyptr->Stack_alloc; \
2340 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2341 yyptr += yynewbytes / sizeof (*yyptr); \
2347 /* YYFINAL -- State number of the termination state. */
2349 /* YYLAST -- Last index in YYTABLE. */
2352 /* YYNTOKENS -- Number of terminals. */
2353 #define YYNTOKENS 136
2354 /* YYNNTS -- Number of nonterminals. */
2356 /* YYNRULES -- Number of rules. */
2357 #define YYNRULES 351
2358 /* YYNRULES -- Number of states. */
2359 #define YYNSTATES 598
2361 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2362 #define YYUNDEFTOK 2
2363 #define YYMAXUTOK 365
2365 #define YYTRANSLATE(YYX) \
2366 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2368 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2369 static const yytype_uint8 yytranslate[] =
2371 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2374 2, 2, 2, 120, 2, 2, 2, 118, 109, 2,
2375 124, 135, 117, 115, 102, 114, 129, 116, 2, 2,
2376 2, 2, 2, 2, 2, 2, 2, 2, 106, 101,
2377 111, 104, 112, 105, 130, 2, 2, 2, 2, 2,
2378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2380 2, 126, 2, 127, 108, 2, 2, 2, 2, 2,
2381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2383 2, 2, 2, 128, 107, 134, 119, 2, 2, 2,
2384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2386 2, 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, 2, 2, 2, 2, 2, 2, 2,
2390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2392 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2396 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2397 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2398 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2399 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2400 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2401 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2402 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2403 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2404 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2405 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2406 95, 96, 97, 98, 99, 100, 103, 110, 113, 121,
2407 122, 123, 125, 131, 132, 133
2411 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2413 static const yytype_uint16 yyprhs[] =
2415 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2416 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2417 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2418 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2419 85, 87, 89, 91, 95, 98, 100, 102, 104, 106,
2420 108, 110, 112, 117, 120, 122, 124, 128, 131, 132,
2421 135, 138, 140, 144, 148, 149, 152, 153, 161, 162,
2422 164, 166, 170, 172, 175, 179, 188, 195, 196, 203,
2423 204, 212, 214, 217, 219, 222, 223, 225, 227, 230,
2424 232, 235, 240, 244, 245, 254, 255, 265, 266, 272,
2425 274, 277, 279, 282, 284, 285, 292, 295, 297, 302,
2426 305, 307, 309, 311, 313, 317, 319, 320, 327, 328,
2427 334, 337, 342, 343, 345, 347, 350, 352, 354, 356,
2428 358, 360, 362, 364, 366, 368, 370, 371, 374, 375,
2429 378, 379, 382, 383, 393, 394, 403, 404, 406, 408,
2430 411, 413, 418, 420, 422, 424, 425, 427, 429, 432,
2431 434, 437, 446, 448, 450, 451, 456, 458, 462, 466,
2432 467, 470, 472, 474, 476, 478, 480, 482, 484, 486,
2433 488, 490, 492, 494, 495, 496, 501, 502, 507, 508,
2434 511, 514, 517, 520, 524, 526, 528, 539, 546, 558,
2435 559, 561, 563, 566, 568, 572, 576, 580, 584, 585,
2436 587, 590, 595, 599, 601, 606, 609, 611, 613, 614,
2437 615, 628, 630, 631, 632, 643, 645, 649, 651, 653,
2438 655, 659, 661, 663, 665, 668, 669, 670, 674, 675,
2439 677, 679, 681, 684, 687, 688, 693, 698, 703, 706,
2440 708, 711, 713, 715, 717, 721, 723, 727, 728, 730,
2441 732, 734, 736, 738, 740, 744, 750, 752, 754, 756,
2442 758, 760, 762, 764, 766, 768, 770, 774, 778, 782,
2443 786, 790, 794, 798, 802, 806, 810, 814, 818, 821,
2444 824, 828, 832, 836, 840, 844, 848, 852, 856, 860,
2445 864, 868, 872, 876, 880, 884, 889, 892, 894, 898,
2446 901, 906, 910, 914, 918, 922, 926, 930, 934, 938,
2447 942, 946, 950, 954, 960, 963, 966, 969, 972, 976,
2448 979, 980, 987, 989, 991, 993, 995, 997, 1003, 1007,
2449 1013, 1018, 1023, 1030, 1037, 1041, 1043, 1046, 1051, 1056,
2453 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2454 static const yytype_int16 yyrhs[] =
2456 137, 0, -1, 138, -1, -1, 139, -1, 140, -1,
2457 139, 140, -1, 188, -1, 200, -1, 198, -1, 234,
2458 -1, 209, -1, 149, -1, 150, 128, 138, 134, -1,
2459 101, -1, -1, 142, -1, 143, -1, 142, 143, -1,
2460 200, -1, 198, -1, 234, -1, 209, -1, 149, -1,
2461 150, 128, 141, 134, -1, 101, -1, 145, -1, -1,
2462 145, 147, -1, 147, -1, 269, -1, 191, -1, 161,
2463 -1, 162, -1, 163, -1, 165, -1, 173, -1, 156,
2464 -1, 185, -1, 181, -1, 257, -1, 270, -1, 268,
2465 -1, 128, 145, 134, -1, 128, 134, -1, 101, -1,
2466 146, -1, 152, -1, 167, -1, 168, -1, 253, -1,
2467 183, -1, 150, 128, 145, 134, -1, 147, 101, -1,
2468 147, -1, 146, -1, 3, 91, 3, -1, 104, 261,
2469 -1, -1, 46, 153, -1, 32, 153, -1, 154, -1,
2470 153, 102, 154, -1, 3, 244, 151, -1, -1, 66,
2471 148, -1, -1, 65, 124, 157, 255, 135, 148, 155,
2472 -1, -1, 152, -1, 257, -1, 46, 3, 244, -1,
2473 3, -1, 11, 124, -1, 11, 50, 124, -1, 160,
2474 158, 101, 255, 101, 257, 135, 148, -1, 160, 159,
2475 69, 255, 135, 148, -1, -1, 12, 124, 164, 255,
2476 135, 148, -1, -1, 13, 166, 148, 12, 124, 255,
2477 135, -1, 67, -1, 67, 3, -1, 30, -1, 30,
2478 3, -1, -1, 170, -1, 172, -1, 170, 172, -1,
2479 171, -1, 170, 171, -1, 34, 261, 106, 144, -1,
2480 62, 106, 144, -1, -1, 14, 124, 174, 261, 135,
2481 128, 169, 134, -1, -1, 33, 124, 3, 244, 135,
2482 176, 128, 144, 134, -1, -1, 27, 128, 178, 144,
2483 134, -1, 175, -1, 179, 175, -1, 179, -1, 179,
2484 177, -1, 177, -1, -1, 52, 128, 182, 144, 134,
2485 180, -1, 37, 255, -1, 37, -1, 39, 124, 255,
2486 135, -1, 184, 148, -1, 3, -1, 17, -1, 16,
2487 -1, 4, -1, 187, 129, 186, -1, 186, -1, -1,
2488 17, 187, 128, 189, 141, 134, -1, -1, 17, 128,
2489 190, 141, 134, -1, 41, 240, -1, 41, 187, 129,
2490 117, -1, -1, 193, -1, 194, -1, 193, 194, -1,
2491 20, -1, 21, -1, 18, -1, 38, -1, 47, -1,
2492 49, -1, 48, -1, 25, -1, 23, -1, 4, -1,
2493 -1, 54, 241, -1, -1, 54, 242, -1, -1, 15,
2494 242, -1, -1, 192, 31, 3, 195, 197, 128, 199,
2495 202, 134, -1, -1, 192, 44, 3, 196, 128, 201,
2496 205, 134, -1, -1, 203, -1, 204, -1, 203, 204,
2497 -1, 101, -1, 150, 128, 202, 134, -1, 209, -1,
2498 234, -1, 146, -1, -1, 206, -1, 207, -1, 206,
2499 207, -1, 101, -1, 46, 3, -1, 192, 26, 233,
2500 3, 124, 230, 135, 244, -1, 46, -1, 32, -1,
2501 -1, 192, 208, 210, 211, -1, 212, -1, 211, 102,
2502 212, -1, 3, 244, 151, -1, -1, 104, 261, -1,
2503 8, -1, 9, -1, 10, -1, 5, -1, 56, -1,
2504 55, -1, 45, -1, 28, -1, 29, -1, 226, -1,
2505 111, -1, 112, -1, -1, -1, 128, 261, 220, 134,
2506 -1, -1, 128, 261, 222, 134, -1, -1, 223, 219,
2507 -1, 223, 5, -1, 223, 112, -1, 226, 223, -1,
2508 224, 226, 223, -1, 3, -1, 221, -1, 216, 225,
2509 227, 217, 223, 111, 116, 225, 218, 112, -1, 216,
2510 225, 227, 116, 218, 112, -1, 216, 225, 227, 217,
2511 223, 224, 111, 116, 225, 218, 112, -1, -1, 228,
2512 -1, 229, -1, 228, 229, -1, 221, -1, 221, 104,
2513 5, -1, 221, 104, 221, -1, 3, 104, 221, -1,
2514 3, 104, 5, -1, -1, 231, -1, 95, 232, -1,
2515 231, 102, 95, 232, -1, 231, 102, 232, -1, 232,
2516 -1, 3, 106, 243, 213, -1, 3, 213, -1, 51,
2517 -1, 35, -1, -1, -1, 192, 26, 233, 3, 124,
2518 230, 135, 244, 128, 235, 144, 134, -1, 3, -1,
2519 -1, -1, 26, 236, 124, 230, 135, 244, 128, 238,
2520 144, 134, -1, 186, -1, 187, 129, 186, -1, 240,
2521 -1, 239, -1, 241, -1, 242, 102, 241, -1, 241,
2522 -1, 117, -1, 36, -1, 106, 243, -1, -1, -1,
2523 124, 246, 135, -1, -1, 247, -1, 248, -1, 254,
2524 -1, 247, 102, -1, 248, 254, -1, -1, 24, 261,
2525 249, 245, -1, 261, 124, 246, 135, -1, 53, 124,
2526 246, 135, -1, 64, 261, -1, 42, -1, 42, 255,
2527 -1, 261, -1, 256, -1, 261, -1, 256, 102, 261,
2528 -1, 261, -1, 257, 102, 261, -1, -1, 260, -1,
2529 3, -1, 5, -1, 8, -1, 9, -1, 10, -1,
2530 259, 106, 254, -1, 260, 102, 259, 106, 254, -1,
2531 237, -1, 265, -1, 250, -1, 252, -1, 251, -1,
2532 266, -1, 214, -1, 215, -1, 6, -1, 19, -1,
2533 126, 246, 127, -1, 71, 258, 134, -1, 261, 111,
2534 261, -1, 261, 112, 261, -1, 261, 76, 261, -1,
2535 261, 77, 261, -1, 261, 72, 261, -1, 261, 73,
2536 261, -1, 261, 75, 261, -1, 261, 74, 261, -1,
2537 261, 89, 261, -1, 261, 90, 261, -1, 120, 261,
2538 -1, 119, 261, -1, 261, 109, 261, -1, 261, 108,
2539 261, -1, 261, 107, 261, -1, 261, 98, 261, -1,
2540 261, 97, 261, -1, 261, 96, 261, -1, 261, 116,
2541 261, -1, 261, 118, 261, -1, 261, 115, 261, -1,
2542 261, 114, 261, -1, 261, 117, 261, -1, 261, 69,
2543 261, -1, 261, 70, 261, -1, 261, 40, 261, -1,
2544 261, 68, 261, -1, 43, 124, 261, 135, -1, 36,
2545 261, -1, 36, -1, 124, 256, 135, -1, 114, 261,
2546 -1, 261, 126, 261, 127, -1, 261, 81, 261, -1,
2547 261, 80, 261, -1, 261, 87, 261, -1, 261, 86,
2548 261, -1, 261, 88, 261, -1, 261, 79, 261, -1,
2549 261, 78, 261, -1, 261, 85, 261, -1, 261, 82,
2550 261, -1, 261, 83, 261, -1, 261, 84, 261, -1,
2551 261, 104, 261, -1, 261, 105, 261, 106, 261, -1,
2552 261, 93, -1, 261, 92, -1, 93, 261, -1, 92,
2553 261, -1, 53, 129, 3, -1, 130, 3, -1, -1,
2554 261, 129, 124, 262, 261, 135, -1, 3, -1, 117,
2555 -1, 4, -1, 186, -1, 117, -1, 261, 129, 263,
2556 91, 264, -1, 261, 94, 264, -1, 261, 129, 126,
2557 261, 127, -1, 261, 129, 130, 264, -1, 261, 94,
2558 130, 264, -1, 261, 129, 130, 126, 261, 127, -1,
2559 261, 94, 130, 126, 261, 127, -1, 261, 129, 264,
2560 -1, 3, -1, 16, 3, -1, 16, 3, 104, 3,
2561 -1, 16, 3, 104, 5, -1, 192, 267, -1, 63,
2562 16, 104, 261, -1, 22, 16, 241, -1
2565 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2566 static const yytype_uint16 yyrline[] =
2568 0, 1885, 1885, 1887, 1887, 1888, 1889, 1891, 1892, 1893,
2569 1894, 1895, 1896, 1897, 1898, 1900, 1900, 1901, 1902, 1904,
2570 1905, 1906, 1907, 1908, 1909, 1910, 1912, 1913, 1915, 1918,
2571 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930,
2572 1931, 1932, 1933, 1934, 1935, 1938, 1939, 1940, 1941, 1942,
2573 1943, 1944, 1945, 1957, 1958, 1962, 1969, 1988, 1989, 1991,
2574 1992, 1994, 1995, 1997, 2057, 2058, 2061, 2061, 2080, 2081,
2575 2082, 2087, 2091, 2096, 2097, 2099, 2119, 2167, 2167, 2186,
2576 2186, 2201, 2204, 2207, 2210, 2214, 2215, 2216, 2217, 2218,
2577 2219, 2221, 2232, 2235, 2235, 2266, 2266, 2291, 2291, 2307,
2578 2308, 2309, 2310, 2318, 2327, 2327, 2376, 2380, 2391, 2401,
2579 2418, 2419, 2420, 2421, 2423, 2424, 2426, 2426, 2428, 2428,
2580 2451, 2465, 2481, 2482, 2483, 2484, 2491, 2492, 2493, 2494,
2581 2495, 2496, 2497, 2498, 2499, 2500, 2504, 2505, 2507, 2508,
2582 2510, 2511, 2515, 2513, 2521, 2519, 2528, 2529, 2530, 2531,
2583 2532, 2533, 2534, 2535, 2537, 2543, 2544, 2545, 2546, 2547,
2584 2548, 2551, 2623, 2623, 2625, 2625, 2627, 2628, 2630, 2714,
2585 2715, 2724, 2725, 2728, 2729, 2730, 2731, 2732, 2733, 2734,
2586 2752, 2754, 2755, 2756, 2758, 2758, 2762, 2762, 2766, 2767,
2587 2770, 2771, 2773, 2774, 2776, 2777, 2779, 2783, 2786, 2791,
2588 2792, 2793, 2794, 2796, 2799, 2803, 2806, 2809, 2819, 2823,
2589 2829, 2835, 2843, 2848, 2854, 2862, 2870, 2871, 2872, 2875,
2590 2874, 2891, 2892, 2894, 2893, 2917, 2936, 2950, 2951, 2953,
2591 2954, 2956, 2957, 2958, 2967, 2968, 2972, 2973, 2975, 2976,
2592 2977, 2979, 2983, 2984, 2989, 2990, 3034, 3084, 3105, 3127,
2593 3130, 3137, 3140, 3143, 3146, 3149, 3152, 3157, 3158, 3160,
2594 3161, 3162, 3163, 3164, 3166, 3172, 3181, 3182, 3183, 3184,
2595 3185, 3186, 3188, 3192, 3204, 3222, 3233, 3243, 3252, 3253,
2596 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263,
2597 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273,
2598 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283,
2599 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293,
2600 3294, 3295, 3296, 3297, 3299, 3300, 3301, 3302, 3304, 3319,
2601 3327, 3327, 3381, 3382, 3383, 3384, 3385, 3393, 3411, 3418,
2602 3429, 3436, 3443, 3453, 3464, 3642, 3678, 3685, 3692, 3699,
2607 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2608 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2609 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2610 static const char *const yytname[] =
2612 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2613 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2614 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2615 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2616 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2617 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2618 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2619 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2620 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2621 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2622 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2623 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2624 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"",
2625 "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"",
2626 "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"",
2627 "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"",
2628 "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"",
2629 "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"",
2630 "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2631 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2632 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2633 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2634 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2635 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2636 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2637 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2638 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2639 "PACKAGE_INITCODE", "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION",
2640 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2641 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2642 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2643 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2644 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2645 "TRY", "$@7", "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE",
2646 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2647 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2648 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2649 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2650 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2651 "SLOT_DECLARATION", "$@12", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT",
2652 "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@13",
2653 "XMLEXPR2", "$@14", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", "XMLNODE",
2654 "MAYBE_XMLATTRIBUTES", "XMLATTRIBUTES", "XMLATTRIBUTE",
2655 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2656 "FUNCTION_DECLARATION", "$@15", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2657 "$@16", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2658 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2659 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2660 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2661 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2662 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@17", "ID_OR_NS", "SUBNODE",
2663 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2664 "DEFAULT_NAMESPACE", "USE_NAMESPACE", 0
2669 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2671 static const yytype_uint16 yytoknum[] =
2673 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2674 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2675 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2676 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2677 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2678 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2679 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2680 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2681 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2682 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2683 355, 59, 44, 356, 61, 63, 58, 124, 94, 38,
2684 357, 60, 62, 358, 45, 43, 47, 42, 37, 126,
2685 33, 359, 360, 361, 40, 362, 91, 93, 123, 46,
2686 64, 363, 364, 365, 125, 41
2690 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2691 static const yytype_uint16 yyr1[] =
2693 0, 136, 137, 138, 138, 139, 139, 140, 140, 140,
2694 140, 140, 140, 140, 140, 141, 141, 142, 142, 143,
2695 143, 143, 143, 143, 143, 143, 144, 144, 145, 145,
2696 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
2697 146, 146, 146, 146, 146, 147, 147, 147, 147, 147,
2698 147, 147, 147, 148, 148, 149, 150, 151, 151, 152,
2699 152, 153, 153, 154, 155, 155, 157, 156, 158, 158,
2700 158, 159, 159, 160, 160, 161, 162, 164, 163, 166,
2701 165, 167, 167, 168, 168, 169, 169, 169, 169, 170,
2702 170, 171, 172, 174, 173, 176, 175, 178, 177, 179,
2703 179, 180, 180, 180, 182, 181, 183, 183, 184, 185,
2704 186, 186, 186, 186, 187, 187, 189, 188, 190, 188,
2705 191, 191, 192, 192, 193, 193, 194, 194, 194, 194,
2706 194, 194, 194, 194, 194, 194, 195, 195, 196, 196,
2707 197, 197, 199, 198, 201, 200, 202, 202, 203, 203,
2708 204, 204, 204, 204, 204, 205, 205, 206, 206, 207,
2709 207, 207, 208, 208, 210, 209, 211, 211, 212, 213,
2710 213, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2711 215, 216, 217, 218, 220, 219, 222, 221, 223, 223,
2712 223, 223, 224, 224, 225, 225, 226, 226, 226, 227,
2713 227, 228, 228, 229, 229, 229, 229, 229, 230, 230,
2714 230, 230, 231, 231, 232, 232, 233, 233, 233, 235,
2715 234, 236, 236, 238, 237, 239, 240, 241, 241, 242,
2716 242, 243, 243, 243, 244, 244, 245, 245, 246, 246,
2717 246, 247, 248, 247, 249, 250, 251, 251, 252, 253,
2718 253, 254, 255, 256, 256, 257, 257, 258, 258, 259,
2719 259, 259, 259, 259, 260, 260, 261, 261, 261, 261,
2720 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2721 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2722 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2723 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2724 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2725 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2726 262, 261, 263, 263, 263, 264, 264, 261, 261, 261,
2727 261, 261, 261, 261, 265, 266, 267, 267, 267, 268,
2731 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2732 static const yytype_uint8 yyr2[] =
2734 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2735 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2736 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2737 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2738 1, 1, 1, 3, 2, 1, 1, 1, 1, 1,
2739 1, 1, 4, 2, 1, 1, 3, 2, 0, 2,
2740 2, 1, 3, 3, 0, 2, 0, 7, 0, 1,
2741 1, 3, 1, 2, 3, 8, 6, 0, 6, 0,
2742 7, 1, 2, 1, 2, 0, 1, 1, 2, 1,
2743 2, 4, 3, 0, 8, 0, 9, 0, 5, 1,
2744 2, 1, 2, 1, 0, 6, 2, 1, 4, 2,
2745 1, 1, 1, 1, 3, 1, 0, 6, 0, 5,
2746 2, 4, 0, 1, 1, 2, 1, 1, 1, 1,
2747 1, 1, 1, 1, 1, 1, 0, 2, 0, 2,
2748 0, 2, 0, 9, 0, 8, 0, 1, 1, 2,
2749 1, 4, 1, 1, 1, 0, 1, 1, 2, 1,
2750 2, 8, 1, 1, 0, 4, 1, 3, 3, 0,
2751 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2752 1, 1, 1, 0, 0, 4, 0, 4, 0, 2,
2753 2, 2, 2, 3, 1, 1, 10, 6, 11, 0,
2754 1, 1, 2, 1, 3, 3, 3, 3, 0, 1,
2755 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2756 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2757 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2758 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2759 2, 1, 1, 1, 3, 1, 3, 0, 1, 1,
2760 1, 1, 1, 1, 3, 5, 1, 1, 1, 1,
2761 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
2762 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2763 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2764 3, 3, 3, 3, 3, 4, 2, 1, 3, 2,
2765 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2766 3, 3, 3, 5, 2, 2, 2, 2, 3, 2,
2767 0, 6, 1, 1, 1, 1, 1, 5, 3, 5,
2768 4, 4, 6, 6, 3, 1, 2, 4, 4, 2,
2772 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2773 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2774 means the default is an error. */
2775 static const yytype_uint16 yydefact[] =
2777 122, 345, 135, 174, 274, 171, 172, 173, 0, 0,
2778 79, 0, 0, 128, 275, 126, 127, 0, 134, 0,
2779 133, 222, 178, 179, 307, 129, 0, 0, 0, 177,
2780 130, 132, 131, 0, 0, 176, 175, 0, 0, 0,
2781 257, 0, 0, 14, 181, 0, 0, 0, 0, 238,
2782 122, 0, 0, 2, 122, 5, 55, 12, 0, 37,
2783 68, 32, 33, 34, 35, 36, 39, 122, 38, 7,
2784 31, 0, 123, 124, 9, 8, 11, 272, 273, 0,
2785 180, 10, 266, 268, 270, 269, 40, 255, 267, 271,
2786 42, 30, 41, 0, 0, 73, 77, 122, 93, 110,
2787 113, 112, 111, 118, 115, 0, 0, 345, 244, 221,
2788 0, 306, 0, 0, 120, 0, 104, 238, 0, 0,
2789 248, 66, 259, 260, 261, 262, 263, 0, 0, 258,
2790 327, 326, 309, 289, 288, 0, 253, 0, 239, 240,
2791 241, 251, 83, 0, 107, 249, 0, 81, 45, 44,
2792 122, 46, 29, 0, 47, 48, 49, 51, 0, 50,
2793 329, 1, 6, 122, 345, 0, 69, 0, 0, 70,
2794 54, 109, 0, 218, 0, 163, 0, 162, 164, 349,
2795 125, 194, 0, 195, 199, 0, 0, 0, 0, 0,
2796 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2797 0, 0, 0, 0, 0, 0, 0, 0, 0, 325,
2798 324, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2799 0, 0, 0, 0, 0, 0, 0, 238, 0, 0,
2800 56, 74, 0, 0, 0, 122, 116, 0, 225, 0,
2801 228, 227, 351, 236, 208, 0, 252, 0, 0, 27,
2802 0, 328, 0, 0, 277, 0, 0, 0, 308, 276,
2803 242, 243, 84, 235, 60, 61, 106, 250, 59, 82,
2804 43, 28, 122, 0, 235, 0, 0, 53, 346, 217,
2805 216, 0, 136, 138, 0, 186, 0, 203, 0, 200,
2806 201, 256, 303, 304, 301, 302, 282, 283, 285, 284,
2807 280, 281, 317, 316, 312, 311, 319, 320, 321, 318,
2808 314, 313, 315, 286, 287, 336, 0, 335, 338, 295,
2809 294, 293, 322, 0, 292, 291, 290, 278, 279, 299,
2810 298, 296, 300, 297, 0, 0, 110, 113, 336, 330,
2811 0, 0, 0, 344, 0, 0, 0, 25, 0, 122,
2812 17, 23, 0, 20, 19, 22, 21, 122, 114, 0,
2813 238, 245, 169, 0, 0, 209, 213, 108, 121, 226,
2814 305, 0, 26, 247, 350, 0, 264, 0, 254, 0,
2815 58, 0, 122, 13, 58, 0, 0, 0, 0, 0,
2816 140, 0, 0, 235, 165, 166, 0, 0, 0, 182,
2817 183, 188, 202, 0, 341, 0, 246, 310, 0, 0,
2818 0, 340, 0, 122, 0, 0, 119, 18, 122, 0,
2819 0, 0, 0, 215, 210, 235, 0, 0, 122, 0,
2820 233, 232, 231, 234, 0, 63, 62, 52, 0, 122,
2821 347, 348, 208, 137, 0, 0, 229, 139, 144, 58,
2822 0, 187, 207, 206, 204, 205, 0, 0, 0, 323,
2823 0, 339, 0, 337, 78, 0, 85, 0, 117, 237,
2824 170, 169, 0, 0, 212, 0, 0, 99, 103, 101,
2825 105, 64, 265, 57, 0, 76, 0, 141, 142, 0,
2826 122, 168, 167, 197, 190, 181, 191, 0, 189, 0,
2827 188, 343, 331, 342, 80, 0, 0, 0, 86, 89,
2828 87, 24, 214, 223, 211, 97, 0, 100, 102, 122,
2829 67, 122, 235, 122, 230, 0, 159, 0, 0, 122,
2830 157, 0, 184, 181, 188, 192, 0, 27, 94, 90,
2831 88, 27, 27, 235, 65, 75, 0, 150, 154, 0,
2832 0, 0, 122, 148, 152, 153, 160, 218, 145, 158,
2833 183, 0, 0, 193, 27, 92, 0, 0, 0, 219,
2834 122, 143, 149, 0, 0, 185, 183, 91, 224, 98,
2835 95, 27, 0, 0, 196, 0, 0, 0, 151, 208,
2836 198, 27, 220, 0, 0, 235, 96, 161
2839 /* YYDEFGOTO[NTERM-NUM]. */
2840 static const yytype_int16 yydefgoto[] =
2842 -1, 52, 53, 54, 55, 348, 349, 350, 371, 372,
2843 151, 152, 171, 351, 153, 435, 154, 268, 265, 520,
2844 59, 253, 167, 168, 60, 61, 62, 63, 232, 64,
2845 97, 155, 156, 507, 508, 509, 510, 65, 234, 477,
2846 586, 478, 542, 479, 480, 66, 249, 157, 67, 68,
2847 238, 239, 69, 357, 235, 70, 158, 72, 73, 390,
2848 392, 445, 353, 523, 354, 490, 551, 552, 553, 528,
2849 529, 530, 178, 355, 284, 394, 395, 423, 77, 78,
2850 79, 401, 456, 498, 561, 183, 396, 457, 499, 184,
2851 80, 288, 289, 290, 364, 365, 366, 281, 356, 581,
2852 110, 82, 541, 240, 241, 432, 447, 433, 380, 361,
2853 137, 138, 139, 243, 83, 84, 85, 159, 140, 245,
2854 246, 86, 127, 128, 129, 87, 408, 342, 318, 88,
2858 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2860 #define YYPACT_NINF -494
2861 static const yytype_int16 yypact[] =
2863 1763, -21, -494, -494, -494, -494, -494, -494, -29, -45,
2864 -494, -36, 68, -494, -494, -494, -494, 75, -494, 2217,
2865 -494, 91, -494, -494, 438, -494, -15, 316, -5, -494,
2866 -494, -494, -494, 7, -37, -494, -494, 107, 2217, 24,
2867 367, 2217, 2217, -494, -494, 2217, 2217, 2217, 2217, 2217,
2868 707, 127, 139, -494, 575, -494, -494, -494, 23, -494,
2869 2145, -494, -494, -494, -494, -494, -494, 2019, -494, -494,
2870 -494, 488, 431, -494, -494, -494, -494, -494, -494, 17,
2871 -494, -494, -494, -494, -494, -494, 57, 2920, -494, -494,
2872 -494, -494, -494, 155, 36, -494, -494, 2019, -494, -494,
2873 -494, -494, -494, -494, -494, 28, 316, -494, -48, -494,
2874 47, 213, 2217, 69, -494, 2217, -494, 2217, 194, 116,
2875 213, -494, -494, -494, -494, -494, -494, 92, 121, 132,
2876 213, 213, 379, 213, 213, -42, 2858, 114, 146, 2217,
2877 -494, 2858, 246, 247, 2217, 2217, 247, 249, -494, -494,
2878 839, -494, -494, 125, -494, -494, -494, -494, 248, -494,
2879 -494, -494, -494, 1103, 197, 264, -494, 168, 203, 57,
2880 173, -494, 274, 66, 276, -494, 278, -494, -494, -494,
2881 -494, -494, 2217, -494, 21, 2217, 2217, 2217, 2217, 2217,
2882 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2883 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, -494,
2884 -494, 138, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2885 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 130,
2886 -494, -494, 2217, 273, 2217, 1235, -494, 316, 158, 160,
2887 -494, -494, -494, 167, 15, 157, 192, 229, 2276, 1891,
2888 165, -494, 2217, 2217, -494, 2217, 367, 2217, -494, -494,
2889 -494, -494, -494, 207, 212, -494, -494, -494, 212, -494,
2890 -494, -494, 2019, 181, 207, 2217, 2217, -494, 217, -494,
2891 -494, 314, 262, 269, 315, 2858, 220, 221, 6, 21,
2892 -494, 2858, 1095, 567, 567, 567, 3292, 3292, 3292, 3292,
2893 1095, 1095, 2858, 2858, 2858, 2858, 2858, 2858, 2858, 2858,
2894 2858, 2858, 2858, 2982, 3044, -494, 214, -494, -494, 313,
2895 313, 313, 2858, 2486, 3106, 3168, 3230, 1095, 1095, 379,
2896 379, 213, 213, 213, 199, 2548, 238, 244, 245, -494,
2897 2217, 267, 254, -494, 226, 224, 2346, -494, 228, 1367,
2898 -494, -494, 235, -494, -494, -494, -494, 1235, -494, 316,
2899 2217, -494, -55, 363, 232, 280, -494, -494, -494, 240,
2900 -494, 237, 1891, -494, 2858, 243, -494, 277, 2858, 292,
2901 281, 247, 971, -494, -6, 279, 252, 135, 270, 316,
2902 376, 316, 268, 207, 296, -494, 265, 22, 34, -494,
2903 -494, -494, -494, 2217, -494, 2217, -494, -494, 2217, 2610,
2904 2217, -494, 294, 2019, 2217, 272, -494, -494, 1235, 283,
2905 275, 2217, 292, -494, -494, 207, 19, 78, 2019, 2217,
2906 -494, -494, -494, -494, 2217, -494, -494, -494, 2217, 2019,
2907 -494, -494, 15, -494, 316, 284, -494, 300, -494, 281,
2908 315, -494, -494, -494, -494, -494, 291, 253, 2672, 2858,
2909 2416, -494, 2734, -494, -494, 287, 46, 289, -494, -494,
2910 2858, 309, 286, 363, -494, 297, 312, -494, -494, 78,
2911 -494, 338, -494, 2858, -38, -494, 298, 300, -494, 316,
2912 27, -494, -494, -494, -494, 299, -494, 2217, -494, 327,
2913 -494, -494, -494, -494, -494, 2217, 318, 306, 46, -494,
2914 -494, -494, -494, -494, -494, -494, 442, -494, -494, 2019,
2915 -494, 2019, 207, 1499, -494, 447, -494, 427, 321, 255,
2916 -494, 17, 2858, 342, -494, 25, 2796, 1891, -494, -494,
2917 -494, 1891, 1891, 207, -494, -494, 332, -494, -494, 335,
2918 328, 331, 1631, -494, -494, -494, -494, 66, -494, -494,
2919 -494, 334, 17, 25, 1891, -494, 336, 340, 341, -494,
2920 1499, -494, -494, 472, 365, -494, -494, -494, -494, -494,
2921 -494, 1891, 347, 358, -494, 373, 359, 352, -494, 15,
2922 -494, 1891, -494, 353, 355, 207, -494, -494
2925 /* YYPGOTO[NTERM-NUM]. */
2926 static const yytype_int16 yypgoto[] =
2928 -494, -494, 337, -494, 444, -315, -494, 150, -475, -34,
2929 1, -60, -87, 53, 2, 52, 446, 364, 129, -494,
2930 -494, -494, -494, -494, -494, -494, -494, -494, -494, -494,
2931 -494, -494, -494, -494, -494, 5, 8, -494, -494, 32,
2932 -494, 33, -494, -494, -494, -494, -494, -494, -494, -494,
2933 14, 56, -494, -494, -494, -494, 0, -494, 430, -494,
2934 -494, -494, 59, -494, 61, -494, -53, -494, -31, -494,
2935 -494, -14, -494, 3, -494, -494, 72, 62, -494, -494,
2936 -494, -494, -464, -494, -494, -169, -494, -457, -494, -493,
2937 -413, -494, -494, 239, -419, -494, -344, -39, 4, -494,
2938 -494, -494, -494, -494, 508, -101, 93, 117, -257, -494,
2939 -103, -494, -494, -494, -494, -494, -494, -494, -130, -132,
2940 490, -52, -494, 285, -494, -13, -494, -494, -189, -494,
2941 -494, -494, -494, -494, -494
2944 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2945 positive, shift that token. If negative, reduce the rule which
2946 number is the opposite. If zero, do what YYDEFACT says.
2947 If YYTABLE_NINF, syntax error. */
2948 #define YYTABLE_NINF -335
2949 static const yytype_int16 yytable[] =
2951 71, 56, 58, 76, 81, 242, 108, 170, 169, 261,
2952 233, 111, 266, 267, 250, 287, 150, 384, 362, 424,
2953 181, 94, 362, 486, 286, 120, 104, 452, 130, 131,
2954 494, 2, 132, 133, 134, 136, 141, 170, 560, 454,
2955 343, 104, 419, 535, 500, 13, 211, 15, 16, 421,
2956 18, 422, 20, 57, 71, 56, 58, 76, 81, 74,
2957 257, 75, 565, -71, 185, 25, 566, 567, 105, 576,
2958 93, 99, 100, 525, 30, 31, 32, 563, 228, 96,
2959 505, 229, 474, 113, 101, 102, 534, 117, 98, 577,
2960 271, 106, 118, 258, 109, 95, 574, 521, 434, 136,
2961 344, 279, 248, 467, 141, 475, 587, 57, 506, 112,
2962 363, 476, 585, 74, 473, 75, 594, 280, 399, 115,
2963 287, 375, 400, 119, 334, 376, 141, 404, 526, 514,
2964 160, 136, 136, 336, 337, 116, 449, 496, 440, 161,
2965 441, 99, 100, 385, 386, 182, 101, 102, 121, 182,
2966 182, 163, 411, 497, 101, 102, 236, 237, 230, 185,
2967 231, -155, 182, 71, 56, 58, 76, 81, 472, 285,
2968 593, 244, 291, 292, 293, 294, 295, 296, 297, 298,
2969 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
2970 309, 310, 311, 312, 313, 314, 103, 251, 247, 319,
2971 320, 321, 322, 323, 324, 325, 326, 327, 328, 329,
2972 330, 331, 332, 333, 141, 335, 57, 99, 100, 136,
2973 252, 346, 74, 463, 75, 317, 254, 255, 453, 455,
2974 101, 102, 99, 100, 256, 71, 56, 352, 382, 374,
2975 136, 259, 141, 317, 378, 101, 102, 338, 260, 262,
2976 263, 358, 269, 272, 339, 315, 340, 420, 494, 2,
2977 341, 369, 136, 136, 172, 546, -72, 274, 316, 275,
2978 99, 100, 276, 13, 277, 15, 16, 278, 18, 282,
2979 20, 283, 465, 101, 102, 345, 568, -115, 443, 359,
2980 446, 360, 367, 25, 257, 99, 100, 99, 100, 482,
2981 373, 525, 30, 31, 32, 209, 210, 211, 101, 102,
2982 101, 102, 271, 379, 381, 383, 389, 388, 393, 99,
2983 100, 387, 271, 391, 397, 398, 464, 409, 430, -332,
2984 317, 315, 101, 102, 406, -334, -333, 227, 597, 228,
2985 403, 481, 229, 446, 172, 412, 368, 141, 414, 71,
2986 56, 352, 485, 170, 173, 317, 526, 71, 56, 352,
2987 175, 413, 416, 418, 495, 496, 362, 425, 170, -114,
2988 122, 427, 123, 369, 177, 124, 125, 126, 428, 170,
2989 438, 497, 426, 429, 315, 434, 484, 439, 524, -156,
2990 458, 444, 459, 410, 442, 460, 448, 462, 450, 451,
2991 466, 136, 489, 493, 519, 209, 210, 211, 470, 431,
2992 469, 315, 488, 421, 513, 531, 141, 468, 71, 56,
2993 352, 483, 504, 511, 537, 515, 317, 222, 223, 224,
2994 225, 226, 544, 522, 545, 2, 516, 227, 533, 228,
2995 538, 107, 229, 3, 4, 543, 5, 6, 7, 13,
2996 556, 15, 16, 557, 18, 558, 20, 14, 562, 170,
2997 569, 170, 19, 570, 21, 571, 22, 23, 575, 25,
2998 578, 209, 210, 211, 579, 583, 580, 584, 30, 31,
2999 32, 588, 589, 29, 532, 590, 592, 591, 595, 596,
3000 527, 34, 536, 35, 36, 224, 225, 226, 162, 417,
3001 273, 491, 180, 227, 172, 228, 166, 264, 229, 40,
3002 436, 517, 518, 539, 173, 559, 540, 582, 573, 174,
3003 175, 572, 492, 550, 548, 549, 554, 555, 402, 527,
3004 41, 42, 176, 512, 177, 114, 0, 487, 135, 471,
3005 0, 377, 0, 0, 0, 0, 0, 0, 0, 0,
3006 0, 0, 550, 548, 549, 554, 555, 0, 0, 0,
3007 0, 0, 48, 0, 49, 0, 0, 0, 51, 0,
3008 550, 548, 549, 554, 555, -4, 0, 0, 1, 2,
3009 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3010 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
3011 20, 0, 0, 22, 23, 0, 0, 186, 0, 0,
3012 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3013 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3014 35, 36, 0, 0, 0, -335, -335, -335, 37, 38,
3015 39, 0, 0, 194, 195, 0, 40, 0, 0, 0,
3016 0, 0, 0, 0, 0, 0, 0, 0, 0, 209,
3017 210, 211, 0, 212, 213, 214, 0, 41, 42, 0,
3018 0, 0, 0, 0, 0, 0, 43, 0, 220, 221,
3019 0, 222, 223, 224, 225, 226, 44, 0, 0, 45,
3020 0, 227, 0, 228, 46, 47, 229, 0, 0, 48,
3021 0, 49, 0, 50, 0, 51, 0, 0, 0, -4,
3022 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3023 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3024 18, 19, 20, 21, 0, 22, 23, 142, 0, 143,
3025 0, 0, 0, 24, 144, 25, 26, 0, 27, 145,
3026 28, 0, 29, 146, 30, 31, 32, 0, 0, 33,
3027 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3028 37, 38, 39, 0, 147, 0, 0, 0, 40, 0,
3029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3030 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3031 42, 0, 0, 0, 0, 0, 0, 0, 148, 0,
3032 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3033 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3034 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3035 0, 149, 1, 2, 3, 4, 0, 5, 6, 7,
3036 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3037 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3038 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3039 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3040 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3041 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3042 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3044 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3045 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3046 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3047 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3048 0, 0, 0, 270, 1, 2, 3, 4, 0, 5,
3049 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3050 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3051 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3052 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3053 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3054 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3055 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3056 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3057 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3058 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3059 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3060 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3061 0, 51, 0, 0, 0, 437, 1, 2, 3, 4,
3062 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3063 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3064 0, 22, 23, 0, 0, -335, 0, 0, 0, 24,
3065 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3066 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3067 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3068 0, -335, -335, 0, 40, 0, 0, 0, 0, 0,
3069 0, 0, 0, 0, 0, 0, 0, 209, 210, 211,
3070 0, 212, 213, 214, 0, 41, 42, 0, 0, 0,
3071 0, 0, 0, 0, 43, 0, -335, -335, 0, 222,
3072 223, 224, 225, 226, 44, 0, 0, 45, 0, 227,
3073 0, 228, 46, 47, 229, 0, 0, 48, 0, 49,
3074 0, 50, 0, 51, 0, 0, 0, -3, 1, 2,
3075 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3076 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3077 20, 0, 0, 22, 23, 0, 0, 0, 0, 0,
3078 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3079 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3080 35, 36, 0, 0, 0, 0, 0, 0, 37, 38,
3081 39, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3082 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3083 0, 0, 0, 0, 0, 0, 0, 41, 42, 0,
3084 0, 0, 0, 0, 0, 0, 347, 0, 0, 0,
3085 0, 0, 0, 0, 0, 0, 44, 0, 0, 45,
3086 0, 0, 0, 0, 46, 47, 0, 0, 0, 48,
3087 0, 49, 0, 50, 0, 51, 0, 0, 0, -15,
3088 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3089 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3090 18, 19, 20, 0, 0, 22, 23, 0, 0, 0,
3091 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
3092 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
3093 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3094 37, 38, 39, 0, 0, 0, 0, 0, 40, 0,
3095 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3096 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3097 42, 0, 0, 0, 0, 0, 0, 0, 347, 0,
3098 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3099 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3100 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3101 0, -16, 1, 2, 3, 4, 0, 5, 6, 7,
3102 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3103 16, 17, 18, 19, 20, 0, 0, 22, 23, 0,
3104 0, 0, 0, 0, 0, 24, 0, 25, 26, 0,
3105 27, 0, 28, 0, 29, 0, 30, 31, 32, 0,
3106 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3107 0, 0, 37, 38, 39, 0, 0, 0, 0, 0,
3108 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3110 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3111 547, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3112 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3113 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3114 0, 0, 0, -146, 1, 2, 3, 4, 0, 5,
3115 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3116 14, 15, 16, 17, 18, 19, 20, 0, 0, 22,
3117 23, 0, 0, 0, 0, 0, 0, 24, 0, 25,
3118 26, 0, 27, 0, 28, 0, 29, 0, 30, 31,
3119 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3120 0, 0, 0, 0, 37, 38, 39, 0, 0, 0,
3121 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3123 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3124 0, 0, 547, 0, 0, 0, 0, 0, 0, 0,
3125 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3126 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3127 0, 51, 0, -3, 0, -147, 1, 2, 3, 4,
3128 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3129 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3130 0, 22, 23, 0, 0, 0, 0, 0, 0, 24,
3131 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3132 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3133 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3134 0, 0, 0, 0, 40, 0, 0, 0, 0, 0,
3135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3136 0, 0, 0, 0, 0, 41, 42, 0, 0, 0,
3137 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
3138 0, 0, 0, 0, 44, 0, 0, 45, 0, 0,
3139 0, 0, 46, 47, 0, 0, 0, 48, 0, 49,
3140 0, 50, 0, 51, 1, 2, 3, 4, 0, 5,
3141 6, 7, 8, 9, 10, 11, 0, -122, 0, 13,
3142 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3143 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3144 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3145 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3146 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3147 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3148 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3149 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3150 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3151 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3152 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3153 0, 51, 1, 2, 3, 4, 0, 5, 6, 7,
3154 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3155 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3156 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3157 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3158 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3159 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3160 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3162 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3163 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3164 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3165 0, 0, 0, 48, 0, 49, 0, 50, 164, 51,
3166 3, 4, 0, 5, 6, 7, 0, 0, 0, 0,
3167 0, 0, 0, 0, 14, 0, 0, 0, 0, 19,
3168 0, 21, 0, 22, 23, 0, 0, 143, 0, 0,
3169 0, 24, 0, 0, 0, 0, 0, 0, 28, 0,
3170 29, 165, 0, 0, 0, 0, 0, 0, 34, 0,
3171 35, 36, 0, 0, 0, 0, 0, 0, 0, 38,
3172 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3173 107, 0, 3, 4, 0, 5, 6, 7, 0, 0,
3174 0, 0, 0, 0, 0, 0, 14, 41, 42, 0,
3175 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3176 0, 0, 0, 24, 0, 0, 44, 0, 0, 45,
3177 28, 0, 29, 0, 46, 47, 0, 0, 0, 48,
3178 34, 49, 35, 36, 0, 51, 0, 0, 0, 0,
3179 0, 38, 0, 0, 0, 0, 0, 0, 40, 0,
3180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3181 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3182 42, 0, 0, 0, 0, 0, 186, 0, 0, 0,
3183 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3184 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3185 0, 48, 0, 49, 187, 188, 189, 51, 190, 191,
3186 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3187 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3188 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3189 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3190 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3191 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3192 0, 370, 0, 0, 187, 188, 189, 0, 190, 191,
3193 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3194 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3195 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3196 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3197 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3198 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3199 0, 415, 0, 0, 187, 188, 189, 0, 190, 191,
3200 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3201 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3202 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3203 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3204 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3205 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3206 0, 502, 0, 0, 187, 188, 189, 0, 190, 191,
3207 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3208 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3209 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3210 215, 216, 405, 217, 218, 219, 0, 220, 221, 0,
3211 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3212 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3213 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3214 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3215 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3216 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3217 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3218 0, 0, 227, 0, 228, 407, 0, 229, 187, 188,
3219 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3220 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3221 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3222 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3223 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3224 0, 0, 0, 0, 227, 0, 228, 461, 0, 229,
3225 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3226 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
3227 206, 207, 208, 0, 209, 210, 211, 0, 212, 213,
3228 214, 0, 0, 0, 186, 0, 215, 216, 0, 217,
3229 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3230 226, 0, 0, 0, 0, 0, 227, 0, 228, 501,
3231 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3232 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3233 204, 205, 206, 207, 208, 0, 209, 210, 211, 0,
3234 212, 213, 214, 0, 0, 0, 186, 0, 215, 216,
3235 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3236 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3237 228, 503, 0, 229, 187, 188, 189, 0, 190, 191,
3238 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3239 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3240 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3241 215, 216, 564, 217, 218, 219, 0, 220, 221, 0,
3242 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3243 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3244 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3245 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3246 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3247 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3248 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3249 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3250 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3251 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3252 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3253 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3254 0, 0, 221, 0, 222, 223, 224, 225, 226, 0,
3255 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3256 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3258 0, 0, 208, 0, 209, 210, 211, 0, 212, 213,
3259 214, 0, 0, 0, 186, 0, 0, 0, 0, 217,
3260 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3261 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3262 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3263 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
3264 0, 0, 0, 0, 0, 0, 209, 210, 211, 0,
3265 212, 213, 214, 0, 0, 0, 186, 0, 0, 0,
3266 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3267 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3268 228, 0, 0, 229, 187, 188, 189, 0, 190, 191,
3269 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
3270 0, 0, 0, 0, 0, 0, 0, 0, 209, 210,
3271 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3272 0, 0, 0, 0, 218, 219, 0, 220, 221, 0,
3273 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3274 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3275 190, 191, 192, 193, 194, 195, 0, 0, 0, 0,
3276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3277 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3278 186, 0, 0, 0, 0, 0, 0, 219, 0, 220,
3279 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3280 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3281 189, 0, 190, 191, 192, 193, 194, 195, 0, 0,
3282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3283 0, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3284 0, 0, 186, 0, 0, 0, 0, 0, 0, -335,
3285 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3286 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3287 187, 188, 189, 0, -335, -335, -335, -335, 194, 195,
3288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3289 0, 0, 0, 0, 209, 210, 211, 0, 212, 213,
3290 214, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3291 0, 0, 0, 220, 221, 0, 222, 223, 224, 225,
3292 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3296 static const yytype_int16 yycheck[] =
3298 0, 0, 0, 0, 0, 106, 19, 67, 60, 139,
3299 97, 24, 144, 145, 117, 184, 50, 274, 3, 363,
3300 3, 50, 3, 442, 3, 38, 12, 5, 41, 42,
3301 5, 4, 45, 46, 47, 48, 49, 97, 531, 5,
3302 229, 27, 357, 500, 457, 18, 94, 20, 21, 104,
3303 23, 106, 25, 0, 54, 54, 54, 54, 54, 0,
3304 102, 0, 537, 69, 102, 38, 541, 542, 12, 562,
3305 91, 3, 4, 46, 47, 48, 49, 534, 126, 124,
3306 34, 129, 426, 27, 16, 17, 499, 124, 124, 564,
3307 150, 16, 129, 135, 3, 124, 560, 135, 104, 112,
3308 232, 35, 115, 418, 117, 27, 581, 54, 62, 124,
3309 95, 33, 576, 54, 95, 54, 591, 51, 112, 124,
3310 289, 253, 116, 16, 227, 255, 139, 316, 101, 473,
3311 3, 144, 145, 3, 4, 128, 393, 112, 3, 0,
3312 5, 3, 4, 275, 276, 128, 16, 17, 124, 128,
3313 128, 128, 341, 128, 16, 17, 128, 129, 3, 102,
3314 124, 134, 128, 163, 163, 163, 163, 163, 425, 182,
3315 589, 124, 185, 186, 187, 188, 189, 190, 191, 192,
3316 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3317 203, 204, 205, 206, 207, 208, 128, 3, 129, 212,
3318 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
3319 223, 224, 225, 226, 227, 228, 163, 3, 4, 232,
3320 104, 234, 163, 412, 163, 211, 134, 106, 397, 398,
3321 16, 17, 3, 4, 102, 235, 235, 235, 272, 252,
3322 253, 127, 255, 229, 257, 16, 17, 117, 102, 3,
3323 3, 237, 3, 128, 124, 117, 126, 360, 5, 4,
3324 130, 247, 275, 276, 16, 522, 69, 3, 130, 101,
3325 3, 4, 69, 18, 101, 20, 21, 3, 23, 3,
3326 25, 3, 414, 16, 17, 12, 543, 129, 389, 129,
3327 391, 124, 135, 38, 102, 3, 4, 3, 4, 429,
3328 135, 46, 47, 48, 49, 92, 93, 94, 16, 17,
3329 16, 17, 372, 106, 102, 134, 54, 3, 3, 3,
3330 4, 104, 382, 54, 104, 104, 413, 340, 36, 91,
3331 316, 117, 16, 17, 135, 91, 91, 124, 595, 126,
3332 126, 428, 129, 444, 16, 91, 117, 360, 124, 349,
3333 349, 349, 439, 413, 26, 341, 101, 357, 357, 357,
3334 32, 135, 134, 128, 111, 112, 3, 135, 428, 129,
3335 3, 134, 5, 359, 46, 8, 9, 10, 135, 439,
3336 101, 128, 102, 106, 117, 104, 438, 135, 489, 134,
3337 403, 15, 405, 126, 124, 408, 128, 410, 102, 134,
3338 128, 414, 102, 112, 66, 92, 93, 94, 421, 117,
3339 135, 117, 128, 104, 128, 116, 429, 134, 418, 418,
3340 418, 434, 135, 134, 106, 128, 412, 114, 115, 116,
3341 117, 118, 519, 135, 521, 4, 124, 124, 111, 126,
3342 134, 3, 129, 5, 6, 3, 8, 9, 10, 18,
3343 3, 20, 21, 26, 23, 134, 25, 19, 116, 519,
3344 128, 521, 24, 128, 26, 134, 28, 29, 134, 38,
3345 134, 92, 93, 94, 134, 3, 135, 112, 47, 48,
3346 49, 134, 124, 45, 497, 112, 134, 128, 135, 134,
3347 490, 53, 505, 55, 56, 116, 117, 118, 54, 349,
3348 163, 449, 72, 124, 16, 126, 60, 143, 129, 71,
3349 381, 479, 479, 508, 26, 529, 508, 570, 557, 31,
3350 32, 552, 450, 523, 523, 523, 523, 523, 289, 529,
3351 92, 93, 44, 471, 46, 27, -1, 444, 48, 422,
3352 -1, 256, -1, -1, -1, -1, -1, -1, -1, -1,
3353 -1, -1, 552, 552, 552, 552, 552, -1, -1, -1,
3354 -1, -1, 124, -1, 126, -1, -1, -1, 130, -1,
3355 570, 570, 570, 570, 570, 0, -1, -1, 3, 4,
3356 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3357 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
3358 25, -1, -1, 28, 29, -1, -1, 40, -1, -1,
3359 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3360 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3361 55, 56, -1, -1, -1, 68, 69, 70, 63, 64,
3362 65, -1, -1, 76, 77, -1, 71, -1, -1, -1,
3363 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3364 93, 94, -1, 96, 97, 98, -1, 92, 93, -1,
3365 -1, -1, -1, -1, -1, -1, 101, -1, 111, 112,
3366 -1, 114, 115, 116, 117, 118, 111, -1, -1, 114,
3367 -1, 124, -1, 126, 119, 120, 129, -1, -1, 124,
3368 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3369 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3370 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3371 23, 24, 25, 26, -1, 28, 29, 30, -1, 32,
3372 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
3373 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
3374 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3375 63, 64, 65, -1, 67, -1, -1, -1, 71, -1,
3376 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3377 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3378 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3379 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3380 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3381 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3382 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3383 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3384 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3385 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3386 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3387 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3388 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3389 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3390 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3391 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3392 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3393 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3394 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3395 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3396 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3397 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3398 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3399 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3400 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3401 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3402 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3403 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3404 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3405 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3406 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3407 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3408 -1, 130, -1, -1, -1, 134, 3, 4, 5, 6,
3409 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3410 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3411 -1, 28, 29, -1, -1, 40, -1, -1, -1, 36,
3412 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3413 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3414 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3415 -1, 76, 77, -1, 71, -1, -1, -1, -1, -1,
3416 -1, -1, -1, -1, -1, -1, -1, 92, 93, 94,
3417 -1, 96, 97, 98, -1, 92, 93, -1, -1, -1,
3418 -1, -1, -1, -1, 101, -1, 111, 112, -1, 114,
3419 115, 116, 117, 118, 111, -1, -1, 114, -1, 124,
3420 -1, 126, 119, 120, 129, -1, -1, 124, -1, 126,
3421 -1, 128, -1, 130, -1, -1, -1, 134, 3, 4,
3422 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3423 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3424 25, -1, -1, 28, 29, -1, -1, -1, -1, -1,
3425 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3426 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3427 55, 56, -1, -1, -1, -1, -1, -1, 63, 64,
3428 65, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3429 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3430 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
3431 -1, -1, -1, -1, -1, -1, 101, -1, -1, -1,
3432 -1, -1, -1, -1, -1, -1, 111, -1, -1, 114,
3433 -1, -1, -1, -1, 119, 120, -1, -1, -1, 124,
3434 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3435 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3436 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3437 23, 24, 25, -1, -1, 28, 29, -1, -1, -1,
3438 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3439 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3440 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3441 63, 64, 65, -1, -1, -1, -1, -1, 71, -1,
3442 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3443 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3444 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3445 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3446 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3447 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3448 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3449 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3450 21, 22, 23, 24, 25, -1, -1, 28, 29, -1,
3451 -1, -1, -1, -1, -1, 36, -1, 38, 39, -1,
3452 41, -1, 43, -1, 45, -1, 47, 48, 49, -1,
3453 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3454 -1, -1, 63, 64, 65, -1, -1, -1, -1, -1,
3455 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3456 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3457 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3458 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3459 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3460 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3461 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3462 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3463 19, 20, 21, 22, 23, 24, 25, -1, -1, 28,
3464 29, -1, -1, -1, -1, -1, -1, 36, -1, 38,
3465 39, -1, 41, -1, 43, -1, 45, -1, 47, 48,
3466 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3467 -1, -1, -1, -1, 63, 64, 65, -1, -1, -1,
3468 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3469 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3470 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3471 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3472 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3473 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3474 -1, 130, -1, 0, -1, 134, 3, 4, 5, 6,
3475 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3476 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3477 -1, 28, 29, -1, -1, -1, -1, -1, -1, 36,
3478 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3479 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3480 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3481 -1, -1, -1, -1, 71, -1, -1, -1, -1, -1,
3482 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3483 -1, -1, -1, -1, -1, 92, 93, -1, -1, -1,
3484 -1, -1, -1, -1, 101, -1, -1, -1, -1, -1,
3485 -1, -1, -1, -1, 111, -1, -1, 114, -1, -1,
3486 -1, -1, 119, 120, -1, -1, -1, 124, -1, 126,
3487 -1, 128, -1, 130, 3, 4, 5, 6, -1, 8,
3488 9, 10, 11, 12, 13, 14, -1, 16, -1, 18,
3489 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3490 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3491 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3492 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3493 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3494 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3495 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3496 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3497 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3498 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3499 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3500 -1, 130, 3, 4, 5, 6, -1, 8, 9, 10,
3501 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3502 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3503 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3504 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3505 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3506 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3507 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3508 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3509 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3510 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3511 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3512 -1, -1, -1, 124, -1, 126, -1, 128, 3, 130,
3513 5, 6, -1, 8, 9, 10, -1, -1, -1, -1,
3514 -1, -1, -1, -1, 19, -1, -1, -1, -1, 24,
3515 -1, 26, -1, 28, 29, -1, -1, 32, -1, -1,
3516 -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
3517 45, 46, -1, -1, -1, -1, -1, -1, 53, -1,
3518 55, 56, -1, -1, -1, -1, -1, -1, -1, 64,
3519 -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3520 3, -1, 5, 6, -1, 8, 9, 10, -1, -1,
3521 -1, -1, -1, -1, -1, -1, 19, 92, 93, -1,
3522 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3523 -1, -1, -1, 36, -1, -1, 111, -1, -1, 114,
3524 43, -1, 45, -1, 119, 120, -1, -1, -1, 124,
3525 53, 126, 55, 56, -1, 130, -1, -1, -1, -1,
3526 -1, 64, -1, -1, -1, -1, -1, -1, 71, -1,
3527 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3528 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3529 93, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3530 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3531 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3532 -1, 124, -1, 126, 68, 69, 70, 130, 72, 73,
3533 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3534 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3535 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3536 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3537 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3538 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3539 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3540 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3541 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3542 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3543 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3544 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3545 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3546 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3547 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3548 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3549 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3550 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3551 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3552 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3553 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3554 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3555 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3556 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3557 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3558 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3559 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3560 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3561 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3562 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3563 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3564 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3565 -1, -1, 124, -1, 126, 127, -1, 129, 68, 69,
3566 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3567 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3568 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3569 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3570 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3571 -1, -1, -1, -1, 124, -1, 126, 127, -1, 129,
3572 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3573 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3574 88, 89, 90, -1, 92, 93, 94, -1, 96, 97,
3575 98, -1, -1, -1, 40, -1, 104, 105, -1, 107,
3576 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3577 118, -1, -1, -1, -1, -1, 124, -1, 126, 127,
3578 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3579 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3580 86, 87, 88, 89, 90, -1, 92, 93, 94, -1,
3581 96, 97, 98, -1, -1, -1, 40, -1, 104, 105,
3582 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3583 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3584 126, 127, -1, 129, 68, 69, 70, -1, 72, 73,
3585 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3586 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3587 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3588 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3589 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3590 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3591 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3592 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3593 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3594 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3595 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3596 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3597 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3598 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3599 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3600 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3601 -1, -1, 112, -1, 114, 115, 116, 117, 118, -1,
3602 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3603 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3604 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3605 -1, -1, 90, -1, 92, 93, 94, -1, 96, 97,
3606 98, -1, -1, -1, 40, -1, -1, -1, -1, 107,
3607 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3608 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3609 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3610 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
3611 -1, -1, -1, -1, -1, -1, 92, 93, 94, -1,
3612 96, 97, 98, -1, -1, -1, 40, -1, -1, -1,
3613 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3614 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3615 126, -1, -1, 129, 68, 69, 70, -1, 72, 73,
3616 74, 75, 76, 77, -1, -1, -1, -1, -1, -1,
3617 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3618 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3619 -1, -1, -1, -1, 108, 109, -1, 111, 112, -1,
3620 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3621 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3622 72, 73, 74, 75, 76, 77, -1, -1, -1, -1,
3623 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3624 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3625 40, -1, -1, -1, -1, -1, -1, 109, -1, 111,
3626 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3627 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3628 70, -1, 72, 73, 74, 75, 76, 77, -1, -1,
3629 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3630 -1, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3631 -1, -1, 40, -1, -1, -1, -1, -1, -1, 109,
3632 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3633 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3634 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3635 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3636 -1, -1, -1, -1, 92, 93, 94, -1, 96, 97,
3637 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3638 -1, -1, -1, 111, 112, -1, 114, 115, 116, 117,
3639 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3643 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3644 symbol of state STATE-NUM. */
3645 static const yytype_uint16 yystos[] =
3647 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3648 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3649 25, 26, 28, 29, 36, 38, 39, 41, 43, 45,
3650 47, 48, 49, 52, 53, 55, 56, 63, 64, 65,
3651 71, 92, 93, 101, 111, 114, 119, 120, 124, 126,
3652 128, 130, 137, 138, 139, 140, 146, 149, 150, 156,
3653 160, 161, 162, 163, 165, 173, 181, 184, 185, 188,
3654 191, 192, 193, 194, 198, 200, 209, 214, 215, 216,
3655 226, 234, 237, 250, 251, 252, 257, 261, 265, 266,
3656 268, 269, 270, 91, 50, 124, 124, 166, 124, 3,
3657 4, 16, 17, 128, 186, 187, 16, 3, 261, 3,
3658 236, 261, 124, 187, 240, 124, 128, 124, 129, 16,
3659 261, 124, 3, 5, 8, 9, 10, 258, 259, 260,
3660 261, 261, 261, 261, 261, 256, 261, 246, 247, 248,
3661 254, 261, 30, 32, 37, 42, 46, 67, 101, 134,
3662 145, 146, 147, 150, 152, 167, 168, 183, 192, 253,
3663 3, 0, 140, 128, 3, 46, 152, 158, 159, 257,
3664 147, 148, 16, 26, 31, 32, 44, 46, 208, 267,
3665 194, 3, 128, 221, 225, 102, 40, 68, 69, 70,
3666 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3667 82, 83, 84, 85, 86, 87, 88, 89, 90, 92,
3668 93, 94, 96, 97, 98, 104, 105, 107, 108, 109,
3669 111, 112, 114, 115, 116, 117, 118, 124, 126, 129,
3670 3, 124, 164, 148, 174, 190, 128, 129, 186, 187,
3671 239, 240, 241, 249, 124, 255, 256, 129, 261, 182,
3672 246, 3, 104, 157, 134, 106, 102, 102, 135, 127,
3673 102, 254, 3, 3, 153, 154, 255, 255, 153, 3,
3674 134, 147, 128, 138, 3, 101, 69, 101, 3, 35,
3675 51, 233, 3, 3, 210, 261, 3, 221, 227, 228,
3676 229, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3677 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3678 261, 261, 261, 261, 261, 117, 130, 186, 264, 261,
3679 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3680 261, 261, 261, 261, 246, 261, 3, 4, 117, 124,
3681 126, 130, 263, 264, 255, 12, 261, 101, 141, 142,
3682 143, 149, 150, 198, 200, 209, 234, 189, 186, 129,
3683 124, 245, 3, 95, 230, 231, 232, 135, 117, 186,
3684 135, 144, 145, 135, 261, 255, 254, 259, 261, 106,
3685 244, 102, 145, 134, 244, 255, 255, 104, 3, 54,
3686 195, 54, 196, 3, 211, 212, 222, 104, 104, 112,
3687 116, 217, 229, 126, 264, 106, 135, 127, 262, 261,
3688 126, 264, 91, 135, 124, 135, 134, 143, 128, 141,
3689 246, 104, 106, 213, 232, 135, 102, 134, 135, 106,
3690 36, 117, 241, 243, 104, 151, 154, 134, 101, 135,
3691 3, 5, 124, 241, 15, 197, 241, 242, 128, 244,
3692 102, 134, 5, 221, 5, 221, 218, 223, 261, 261,
3693 261, 127, 261, 264, 148, 255, 128, 141, 134, 135,
3694 261, 243, 244, 95, 232, 27, 33, 175, 177, 179,
3695 180, 148, 254, 261, 257, 148, 230, 242, 128, 102,
3696 201, 151, 212, 112, 5, 111, 112, 128, 219, 224,
3697 226, 127, 135, 127, 135, 34, 62, 169, 170, 171,
3698 172, 134, 213, 128, 232, 128, 124, 175, 177, 66,
3699 155, 135, 135, 199, 241, 46, 101, 192, 205, 206,
3700 207, 116, 261, 111, 226, 223, 261, 106, 134, 171,
3701 172, 238, 178, 3, 148, 148, 244, 101, 146, 150,
3702 192, 202, 203, 204, 209, 234, 3, 26, 134, 207,
3703 225, 220, 116, 223, 106, 144, 144, 144, 244, 128,
3704 128, 134, 204, 233, 218, 134, 225, 144, 134, 134,
3705 135, 235, 202, 3, 112, 218, 176, 144, 134, 124,
3706 112, 128, 134, 230, 144, 135, 134, 244
3709 #define yyerrok (yyerrstatus = 0)
3710 #define yyclearin (yychar = YYEMPTY)
3711 #define YYEMPTY (-2)
3714 #define YYACCEPT goto yyacceptlab
3715 #define YYABORT goto yyabortlab
3716 #define YYERROR goto yyerrorlab
3719 /* Like YYERROR except do call yyerror. This remains here temporarily
3720 to ease the transition to the new meaning of YYERROR, for GCC.
3721 Once GCC version 2 has supplanted version 1, this can go. */
3723 #define YYFAIL goto yyerrlab
3725 #define YYRECOVERING() (!!yyerrstatus)
3727 #define YYBACKUP(Token, Value) \
3729 if (yychar == YYEMPTY && yylen == 1) \
3733 yytoken = YYTRANSLATE (yychar); \
3739 yyerror (YY_("syntax error: cannot back up")); \
3746 #define YYERRCODE 256
3749 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3750 If N is 0, then set CURRENT to the empty location which ends
3751 the previous symbol: RHS[0] (always defined). */
3753 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3754 #ifndef YYLLOC_DEFAULT
3755 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3759 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3760 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3761 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3762 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3766 (Current).first_line = (Current).last_line = \
3767 YYRHSLOC (Rhs, 0).last_line; \
3768 (Current).first_column = (Current).last_column = \
3769 YYRHSLOC (Rhs, 0).last_column; \
3775 /* YY_LOCATION_PRINT -- Print the location on the stream.
3776 This macro was not mandated originally: define only if we know
3777 we won't break user code: when these are the locations we know. */
3779 #ifndef YY_LOCATION_PRINT
3780 # if YYLTYPE_IS_TRIVIAL
3781 # define YY_LOCATION_PRINT(File, Loc) \
3782 fprintf (File, "%d.%d-%d.%d", \
3783 (Loc).first_line, (Loc).first_column, \
3784 (Loc).last_line, (Loc).last_column)
3786 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3791 /* YYLEX -- calling `yylex' with the right arguments. */
3794 # define YYLEX yylex (YYLEX_PARAM)
3796 # define YYLEX yylex ()
3799 /* Enable debugging if requested. */
3803 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3804 # define YYFPRINTF fprintf
3807 # define YYDPRINTF(Args) \
3813 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3817 YYFPRINTF (stderr, "%s ", Title); \
3818 yy_symbol_print (stderr, \
3820 YYFPRINTF (stderr, "\n"); \
3825 /*--------------------------------.
3826 | Print this symbol on YYOUTPUT. |
3827 `--------------------------------*/
3830 #if (defined __STDC__ || defined __C99__FUNC__ \
3831 || defined __cplusplus || defined _MSC_VER)
3833 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3836 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3839 YYSTYPE const * const yyvaluep;
3845 if (yytype < YYNTOKENS)
3846 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3858 /*--------------------------------.
3859 | Print this symbol on YYOUTPUT. |
3860 `--------------------------------*/
3862 #if (defined __STDC__ || defined __C99__FUNC__ \
3863 || defined __cplusplus || defined _MSC_VER)
3865 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3868 yy_symbol_print (yyoutput, yytype, yyvaluep)
3871 YYSTYPE const * const yyvaluep;
3874 if (yytype < YYNTOKENS)
3875 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3877 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3879 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3880 YYFPRINTF (yyoutput, ")");
3883 /*------------------------------------------------------------------.
3884 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3886 `------------------------------------------------------------------*/
3888 #if (defined __STDC__ || defined __C99__FUNC__ \
3889 || defined __cplusplus || defined _MSC_VER)
3891 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3894 yy_stack_print (yybottom, yytop)
3895 yytype_int16 *yybottom;
3896 yytype_int16 *yytop;
3899 YYFPRINTF (stderr, "Stack now");
3900 for (; yybottom <= yytop; yybottom++)
3902 int yybot = *yybottom;
3903 YYFPRINTF (stderr, " %d", yybot);
3905 YYFPRINTF (stderr, "\n");
3908 # define YY_STACK_PRINT(Bottom, Top) \
3911 yy_stack_print ((Bottom), (Top)); \
3915 /*------------------------------------------------.
3916 | Report that the YYRULE is going to be reduced. |
3917 `------------------------------------------------*/
3919 #if (defined __STDC__ || defined __C99__FUNC__ \
3920 || defined __cplusplus || defined _MSC_VER)
3922 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3925 yy_reduce_print (yyvsp, yyrule)
3930 int yynrhs = yyr2[yyrule];
3932 unsigned long int yylno = yyrline[yyrule];
3933 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3935 /* The symbols being reduced. */
3936 for (yyi = 0; yyi < yynrhs; yyi++)
3938 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3939 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3940 &(yyvsp[(yyi + 1) - (yynrhs)])
3942 YYFPRINTF (stderr, "\n");
3946 # define YY_REDUCE_PRINT(Rule) \
3949 yy_reduce_print (yyvsp, Rule); \
3952 /* Nonzero means print parse trace. It is left uninitialized so that
3953 multiple parsers can coexist. */
3955 #else /* !YYDEBUG */
3956 # define YYDPRINTF(Args)
3957 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3958 # define YY_STACK_PRINT(Bottom, Top)
3959 # define YY_REDUCE_PRINT(Rule)
3960 #endif /* !YYDEBUG */
3963 /* YYINITDEPTH -- initial size of the parser's stacks. */
3965 # define YYINITDEPTH 200
3968 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3969 if the built-in stack extension method is used).
3971 Do not make this value too large; the results are undefined if
3972 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3973 evaluated with infinite-precision integer arithmetic. */
3976 # define YYMAXDEPTH 10000
3984 # if defined __GLIBC__ && defined _STRING_H
3985 # define yystrlen strlen
3987 /* Return the length of YYSTR. */
3988 #if (defined __STDC__ || defined __C99__FUNC__ \
3989 || defined __cplusplus || defined _MSC_VER)
3991 yystrlen (const char *yystr)
3999 for (yylen = 0; yystr[yylen]; yylen++)
4007 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
4008 # define yystpcpy stpcpy
4010 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
4012 #if (defined __STDC__ || defined __C99__FUNC__ \
4013 || defined __cplusplus || defined _MSC_VER)
4015 yystpcpy (char *yydest, const char *yysrc)
4018 yystpcpy (yydest, yysrc)
4024 const char *yys = yysrc;
4026 while ((*yyd++ = *yys++) != '\0')
4035 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
4036 quotes and backslashes, so that it's suitable for yyerror. The
4037 heuristic is that double-quoting is unnecessary unless the string
4038 contains an apostrophe, a comma, or backslash (other than
4039 backslash-backslash). YYSTR is taken from yytname. If YYRES is
4040 null, do not copy; instead, return the length of what the result
4043 yytnamerr (char *yyres, const char *yystr)
4048 char const *yyp = yystr;
4055 goto do_not_strip_quotes;
4059 goto do_not_strip_quotes;
4072 do_not_strip_quotes: ;
4076 return yystrlen (yystr);
4078 return yystpcpy (yyres, yystr) - yyres;
4082 /* Copy into YYRESULT an error message about the unexpected token
4083 YYCHAR while in state YYSTATE. Return the number of bytes copied,
4084 including the terminating null byte. If YYRESULT is null, do not
4085 copy anything; just return the number of bytes that would be
4086 copied. As a special case, return 0 if an ordinary "syntax error"
4087 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
4088 size calculation. */
4090 yysyntax_error (char *yyresult, int yystate, int yychar)
4092 int yyn = yypact[yystate];
4094 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
4098 int yytype = YYTRANSLATE (yychar);
4099 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4100 YYSIZE_T yysize = yysize0;
4102 int yysize_overflow = 0;
4103 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
4104 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4108 /* This is so xgettext sees the translatable formats that are
4109 constructed on the fly. */
4110 YY_("syntax error, unexpected %s");
4111 YY_("syntax error, unexpected %s, expecting %s");
4112 YY_("syntax error, unexpected %s, expecting %s or %s");
4113 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4114 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4118 static char const yyunexpected[] = "syntax error, unexpected %s";
4119 static char const yyexpecting[] = ", expecting %s";
4120 static char const yyor[] = " or %s";
4121 char yyformat[sizeof yyunexpected
4122 + sizeof yyexpecting - 1
4123 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4124 * (sizeof yyor - 1))];
4125 char const *yyprefix = yyexpecting;
4127 /* Start YYX at -YYN if negative to avoid negative indexes in
4129 int yyxbegin = yyn < 0 ? -yyn : 0;
4131 /* Stay within bounds of both yycheck and yytname. */
4132 int yychecklim = YYLAST - yyn + 1;
4133 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4136 yyarg[0] = yytname[yytype];
4137 yyfmt = yystpcpy (yyformat, yyunexpected);
4139 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4140 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4142 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4146 yyformat[sizeof yyunexpected - 1] = '\0';
4149 yyarg[yycount++] = yytname[yyx];
4150 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4151 yysize_overflow |= (yysize1 < yysize);
4153 yyfmt = yystpcpy (yyfmt, yyprefix);
4157 yyf = YY_(yyformat);
4158 yysize1 = yysize + yystrlen (yyf);
4159 yysize_overflow |= (yysize1 < yysize);
4162 if (yysize_overflow)
4163 return YYSIZE_MAXIMUM;
4167 /* Avoid sprintf, as that infringes on the user's name space.
4168 Don't have undefined behavior even if the translation
4169 produced a string with the wrong number of "%s"s. */
4170 char *yyp = yyresult;
4172 while ((*yyp = *yyf) != '\0')
4174 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4176 yyp += yytnamerr (yyp, yyarg[yyi++]);
4189 #endif /* YYERROR_VERBOSE */
4192 /*-----------------------------------------------.
4193 | Release the memory associated to this symbol. |
4194 `-----------------------------------------------*/
4197 #if (defined __STDC__ || defined __C99__FUNC__ \
4198 || defined __cplusplus || defined _MSC_VER)
4200 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4203 yydestruct (yymsg, yytype, yyvaluep)
4213 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4223 /* Prevent warnings from -Wmissing-prototypes. */
4224 #ifdef YYPARSE_PARAM
4225 #if defined __STDC__ || defined __cplusplus
4226 int yyparse (void *YYPARSE_PARAM);
4230 #else /* ! YYPARSE_PARAM */
4231 #if defined __STDC__ || defined __cplusplus
4236 #endif /* ! YYPARSE_PARAM */
4239 /* The lookahead symbol. */
4242 /* The semantic value of the lookahead symbol. */
4245 /* Number of syntax errors so far. */
4250 /*-------------------------.
4251 | yyparse or yypush_parse. |
4252 `-------------------------*/
4254 #ifdef YYPARSE_PARAM
4255 #if (defined __STDC__ || defined __C99__FUNC__ \
4256 || defined __cplusplus || defined _MSC_VER)
4258 yyparse (void *YYPARSE_PARAM)
4261 yyparse (YYPARSE_PARAM)
4262 void *YYPARSE_PARAM;
4264 #else /* ! YYPARSE_PARAM */
4265 #if (defined __STDC__ || defined __C99__FUNC__ \
4266 || defined __cplusplus || defined _MSC_VER)
4279 /* Number of tokens to shift before error messages enabled. */
4282 /* The stacks and their tools:
4283 `yyss': related to states.
4284 `yyvs': related to semantic values.
4286 Refer to the stacks thru separate pointers, to allow yyoverflow
4287 to reallocate them elsewhere. */
4289 /* The state stack. */
4290 yytype_int16 yyssa[YYINITDEPTH];
4292 yytype_int16 *yyssp;
4294 /* The semantic value stack. */
4295 YYSTYPE yyvsa[YYINITDEPTH];
4299 YYSIZE_T yystacksize;
4303 /* Lookahead token as an internal (translated) token number. */
4305 /* The variables used to return semantic value and location from the
4310 /* Buffer for error messages, and its allocated size. */
4312 char *yymsg = yymsgbuf;
4313 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4316 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4318 /* The number of symbols on the RHS of the reduced rule.
4319 Keep to zero when no symbol should be popped. */
4325 yystacksize = YYINITDEPTH;
4327 YYDPRINTF ((stderr, "Starting parse\n"));
4332 yychar = YYEMPTY; /* Cause a token to be read. */
4334 /* Initialize stack pointers.
4335 Waste one element of value and location stack
4336 so that they stay on the same level as the state stack.
4337 The wasted elements are never initialized. */
4343 /*------------------------------------------------------------.
4344 | yynewstate -- Push a new state, which is found in yystate. |
4345 `------------------------------------------------------------*/
4347 /* In all cases, when you get here, the value and location stacks
4348 have just been pushed. So pushing a state here evens the stacks. */
4354 if (yyss + yystacksize - 1 <= yyssp)
4356 /* Get the current used size of the three stacks, in elements. */
4357 YYSIZE_T yysize = yyssp - yyss + 1;
4361 /* Give user a chance to reallocate the stack. Use copies of
4362 these so that the &'s don't force the real ones into
4364 YYSTYPE *yyvs1 = yyvs;
4365 yytype_int16 *yyss1 = yyss;
4367 /* Each stack pointer address is followed by the size of the
4368 data in use in that stack, in bytes. This used to be a
4369 conditional around just the two extra args, but that might
4370 be undefined if yyoverflow is a macro. */
4371 yyoverflow (YY_("memory exhausted"),
4372 &yyss1, yysize * sizeof (*yyssp),
4373 &yyvs1, yysize * sizeof (*yyvsp),
4379 #else /* no yyoverflow */
4380 # ifndef YYSTACK_RELOCATE
4381 goto yyexhaustedlab;
4383 /* Extend the stack our own way. */
4384 if (YYMAXDEPTH <= yystacksize)
4385 goto yyexhaustedlab;
4387 if (YYMAXDEPTH < yystacksize)
4388 yystacksize = YYMAXDEPTH;
4391 yytype_int16 *yyss1 = yyss;
4392 union yyalloc *yyptr =
4393 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4395 goto yyexhaustedlab;
4396 YYSTACK_RELOCATE (yyss_alloc, yyss);
4397 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4398 # undef YYSTACK_RELOCATE
4400 YYSTACK_FREE (yyss1);
4403 #endif /* no yyoverflow */
4405 yyssp = yyss + yysize - 1;
4406 yyvsp = yyvs + yysize - 1;
4408 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4409 (unsigned long int) yystacksize));
4411 if (yyss + yystacksize - 1 <= yyssp)
4415 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4417 if (yystate == YYFINAL)
4427 /* Do appropriate processing given the current state. Read a
4428 lookahead token if we need one and don't already have one. */
4430 /* First try to decide what to do without reference to lookahead token. */
4431 yyn = yypact[yystate];
4432 if (yyn == YYPACT_NINF)
4435 /* Not known => get a lookahead token if don't already have one. */
4437 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4438 if (yychar == YYEMPTY)
4440 YYDPRINTF ((stderr, "Reading a token: "));
4444 if (yychar <= YYEOF)
4446 yychar = yytoken = YYEOF;
4447 YYDPRINTF ((stderr, "Now at end of input.\n"));
4451 yytoken = YYTRANSLATE (yychar);
4452 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4455 /* If the proper action on seeing token YYTOKEN is to reduce or to
4456 detect an error, take that action. */
4458 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4463 if (yyn == 0 || yyn == YYTABLE_NINF)
4469 /* Count tokens shifted since error; after three, turn off error
4474 /* Shift the lookahead token. */
4475 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4477 /* Discard the shifted token. */
4486 /*-----------------------------------------------------------.
4487 | yydefault -- do the default action for the current state. |
4488 `-----------------------------------------------------------*/
4490 yyn = yydefact[yystate];
4496 /*-----------------------------.
4497 | yyreduce -- Do a reduction. |
4498 `-----------------------------*/
4500 /* yyn is the number of a rule to reduce with. */
4503 /* If YYLEN is nonzero, implement the default value of the action:
4506 Otherwise, the following line sets YYVAL to garbage.
4507 This behavior is undocumented and Bison
4508 users should not rely upon it. Assigning to YYVAL
4509 unconditionally makes the parser a bit smaller, and it avoids a
4510 GCC warning that YYVAL may be used uninitialized. */
4511 yyval = yyvsp[1-yylen];
4514 YY_REDUCE_PRINT (yyn);
4521 /* Line 1464 of skeleton.m4 */
4522 #line 1897 "parser.y"
4523 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4532 /* Line 1464 of skeleton.m4 */
4533 #line 1909 "parser.y"
4534 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4543 /* Line 1464 of skeleton.m4 */
4544 #line 1912 "parser.y"
4545 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4554 /* Line 1464 of skeleton.m4 */
4555 #line 1913 "parser.y"
4556 {(yyval.code)=code_new();}
4565 /* Line 1464 of skeleton.m4 */
4566 #line 1915 "parser.y"
4568 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4578 /* Line 1464 of skeleton.m4 */
4579 #line 1918 "parser.y"
4580 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4589 /* Line 1464 of skeleton.m4 */
4590 #line 1934 "parser.y"
4591 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4600 /* Line 1464 of skeleton.m4 */
4601 #line 1935 "parser.y"
4611 /* Line 1464 of skeleton.m4 */
4612 #line 1938 "parser.y"
4622 /* Line 1464 of skeleton.m4 */
4623 #line 1945 "parser.y"
4627 (yyval.code) = (yyvsp[(3) - (4)].code);
4631 as3_pass=(yyvsp[(1) - (4)].number_int);
4641 /* Line 1464 of skeleton.m4 */
4642 #line 1957 "parser.y"
4643 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4652 /* Line 1464 of skeleton.m4 */
4653 #line 1958 "parser.y"
4654 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4663 /* Line 1464 of skeleton.m4 */
4664 #line 1962 "parser.y"
4666 code_t**cc = &global->init->method->body->code;
4667 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4677 /* Line 1464 of skeleton.m4 */
4678 #line 1969 "parser.y"
4681 (yyval.number_int)=as3_pass;
4682 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4683 if(!definitions || !dict_contains(definitions, key)) {
4696 /* Line 1464 of skeleton.m4 */
4697 #line 1988 "parser.y"
4698 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4707 /* Line 1464 of skeleton.m4 */
4708 #line 1989 "parser.y"
4709 {(yyval.node)=mkdummynode();}
4718 /* Line 1464 of skeleton.m4 */
4719 #line 1991 "parser.y"
4720 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4729 /* Line 1464 of skeleton.m4 */
4730 #line 1992 "parser.y"
4731 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4740 /* Line 1464 of skeleton.m4 */
4741 #line 1994 "parser.y"
4742 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4751 /* Line 1464 of skeleton.m4 */
4752 #line 1995 "parser.y"
4753 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4762 /* Line 1464 of skeleton.m4 */
4763 #line 1998 "parser.y"
4766 if(variable_exists((yyvsp[(1) - (3)].id)))
4767 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4769 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4774 if(state->method->uses_slots) {
4775 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4777 // this variable is stored in a slot
4779 v->type = (yyvsp[(2) - (3)].classinfo);
4785 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4788 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4790 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
4791 if(!is_subtype_of(v.t, (yyvsp[(2) - (3)].classinfo))) {
4792 syntaxerror("Can't convert %s to %s", v.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4794 if((yyvsp[(2) - (3)].classinfo)) {
4795 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4796 (yyval.code) = code_append((yyval.code), v.c);
4797 (yyval.code) = converttype((yyval.code), v.t, (yyvsp[(2) - (3)].classinfo));
4800 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4803 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4804 (yyval.code) = code_append((yyval.code), v.c);
4805 (yyval.code) = abc_coerce_a((yyval.code));
4807 // don't do anything
4809 code_free((yyval.code));
4815 (yyval.code) = abc_setslot((yyval.code), index);
4817 (yyval.code) = abc_setlocal((yyval.code), index);
4828 /* Line 1464 of skeleton.m4 */
4829 #line 2057 "parser.y"
4830 {(yyval.code) = code_new();}
4839 /* Line 1464 of skeleton.m4 */
4840 #line 2058 "parser.y"
4841 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4850 /* Line 1464 of skeleton.m4 */
4851 #line 2061 "parser.y"
4852 {PASS12 new_state();}
4861 /* Line 1464 of skeleton.m4 */
4862 #line 2061 "parser.y"
4865 (yyval.code) = code_new();
4866 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4867 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4869 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4870 if((yyvsp[(7) - (7)].code)) {
4871 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4873 myif->branch = (yyval.code) = abc_nop((yyval.code));
4874 if((yyvsp[(7) - (7)].code)) {
4875 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4876 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4878 (yyval.code) = var_block((yyval.code));
4889 /* Line 1464 of skeleton.m4 */
4890 #line 2080 "parser.y"
4891 {(yyval.code)=code_new();}
4900 /* Line 1464 of skeleton.m4 */
4901 #line 2087 "parser.y"
4903 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4904 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4914 /* Line 1464 of skeleton.m4 */
4915 #line 2091 "parser.y"
4918 (yyval.id)=(yyvsp[(1) - (1)].id);
4928 /* Line 1464 of skeleton.m4 */
4929 #line 2096 "parser.y"
4930 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4939 /* Line 1464 of skeleton.m4 */
4940 #line 2097 "parser.y"
4941 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4950 /* Line 1464 of skeleton.m4 */
4951 #line 2099 "parser.y"
4953 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4954 (yyval.code) = code_new();
4955 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4956 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4957 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4958 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4959 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4960 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4961 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4962 (yyval.code) = abc_jump((yyval.code), loopstart);
4963 code_t*out = (yyval.code) = abc_nop((yyval.code));
4964 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4965 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4968 (yyval.code) = var_block((yyval.code));
4979 /* Line 1464 of skeleton.m4 */
4980 #line 2119 "parser.y"
4982 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4984 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4987 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4988 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4989 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4990 int array = new_variable(tmp1name, 0, 0, 0);
4992 (yyval.code) = code_new();
4993 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4994 (yyval.code) = abc_coerce_a((yyval.code));
4995 (yyval.code) = abc_setlocal((yyval.code), array);
4996 (yyval.code) = abc_pushbyte((yyval.code), 0);
4997 (yyval.code) = abc_setlocal((yyval.code), it);
4999 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5001 (yyval.code) = abc_hasnext2((yyval.code), array, it);
5002 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
5003 (yyval.code) = abc_getlocal((yyval.code), array);
5004 (yyval.code) = abc_getlocal((yyval.code), it);
5005 if(!(yyvsp[(1) - (6)].for_start).each)
5006 (yyval.code) = abc_nextname((yyval.code));
5008 (yyval.code) = abc_nextvalue((yyval.code));
5009 (yyval.code) = converttype((yyval.code), 0, var->type);
5010 (yyval.code) = abc_setlocal((yyval.code), var->index);
5012 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5013 (yyval.code) = abc_jump((yyval.code), loopstart);
5015 code_t*out = (yyval.code) = abc_nop((yyval.code));
5016 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
5017 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
5021 (yyval.code) = var_block((yyval.code));
5036 /* Line 1464 of skeleton.m4 */
5037 #line 2167 "parser.y"
5038 {PASS12 new_state();}
5047 /* Line 1464 of skeleton.m4 */
5048 #line 2167 "parser.y"
5051 (yyval.code) = code_new();
5053 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
5054 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5055 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5056 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5057 myjmp->branch = cont;
5058 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5059 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5060 code_t*out = (yyval.code) = abc_nop((yyval.code));
5061 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5062 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5064 (yyval.code) = var_block((yyval.code));
5075 /* Line 1464 of skeleton.m4 */
5076 #line 2186 "parser.y"
5077 {PASS12 new_state();}
5086 /* Line 1464 of skeleton.m4 */
5087 #line 2186 "parser.y"
5089 (yyval.code) = code_new();
5090 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5091 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
5092 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5093 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
5094 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5095 code_t*out = (yyval.code) = abc_nop((yyval.code));
5096 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
5097 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
5099 (yyval.code) = var_block((yyval.code));
5110 /* Line 1464 of skeleton.m4 */
5111 #line 2201 "parser.y"
5113 (yyval.code) = abc___break__(0, "");
5123 /* Line 1464 of skeleton.m4 */
5124 #line 2204 "parser.y"
5126 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5136 /* Line 1464 of skeleton.m4 */
5137 #line 2207 "parser.y"
5139 (yyval.code) = abc___continue__(0, "");
5149 /* Line 1464 of skeleton.m4 */
5150 #line 2210 "parser.y"
5152 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5162 /* Line 1464 of skeleton.m4 */
5163 #line 2214 "parser.y"
5173 /* Line 1464 of skeleton.m4 */
5174 #line 2215 "parser.y"
5175 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5184 /* Line 1464 of skeleton.m4 */
5185 #line 2216 "parser.y"
5186 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5195 /* Line 1464 of skeleton.m4 */
5196 #line 2217 "parser.y"
5197 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5206 /* Line 1464 of skeleton.m4 */
5207 #line 2218 "parser.y"
5208 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5217 /* Line 1464 of skeleton.m4 */
5218 #line 2219 "parser.y"
5219 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5228 /* Line 1464 of skeleton.m4 */
5229 #line 2221 "parser.y"
5231 (yyval.code) = abc_getlocal(0, state->switch_var);
5232 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5233 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5234 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5235 if((yyval.code)->opcode != OPCODE___BREAK__) {
5236 (yyval.code) = abc___fallthrough__((yyval.code), "");
5238 code_t*e = (yyval.code) = abc_nop((yyval.code));
5249 /* Line 1464 of skeleton.m4 */
5250 #line 2232 "parser.y"
5252 (yyval.code) = (yyvsp[(3) - (3)].code);
5262 /* Line 1464 of skeleton.m4 */
5263 #line 2235 "parser.y"
5264 {PASS12 new_state();state->switch_var=alloc_local();}
5273 /* Line 1464 of skeleton.m4 */
5274 #line 2235 "parser.y"
5276 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5277 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5278 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5280 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5281 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5283 code_t*c = (yyval.code),*lastblock=0;
5285 if(c->opcode == OPCODE_IFNE) {
5286 if(!c->next) syntaxerror("internal error in fallthrough handling");
5288 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5290 c->opcode = OPCODE_JUMP;
5291 c->branch = lastblock;
5293 /* fall through end of switch */
5294 c->opcode = OPCODE_NOP;
5300 (yyval.code) = var_block((yyval.code));
5311 /* Line 1464 of skeleton.m4 */
5312 #line 2266 "parser.y"
5313 {PASS12 new_state();
5314 state->exception_name=(yyvsp[(3) - (5)].id);
5315 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5316 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5326 /* Line 1464 of skeleton.m4 */
5327 #line 2271 "parser.y"
5329 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5330 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5332 NEW(abc_exception_t, e)
5333 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5334 e->var_name = multiname_clone(&name);
5335 (yyval.exception) = e;
5338 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5339 e->target = c = abc_nop(0);
5340 c = abc_setlocal(c, i);
5341 c = code_append(c, code_dup(state->method->scope_code));
5342 c = code_append(c, (yyvsp[(8) - (9)].code));
5356 /* Line 1464 of skeleton.m4 */
5357 #line 2291 "parser.y"
5358 {PASS12 new_state();state->exception_name=0;}
5367 /* Line 1464 of skeleton.m4 */
5368 #line 2291 "parser.y"
5370 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5371 if(!(yyvsp[(4) - (5)].code)) {
5372 (yyval.exception)=0;
5374 NEW(abc_exception_t, e)
5375 e->exc_type = 0; //all exceptions
5376 e->var_name = 0; //no name
5379 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5380 (yyval.exception) = e;
5392 /* Line 1464 of skeleton.m4 */
5393 #line 2307 "parser.y"
5394 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5403 /* Line 1464 of skeleton.m4 */
5404 #line 2308 "parser.y"
5405 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5414 /* Line 1464 of skeleton.m4 */
5415 #line 2309 "parser.y"
5416 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5425 /* Line 1464 of skeleton.m4 */
5426 #line 2310 "parser.y"
5428 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5429 (yyval.catch_list).finally = 0;
5430 if((yyvsp[(2) - (2)].exception)) {
5431 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5432 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5443 /* Line 1464 of skeleton.m4 */
5444 #line 2318 "parser.y"
5446 (yyval.catch_list).l=list_new();
5447 (yyval.catch_list).finally = 0;
5448 if((yyvsp[(1) - (1)].exception)) {
5449 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5450 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5461 /* Line 1464 of skeleton.m4 */
5462 #line 2327 "parser.y"
5463 {PASS12 new_state();
5464 state->method->has_exceptions=1;
5465 state->method->late_binding=1;//for invariant scope_code
5475 /* Line 1464 of skeleton.m4 */
5476 #line 2330 "parser.y"
5478 code_t*out = abc_nop(0);
5480 code_t*start = abc_nop(0);
5481 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5482 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5483 (yyval.code) = abc_jump((yyval.code), out);
5485 code_t*end = (yyval.code) = abc_nop((yyval.code));
5488 if((yyvsp[(6) - (6)].catch_list).finally)
5489 tmp = new_variable("__finally__", 0, 0, 0);
5491 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5494 abc_exception_t*e = l->abc_exception;
5496 (yyval.code) = code_append((yyval.code), e->target);
5497 (yyval.code) = abc_jump((yyval.code), out);
5499 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5501 e->target = (yyval.code) = abc_nop((yyval.code));
5502 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5503 (yyval.code) = abc___rethrow__((yyval.code));
5511 (yyval.code) = code_append((yyval.code), out);
5513 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5515 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5517 (yyval.code) = var_block((yyval.code));
5528 /* Line 1464 of skeleton.m4 */
5529 #line 2376 "parser.y"
5531 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5532 (yyval.code)=abc_throw((yyval.code));
5542 /* Line 1464 of skeleton.m4 */
5543 #line 2380 "parser.y"
5545 if(!state->exception_name)
5546 syntaxerror("re-throw only possible within a catch block");
5547 variable_t*v = find_variable(state, state->exception_name);
5548 (yyval.code)=code_new();
5549 (yyval.code)=abc_getlocal((yyval.code), v->index);
5550 (yyval.code)=abc_throw((yyval.code));
5560 /* Line 1464 of skeleton.m4 */
5561 #line 2391 "parser.y"
5564 if(state->method->has_exceptions) {
5565 int v = alloc_local();
5566 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5567 state->method->scope_code = abc_pushwith(state->method->scope_code);
5568 (yyval.value_list).number = v;
5570 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5580 /* Line 1464 of skeleton.m4 */
5581 #line 2401 "parser.y"
5583 /* remove getlocal;pushwith from scope code again */
5584 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5586 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5587 if(state->method->has_exceptions) {
5588 (yyval.code) = abc_dup((yyval.code));
5589 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5591 (yyval.code) = abc_pushwith((yyval.code));
5592 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5593 (yyval.code) = abc_popscope((yyval.code));
5604 /* Line 1464 of skeleton.m4 */
5605 #line 2419 "parser.y"
5606 {PASS12 (yyval.id)="package";}
5615 /* Line 1464 of skeleton.m4 */
5616 #line 2420 "parser.y"
5617 {PASS12 (yyval.id)="namespace";}
5626 /* Line 1464 of skeleton.m4 */
5627 #line 2421 "parser.y"
5628 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5637 /* Line 1464 of skeleton.m4 */
5638 #line 2423 "parser.y"
5639 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5648 /* Line 1464 of skeleton.m4 */
5649 #line 2424 "parser.y"
5650 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5659 /* Line 1464 of skeleton.m4 */
5660 #line 2426 "parser.y"
5661 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5670 /* Line 1464 of skeleton.m4 */
5671 #line 2427 "parser.y"
5672 {PASS12 endpackage();(yyval.code)=0;}
5681 /* Line 1464 of skeleton.m4 */
5682 #line 2428 "parser.y"
5683 {PASS12 startpackage("");}
5692 /* Line 1464 of skeleton.m4 */
5693 #line 2429 "parser.y"
5694 {PASS12 endpackage();(yyval.code)=0;}
5703 /* Line 1464 of skeleton.m4 */
5704 #line 2451 "parser.y"
5707 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5708 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5709 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5711 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5713 syntaxerror("Couldn't import class\n");
5714 state_has_imports();
5715 dict_put(state->imports, c->name, c);
5716 import_toplevel(c->package);
5727 /* Line 1464 of skeleton.m4 */
5728 #line 2465 "parser.y"
5731 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5732 as3_schedule_package((yyvsp[(2) - (4)].id));
5736 i->package = (yyvsp[(2) - (4)].id);
5737 state_has_imports();
5738 list_append(state->wildcard_imports, i);
5739 import_toplevel(i->package);
5750 /* Line 1464 of skeleton.m4 */
5751 #line 2481 "parser.y"
5752 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5761 /* Line 1464 of skeleton.m4 */
5762 #line 2482 "parser.y"
5763 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5772 /* Line 1464 of skeleton.m4 */
5773 #line 2483 "parser.y"
5774 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5783 /* Line 1464 of skeleton.m4 */
5784 #line 2484 "parser.y"
5787 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5788 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5789 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5800 /* Line 1464 of skeleton.m4 */
5801 #line 2491 "parser.y"
5802 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5811 /* Line 1464 of skeleton.m4 */
5812 #line 2492 "parser.y"
5813 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5822 /* Line 1464 of skeleton.m4 */
5823 #line 2493 "parser.y"
5824 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5833 /* Line 1464 of skeleton.m4 */
5834 #line 2494 "parser.y"
5835 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5844 /* Line 1464 of skeleton.m4 */
5845 #line 2495 "parser.y"
5846 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5855 /* Line 1464 of skeleton.m4 */
5856 #line 2496 "parser.y"
5857 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5866 /* Line 1464 of skeleton.m4 */
5867 #line 2497 "parser.y"
5868 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5877 /* Line 1464 of skeleton.m4 */
5878 #line 2498 "parser.y"
5879 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5888 /* Line 1464 of skeleton.m4 */
5889 #line 2499 "parser.y"
5890 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5899 /* Line 1464 of skeleton.m4 */
5900 #line 2500 "parser.y"
5901 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5902 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5912 /* Line 1464 of skeleton.m4 */
5913 #line 2504 "parser.y"
5914 {PASS12 (yyval.classinfo)=0;}
5923 /* Line 1464 of skeleton.m4 */
5924 #line 2505 "parser.y"
5925 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5934 /* Line 1464 of skeleton.m4 */
5935 #line 2507 "parser.y"
5936 {PASS12 (yyval.classinfo_list)=list_new();}
5945 /* Line 1464 of skeleton.m4 */
5946 #line 2508 "parser.y"
5947 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5956 /* Line 1464 of skeleton.m4 */
5957 #line 2510 "parser.y"
5958 {PASS12 (yyval.classinfo_list)=list_new();}
5967 /* Line 1464 of skeleton.m4 */
5968 #line 2511 "parser.y"
5969 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5978 /* Line 1464 of skeleton.m4 */
5979 #line 2515 "parser.y"
5980 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5989 /* Line 1464 of skeleton.m4 */
5990 #line 2517 "parser.y"
5991 {PASS12 endclass();(yyval.code)=0;}
6000 /* Line 1464 of skeleton.m4 */
6001 #line 2521 "parser.y"
6002 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
6003 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
6012 /* Line 1464 of skeleton.m4 */
6013 #line 2524 "parser.y"
6014 {PASS12 endclass();(yyval.code)=0;}
6023 /* Line 1464 of skeleton.m4 */
6024 #line 2533 "parser.y"
6025 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
6034 /* Line 1464 of skeleton.m4 */
6035 #line 2537 "parser.y"
6037 code_t*c = state->cls->static_init->header;
6038 c = code_append(c, (yyvsp[(1) - (1)].code));
6039 state->cls->static_init->header = c;
6049 /* Line 1464 of skeleton.m4 */
6050 #line 2548 "parser.y"
6052 syntaxerror("variable declarations not allowed in interfaces");
6062 /* Line 1464 of skeleton.m4 */
6063 #line 2551 "parser.y"
6066 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
6067 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
6068 syntaxerror("invalid method modifiers: interface methods always need to be public");
6070 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
6071 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
6072 list_deep_free((yyvsp[(6) - (8)].params).list);
6082 /* Line 1464 of skeleton.m4 */
6083 #line 2625 "parser.y"
6084 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
6093 /* Line 1464 of skeleton.m4 */
6094 #line 2625 "parser.y"
6095 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
6104 /* Line 1464 of skeleton.m4 */
6105 #line 2627 "parser.y"
6106 {PASS12 (yyval.code)=0;}
6115 /* Line 1464 of skeleton.m4 */
6116 #line 2628 "parser.y"
6117 {PASS12 (yyval.code)=0;}
6126 /* Line 1464 of skeleton.m4 */
6127 #line 2631 "parser.y"
6130 int flags = slotstate_flags->flags;
6131 namespace_t ns = modifiers2access(slotstate_flags);
6135 varinfo_t* info = 0;
6137 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6139 check_override(i, flags);
6141 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6143 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6145 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6147 if(ns.name && ns.name[0]) {
6148 syntaxerror("namespaces not allowed on package-level variables");
6150 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6153 info->type = (yyvsp[(2) - (3)].classinfo);
6154 info->flags = flags;
6156 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6160 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6164 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6166 if((yyvsp[(2) - (3)].classinfo)) {
6167 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6168 t->type_name = multiname_clone(&m);
6170 info->slot = t->slot_id;
6172 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6173 FIXME: is there a way to use slots and still don't have conflicting overrides?
6175 info->slot = t->slot_id = 0;
6177 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6178 if(cval.type!=CONSTANT_UNKNOWN) {
6179 /* compile time constant */
6180 t->value = malloc(sizeof(constant_t));
6181 memcpy(t->value, &cval, sizeof(constant_t));
6182 info->value = constant_clone(t->value);
6184 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6185 /* initalization code (if needed) */
6187 if(v.c && !is_pushundefined(v.c)) {
6188 c = abc_getlocal_0(c);
6189 c = code_append(c, v.c);
6190 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6192 c = abc_initproperty2(c, &mname);
6194 c = abc_setslot(c, t->slot_id);
6197 *code = code_append(*code, c);
6200 if(slotstate_varconst==KW_CONST) {
6201 t->kind= TRAIT_CONST;
6202 info->flags |= FLAG_CONST;
6216 /* Line 1464 of skeleton.m4 */
6217 #line 2714 "parser.y"
6218 {(yyval.constant)=0;}
6227 /* Line 1464 of skeleton.m4 */
6228 #line 2715 "parser.y"
6230 (yyval.constant) = malloc(sizeof(constant_t));
6231 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6232 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6233 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6244 /* Line 1464 of skeleton.m4 */
6245 #line 2724 "parser.y"
6246 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6255 /* Line 1464 of skeleton.m4 */
6256 #line 2725 "parser.y"
6258 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6268 /* Line 1464 of skeleton.m4 */
6269 #line 2728 "parser.y"
6270 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6279 /* Line 1464 of skeleton.m4 */
6280 #line 2729 "parser.y"
6281 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6290 /* Line 1464 of skeleton.m4 */
6291 #line 2730 "parser.y"
6292 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6301 /* Line 1464 of skeleton.m4 */
6302 #line 2731 "parser.y"
6303 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6312 /* Line 1464 of skeleton.m4 */
6313 #line 2732 "parser.y"
6314 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6323 /* Line 1464 of skeleton.m4 */
6324 #line 2733 "parser.y"
6325 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6334 /* Line 1464 of skeleton.m4 */
6335 #line 2734 "parser.y"
6336 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6345 /* Line 1464 of skeleton.m4 */
6346 #line 2754 "parser.y"
6347 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6356 /* Line 1464 of skeleton.m4 */
6357 #line 2755 "parser.y"
6358 {PASS_ALWAYS tokenizer_begin_xmltext();}
6367 /* Line 1464 of skeleton.m4 */
6368 #line 2756 "parser.y"
6369 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6378 /* Line 1464 of skeleton.m4 */
6379 #line 2758 "parser.y"
6380 {PASS_ALWAYS tokenizer_begin_xmltext();}
6389 /* Line 1464 of skeleton.m4 */
6390 #line 2758 "parser.y"
6392 (yyval.id)=strdup("{...}");
6393 as3_warning("xml string substitution not yet supported");
6403 /* Line 1464 of skeleton.m4 */
6404 #line 2762 "parser.y"
6405 {PASS_ALWAYS tokenizer_begin_xml();}
6414 /* Line 1464 of skeleton.m4 */
6415 #line 2762 "parser.y"
6417 (yyval.id)=strdup("{...}");
6418 as3_warning("xml string substitution not yet supported");
6428 /* Line 1464 of skeleton.m4 */
6429 #line 2766 "parser.y"
6439 /* Line 1464 of skeleton.m4 */
6440 #line 2767 "parser.y"
6442 (yyval.id) = concat2((yyvsp[(1) - (2)].id), "{...}");
6452 /* Line 1464 of skeleton.m4 */
6453 #line 2770 "parser.y"
6454 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), string_cstr(&(yyvsp[(2) - (2)].str)));}
6463 /* Line 1464 of skeleton.m4 */
6464 #line 2771 "parser.y"
6465 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), ">");}
6474 /* Line 1464 of skeleton.m4 */
6475 #line 2773 "parser.y"
6476 {(yyval.id)=concat2((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].id));}
6485 /* Line 1464 of skeleton.m4 */
6486 #line 2774 "parser.y"
6487 {(yyval.id)=concat3((yyvsp[(1) - (3)].id),(yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));free((yyvsp[(2) - (3)].id));free((yyvsp[(3) - (3)].id));}
6496 /* Line 1464 of skeleton.m4 */
6497 #line 2776 "parser.y"
6498 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6507 /* Line 1464 of skeleton.m4 */
6508 #line 2777 "parser.y"
6509 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6518 /* Line 1464 of skeleton.m4 */
6519 #line 2779 "parser.y"
6521 (yyval.id) = allocprintf("<%s%s>%s</%s>", (yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].id), (yyvsp[(5) - (10)].id), (yyvsp[(8) - (10)].id));
6522 free((yyvsp[(2) - (10)].id));free((yyvsp[(3) - (10)].id));free((yyvsp[(5) - (10)].id));free((yyvsp[(8) - (10)].id));
6532 /* Line 1464 of skeleton.m4 */
6533 #line 2783 "parser.y"
6535 (yyval.id) = allocprintf("<%s%s/>", (yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].id));
6545 /* Line 1464 of skeleton.m4 */
6546 #line 2786 "parser.y"
6548 (yyval.id) = allocprintf("<%s%s>%s%s</%s>", (yyvsp[(2) - (11)].id), (yyvsp[(3) - (11)].id), (yyvsp[(5) - (11)].id), (yyvsp[(6) - (11)].id), (yyvsp[(9) - (11)].id));
6549 free((yyvsp[(2) - (11)].id));free((yyvsp[(3) - (11)].id));free((yyvsp[(5) - (11)].id));free((yyvsp[(6) - (11)].id));free((yyvsp[(9) - (11)].id));
6559 /* Line 1464 of skeleton.m4 */
6560 #line 2791 "parser.y"
6561 {(yyval.id)=strdup("");}
6570 /* Line 1464 of skeleton.m4 */
6571 #line 2792 "parser.y"
6572 {(yyval.id)=concat2(" ",(yyvsp[(1) - (1)].id));}
6581 /* Line 1464 of skeleton.m4 */
6582 #line 2793 "parser.y"
6583 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6592 /* Line 1464 of skeleton.m4 */
6593 #line 2794 "parser.y"
6594 {(yyval.id)=concat3((yyvsp[(1) - (2)].id)," ",(yyvsp[(2) - (2)].id));free((yyvsp[(1) - (2)].id));free((yyvsp[(2) - (2)].id));}
6603 /* Line 1464 of skeleton.m4 */
6604 #line 2796 "parser.y"
6606 (yyval.id) = strdup("{...}");
6616 /* Line 1464 of skeleton.m4 */
6617 #line 2799 "parser.y"
6619 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6620 (yyval.id) = concat2("{...}=",str);
6630 /* Line 1464 of skeleton.m4 */
6631 #line 2803 "parser.y"
6633 (yyval.id) = strdup("{...}={...}");
6643 /* Line 1464 of skeleton.m4 */
6644 #line 2806 "parser.y"
6646 (yyval.id) = concat2((yyvsp[(1) - (3)].id),"={...}");
6656 /* Line 1464 of skeleton.m4 */
6657 #line 2809 "parser.y"
6659 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6660 (yyval.id)=allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str);
6662 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6672 /* Line 1464 of skeleton.m4 */
6673 #line 2819 "parser.y"
6676 memset(&(yyval.params),0,sizeof((yyval.params)));
6686 /* Line 1464 of skeleton.m4 */
6687 #line 2823 "parser.y"
6690 (yyval.params)=(yyvsp[(1) - (1)].params);
6700 /* Line 1464 of skeleton.m4 */
6701 #line 2829 "parser.y"
6704 memset(&(yyval.params),0,sizeof((yyval.params)));
6705 (yyval.params).varargs=1;
6706 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6716 /* Line 1464 of skeleton.m4 */
6717 #line 2835 "parser.y"
6720 (yyval.params) =(yyvsp[(1) - (4)].params);
6721 (yyval.params).varargs=1;
6722 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6732 /* Line 1464 of skeleton.m4 */
6733 #line 2843 "parser.y"
6736 (yyval.params) = (yyvsp[(1) - (3)].params);
6737 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6747 /* Line 1464 of skeleton.m4 */
6748 #line 2848 "parser.y"
6751 memset(&(yyval.params),0,sizeof((yyval.params)));
6752 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6762 /* Line 1464 of skeleton.m4 */
6763 #line 2854 "parser.y"
6766 (yyval.param) = rfx_calloc(sizeof(param_t));
6767 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6768 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6770 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6780 /* Line 1464 of skeleton.m4 */
6781 #line 2862 "parser.y"
6784 (yyval.param) = rfx_calloc(sizeof(param_t));
6785 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6786 (yyval.param)->type = TYPE_ANY;
6788 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6798 /* Line 1464 of skeleton.m4 */
6799 #line 2872 "parser.y"
6800 {PASS12 (yyval.token)=0;}
6809 /* Line 1464 of skeleton.m4 */
6810 #line 2875 "parser.y"
6811 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6820 /* Line 1464 of skeleton.m4 */
6821 #line 2876 "parser.y"
6824 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6826 if(!state->method->info) syntaxerror("internal error");
6828 code_t*c = method_header(state->method);
6829 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6831 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6833 list_deep_free((yyvsp[(6) - (12)].params).list);
6844 /* Line 1464 of skeleton.m4 */
6845 #line 2892 "parser.y"
6846 {PASS12 (yyval.id)=0;}
6855 /* Line 1464 of skeleton.m4 */
6856 #line 2894 "parser.y"
6857 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6866 /* Line 1464 of skeleton.m4 */
6867 #line 2895 "parser.y"
6870 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6872 methodinfo_t*f = state->method->info;
6873 if(!f || !f->kind) syntaxerror("internal error");
6875 code_t*c = method_header(state->method);
6876 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6878 int index = state->method->var_index;
6879 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6881 (yyval.value).c = abc_getlocal(0, index);
6882 (yyval.value).t = TYPE_FUNCTION(f);
6884 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6894 /* Line 1464 of skeleton.m4 */
6895 #line 2917 "parser.y"
6897 PASS1 NEW(unresolvedinfo_t,c);
6898 memset(c, 0, sizeof(*c));
6899 c->kind = INFOTYPE_UNRESOLVED;
6900 c->name = (yyvsp[(1) - (1)].id);
6901 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6903 c->nsset = get_current_imports();
6904 /* make the compiler look for this class in the current directory,
6906 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6908 (yyval.classinfo) = (classinfo_t*)c;
6910 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6911 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6912 (yyval.classinfo) = (classinfo_t*)s;
6922 /* Line 1464 of skeleton.m4 */
6923 #line 2936 "parser.y"
6925 PASS1 NEW(unresolvedinfo_t,c);
6926 memset(c, 0, sizeof(*c));
6927 c->kind = INFOTYPE_UNRESOLVED;
6928 c->package = (yyvsp[(1) - (3)].id);
6929 c->name = (yyvsp[(3) - (3)].id);
6930 (yyval.classinfo) = (classinfo_t*)c;
6932 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6933 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6934 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6935 (yyval.classinfo) = (classinfo_t*)s;
6945 /* Line 1464 of skeleton.m4 */
6946 #line 2953 "parser.y"
6947 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6956 /* Line 1464 of skeleton.m4 */
6957 #line 2954 "parser.y"
6958 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6967 /* Line 1464 of skeleton.m4 */
6968 #line 2956 "parser.y"
6969 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6978 /* Line 1464 of skeleton.m4 */
6979 #line 2957 "parser.y"
6980 {PASS12 (yyval.classinfo)=TYPE_ANY;}
6989 /* Line 1464 of skeleton.m4 */
6990 #line 2958 "parser.y"
6991 {PASS12 (yyval.classinfo)=TYPE_VOID;}
7000 /* Line 1464 of skeleton.m4 */
7001 #line 2967 "parser.y"
7002 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
7011 /* Line 1464 of skeleton.m4 */
7012 #line 2968 "parser.y"
7013 {PASS12 (yyval.classinfo)=0;}
7022 /* Line 1464 of skeleton.m4 */
7023 #line 2972 "parser.y"
7024 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7033 /* Line 1464 of skeleton.m4 */
7034 #line 2973 "parser.y"
7035 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
7044 /* Line 1464 of skeleton.m4 */
7045 #line 2975 "parser.y"
7046 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7055 /* Line 1464 of skeleton.m4 */
7056 #line 2979 "parser.y"
7057 {(yyval.value_list).number=1;
7058 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
7068 /* Line 1464 of skeleton.m4 */
7069 #line 2983 "parser.y"
7070 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
7079 /* Line 1464 of skeleton.m4 */
7080 #line 2984 "parser.y"
7082 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
7083 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
7093 /* Line 1464 of skeleton.m4 */
7094 #line 2990 "parser.y"
7096 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
7097 (yyval.value).c = v.c;
7098 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
7100 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
7101 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7102 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7103 (yyval.value).c = code_cutlast((yyval.value).c);
7104 (yyval.value).c = code_append((yyval.value).c, paramcode);
7105 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
7106 multiname_destroy(name);
7107 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7108 code_free((yyval.value).c);
7109 classinfo_t*c = v.t->data;
7111 (yyval.value).c = abc_findpropstrict2(0, &m);
7112 (yyval.value).c = code_append((yyval.value).c, paramcode);
7113 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
7114 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
7115 int slot = (int)(ptroff_t)$$.c->data[0];
7116 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
7117 multiname_t*name = t->name;
7118 $$.c = code_cutlast($$.c);
7119 $$.c = code_append($$.c, paramcode);
7120 $$.c = abc_constructprop2($$.c, name, $4.number);*/
7122 (yyval.value).c = code_append((yyval.value).c, paramcode);
7123 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
7126 (yyval.value).t = TYPE_ANY;
7127 if(TYPE_IS_CLASS(v.t) && v.t->data) {
7128 (yyval.value).t = v.t->data;
7130 (yyval.value).c = abc_coerce_a((yyval.value).c);
7131 (yyval.value).t = TYPE_ANY;
7142 /* Line 1464 of skeleton.m4 */
7143 #line 3034 "parser.y"
7146 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
7147 (yyval.value).c = v.c;
7148 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7149 (yyval.value).c = code_cutlast((yyval.value).c);
7151 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
7153 (yyval.value).t = TYPE_ANY;
7154 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7155 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7156 (yyval.value).c = code_cutlast((yyval.value).c);
7157 (yyval.value).c = code_append((yyval.value).c, paramcode);
7158 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7159 multiname_destroy(name);
7160 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7161 int slot = (int)(ptroff_t)$$.c->data[0];
7162 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7163 if(t->kind!=TRAIT_METHOD) {
7164 //ok: flash allows to assign closures to members.
7166 multiname_t*name = t->name;
7167 $$.c = code_cutlast($$.c);
7168 $$.c = code_append($$.c, paramcode);
7169 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7170 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7171 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7172 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7173 (yyval.value).c = code_cutlast((yyval.value).c);
7174 (yyval.value).c = code_append((yyval.value).c, paramcode);
7175 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7176 multiname_destroy(name);
7178 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7179 (yyval.value).c = code_append((yyval.value).c, paramcode);
7180 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7183 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7184 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7185 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7186 // calling a class is like a typecast
7187 (yyval.value).t = (classinfo_t*)v.t->data;
7189 (yyval.value).c = abc_coerce_a((yyval.value).c);
7190 (yyval.value).t = TYPE_ANY;
7201 /* Line 1464 of skeleton.m4 */
7202 #line 3084 "parser.y"
7204 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7205 if(!state->method) syntaxerror("super() not allowed outside of a function");
7206 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7208 (yyval.value).c = code_new();
7209 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7211 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7213 this is dependent on the control path, check this somewhere else
7214 if(state->method->has_super)
7215 syntaxerror("constructor may call super() only once");
7217 state->method->has_super = 1;
7219 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7220 (yyval.value).c = abc_pushundefined((yyval.value).c);
7221 (yyval.value).t = TYPE_ANY;
7231 /* Line 1464 of skeleton.m4 */
7232 #line 3105 "parser.y"
7234 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7235 (yyval.value).c = v.c;
7236 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7237 (yyval.value).c = code_cutlast((yyval.value).c);
7239 multiname_t*name = 0;
7240 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7241 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7242 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7243 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7244 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7245 (yyval.value).c = code_cutlast((yyval.value).c);
7246 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7248 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7249 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7250 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7252 (yyval.value).t = TYPE_BOOLEAN;
7262 /* Line 1464 of skeleton.m4 */
7263 #line 3127 "parser.y"
7265 (yyval.code) = abc_returnvoid(0);
7275 /* Line 1464 of skeleton.m4 */
7276 #line 3130 "parser.y"
7278 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7279 (yyval.code) = abc_returnvalue((yyval.code));
7289 /* Line 1464 of skeleton.m4 */
7290 #line 3137 "parser.y"
7292 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7302 /* Line 1464 of skeleton.m4 */
7303 #line 3140 "parser.y"
7305 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7315 /* Line 1464 of skeleton.m4 */
7316 #line 3143 "parser.y"
7318 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7328 /* Line 1464 of skeleton.m4 */
7329 #line 3146 "parser.y"
7331 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7341 /* Line 1464 of skeleton.m4 */
7342 #line 3149 "parser.y"
7344 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7354 /* Line 1464 of skeleton.m4 */
7355 #line 3152 "parser.y"
7357 (yyval.code) = (yyvsp[(1) - (3)].code);
7358 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7368 /* Line 1464 of skeleton.m4 */
7369 #line 3157 "parser.y"
7370 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7379 /* Line 1464 of skeleton.m4 */
7380 #line 3158 "parser.y"
7381 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7390 /* Line 1464 of skeleton.m4 */
7391 #line 3160 "parser.y"
7392 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7401 /* Line 1464 of skeleton.m4 */
7402 #line 3161 "parser.y"
7403 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7412 /* Line 1464 of skeleton.m4 */
7413 #line 3162 "parser.y"
7414 {syntaxerror("dictionary keys must be strings");}
7423 /* Line 1464 of skeleton.m4 */
7424 #line 3163 "parser.y"
7425 {syntaxerror("dictionary keys must be strings");}
7434 /* Line 1464 of skeleton.m4 */
7435 #line 3164 "parser.y"
7436 {syntaxerror("dictionary keys must be strings");}
7445 /* Line 1464 of skeleton.m4 */
7446 #line 3166 "parser.y"
7448 (yyval.value_list).cc = 0;
7449 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7450 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7451 (yyval.value_list).number = 2;
7461 /* Line 1464 of skeleton.m4 */
7462 #line 3172 "parser.y"
7464 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7465 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7466 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7467 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7477 /* Line 1464 of skeleton.m4 */
7478 #line 3181 "parser.y"
7479 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7488 /* Line 1464 of skeleton.m4 */
7489 #line 3182 "parser.y"
7490 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7499 /* Line 1464 of skeleton.m4 */
7500 #line 3183 "parser.y"
7501 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7510 /* Line 1464 of skeleton.m4 */
7511 #line 3184 "parser.y"
7512 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7521 /* Line 1464 of skeleton.m4 */
7522 #line 3185 "parser.y"
7523 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7532 /* Line 1464 of skeleton.m4 */
7533 #line 3186 "parser.y"
7534 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7543 /* Line 1464 of skeleton.m4 */
7544 #line 3188 "parser.y"
7546 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7556 /* Line 1464 of skeleton.m4 */
7557 #line 3192 "parser.y"
7561 multiname_t m = {QNAME, &stdns, 0, "XML"};
7562 v.c = abc_getlex2(v.c, &m);
7563 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].id));
7564 v.c = abc_construct(v.c, 1);
7566 (yyval.node) = mkcodenode(v);
7576 /* Line 1464 of skeleton.m4 */
7577 #line 3204 "parser.y"
7581 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7582 if(!(yyvsp[(1) - (1)].regexp).options) {
7583 v.c = abc_getlex2(v.c, &m);
7584 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7585 v.c = abc_construct(v.c, 1);
7587 v.c = abc_getlex2(v.c, &m);
7588 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7589 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7590 v.c = abc_construct(v.c, 2);
7593 (yyval.node) = mkcodenode(v);
7603 /* Line 1464 of skeleton.m4 */
7604 #line 3222 "parser.y"
7607 state->method->need_arguments = 1;
7610 v.c = abc_getlocal(0, state->method->need_arguments);
7612 (yyval.node) = mkcodenode(v);
7622 /* Line 1464 of skeleton.m4 */
7623 #line 3233 "parser.y"
7627 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7628 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7629 v.t = registry_getarrayclass();
7630 (yyval.node) = mkcodenode(v);
7640 /* Line 1464 of skeleton.m4 */
7641 #line 3243 "parser.y"
7645 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7646 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7647 v.t = registry_getobjectclass();
7648 (yyval.node) = mkcodenode(v);
7658 /* Line 1464 of skeleton.m4 */
7659 #line 3252 "parser.y"
7660 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7669 /* Line 1464 of skeleton.m4 */
7670 #line 3253 "parser.y"
7671 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7680 /* Line 1464 of skeleton.m4 */
7681 #line 3254 "parser.y"
7682 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7691 /* Line 1464 of skeleton.m4 */
7692 #line 3255 "parser.y"
7693 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7702 /* Line 1464 of skeleton.m4 */
7703 #line 3256 "parser.y"
7704 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7713 /* Line 1464 of skeleton.m4 */
7714 #line 3257 "parser.y"
7715 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7724 /* Line 1464 of skeleton.m4 */
7725 #line 3258 "parser.y"
7726 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7735 /* Line 1464 of skeleton.m4 */
7736 #line 3259 "parser.y"
7737 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7746 /* Line 1464 of skeleton.m4 */
7747 #line 3260 "parser.y"
7748 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7757 /* Line 1464 of skeleton.m4 */
7758 #line 3261 "parser.y"
7759 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7768 /* Line 1464 of skeleton.m4 */
7769 #line 3262 "parser.y"
7770 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7779 /* Line 1464 of skeleton.m4 */
7780 #line 3263 "parser.y"
7781 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7790 /* Line 1464 of skeleton.m4 */
7791 #line 3264 "parser.y"
7792 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7801 /* Line 1464 of skeleton.m4 */
7802 #line 3265 "parser.y"
7803 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7812 /* Line 1464 of skeleton.m4 */
7813 #line 3266 "parser.y"
7814 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7823 /* Line 1464 of skeleton.m4 */
7824 #line 3267 "parser.y"
7825 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7834 /* Line 1464 of skeleton.m4 */
7835 #line 3268 "parser.y"
7836 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7845 /* Line 1464 of skeleton.m4 */
7846 #line 3269 "parser.y"
7847 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7856 /* Line 1464 of skeleton.m4 */
7857 #line 3270 "parser.y"
7858 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7867 /* Line 1464 of skeleton.m4 */
7868 #line 3271 "parser.y"
7869 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7878 /* Line 1464 of skeleton.m4 */
7879 #line 3272 "parser.y"
7880 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7889 /* Line 1464 of skeleton.m4 */
7890 #line 3273 "parser.y"
7891 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7900 /* Line 1464 of skeleton.m4 */
7901 #line 3274 "parser.y"
7902 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7911 /* Line 1464 of skeleton.m4 */
7912 #line 3275 "parser.y"
7913 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7922 /* Line 1464 of skeleton.m4 */
7923 #line 3276 "parser.y"
7924 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7933 /* Line 1464 of skeleton.m4 */
7934 #line 3277 "parser.y"
7935 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7944 /* Line 1464 of skeleton.m4 */
7945 #line 3278 "parser.y"
7946 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7955 /* Line 1464 of skeleton.m4 */
7956 #line 3279 "parser.y"
7957 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(3) - (4)].node));}
7966 /* Line 1464 of skeleton.m4 */
7967 #line 3280 "parser.y"
7968 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
7977 /* Line 1464 of skeleton.m4 */
7978 #line 3281 "parser.y"
7979 { (yyval.node) = mkconstnode(constant_new_undefined());}
7988 /* Line 1464 of skeleton.m4 */
7989 #line 3282 "parser.y"
7990 { (yyval.node)=(yyvsp[(2) - (3)].node);}
7999 /* Line 1464 of skeleton.m4 */
8000 #line 3283 "parser.y"
8001 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
8010 /* Line 1464 of skeleton.m4 */
8011 #line 3284 "parser.y"
8012 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
8021 /* Line 1464 of skeleton.m4 */
8022 #line 3285 "parser.y"
8023 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8032 /* Line 1464 of skeleton.m4 */
8033 #line 3286 "parser.y"
8034 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8043 /* Line 1464 of skeleton.m4 */
8044 #line 3287 "parser.y"
8045 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8054 /* Line 1464 of skeleton.m4 */
8055 #line 3288 "parser.y"
8056 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8065 /* Line 1464 of skeleton.m4 */
8066 #line 3289 "parser.y"
8067 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8076 /* Line 1464 of skeleton.m4 */
8077 #line 3290 "parser.y"
8078 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8087 /* Line 1464 of skeleton.m4 */
8088 #line 3291 "parser.y"
8089 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8098 /* Line 1464 of skeleton.m4 */
8099 #line 3292 "parser.y"
8100 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8109 /* Line 1464 of skeleton.m4 */
8110 #line 3293 "parser.y"
8111 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8120 /* Line 1464 of skeleton.m4 */
8121 #line 3294 "parser.y"
8122 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8131 /* Line 1464 of skeleton.m4 */
8132 #line 3295 "parser.y"
8133 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8142 /* Line 1464 of skeleton.m4 */
8143 #line 3296 "parser.y"
8144 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8153 /* Line 1464 of skeleton.m4 */
8154 #line 3297 "parser.y"
8155 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
8164 /* Line 1464 of skeleton.m4 */
8165 #line 3299 "parser.y"
8166 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
8175 /* Line 1464 of skeleton.m4 */
8176 #line 3300 "parser.y"
8177 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
8186 /* Line 1464 of skeleton.m4 */
8187 #line 3301 "parser.y"
8188 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
8197 /* Line 1464 of skeleton.m4 */
8198 #line 3302 "parser.y"
8199 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
8208 /* Line 1464 of skeleton.m4 */
8209 #line 3305 "parser.y"
8210 { if(!state->cls->info)
8211 syntaxerror("super keyword not allowed outside a class");
8212 classinfo_t*t = state->cls->info->superclass;
8213 if(!t) t = TYPE_OBJECT;
8214 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8215 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8218 v.c = abc_getlocal_0(v.c);
8219 v.c = abc_getsuper2(v.c, &m);
8220 v.t = slotinfo_gettype((slotinfo_t*)f);
8221 (yyval.node) = mkcodenode(v);
8231 /* Line 1464 of skeleton.m4 */
8232 #line 3319 "parser.y"
8235 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
8236 v.c = abc_getlex2(0, &m);
8238 (yyval.node) = mkcodenode(v);
8248 /* Line 1464 of skeleton.m4 */
8249 #line 3327 "parser.y"
8250 {PASS12 new_state();state->xmlfilter=1;}
8259 /* Line 1464 of skeleton.m4 */
8260 #line 3327 "parser.y"
8264 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8265 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8267 int index = alloc_local();
8268 int result = alloc_local();
8269 int tmp = alloc_local();
8270 int xml = alloc_local();
8272 c = code_append(c, v.c);
8273 c = abc_checkfilter(c);
8274 c = abc_coerce_a(c); //hasnext2 converts to *
8275 c = abc_setlocal(c, xml);
8276 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8277 c = abc_getlex2(c, &m);
8278 c = abc_construct(c, 0);
8279 c = abc_setlocal(c, result);
8280 c = abc_pushbyte(c, 0);
8281 c = abc_setlocal(c, index);
8282 code_t*jmp = c = abc_jump(c, 0);
8283 code_t*loop = c = abc_label(c);
8284 c = abc_getlocal(c, xml);
8285 c = abc_getlocal(c, index);
8286 c = abc_nextvalue(c);
8288 c = abc_setlocal(c, tmp);
8289 c = abc_pushwith(c);
8290 c = code_append(c, w.c);
8291 c = abc_popscope(c);
8292 code_t*b = c = abc_iffalse(c, 0);
8293 c = abc_getlocal(c, result);
8294 c = abc_getlocal(c, index);
8295 c = abc_getlocal(c, tmp);
8296 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8297 c = abc_setproperty2(c, &m2);
8298 c = b->branch = jmp->branch = abc_nop(c);
8299 c = abc_kill(c, tmp);
8300 c = abc_hasnext2(c, xml, index);
8301 c = abc_iftrue(c, loop);
8302 c = abc_getlocal(c, result);
8303 c = abc_kill(c, xml);
8304 c = abc_kill(c, result);
8305 c = abc_kill(c, index);
8312 (yyval.node) = mkcodenode(r);
8322 /* Line 1464 of skeleton.m4 */
8323 #line 3381 "parser.y"
8324 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8333 /* Line 1464 of skeleton.m4 */
8334 #line 3382 "parser.y"
8344 /* Line 1464 of skeleton.m4 */
8345 #line 3383 "parser.y"
8346 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8355 /* Line 1464 of skeleton.m4 */
8356 #line 3385 "parser.y"
8366 /* Line 1464 of skeleton.m4 */
8367 #line 3393 "parser.y"
8369 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8370 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8371 v.c = code_append(v.c, w.c);
8372 if(!TYPE_IS_NAMESPACE(w.t)) {
8373 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8375 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8376 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8377 v.c = abc_getproperty2(v.c, &m);
8378 if(TYPE_IS_XML(v.t)) {
8381 v.c = abc_coerce_a(v.c);
8384 (yyval.node) = mkcodenode(v);
8394 /* Line 1464 of skeleton.m4 */
8395 #line 3411 "parser.y"
8397 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8398 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8399 v.c = abc_getdescendants2(v.c, &m);
8401 (yyval.node) = mkcodenode(v);
8411 /* Line 1464 of skeleton.m4 */
8412 #line 3418 "parser.y"
8414 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8415 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8416 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8417 v.c = code_append(v.c, w.c);
8418 v.c = converttype(w.c, w.t, TYPE_STRING);
8419 v.c = abc_getproperty2(v.c, &m);
8421 (yyval.node) = mkcodenode(v);
8431 /* Line 1464 of skeleton.m4 */
8432 #line 3429 "parser.y"
8434 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8435 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8436 v.c = abc_getproperty2(v.c, &m);
8438 (yyval.node) = mkcodenode(v);
8448 /* Line 1464 of skeleton.m4 */
8449 #line 3436 "parser.y"
8451 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8452 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8453 v.c = abc_getdescendants2(v.c, &m);
8455 (yyval.node) = mkcodenode(v);
8465 /* Line 1464 of skeleton.m4 */
8466 #line 3443 "parser.y"
8468 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8469 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8470 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8471 v.c = code_append(v.c, w.c);
8472 v.c = converttype(w.c, w.t, TYPE_STRING);
8473 v.c = abc_getproperty2(v.c, &m);
8475 (yyval.node) = mkcodenode(v);
8485 /* Line 1464 of skeleton.m4 */
8486 #line 3453 "parser.y"
8488 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8489 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8490 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8491 v.c = code_append(v.c, w.c);
8492 v.c = converttype(w.c, w.t, TYPE_STRING);
8493 v.c = abc_getdescendants2(v.c, &m);
8495 (yyval.node) = mkcodenode(v);
8505 /* Line 1464 of skeleton.m4 */
8506 #line 3464 "parser.y"
8508 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8509 (yyval.value).c = v1.c;
8510 classinfo_t*t = v1.t;
8512 if(TYPE_IS_CLASS(t) && t->data) {
8516 if(TYPE_IS_XML(t)) {
8517 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8518 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8519 (yyval.value).c = abc_coerce_a((yyval.value).c);
8520 (yyval.value).t = TYPE_XMLLIST;
8522 if(t->subtype==INFOTYPE_UNRESOLVED) {
8523 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8525 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8527 if(f && !is_static != !(f->flags&FLAG_STATIC))
8529 if(f && f->slot && !noslot) {
8530 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8533 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8535 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8536 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8538 /* determine type */
8539 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8540 if(!(yyval.value).t)
8541 (yyval.value).c = abc_coerce_a((yyval.value).c);
8543 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8544 string_t*package = v1.c->data[0];
8545 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8547 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8549 (yyval.value) = push_class(a);
8550 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8551 registry_ispackage(package2)) {
8552 (yyval.value).c = v1.c;
8553 (yyval.value).c->data[0] = string_new4(package2);
8554 (yyval.value).t = 0;
8556 syntaxerror("couldn't resolve %s", package2);
8559 /* when resolving a property on an unknown type, we do know the
8560 name of the property (and don't seem to need the package), but
8561 we need to make avm2 try out all access modes */
8562 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8563 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8564 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8565 (yyval.value).c = abc_coerce_a((yyval.value).c);
8566 (yyval.value).t = TYPE_ANY;
8577 /* Line 1464 of skeleton.m4 */
8578 #line 3642 "parser.y"
8581 /* Queue unresolved identifiers for checking against the parent
8582 function's variables.
8583 We consider everything which is not a local variable "unresolved".
8584 This encompasses class names, members of the surrounding class
8585 etc. which is *correct* because local variables of the parent function
8589 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8590 if(state->method->inner) {
8591 unknown_variable((yyvsp[(1) - (1)].id));
8593 /* let the compiler know that it might want to check the current directory/package
8594 for this identifier- maybe there's a file $1.as defining $1. */
8595 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8601 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8611 /* Line 1464 of skeleton.m4 */
8612 #line 3678 "parser.y"
8615 NEW(namespace_decl_t,n);
8616 n->name = (yyvsp[(2) - (2)].id);
8617 n->url = (yyvsp[(2) - (2)].id);
8618 (yyval.namespace_decl)=n;
8628 /* Line 1464 of skeleton.m4 */
8629 #line 3685 "parser.y"
8632 NEW(namespace_decl_t,n);
8633 n->name = (yyvsp[(2) - (4)].id);
8634 n->url = (yyvsp[(4) - (4)].id);
8635 (yyval.namespace_decl)=n;
8645 /* Line 1464 of skeleton.m4 */
8646 #line 3692 "parser.y"
8649 NEW(namespace_decl_t,n);
8650 n->name = (yyvsp[(2) - (4)].id);
8651 n->url = (yyvsp[(4) - (4)].str).str;
8652 (yyval.namespace_decl)=n;
8662 /* Line 1464 of skeleton.m4 */
8663 #line 3699 "parser.y"
8666 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8668 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8669 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8670 var->type = TYPE_NAMESPACE;
8672 ns.access = ACCESS_NAMESPACE;
8673 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8674 var->value = constant_new_namespace(&ns);
8677 MULTINAME(m, TYPE_NAMESPACE);
8678 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8679 t->value = var->value;
8680 t->type_name = multiname_clone(&m);
8693 /* Line 1464 of skeleton.m4 */
8694 #line 3722 "parser.y"
8696 as3_warning("default xml namespaces not supported yet");
8706 /* Line 1464 of skeleton.m4 */
8707 #line 3726 "parser.y"
8710 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8712 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8713 if(s->kind == INFOTYPE_UNRESOLVED) {
8714 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8716 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8719 if(!s || s->kind != INFOTYPE_VAR)
8720 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8721 if(!s->value || !NS_TYPE(s->value->type))
8722 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8723 url = s->value->ns->name;
8725 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8726 add_active_url(url);
8735 /* Line 1464 of skeleton.m4 */
8736 #line 8737 "parser.tab.c"
8739 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8743 YY_STACK_PRINT (yyss, yyssp);
8747 /* Now `shift' the result of the reduction. Determine what state
8748 that goes to, based on the state we popped back to and the rule
8749 number reduced by. */
8753 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8754 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8755 yystate = yytable[yystate];
8757 yystate = yydefgoto[yyn - YYNTOKENS];
8762 /*------------------------------------.
8763 | yyerrlab -- here on detecting error |
8764 `------------------------------------*/
8766 /* If not already recovering from an error, report this error. */
8770 #if ! YYERROR_VERBOSE
8771 yyerror (YY_("syntax error"));
8774 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8775 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8777 YYSIZE_T yyalloc = 2 * yysize;
8778 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8779 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8780 if (yymsg != yymsgbuf)
8781 YYSTACK_FREE (yymsg);
8782 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8784 yymsg_alloc = yyalloc;
8788 yymsg_alloc = sizeof yymsgbuf;
8792 if (0 < yysize && yysize <= yymsg_alloc)
8794 (void) yysyntax_error (yymsg, yystate, yychar);
8799 yyerror (YY_("syntax error"));
8801 goto yyexhaustedlab;
8809 if (yyerrstatus == 3)
8811 /* If just tried and failed to reuse lookahead token after an
8812 error, discard it. */
8814 if (yychar <= YYEOF)
8816 /* Return failure if at end of input. */
8817 if (yychar == YYEOF)
8822 yydestruct ("Error: discarding",
8828 /* Else will try to reuse lookahead token after shifting the error
8833 /*---------------------------------------------------.
8834 | yyerrorlab -- error raised explicitly by YYERROR. |
8835 `---------------------------------------------------*/
8838 /* Pacify compilers like GCC when the user code never invokes
8839 YYERROR and the label yyerrorlab therefore never appears in user
8841 if (/*CONSTCOND*/ 0)
8844 /* Do not reclaim the symbols of the rule which action triggered
8848 YY_STACK_PRINT (yyss, yyssp);
8853 /*-------------------------------------------------------------.
8854 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8855 `-------------------------------------------------------------*/
8857 yyerrstatus = 3; /* Each real token shifted decrements this. */
8861 yyn = yypact[yystate];
8862 if (yyn != YYPACT_NINF)
8865 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8873 /* Pop the current state because it cannot handle the error token. */
8878 yydestruct ("Error: popping",
8879 yystos[yystate], yyvsp);
8882 YY_STACK_PRINT (yyss, yyssp);
8888 /* Shift the error token. */
8889 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8895 /*-------------------------------------.
8896 | yyacceptlab -- YYACCEPT comes here. |
8897 `-------------------------------------*/
8902 /*-----------------------------------.
8903 | yyabortlab -- YYABORT comes here. |
8904 `-----------------------------------*/
8909 #if !defined(yyoverflow) || YYERROR_VERBOSE
8910 /*-------------------------------------------------.
8911 | yyexhaustedlab -- memory exhaustion comes here. |
8912 `-------------------------------------------------*/
8914 yyerror (YY_("memory exhausted"));
8920 if (yychar != YYEMPTY)
8921 yydestruct ("Cleanup: discarding lookahead",
8923 /* Do not reclaim the symbols of the rule which action triggered
8924 this YYABORT or YYACCEPT. */
8926 YY_STACK_PRINT (yyss, yyssp);
8927 while (yyssp != yyss)
8929 yydestruct ("Cleanup: popping",
8930 yystos[*yyssp], yyvsp);
8935 YYSTACK_FREE (yyss);
8938 if (yymsg != yymsgbuf)
8939 YYSTACK_FREE (yymsg);
8941 /* Make sure YYID is used. */
8942 return YYID (yyresult);