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 for(t=0;t<state->vars->hashsize;t++) {
752 DICT_ITERATE_DATA(state->vars, variable_t*, v) {
753 if(v->type && v->init) {
754 c = defaultvalue(c, v->type);
755 c = abc_setlocal(c, v->index);
756 k = abc_kill(k, v->index);
765 if(x->opcode== OPCODE___BREAK__ ||
766 x->opcode== OPCODE___CONTINUE__) {
767 /* link kill code before break/continue */
768 code_t*e = code_dup(k);
769 code_t*s = code_start(e);
781 c = code_append(c, body);
782 c = code_append(c, k);
786 static void unknown_variable(char*name)
788 if(!state->method->unresolved_variables)
789 state->method->unresolved_variables = dict_new();
790 if(!dict_contains(state->method->unresolved_variables, name))
791 dict_put(state->method->unresolved_variables, name, 0);
794 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
796 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
797 c = abc_getlocal_0(c);
798 c = abc_pushscope(c);
801 /* FIXME: this alloc_local() causes variable indexes to be
802 different in pass2 than in pass1 */
803 if(!m->activation_var) {
804 m->activation_var = alloc_local();
807 c = abc_newactivation(c);
809 c = abc_pushscope(c);
810 c = abc_setlocal(c, m->activation_var);
812 c = abc_getlocal(c, m->activation_var);
813 c = abc_pushscope(c);
819 static code_t* method_header(methodstate_t*m)
823 c = add_scope_code(c, m, 1);
825 methodstate_list_t*l = m->innerfunctions;
827 parserassert(l->methodstate->abc);
828 if(m->uses_slots && l->methodstate->is_a_slot) {
829 c = abc_getscopeobject(c, 1);
830 c = abc_newfunction(c, l->methodstate->abc);
832 c = abc_setlocal(c, l->methodstate->var_index);
833 c = abc_setslot(c, l->methodstate->slot_index);
835 c = abc_newfunction(c, l->methodstate->abc);
836 c = abc_setlocal(c, l->methodstate->var_index);
838 free(l->methodstate);l->methodstate=0;
842 c = code_append(c, m->header);
845 if(m->is_constructor && !m->has_super) {
846 // call default constructor
847 c = abc_getlocal_0(c);
848 c = abc_constructsuper(c, 0);
852 /* all parameters that are used by inner functions
853 need to be copied from local to slot */
854 parserassert(m->activation_var);
855 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
856 if(v->is_parameter) {
857 c = abc_getlocal(c, m->activation_var);
858 c = abc_getlocal(c, v->index);
859 c = abc_setslot(c, v->index);
863 list_free(m->innerfunctions);
864 m->innerfunctions = 0;
869 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
871 c = code_append(c, header);
872 c = code_append(c, var_block(body));
873 /* append return if necessary */
874 if(!c || (c->opcode != OPCODE_RETURNVOID &&
875 c->opcode != OPCODE_RETURNVALUE)) {
876 c = abc_returnvoid(c);
881 static void startpackage(char*name)
884 state->package = strdup(name);
886 static void endpackage()
888 //used e.g. in classinfo_register:
889 //free(state->package);state->package=0;
893 #define FLAG_PUBLIC 256
894 #define FLAG_PROTECTED 512
895 #define FLAG_PRIVATE 1024
896 #define FLAG_PACKAGEINTERNAL 2048
897 #define FLAG_NAMESPACE 4096
899 static namespace_t modifiers2access(modifiers_t*mod)
904 if(mod->flags&FLAG_NAMESPACE) {
905 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
906 syntaxerror("invalid combination of access levels and namespaces");
907 ns.access = ACCESS_NAMESPACE;
909 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
911 /* shouldn't happen- the tokenizer only reports something as a namespace
912 if it was already registered */
913 trie_dump(active_namespaces);
914 syntaxerror("unknown namespace: %s", mod->ns);
917 } else if(mod->flags&FLAG_PUBLIC) {
918 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
919 syntaxerror("invalid combination of access levels");
920 ns.access = ACCESS_PACKAGE;
921 } else if(mod->flags&FLAG_PRIVATE) {
922 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
923 syntaxerror("invalid combination of access levels");
924 ns.access = ACCESS_PRIVATE;
925 } else if(mod->flags&FLAG_PROTECTED) {
926 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
927 syntaxerror("invalid combination of access levels");
928 ns.access = ACCESS_PROTECTED;
930 ns.access = ACCESS_PACKAGEINTERNAL;
934 static slotinfo_t* find_class(const char*name);
936 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
938 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
941 static void innerfunctions2vars(methodstate_t*m)
943 methodstate_list_t*l = m->innerfunctions;
945 methodstate_t*m = l->methodstate;
947 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 0);
948 m->var_index = v->index;
950 m->slot_index = m->is_a_slot;
951 v->is_inner_method = m;
956 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
961 index = new_variable("this", 0, 0, 0);
962 else if(!m->is_global)
963 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
965 index = new_variable("globalscope", 0, 0, 0);
966 parserassert(!index);
971 for(p=params->list;p;p=p->next) {
972 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
975 if(as3_pass==2 && m->need_arguments) {
976 /* arguments can never be used by an innerfunction (the inner functions
977 have their own arguments var), so it's ok to not initialize this until
978 pass 2. (We don't know whether we need it before, anyway) */
979 variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0);
980 m->need_arguments = v->index;
984 innerfunctions2vars(m);
987 m->scope_code = add_scope_code(m->scope_code, m, 0);
989 /* exchange unresolved identifiers with the actual objects */
990 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
991 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
992 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
993 if(!type || type->kind != INFOTYPE_CLASS) {
994 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1004 char*as3_globalclass=0;
1005 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1008 syntaxerror("inner classes now allowed");
1013 classinfo_list_t*mlist=0;
1015 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1016 syntaxerror("invalid modifier(s)");
1018 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1019 syntaxerror("public and internal not supported at the same time.");
1021 if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC))
1022 syntaxerror("protected and static not supported at the same time.");
1024 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1025 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1026 // all classes extend object
1027 extends = registry_getobjectclass();
1030 /* create the class name, together with the proper attributes */
1034 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1035 access = ACCESS_PRIVATE; package = internal_filename_package;
1036 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1037 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1038 } else if(state->package!=internal_filename_package) {
1039 access = ACCESS_PACKAGE; package = state->package;
1041 syntaxerror("public classes only allowed inside a package");
1045 state->cls = rfx_calloc(sizeof(classstate_t));
1046 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1047 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1048 state->cls->static_init->is_static=FLAG_STATIC;
1049 state->cls->static_init->variable_count=1;
1050 /* notice: we make no effort to initialize the top variable (local0) here,
1051 even though it has special meaning. We just rely on the fact
1052 that pass 1 won't do anything with variables */
1054 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1056 /* set current method to constructor- all code within the class-level (except
1057 static variable initializations) will be executed during construction time */
1058 state->method = state->cls->init;
1060 if(registry_find(package, classname)) {
1061 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1063 /* build info struct */
1064 int num_interfaces = (list_length(implements));
1065 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1066 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1067 state->cls->info->superclass = extends;
1070 classinfo_list_t*l = implements;
1071 for(l=implements;l;l=l->next) {
1072 state->cls->info->interfaces[pos++] = l->classinfo;
1077 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1079 state->method = state->cls->init;
1080 parserassert(state->cls && state->cls->info);
1082 function_initvars(state->cls->init, 0, 0, 0, 1);
1083 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1085 if(extends && (extends->flags & FLAG_FINAL))
1086 syntaxerror("Can't extend final class '%s'", extends->name);
1089 while(state->cls->info->interfaces[pos]) {
1090 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1091 syntaxerror("'%s' is not an interface",
1092 state->cls->info->interfaces[pos]->name);
1096 /* generate the abc code for this class */
1097 MULTINAME(classname2,state->cls->info);
1098 multiname_t*extends2 = sig2mname(extends);
1100 /* don't add the class to the class index just yet- that will be done later
1102 state->cls->abc = abc_class_new(0, &classname2, extends2);
1103 state->cls->abc->file = global->file;
1105 multiname_destroy(extends2);
1106 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1107 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1108 if(state->cls->info->flags&FLAG_INTERFACE) {
1109 abc_class_interface(state->cls->abc);
1112 for(mlist=implements;mlist;mlist=mlist->next) {
1113 MULTINAME(m, mlist->classinfo);
1114 abc_class_add_interface(state->cls->abc, &m);
1117 state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc);
1118 list_append(global->classes, state->cls->dependencies);
1120 /* flash.display.MovieClip handling */
1121 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1122 if(state->package && state->package[0]) {
1123 as3_globalclass = concat3(state->package, ".", classname);
1125 as3_globalclass = strdup(classname);
1131 static void endclass()
1134 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1136 c = abc_getlocal_0(c);
1137 c = abc_constructsuper(c, 0);
1138 state->cls->init->header = code_append(state->cls->init->header, c);
1139 state->cls->has_constructor=1;
1141 if(state->cls->init) {
1142 if(state->cls->info->flags&FLAG_INTERFACE) {
1143 if(state->cls->init->header)
1144 syntaxerror("interface can not have class-level code");
1146 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1147 code_t*c = method_header(state->cls->init);
1148 m->body->code = wrap_function(c, 0, m->body->code);
1151 if(state->cls->static_init) {
1152 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1153 code_t*c = method_header(state->cls->static_init);
1154 m->body->code = wrap_function(c, 0, m->body->code);
1157 trait_list_t*trait = state->cls->abc->traits;
1158 /* switch all protected members to the protected ns of this class */
1160 trait_t*t = trait->trait;
1161 if(t->name->ns->access == ACCESS_PROTECTED) {
1162 if(!state->cls->abc->protectedNS) {
1163 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1164 state->cls->abc->protectedNS = namespace_new_protected(n);
1165 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1167 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1169 trait = trait->next;
1176 void check_code_for_break(code_t*c)
1179 if(c->opcode == OPCODE___BREAK__) {
1180 char*name = string_cstr(c->data[0]);
1181 syntaxerror("Unresolved \"break %s\"", name);
1183 if(c->opcode == OPCODE___CONTINUE__) {
1184 char*name = string_cstr(c->data[0]);
1185 syntaxerror("Unresolved \"continue %s\"", name);
1187 if(c->opcode == OPCODE___RETHROW__) {
1188 syntaxerror("Unresolved \"rethrow\"");
1190 if(c->opcode == OPCODE___FALLTHROUGH__) {
1191 syntaxerror("Unresolved \"fallthrough\"");
1193 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1194 char*name = string_cstr(c->data[0]);
1195 syntaxerror("Can't reference a package (%s) as such", name);
1201 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1203 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1204 if(TYPE_IS_NUMBER(t)) {
1205 xassert(c->type == CONSTANT_FLOAT
1206 || c->type == CONSTANT_INT
1207 || c->type == CONSTANT_UINT);
1208 } else if(TYPE_IS_UINT(t)) {
1209 xassert(c->type == CONSTANT_UINT ||
1210 (c->type == CONSTANT_INT && c->i>=0));
1211 } else if(TYPE_IS_INT(t)) {
1212 xassert(c->type == CONSTANT_INT);
1213 } else if(TYPE_IS_BOOLEAN(t)) {
1214 xassert(c->type == CONSTANT_TRUE
1215 || c->type == CONSTANT_FALSE);
1219 static void check_override(memberinfo_t*m, int flags)
1223 if(m->parent == state->cls->info)
1224 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1226 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1227 if(m->access==ACCESS_PRIVATE)
1229 if(m->flags & FLAG_FINAL)
1230 syntaxerror("can't override final member %s", m->name);
1232 /* allow this. it's no issue.
1233 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1234 syntaxerror("can't override static member %s", m->name);*/
1236 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1237 syntaxerror("can't override non-static member %s with static declaration", m->name);
1239 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1240 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1241 if(m->kind == INFOTYPE_METHOD)
1242 syntaxerror("can't override without explicit 'override' declaration");
1244 syntaxerror("can't override '%s'", m->name);
1249 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1251 methodinfo_t*minfo = 0;
1252 namespace_t ns = modifiers2access(mod);
1255 minfo = methodinfo_register_global(ns.access, state->package, name);
1256 minfo->return_type = return_type;
1257 } else if(getset != KW_GET && getset != KW_SET) {
1259 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1261 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1263 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1264 minfo->return_type = return_type;
1265 // getslot on a member slot only returns "undefined", so no need
1266 // to actually store these
1267 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1269 //class getter/setter
1270 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1272 if(getset == KW_GET) {
1274 } else if(params->list && params->list->param && !params->list->next) {
1275 type = params->list->param->type;
1277 syntaxerror("setter function needs to take exactly one argument");
1278 // not sure wether to look into superclasses here, too
1279 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1281 if(minfo->kind!=INFOTYPE_VAR)
1282 syntaxerror("class already contains a method called '%s'", name);
1283 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1284 syntaxerror("class already contains a field called '%s'", name);
1285 if(minfo->subtype & gs)
1286 syntaxerror("getter/setter for '%s' already defined", name);
1287 /* make a setter or getter into a getset */
1288 minfo->subtype |= gs;
1291 FIXME: this check needs to be done in pass 2
1293 if((!minfo->return_type != !type) ||
1294 (minfo->return_type && type &&
1295 !strcmp(minfo->return_type->name, type->name))) {
1296 syntaxerror("different type in getter and setter: %s and %s",
1297 minfo->return_type?minfo->return_type->name:"*",
1298 type?type->name:"*");
1301 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1302 minfo->kind = INFOTYPE_VAR; //hack
1303 minfo->subtype = gs;
1304 minfo->return_type = type;
1307 /* can't assign a slot as getter and setter might have different slots */
1308 //minfo->slot = slot;
1310 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1311 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1312 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1317 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1319 //parserassert(state->method && state->method->info);
1321 methodstate_t*parent_method = state->method;
1324 return_type = 0; // not valid in pass 1
1328 state->new_vars = 1;
1329 state->allvars = dict_new();
1332 state->method = rfx_calloc(sizeof(methodstate_t));
1333 state->method->inner = 1;
1334 state->method->is_static = parent_method->is_static;
1335 state->method->variable_count = 0;
1336 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1338 NEW(methodinfo_t,minfo);
1339 minfo->kind = INFOTYPE_METHOD;
1340 minfo->access = ACCESS_PACKAGEINTERNAL;
1342 state->method->info = minfo;
1345 list_append(parent_method->innerfunctions, state->method);
1347 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1349 function_initvars(state->method, 1, params, 0, 1);
1353 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1354 state->method->variable_count = 0;
1355 parserassert(state->method);
1357 state->method->info->return_type = return_type;
1358 function_initvars(state->method, 1, params, 0, 1);
1362 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1363 params_t*params, classinfo_t*return_type)
1365 if(state->method && state->method->info) {
1366 syntaxerror("not able to start another method scope");
1369 state->new_vars = 1;
1370 state->allvars = dict_new();
1373 state->method = rfx_calloc(sizeof(methodstate_t));
1374 state->method->has_super = 0;
1375 state->method->is_static = mod->flags&FLAG_STATIC;
1378 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1380 state->method->is_global = 1;
1381 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1383 if(state->method->is_constructor)
1384 name = "__as3_constructor__";
1386 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1388 function_initvars(state->method, 1, params, mod->flags, 1);
1390 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1394 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1395 state->method->variable_count = 0;
1396 parserassert(state->method);
1399 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1400 check_override(m, mod->flags);
1404 state->cls->has_constructor |= state->method->is_constructor;
1407 function_initvars(state->method, 1, params, mod->flags, 1);
1411 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1412 params_t*params, classinfo_t*return_type, code_t*body)
1415 innerfunctions2vars(state->method);
1417 methodstate_list_t*ml = state->method->innerfunctions;
1419 dict_t*xvars = dict_new();
1422 methodstate_t*m = ml->methodstate;
1423 parserassert(m->inner);
1424 if(m->unresolved_variables) {
1425 dict_t*d = m->unresolved_variables;
1427 DICT_ITERATE_KEY(d, char*, id) {
1428 /* check parent method's variables */
1430 if((v=find_variable(state, id))) {
1431 m->uses_parent_function = 1;
1432 state->method->uses_slots = 1;
1433 dict_put(xvars, id, 0);
1436 dict_destroy(m->unresolved_variables);m->unresolved_variables = 0;
1441 if(state->method->uses_slots) {
1442 state->method->slots = dict_new();
1444 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1445 if(!name) syntaxerror("internal error");
1446 if(v->index && dict_contains(xvars, name)) {
1449 if(v->is_inner_method) {
1450 v->is_inner_method->is_a_slot = i;
1453 dict_put(state->method->slots, name, v);
1456 state->method->uses_slots = i;
1457 dict_destroy(state->vars);state->vars = 0;
1458 parserassert(state->new_vars);
1459 dict_destroy(state->allvars);state->allvars = 0;
1466 /*if(state->method->uses_parent_function){
1467 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1472 multiname_t*type2 = sig2mname(return_type);
1474 if(state->method->inner) {
1475 f = state->method->abc;
1476 abc_method_init(f, global->file, type2, 1);
1477 } else if(state->method->is_constructor) {
1478 f = abc_class_getconstructor(state->cls->abc, type2);
1479 } else if(!state->method->is_global) {
1480 namespace_t ns = modifiers2access(mod);
1481 multiname_t mname = {QNAME, &ns, 0, name};
1482 if(mod->flags&FLAG_STATIC)
1483 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1485 f = abc_class_method(state->cls->abc, type2, &mname);
1486 slot = f->trait->slot_id;
1488 namespace_t mname_ns = {state->method->info->access, state->package};
1489 multiname_t mname = {QNAME, &mname_ns, 0, name};
1491 f = abc_method_new(global->file, type2, 1);
1492 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1493 //abc_code_t*c = global->init->method->body->code;
1495 //flash doesn't seem to allow us to access function slots
1496 //state->method->info->slot = slot;
1498 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1499 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1500 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1501 if(params->varargs) f->flags |= METHOD_NEED_REST;
1502 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1506 for(p=params->list;p;p=p->next) {
1507 if(params->varargs && !p->next) {
1508 break; //varargs: omit last parameter in function signature
1510 multiname_t*m = sig2mname(p->param->type);
1511 list_append(f->parameters, m);
1512 if(p->param->value) {
1513 check_constant_against_type(p->param->type, p->param->value);
1514 opt=1;list_append(f->optional_parameters, p->param->value);
1516 syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name);
1519 if(state->method->slots) {
1520 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1522 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1523 multiname_t*type = sig2mname(v->type);
1524 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1525 t->slot_id = v->index;
1530 check_code_for_break(body);
1532 /* Seems this works now.
1533 if(state->method->exceptions && state->method->uses_slots) {
1534 as3_warning("try/catch and activation not supported yet within the same method");
1538 f->body->code = body;
1539 f->body->exceptions = state->method->exceptions;
1540 } else { //interface
1542 syntaxerror("interface methods can't have a method body");
1552 void breakjumpsto(code_t*c, char*name, code_t*jump)
1555 if(c->opcode == OPCODE___BREAK__) {
1556 string_t*name2 = c->data[0];
1557 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1558 c->opcode = OPCODE_JUMP;
1565 void continuejumpsto(code_t*c, char*name, code_t*jump)
1568 if(c->opcode == OPCODE___CONTINUE__) {
1569 string_t*name2 = c->data[0];
1570 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1571 c->opcode = OPCODE_JUMP;
1579 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1584 return abc_coerce_a(c);
1588 // cast an "any" type to a specific type. subject to
1589 // runtime exceptions
1590 return abc_coerce2(c, &m);
1593 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1594 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1595 // allow conversion between number types
1596 if(TYPE_IS_UINT(to))
1597 return abc_convert_u(c);
1598 else if(TYPE_IS_INT(to))
1599 return abc_convert_i(c);
1600 else if(TYPE_IS_NUMBER(to))
1601 return abc_convert_d(c);
1602 return abc_coerce2(c, &m);
1605 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1608 if(TYPE_IS_BOOLEAN(to))
1609 return abc_convert_b(c);
1610 if(TYPE_IS_STRING(to))
1611 return abc_convert_s(c);
1612 if(TYPE_IS_OBJECT(to))
1613 return abc_convert_o(c);
1615 classinfo_t*supertype = from;
1617 if(supertype == to) {
1618 // target type is one of from's superclasses
1619 return abc_coerce2(c, &m);
1622 while(supertype->interfaces[t]) {
1623 if(supertype->interfaces[t]==to) {
1624 // target type is one of from's interfaces
1625 return abc_coerce2(c, &m);
1629 supertype = supertype->superclass;
1631 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1633 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1635 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1638 as3_error("can't convert type %s%s%s to %s%s%s",
1639 from->package, from->package[0]?".":"", from->name,
1640 to->package, to->package[0]?".":"", to->name);
1644 /* move to ast.c todo end */
1646 char is_pushundefined(code_t*c)
1648 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1651 static const char* get_package_from_name(const char*name)
1653 /* try explicit imports */
1654 dictentry_t* e = dict_get_slot(state->imports, name);
1656 if(!strcmp(e->key, name)) {
1657 slotinfo_t*c = (slotinfo_t*)e->data;
1658 if(c) return c->package;
1664 static namespace_list_t*get_current_imports()
1666 namespace_list_t*searchlist = 0;
1668 list_append(searchlist, namespace_new_package(state->package));
1670 import_list_t*l = state->wildcard_imports;
1672 namespace_t*ns = namespace_new_package(l->import->package);
1673 list_append(searchlist, ns);
1676 list_append(searchlist, namespace_new_package(""));
1677 list_append(searchlist, namespace_new_package(internal_filename_package));
1681 static slotinfo_t* find_class(const char*name)
1685 c = registry_find(state->package, name);
1688 /* try explicit imports */
1689 dictentry_t* e = dict_get_slot(state->imports, name);
1692 if(!strcmp(e->key, name)) {
1693 c = (slotinfo_t*)e->data;
1699 /* try package.* imports */
1700 import_list_t*l = state->wildcard_imports;
1702 //printf("does package %s contain a class %s?\n", l->import->package, name);
1703 c = registry_find(l->import->package, name);
1708 /* try global package */
1709 c = registry_find("", name);
1712 /* try local "filename" package */
1713 c = registry_find(internal_filename_package, name);
1718 typedcode_t push_class(slotinfo_t*a)
1723 if(a->access == ACCESS_PACKAGEINTERNAL &&
1724 strcmp(a->package, state->package) &&
1725 strcmp(a->package, internal_filename_package)
1727 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1728 infotypename(a), a->name, a->package, state->package);
1732 if(a->kind != INFOTYPE_CLASS) {
1734 x.c = abc_findpropstrict2(x.c, &m);
1735 x.c = abc_getproperty2(x.c, &m);
1736 if(a->kind == INFOTYPE_METHOD) {
1737 methodinfo_t*f = (methodinfo_t*)a;
1738 x.t = TYPE_FUNCTION(f);
1740 varinfo_t*v = (varinfo_t*)a;
1745 if(state->cls && state->method == state->cls->static_init) {
1746 /* we're in the static initializer.
1747 record the fact that we're using this class here */
1748 parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a);
1750 classinfo_t*c = (classinfo_t*)a;
1752 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1753 x.c = abc_getglobalscope(x.c);
1754 x.c = abc_getslot(x.c, c->slot);
1757 x.c = abc_getlex2(x.c, &m);
1759 x.t = TYPE_CLASS(c);
1765 char is_break_or_jump(code_t*c)
1769 if(c->opcode == OPCODE_JUMP ||
1770 c->opcode == OPCODE___BREAK__ ||
1771 c->opcode == OPCODE___CONTINUE__ ||
1772 c->opcode == OPCODE_THROW ||
1773 c->opcode == OPCODE_RETURNVOID ||
1774 c->opcode == OPCODE_RETURNVALUE) {
1780 #define IS_FINALLY_TARGET(op) \
1781 ((op) == OPCODE___CONTINUE__ || \
1782 (op) == OPCODE___BREAK__ || \
1783 (op) == OPCODE_RETURNVOID || \
1784 (op) == OPCODE_RETURNVALUE || \
1785 (op) == OPCODE___RETHROW__)
1787 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1789 #define NEED_EXTRA_STACK_ARG
1790 code_t*finally_label = abc_nop(0);
1791 NEW(lookupswitch_t, l);
1797 code_t*prev = i->prev;
1798 if(IS_FINALLY_TARGET(i->opcode)) {
1801 if(i->opcode == OPCODE___RETHROW__ ||
1802 i->opcode == OPCODE_RETURNVALUE) {
1803 if(i->opcode == OPCODE___RETHROW__)
1804 i->opcode = OPCODE_THROW;
1806 p = abc_coerce_a(p);
1807 p = abc_setlocal(p, tempvar);
1809 p = abc_pushbyte(p, count++);
1810 p = abc_jump(p, finally_label);
1811 code_t*target = p = abc_label(p);
1812 #ifdef NEED_EXTRA_STACK_ARG
1816 p = abc_getlocal(p, tempvar);
1819 p->next = i;i->prev = p;
1820 list_append(l->targets, target);
1826 c = abc_pushbyte(c, -1);
1827 c = code_append(c, finally_label);
1828 c = code_append(c, finally);
1830 #ifdef NEED_EXTRA_STACK_ARG
1833 c = abc_lookupswitch(c, l);
1834 c = l->def = abc_label(c);
1835 #ifdef NEED_EXTRA_STACK_ARG
1842 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1846 code_t*prev = i->prev;
1847 if(IS_FINALLY_TARGET(i->opcode)) {
1848 if(i->opcode == OPCODE___RETHROW__)
1849 i->opcode = OPCODE_THROW;
1850 code_t*end = code_dup(finally);
1851 code_t*start = code_start(end);
1852 if(prev) prev->next = start;
1859 return code_append(c, finally);
1862 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1868 int num_insertion_points=0;
1870 if(IS_FINALLY_TARGET(i->opcode))
1871 num_insertion_points++;
1878 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1883 int simple_version_cost = (1+num_insertion_points)*code_size;
1884 int lookup_version_cost = 4*num_insertion_points + 5;
1886 if(cantdup || simple_version_cost > lookup_version_cost) {
1887 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1888 return insert_finally_lookup(c, finally, tempvar);
1890 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1891 return insert_finally_simple(c, finally, tempvar);
1895 #define PASS1 }} if(as3_pass == 1) {{
1896 #define PASS1END }} if(as3_pass == 2) {{
1897 #define PASS2 }} if(as3_pass == 2) {{
1898 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1899 #define PASS12END }} if(as3_pass == 2) {{
1900 #define PASS_ALWAYS }} {{
1904 /* Line 273 of skeleton.m4 */
1905 #line 1906 "parser.tab.c"
1906 /* Unqualified %code blocks. */
1908 /* Line 274 of skeleton.m4 */
1909 #line 1983 "parser.y"
1911 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1917 /* Line 274 of skeleton.m4 */
1918 #line 2433 "parser.y"
1920 static void state_has_imports()
1922 state->wildcard_imports = list_clone(state->wildcard_imports);
1923 state->imports = dict_clone(state->imports);
1924 state->has_own_imports = 1;
1926 static void import_toplevel(const char*package)
1928 char* s = strdup(package);
1930 dict_put(state->import_toplevel_packages, s, 0);
1931 char*x = strrchr(s, '.');
1940 /* Line 274 of skeleton.m4 */
1941 #line 2566 "parser.y"
1943 static int slotstate_varconst = 0;
1944 static modifiers_t*slotstate_flags = 0;
1945 static void setslotstate(modifiers_t* flags, int varconst)
1947 slotstate_varconst = varconst;
1948 slotstate_flags = flags;
1951 if(flags->flags&FLAG_STATIC) {
1952 state->method = state->cls->static_init;
1954 state->method = state->cls->init;
1957 // reset to "default" state (all in class code is static by default) */
1958 state->method = state->cls->static_init;
1961 parserassert(state->method);
1964 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
1966 int flags = modifiers->flags;
1967 namespace_t ns = modifiers2access(modifiers);
1970 multiname_t mname = {QNAME, &ns, 0, name};
1972 trait_list_t**traits;
1976 ns.name = state->package;
1977 traits = &global->init->traits;
1978 code = &global->init->method->body->code;
1979 } else if(flags&FLAG_STATIC) {
1981 traits = &state->cls->abc->static_traits;
1982 code = &state->cls->static_init->header;
1984 // instance variable
1985 traits = &state->cls->abc->traits;
1986 code = &state->cls->init->header;
1991 *m = *multiname_clone(&mname);
1993 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
1997 /* Line 274 of skeleton.m4 */
1998 #line 2746 "parser.y"
2000 static int xml_level = 0;
2003 /* Line 274 of skeleton.m4 */
2004 #line 3525 "parser.y"
2006 node_t* resolve_identifier(char*name)
2016 /* look at variables */
2017 if((v = find_variable(state, name))) {
2018 // name is a local variable
2019 o.c = abc_getlocal(o.c, v->index);
2021 return mkcodenode(o);
2023 if((v = find_slot(state, name))) {
2024 o.c = abc_getscopeobject(o.c, 1);
2025 o.c = abc_getslot(o.c, v->index);
2027 return mkcodenode(o);
2030 int i_am_static = state->method->is_static;
2032 /* look at current class' members */
2033 if(!state->method->inner &&
2034 !state->xmlfilter &&
2036 (f = findmember_nsset(state->cls->info, name, 1)))
2038 // name is a member or attribute in this class
2039 int var_is_static = (f->flags&FLAG_STATIC);
2041 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2042 /* if the variable is a constant (and we know what is evaluates to), we
2043 can just use the value itself */
2044 varinfo_t*v = (varinfo_t*)f;
2046 return mkconstnode(v->value);
2050 if(var_is_static >= i_am_static) {
2051 if(f->kind == INFOTYPE_METHOD) {
2052 o.t = TYPE_FUNCTION(f);
2057 if(var_is_static && !i_am_static) {
2058 /* access to a static member from a non-static location.
2059 do this via findpropstrict:
2060 there doesn't seem to be any non-lookup way to access
2061 static properties of a class */
2062 state->method->late_binding = 1;
2064 namespace_t ns = {f->access, f->package};
2065 multiname_t m = {QNAME, &ns, 0, name};
2066 o.c = abc_findpropstrict2(o.c, &m);
2067 o.c = abc_getproperty2(o.c, &m);
2068 return mkcodenode(o);
2069 } else if(f->slot>0) {
2070 o.c = abc_getlocal_0(o.c);
2071 o.c = abc_getslot(o.c, f->slot);
2072 return mkcodenode(o);
2074 MEMBER_MULTINAME(m, f, name);
2075 o.c = abc_getlocal_0(o.c);
2076 o.c = abc_getproperty2(o.c, &m);
2077 return mkcodenode(o);
2082 /* look at actual classes, in the current package and imported */
2083 if(!state->xmlfilter && (a = find_class(name))) {
2084 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2085 o.c = abc_getlocal_0(0);
2086 o.t = TYPE_CLASS((classinfo_t*)a);
2090 return mkcodenode(o);
2093 /* look through package prefixes */
2094 if(!state->xmlfilter &&
2095 (dict_contains(state->import_toplevel_packages, name) ||
2096 registry_ispackage(name))) {
2097 o.c = abc___pushpackage__(o.c, name);
2099 return mkcodenode(o); //?
2102 /* unknown object, let the avm2 resolve it */
2104 if(!state->method->inner && !state->xmlfilter) {
2105 /* we really should make inner functions aware of the class context */
2106 as3_warning("Couldn't resolve '%s', doing late binding", name);
2108 state->method->late_binding = 1;
2110 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2113 o.c = abc_findpropstrict2(o.c, &m);
2114 o.c = abc_getproperty2(o.c, &m);
2115 return mkcodenode(o);
2120 /* Line 274 of skeleton.m4 */
2121 #line 3667 "parser.y"
2123 void add_active_url(const char*url)
2127 list_append(state->active_namespace_urls, n);
2132 /* Line 274 of skeleton.m4 */
2133 #line 2134 "parser.tab.c"
2140 typedef YYTYPE_UINT8 yytype_uint8;
2142 typedef unsigned char yytype_uint8;
2146 typedef YYTYPE_INT8 yytype_int8;
2147 #elif (defined __STDC__ || defined __C99__FUNC__ \
2148 || defined __cplusplus || defined _MSC_VER)
2149 typedef signed char yytype_int8;
2151 typedef short int yytype_int8;
2154 #ifdef YYTYPE_UINT16
2155 typedef YYTYPE_UINT16 yytype_uint16;
2157 typedef unsigned short int yytype_uint16;
2161 typedef YYTYPE_INT16 yytype_int16;
2163 typedef short int yytype_int16;
2167 # ifdef __SIZE_TYPE__
2168 # define YYSIZE_T __SIZE_TYPE__
2169 # elif defined size_t
2170 # define YYSIZE_T size_t
2171 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2172 || defined __cplusplus || defined _MSC_VER)
2173 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2174 # define YYSIZE_T size_t
2176 # define YYSIZE_T unsigned int
2180 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2185 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2186 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2190 # define YY_(msgid) msgid
2194 /* Suppress unused-variable warnings by "using" E. */
2195 #if ! defined lint || defined __GNUC__
2196 # define YYUSE(e) ((void) (e))
2198 # define YYUSE(e) /* empty */
2201 /* Identity function, used to suppress warnings about constant conditions. */
2203 # define YYID(n) (n)
2205 #if (defined __STDC__ || defined __C99__FUNC__ \
2206 || defined __cplusplus || defined _MSC_VER)
2219 #if ! defined yyoverflow || YYERROR_VERBOSE
2221 /* The parser invokes alloca or malloc; define the necessary symbols. */
2223 # ifdef YYSTACK_USE_ALLOCA
2224 # if YYSTACK_USE_ALLOCA
2226 # define YYSTACK_ALLOC __builtin_alloca
2227 # elif defined __BUILTIN_VA_ARG_INCR
2228 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2230 # define YYSTACK_ALLOC __alloca
2231 # elif defined _MSC_VER
2232 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2233 # define alloca _alloca
2235 # define YYSTACK_ALLOC alloca
2236 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2237 || defined __cplusplus || defined _MSC_VER)
2238 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2240 # define _STDLIB_H 1
2247 # ifdef YYSTACK_ALLOC
2248 /* Pacify GCC's `empty if-body' warning. */
2249 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2250 # ifndef YYSTACK_ALLOC_MAXIMUM
2251 /* The OS might guarantee only one guard page at the bottom of the stack,
2252 and a page size can be as small as 4096 bytes. So we cannot safely
2253 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2254 to allow for a few compiler-allocated temporary stack slots. */
2255 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2258 # define YYSTACK_ALLOC YYMALLOC
2259 # define YYSTACK_FREE YYFREE
2260 # ifndef YYSTACK_ALLOC_MAXIMUM
2261 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2263 # if (defined __cplusplus && ! defined _STDLIB_H \
2264 && ! ((defined YYMALLOC || defined malloc) \
2265 && (defined YYFREE || defined free)))
2266 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2268 # define _STDLIB_H 1
2272 # define YYMALLOC malloc
2273 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2274 || defined __cplusplus || defined _MSC_VER)
2275 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2279 # define YYFREE free
2280 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2281 || defined __cplusplus || defined _MSC_VER)
2282 void free (void *); /* INFRINGES ON USER NAME SPACE */
2286 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2289 #if (! defined yyoverflow \
2290 && (! defined __cplusplus \
2291 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2293 /* A type that is properly aligned for any stack member. */
2296 yytype_int16 yyss_alloc;
2300 /* The size of the maximum gap between one aligned stack and the next. */
2301 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2303 /* The size of an array large to enough to hold all stacks, each with
2305 # define YYSTACK_BYTES(N) \
2306 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2307 + YYSTACK_GAP_MAXIMUM)
2309 /* Copy COUNT objects from FROM to TO. The source and destination do
2312 # if defined __GNUC__ && 1 < __GNUC__
2313 # define YYCOPY(To, From, Count) \
2314 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2316 # define YYCOPY(To, From, Count) \
2320 for (yyi = 0; yyi < (Count); yyi++) \
2321 (To)[yyi] = (From)[yyi]; \
2327 /* Relocate STACK from its old location to the new one. The
2328 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2329 elements in the stack, and YYPTR gives the new location of the
2330 stack. Advance YYPTR to a properly aligned location for the next
2332 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2335 YYSIZE_T yynewbytes; \
2336 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2337 Stack = &yyptr->Stack_alloc; \
2338 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2339 yyptr += yynewbytes / sizeof (*yyptr); \
2345 /* YYFINAL -- State number of the termination state. */
2347 /* YYLAST -- Last index in YYTABLE. */
2350 /* YYNTOKENS -- Number of terminals. */
2351 #define YYNTOKENS 136
2352 /* YYNNTS -- Number of nonterminals. */
2354 /* YYNRULES -- Number of rules. */
2355 #define YYNRULES 351
2356 /* YYNRULES -- Number of states. */
2357 #define YYNSTATES 598
2359 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2360 #define YYUNDEFTOK 2
2361 #define YYMAXUTOK 365
2363 #define YYTRANSLATE(YYX) \
2364 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2366 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2367 static const yytype_uint8 yytranslate[] =
2369 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2372 2, 2, 2, 120, 2, 2, 2, 118, 109, 2,
2373 124, 135, 117, 115, 102, 114, 129, 116, 2, 2,
2374 2, 2, 2, 2, 2, 2, 2, 2, 106, 101,
2375 111, 104, 112, 105, 130, 2, 2, 2, 2, 2,
2376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2378 2, 126, 2, 127, 108, 2, 2, 2, 2, 2,
2379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2381 2, 2, 2, 128, 107, 134, 119, 2, 2, 2,
2382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2383 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
2395 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2396 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2397 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2398 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2399 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2400 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2401 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2402 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2403 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2404 95, 96, 97, 98, 99, 100, 103, 110, 113, 121,
2405 122, 123, 125, 131, 132, 133
2409 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2411 static const yytype_uint16 yyprhs[] =
2413 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2414 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2415 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2416 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2417 85, 87, 89, 91, 95, 98, 100, 102, 104, 106,
2418 108, 110, 112, 117, 120, 122, 124, 128, 131, 132,
2419 135, 138, 140, 144, 148, 149, 152, 153, 161, 162,
2420 164, 166, 170, 172, 175, 179, 188, 195, 196, 203,
2421 204, 212, 214, 217, 219, 222, 223, 225, 227, 230,
2422 232, 235, 240, 244, 245, 254, 255, 265, 266, 272,
2423 274, 277, 279, 282, 284, 285, 292, 295, 297, 302,
2424 305, 307, 309, 311, 313, 317, 319, 320, 327, 328,
2425 334, 337, 342, 343, 345, 347, 350, 352, 354, 356,
2426 358, 360, 362, 364, 366, 368, 370, 371, 374, 375,
2427 378, 379, 382, 383, 393, 394, 403, 404, 406, 408,
2428 411, 413, 418, 420, 422, 424, 425, 427, 429, 432,
2429 434, 437, 446, 448, 450, 451, 456, 458, 462, 466,
2430 467, 470, 472, 474, 476, 478, 480, 482, 484, 486,
2431 488, 490, 492, 494, 495, 496, 501, 502, 507, 508,
2432 511, 514, 517, 520, 524, 526, 528, 539, 546, 558,
2433 559, 561, 563, 566, 568, 572, 576, 580, 584, 585,
2434 587, 590, 595, 599, 601, 606, 609, 611, 613, 614,
2435 615, 628, 630, 631, 632, 643, 645, 649, 651, 653,
2436 655, 659, 661, 663, 665, 668, 669, 670, 674, 675,
2437 677, 679, 681, 684, 687, 688, 693, 698, 703, 706,
2438 708, 711, 713, 715, 717, 721, 723, 727, 728, 730,
2439 732, 734, 736, 738, 740, 744, 750, 752, 754, 756,
2440 758, 760, 762, 764, 766, 768, 770, 774, 778, 782,
2441 786, 790, 794, 798, 802, 806, 810, 814, 818, 821,
2442 824, 828, 832, 836, 840, 844, 848, 852, 856, 860,
2443 864, 868, 872, 876, 880, 884, 889, 892, 894, 898,
2444 901, 906, 910, 914, 918, 922, 926, 930, 934, 938,
2445 942, 946, 950, 954, 960, 963, 966, 969, 972, 976,
2446 979, 980, 987, 989, 991, 993, 995, 997, 1003, 1007,
2447 1013, 1018, 1023, 1030, 1037, 1041, 1043, 1046, 1051, 1056,
2451 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2452 static const yytype_int16 yyrhs[] =
2454 137, 0, -1, 138, -1, -1, 139, -1, 140, -1,
2455 139, 140, -1, 188, -1, 200, -1, 198, -1, 234,
2456 -1, 209, -1, 149, -1, 150, 128, 138, 134, -1,
2457 101, -1, -1, 142, -1, 143, -1, 142, 143, -1,
2458 200, -1, 198, -1, 234, -1, 209, -1, 149, -1,
2459 150, 128, 141, 134, -1, 101, -1, 145, -1, -1,
2460 145, 147, -1, 147, -1, 269, -1, 191, -1, 161,
2461 -1, 162, -1, 163, -1, 165, -1, 173, -1, 156,
2462 -1, 185, -1, 181, -1, 257, -1, 270, -1, 268,
2463 -1, 128, 145, 134, -1, 128, 134, -1, 101, -1,
2464 146, -1, 152, -1, 167, -1, 168, -1, 253, -1,
2465 183, -1, 150, 128, 145, 134, -1, 147, 101, -1,
2466 147, -1, 146, -1, 3, 91, 3, -1, 104, 261,
2467 -1, -1, 46, 153, -1, 32, 153, -1, 154, -1,
2468 153, 102, 154, -1, 3, 244, 151, -1, -1, 66,
2469 148, -1, -1, 65, 124, 157, 255, 135, 148, 155,
2470 -1, -1, 152, -1, 257, -1, 46, 3, 244, -1,
2471 3, -1, 11, 124, -1, 11, 50, 124, -1, 160,
2472 158, 101, 255, 101, 257, 135, 148, -1, 160, 159,
2473 69, 255, 135, 148, -1, -1, 12, 124, 164, 255,
2474 135, 148, -1, -1, 13, 166, 148, 12, 124, 255,
2475 135, -1, 67, -1, 67, 3, -1, 30, -1, 30,
2476 3, -1, -1, 170, -1, 172, -1, 170, 172, -1,
2477 171, -1, 170, 171, -1, 34, 261, 106, 144, -1,
2478 62, 106, 144, -1, -1, 14, 124, 174, 261, 135,
2479 128, 169, 134, -1, -1, 33, 124, 3, 244, 135,
2480 176, 128, 144, 134, -1, -1, 27, 128, 178, 144,
2481 134, -1, 175, -1, 179, 175, -1, 179, -1, 179,
2482 177, -1, 177, -1, -1, 52, 128, 182, 144, 134,
2483 180, -1, 37, 255, -1, 37, -1, 39, 124, 255,
2484 135, -1, 184, 148, -1, 3, -1, 17, -1, 16,
2485 -1, 4, -1, 187, 129, 186, -1, 186, -1, -1,
2486 17, 187, 128, 189, 141, 134, -1, -1, 17, 128,
2487 190, 141, 134, -1, 41, 240, -1, 41, 187, 129,
2488 117, -1, -1, 193, -1, 194, -1, 193, 194, -1,
2489 20, -1, 21, -1, 18, -1, 38, -1, 47, -1,
2490 49, -1, 48, -1, 25, -1, 23, -1, 4, -1,
2491 -1, 54, 241, -1, -1, 54, 242, -1, -1, 15,
2492 242, -1, -1, 192, 31, 3, 195, 197, 128, 199,
2493 202, 134, -1, -1, 192, 44, 3, 196, 128, 201,
2494 205, 134, -1, -1, 203, -1, 204, -1, 203, 204,
2495 -1, 101, -1, 150, 128, 202, 134, -1, 209, -1,
2496 234, -1, 146, -1, -1, 206, -1, 207, -1, 206,
2497 207, -1, 101, -1, 46, 3, -1, 192, 26, 233,
2498 3, 124, 230, 135, 244, -1, 46, -1, 32, -1,
2499 -1, 192, 208, 210, 211, -1, 212, -1, 211, 102,
2500 212, -1, 3, 244, 151, -1, -1, 104, 261, -1,
2501 8, -1, 9, -1, 10, -1, 5, -1, 56, -1,
2502 55, -1, 45, -1, 28, -1, 29, -1, 226, -1,
2503 111, -1, 112, -1, -1, -1, 128, 261, 220, 134,
2504 -1, -1, 128, 261, 222, 134, -1, -1, 223, 219,
2505 -1, 223, 5, -1, 223, 112, -1, 226, 223, -1,
2506 224, 226, 223, -1, 3, -1, 221, -1, 216, 225,
2507 227, 217, 223, 111, 116, 225, 218, 112, -1, 216,
2508 225, 227, 116, 218, 112, -1, 216, 225, 227, 217,
2509 223, 224, 111, 116, 225, 218, 112, -1, -1, 228,
2510 -1, 229, -1, 228, 229, -1, 221, -1, 221, 104,
2511 5, -1, 221, 104, 221, -1, 3, 104, 221, -1,
2512 3, 104, 5, -1, -1, 231, -1, 95, 232, -1,
2513 231, 102, 95, 232, -1, 231, 102, 232, -1, 232,
2514 -1, 3, 106, 243, 213, -1, 3, 213, -1, 51,
2515 -1, 35, -1, -1, -1, 192, 26, 233, 3, 124,
2516 230, 135, 244, 128, 235, 144, 134, -1, 3, -1,
2517 -1, -1, 26, 236, 124, 230, 135, 244, 128, 238,
2518 144, 134, -1, 186, -1, 187, 129, 186, -1, 240,
2519 -1, 239, -1, 241, -1, 242, 102, 241, -1, 241,
2520 -1, 117, -1, 36, -1, 106, 243, -1, -1, -1,
2521 124, 246, 135, -1, -1, 247, -1, 248, -1, 254,
2522 -1, 247, 102, -1, 248, 254, -1, -1, 24, 261,
2523 249, 245, -1, 261, 124, 246, 135, -1, 53, 124,
2524 246, 135, -1, 64, 261, -1, 42, -1, 42, 255,
2525 -1, 261, -1, 256, -1, 261, -1, 256, 102, 261,
2526 -1, 261, -1, 257, 102, 261, -1, -1, 260, -1,
2527 3, -1, 5, -1, 8, -1, 9, -1, 10, -1,
2528 259, 106, 254, -1, 260, 102, 259, 106, 254, -1,
2529 237, -1, 265, -1, 250, -1, 252, -1, 251, -1,
2530 266, -1, 214, -1, 215, -1, 6, -1, 19, -1,
2531 126, 246, 127, -1, 71, 258, 134, -1, 261, 111,
2532 261, -1, 261, 112, 261, -1, 261, 76, 261, -1,
2533 261, 77, 261, -1, 261, 72, 261, -1, 261, 73,
2534 261, -1, 261, 75, 261, -1, 261, 74, 261, -1,
2535 261, 89, 261, -1, 261, 90, 261, -1, 120, 261,
2536 -1, 119, 261, -1, 261, 109, 261, -1, 261, 108,
2537 261, -1, 261, 107, 261, -1, 261, 98, 261, -1,
2538 261, 97, 261, -1, 261, 96, 261, -1, 261, 116,
2539 261, -1, 261, 118, 261, -1, 261, 115, 261, -1,
2540 261, 114, 261, -1, 261, 117, 261, -1, 261, 69,
2541 261, -1, 261, 70, 261, -1, 261, 40, 261, -1,
2542 261, 68, 261, -1, 43, 124, 261, 135, -1, 36,
2543 261, -1, 36, -1, 124, 256, 135, -1, 114, 261,
2544 -1, 261, 126, 261, 127, -1, 261, 81, 261, -1,
2545 261, 80, 261, -1, 261, 87, 261, -1, 261, 86,
2546 261, -1, 261, 88, 261, -1, 261, 79, 261, -1,
2547 261, 78, 261, -1, 261, 85, 261, -1, 261, 82,
2548 261, -1, 261, 83, 261, -1, 261, 84, 261, -1,
2549 261, 104, 261, -1, 261, 105, 261, 106, 261, -1,
2550 261, 93, -1, 261, 92, -1, 93, 261, -1, 92,
2551 261, -1, 53, 129, 3, -1, 130, 3, -1, -1,
2552 261, 129, 124, 262, 261, 135, -1, 3, -1, 117,
2553 -1, 4, -1, 186, -1, 117, -1, 261, 129, 263,
2554 91, 264, -1, 261, 94, 264, -1, 261, 129, 126,
2555 261, 127, -1, 261, 129, 130, 264, -1, 261, 94,
2556 130, 264, -1, 261, 129, 130, 126, 261, 127, -1,
2557 261, 94, 130, 126, 261, 127, -1, 261, 129, 264,
2558 -1, 3, -1, 16, 3, -1, 16, 3, 104, 3,
2559 -1, 16, 3, 104, 5, -1, 192, 267, -1, 63,
2560 16, 104, 261, -1, 22, 16, 241, -1
2563 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2564 static const yytype_uint16 yyrline[] =
2566 0, 1887, 1887, 1889, 1889, 1890, 1891, 1893, 1894, 1895,
2567 1896, 1897, 1898, 1899, 1900, 1902, 1902, 1903, 1904, 1906,
2568 1907, 1908, 1909, 1910, 1911, 1912, 1914, 1915, 1917, 1920,
2569 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932,
2570 1933, 1934, 1935, 1936, 1937, 1940, 1941, 1942, 1943, 1944,
2571 1945, 1946, 1947, 1959, 1960, 1964, 1971, 1990, 1991, 1993,
2572 1994, 1996, 1997, 1999, 2059, 2060, 2063, 2063, 2082, 2083,
2573 2084, 2089, 2093, 2098, 2099, 2101, 2121, 2169, 2169, 2188,
2574 2188, 2203, 2206, 2209, 2212, 2216, 2217, 2218, 2219, 2220,
2575 2221, 2223, 2234, 2237, 2237, 2268, 2268, 2293, 2293, 2309,
2576 2310, 2311, 2312, 2320, 2329, 2329, 2378, 2382, 2393, 2403,
2577 2420, 2421, 2422, 2423, 2425, 2426, 2428, 2428, 2430, 2430,
2578 2453, 2467, 2483, 2484, 2485, 2486, 2493, 2494, 2495, 2496,
2579 2497, 2498, 2499, 2500, 2501, 2502, 2506, 2507, 2509, 2510,
2580 2512, 2513, 2517, 2515, 2523, 2521, 2530, 2531, 2532, 2533,
2581 2534, 2535, 2536, 2537, 2539, 2545, 2546, 2547, 2548, 2549,
2582 2550, 2553, 2621, 2621, 2623, 2623, 2625, 2626, 2628, 2712,
2583 2713, 2722, 2723, 2726, 2727, 2728, 2729, 2730, 2731, 2732,
2584 2750, 2752, 2753, 2754, 2756, 2756, 2760, 2760, 2764, 2765,
2585 2768, 2769, 2771, 2772, 2774, 2775, 2777, 2781, 2784, 2789,
2586 2790, 2791, 2792, 2794, 2797, 2801, 2804, 2807, 2817, 2821,
2587 2827, 2833, 2841, 2846, 2852, 2860, 2868, 2869, 2870, 2873,
2588 2872, 2889, 2890, 2892, 2891, 2915, 2934, 2948, 2949, 2951,
2589 2952, 2954, 2955, 2956, 2965, 2966, 2970, 2971, 2973, 2974,
2590 2975, 2977, 2981, 2982, 2987, 2988, 3032, 3082, 3103, 3125,
2591 3128, 3135, 3138, 3141, 3144, 3147, 3150, 3155, 3156, 3158,
2592 3159, 3160, 3161, 3162, 3164, 3170, 3179, 3180, 3181, 3182,
2593 3183, 3184, 3186, 3190, 3202, 3220, 3231, 3241, 3250, 3251,
2594 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261,
2595 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271,
2596 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281,
2597 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291,
2598 3292, 3293, 3294, 3295, 3297, 3298, 3299, 3300, 3302, 3317,
2599 3325, 3325, 3379, 3380, 3381, 3382, 3383, 3391, 3409, 3416,
2600 3427, 3434, 3441, 3451, 3462, 3640, 3676, 3683, 3690, 3697,
2605 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2606 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2607 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2608 static const char *const yytname[] =
2610 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2611 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2612 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2613 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2614 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2615 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2616 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2617 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2618 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2619 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2620 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2621 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2622 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"",
2623 "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"",
2624 "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"",
2625 "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"",
2626 "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"",
2627 "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"",
2628 "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2629 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2630 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2631 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2632 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2633 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2634 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2635 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2636 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2637 "PACKAGE_INITCODE", "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION",
2638 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2639 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2640 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2641 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2642 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2643 "TRY", "$@7", "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE",
2644 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2645 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2646 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2647 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2648 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2649 "SLOT_DECLARATION", "$@12", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT",
2650 "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@13",
2651 "XMLEXPR2", "$@14", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", "XMLNODE",
2652 "MAYBE_XMLATTRIBUTES", "XMLATTRIBUTES", "XMLATTRIBUTE",
2653 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2654 "FUNCTION_DECLARATION", "$@15", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2655 "$@16", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2656 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2657 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2658 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2659 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2660 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@17", "ID_OR_NS", "SUBNODE",
2661 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2662 "DEFAULT_NAMESPACE", "USE_NAMESPACE", 0
2667 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2669 static const yytype_uint16 yytoknum[] =
2671 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2672 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2673 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2674 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2675 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2676 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2677 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2678 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2679 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2680 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2681 355, 59, 44, 356, 61, 63, 58, 124, 94, 38,
2682 357, 60, 62, 358, 45, 43, 47, 42, 37, 126,
2683 33, 359, 360, 361, 40, 362, 91, 93, 123, 46,
2684 64, 363, 364, 365, 125, 41
2688 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2689 static const yytype_uint16 yyr1[] =
2691 0, 136, 137, 138, 138, 139, 139, 140, 140, 140,
2692 140, 140, 140, 140, 140, 141, 141, 142, 142, 143,
2693 143, 143, 143, 143, 143, 143, 144, 144, 145, 145,
2694 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
2695 146, 146, 146, 146, 146, 147, 147, 147, 147, 147,
2696 147, 147, 147, 148, 148, 149, 150, 151, 151, 152,
2697 152, 153, 153, 154, 155, 155, 157, 156, 158, 158,
2698 158, 159, 159, 160, 160, 161, 162, 164, 163, 166,
2699 165, 167, 167, 168, 168, 169, 169, 169, 169, 170,
2700 170, 171, 172, 174, 173, 176, 175, 178, 177, 179,
2701 179, 180, 180, 180, 182, 181, 183, 183, 184, 185,
2702 186, 186, 186, 186, 187, 187, 189, 188, 190, 188,
2703 191, 191, 192, 192, 193, 193, 194, 194, 194, 194,
2704 194, 194, 194, 194, 194, 194, 195, 195, 196, 196,
2705 197, 197, 199, 198, 201, 200, 202, 202, 203, 203,
2706 204, 204, 204, 204, 204, 205, 205, 206, 206, 207,
2707 207, 207, 208, 208, 210, 209, 211, 211, 212, 213,
2708 213, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2709 215, 216, 217, 218, 220, 219, 222, 221, 223, 223,
2710 223, 223, 224, 224, 225, 225, 226, 226, 226, 227,
2711 227, 228, 228, 229, 229, 229, 229, 229, 230, 230,
2712 230, 230, 231, 231, 232, 232, 233, 233, 233, 235,
2713 234, 236, 236, 238, 237, 239, 240, 241, 241, 242,
2714 242, 243, 243, 243, 244, 244, 245, 245, 246, 246,
2715 246, 247, 248, 247, 249, 250, 251, 251, 252, 253,
2716 253, 254, 255, 256, 256, 257, 257, 258, 258, 259,
2717 259, 259, 259, 259, 260, 260, 261, 261, 261, 261,
2718 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2719 261, 261, 261, 261, 261, 261, 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 262, 261, 263, 263, 263, 264, 264, 261, 261, 261,
2725 261, 261, 261, 261, 265, 266, 267, 267, 267, 268,
2729 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2730 static const yytype_uint8 yyr2[] =
2732 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2733 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2734 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2735 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2736 1, 1, 1, 3, 2, 1, 1, 1, 1, 1,
2737 1, 1, 4, 2, 1, 1, 3, 2, 0, 2,
2738 2, 1, 3, 3, 0, 2, 0, 7, 0, 1,
2739 1, 3, 1, 2, 3, 8, 6, 0, 6, 0,
2740 7, 1, 2, 1, 2, 0, 1, 1, 2, 1,
2741 2, 4, 3, 0, 8, 0, 9, 0, 5, 1,
2742 2, 1, 2, 1, 0, 6, 2, 1, 4, 2,
2743 1, 1, 1, 1, 3, 1, 0, 6, 0, 5,
2744 2, 4, 0, 1, 1, 2, 1, 1, 1, 1,
2745 1, 1, 1, 1, 1, 1, 0, 2, 0, 2,
2746 0, 2, 0, 9, 0, 8, 0, 1, 1, 2,
2747 1, 4, 1, 1, 1, 0, 1, 1, 2, 1,
2748 2, 8, 1, 1, 0, 4, 1, 3, 3, 0,
2749 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2750 1, 1, 1, 0, 0, 4, 0, 4, 0, 2,
2751 2, 2, 2, 3, 1, 1, 10, 6, 11, 0,
2752 1, 1, 2, 1, 3, 3, 3, 3, 0, 1,
2753 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2754 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2755 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2756 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2757 2, 1, 1, 1, 3, 1, 3, 0, 1, 1,
2758 1, 1, 1, 1, 3, 5, 1, 1, 1, 1,
2759 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
2760 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2761 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2762 3, 3, 3, 3, 3, 4, 2, 1, 3, 2,
2763 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2764 3, 3, 3, 5, 2, 2, 2, 2, 3, 2,
2765 0, 6, 1, 1, 1, 1, 1, 5, 3, 5,
2766 4, 4, 6, 6, 3, 1, 2, 4, 4, 2,
2770 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2771 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2772 means the default is an error. */
2773 static const yytype_uint16 yydefact[] =
2775 122, 345, 135, 174, 274, 171, 172, 173, 0, 0,
2776 79, 0, 0, 128, 275, 126, 127, 0, 134, 0,
2777 133, 222, 178, 179, 307, 129, 0, 0, 0, 177,
2778 130, 132, 131, 0, 0, 176, 175, 0, 0, 0,
2779 257, 0, 0, 14, 181, 0, 0, 0, 0, 238,
2780 122, 0, 0, 2, 122, 5, 55, 12, 0, 37,
2781 68, 32, 33, 34, 35, 36, 39, 122, 38, 7,
2782 31, 0, 123, 124, 9, 8, 11, 272, 273, 0,
2783 180, 10, 266, 268, 270, 269, 40, 255, 267, 271,
2784 42, 30, 41, 0, 0, 73, 77, 122, 93, 110,
2785 113, 112, 111, 118, 115, 0, 0, 345, 244, 221,
2786 0, 306, 0, 0, 120, 0, 104, 238, 0, 0,
2787 248, 66, 259, 260, 261, 262, 263, 0, 0, 258,
2788 327, 326, 309, 289, 288, 0, 253, 0, 239, 240,
2789 241, 251, 83, 0, 107, 249, 0, 81, 45, 44,
2790 122, 46, 29, 0, 47, 48, 49, 51, 0, 50,
2791 329, 1, 6, 122, 345, 0, 69, 0, 0, 70,
2792 54, 109, 0, 218, 0, 163, 0, 162, 164, 349,
2793 125, 194, 0, 195, 199, 0, 0, 0, 0, 0,
2794 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2795 0, 0, 0, 0, 0, 0, 0, 0, 0, 325,
2796 324, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2797 0, 0, 0, 0, 0, 0, 0, 238, 0, 0,
2798 56, 74, 0, 0, 0, 122, 116, 0, 225, 0,
2799 228, 227, 351, 236, 208, 0, 252, 0, 0, 27,
2800 0, 328, 0, 0, 277, 0, 0, 0, 308, 276,
2801 242, 243, 84, 235, 60, 61, 106, 250, 59, 82,
2802 43, 28, 122, 0, 235, 0, 0, 53, 346, 217,
2803 216, 0, 136, 138, 0, 186, 0, 203, 0, 200,
2804 201, 256, 303, 304, 301, 302, 282, 283, 285, 284,
2805 280, 281, 317, 316, 312, 311, 319, 320, 321, 318,
2806 314, 313, 315, 286, 287, 336, 0, 335, 338, 295,
2807 294, 293, 322, 0, 292, 291, 290, 278, 279, 299,
2808 298, 296, 300, 297, 0, 0, 110, 113, 336, 330,
2809 0, 0, 0, 344, 0, 0, 0, 25, 0, 122,
2810 17, 23, 0, 20, 19, 22, 21, 122, 114, 0,
2811 238, 245, 169, 0, 0, 209, 213, 108, 121, 226,
2812 305, 0, 26, 247, 350, 0, 264, 0, 254, 0,
2813 58, 0, 122, 13, 58, 0, 0, 0, 0, 0,
2814 140, 0, 0, 235, 165, 166, 0, 0, 0, 182,
2815 183, 188, 202, 0, 341, 0, 246, 310, 0, 0,
2816 0, 340, 0, 122, 0, 0, 119, 18, 122, 0,
2817 0, 0, 0, 215, 210, 235, 0, 0, 122, 0,
2818 233, 232, 231, 234, 0, 63, 62, 52, 0, 122,
2819 347, 348, 208, 137, 0, 0, 229, 139, 144, 58,
2820 0, 187, 207, 206, 204, 205, 0, 0, 0, 323,
2821 0, 339, 0, 337, 78, 0, 85, 0, 117, 237,
2822 170, 169, 0, 0, 212, 0, 0, 99, 103, 101,
2823 105, 64, 265, 57, 0, 76, 0, 141, 142, 0,
2824 122, 168, 167, 197, 190, 181, 191, 0, 189, 0,
2825 188, 343, 331, 342, 80, 0, 0, 0, 86, 89,
2826 87, 24, 214, 223, 211, 97, 0, 100, 102, 122,
2827 67, 122, 235, 122, 230, 0, 159, 0, 0, 122,
2828 157, 0, 184, 181, 188, 192, 0, 27, 94, 90,
2829 88, 27, 27, 235, 65, 75, 0, 150, 154, 0,
2830 0, 0, 122, 148, 152, 153, 160, 218, 145, 158,
2831 183, 0, 0, 193, 27, 92, 0, 0, 0, 219,
2832 122, 143, 149, 0, 0, 185, 183, 91, 224, 98,
2833 95, 27, 0, 0, 196, 0, 0, 0, 151, 208,
2834 198, 27, 220, 0, 0, 235, 96, 161
2837 /* YYDEFGOTO[NTERM-NUM]. */
2838 static const yytype_int16 yydefgoto[] =
2840 -1, 52, 53, 54, 55, 348, 349, 350, 371, 372,
2841 151, 152, 171, 351, 153, 435, 154, 268, 265, 520,
2842 59, 253, 167, 168, 60, 61, 62, 63, 232, 64,
2843 97, 155, 156, 507, 508, 509, 510, 65, 234, 477,
2844 586, 478, 542, 479, 480, 66, 249, 157, 67, 68,
2845 238, 239, 69, 357, 235, 70, 158, 72, 73, 390,
2846 392, 445, 353, 523, 354, 490, 551, 552, 553, 528,
2847 529, 530, 178, 355, 284, 394, 395, 423, 77, 78,
2848 79, 401, 456, 498, 561, 183, 396, 457, 499, 184,
2849 80, 288, 289, 290, 364, 365, 366, 281, 356, 581,
2850 110, 82, 541, 240, 241, 432, 447, 433, 380, 361,
2851 137, 138, 139, 243, 83, 84, 85, 159, 140, 245,
2852 246, 86, 127, 128, 129, 87, 408, 342, 318, 88,
2856 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2858 #define YYPACT_NINF -494
2859 static const yytype_int16 yypact[] =
2861 1763, -21, -494, -494, -494, -494, -494, -494, -29, -45,
2862 -494, -36, 68, -494, -494, -494, -494, 75, -494, 2217,
2863 -494, 91, -494, -494, 438, -494, -15, 316, -5, -494,
2864 -494, -494, -494, 7, -37, -494, -494, 107, 2217, 24,
2865 367, 2217, 2217, -494, -494, 2217, 2217, 2217, 2217, 2217,
2866 707, 127, 139, -494, 575, -494, -494, -494, 23, -494,
2867 2145, -494, -494, -494, -494, -494, -494, 2019, -494, -494,
2868 -494, 488, 431, -494, -494, -494, -494, -494, -494, 17,
2869 -494, -494, -494, -494, -494, -494, 57, 2920, -494, -494,
2870 -494, -494, -494, 155, 36, -494, -494, 2019, -494, -494,
2871 -494, -494, -494, -494, -494, 28, 316, -494, -48, -494,
2872 47, 213, 2217, 69, -494, 2217, -494, 2217, 194, 116,
2873 213, -494, -494, -494, -494, -494, -494, 92, 121, 132,
2874 213, 213, 379, 213, 213, -42, 2858, 114, 146, 2217,
2875 -494, 2858, 246, 247, 2217, 2217, 247, 249, -494, -494,
2876 839, -494, -494, 125, -494, -494, -494, -494, 248, -494,
2877 -494, -494, -494, 1103, 197, 264, -494, 168, 203, 57,
2878 173, -494, 274, 66, 276, -494, 278, -494, -494, -494,
2879 -494, -494, 2217, -494, 21, 2217, 2217, 2217, 2217, 2217,
2880 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2881 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, -494,
2882 -494, 138, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2883 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 130,
2884 -494, -494, 2217, 273, 2217, 1235, -494, 316, 158, 160,
2885 -494, -494, -494, 167, 15, 157, 192, 229, 2276, 1891,
2886 165, -494, 2217, 2217, -494, 2217, 367, 2217, -494, -494,
2887 -494, -494, -494, 207, 212, -494, -494, -494, 212, -494,
2888 -494, -494, 2019, 181, 207, 2217, 2217, -494, 217, -494,
2889 -494, 314, 262, 269, 315, 2858, 220, 221, 6, 21,
2890 -494, 2858, 1095, 567, 567, 567, 3292, 3292, 3292, 3292,
2891 1095, 1095, 2858, 2858, 2858, 2858, 2858, 2858, 2858, 2858,
2892 2858, 2858, 2858, 2982, 3044, -494, 214, -494, -494, 313,
2893 313, 313, 2858, 2486, 3106, 3168, 3230, 1095, 1095, 379,
2894 379, 213, 213, 213, 199, 2548, 238, 244, 245, -494,
2895 2217, 267, 254, -494, 226, 224, 2346, -494, 228, 1367,
2896 -494, -494, 235, -494, -494, -494, -494, 1235, -494, 316,
2897 2217, -494, -55, 363, 232, 280, -494, -494, -494, 240,
2898 -494, 237, 1891, -494, 2858, 243, -494, 277, 2858, 292,
2899 281, 247, 971, -494, -6, 279, 252, 135, 270, 316,
2900 376, 316, 268, 207, 296, -494, 265, 22, 34, -494,
2901 -494, -494, -494, 2217, -494, 2217, -494, -494, 2217, 2610,
2902 2217, -494, 294, 2019, 2217, 272, -494, -494, 1235, 283,
2903 275, 2217, 292, -494, -494, 207, 19, 78, 2019, 2217,
2904 -494, -494, -494, -494, 2217, -494, -494, -494, 2217, 2019,
2905 -494, -494, 15, -494, 316, 284, -494, 300, -494, 281,
2906 315, -494, -494, -494, -494, -494, 291, 253, 2672, 2858,
2907 2416, -494, 2734, -494, -494, 287, 46, 289, -494, -494,
2908 2858, 309, 286, 363, -494, 297, 312, -494, -494, 78,
2909 -494, 338, -494, 2858, -38, -494, 298, 300, -494, 316,
2910 27, -494, -494, -494, -494, 299, -494, 2217, -494, 327,
2911 -494, -494, -494, -494, -494, 2217, 318, 306, 46, -494,
2912 -494, -494, -494, -494, -494, -494, 442, -494, -494, 2019,
2913 -494, 2019, 207, 1499, -494, 447, -494, 427, 321, 255,
2914 -494, 17, 2858, 342, -494, 25, 2796, 1891, -494, -494,
2915 -494, 1891, 1891, 207, -494, -494, 332, -494, -494, 335,
2916 328, 331, 1631, -494, -494, -494, -494, 66, -494, -494,
2917 -494, 334, 17, 25, 1891, -494, 336, 340, 341, -494,
2918 1499, -494, -494, 472, 365, -494, -494, -494, -494, -494,
2919 -494, 1891, 347, 358, -494, 373, 359, 352, -494, 15,
2920 -494, 1891, -494, 353, 355, 207, -494, -494
2923 /* YYPGOTO[NTERM-NUM]. */
2924 static const yytype_int16 yypgoto[] =
2926 -494, -494, 337, -494, 444, -315, -494, 150, -475, -34,
2927 1, -60, -87, 53, 2, 52, 446, 364, 129, -494,
2928 -494, -494, -494, -494, -494, -494, -494, -494, -494, -494,
2929 -494, -494, -494, -494, -494, 5, 8, -494, -494, 32,
2930 -494, 33, -494, -494, -494, -494, -494, -494, -494, -494,
2931 14, 56, -494, -494, -494, -494, 0, -494, 430, -494,
2932 -494, -494, 59, -494, 61, -494, -53, -494, -31, -494,
2933 -494, -14, -494, 3, -494, -494, 72, 62, -494, -494,
2934 -494, -494, -464, -494, -494, -169, -494, -457, -494, -493,
2935 -413, -494, -494, 239, -419, -494, -344, -39, 4, -494,
2936 -494, -494, -494, -494, 508, -101, 93, 117, -257, -494,
2937 -103, -494, -494, -494, -494, -494, -494, -494, -130, -132,
2938 490, -52, -494, 285, -494, -13, -494, -494, -189, -494,
2939 -494, -494, -494, -494, -494
2942 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2943 positive, shift that token. If negative, reduce the rule which
2944 number is the opposite. If zero, do what YYDEFACT says.
2945 If YYTABLE_NINF, syntax error. */
2946 #define YYTABLE_NINF -335
2947 static const yytype_int16 yytable[] =
2949 71, 56, 58, 76, 81, 242, 108, 170, 169, 261,
2950 233, 111, 266, 267, 250, 287, 150, 384, 362, 424,
2951 181, 94, 362, 486, 286, 120, 104, 452, 130, 131,
2952 494, 2, 132, 133, 134, 136, 141, 170, 560, 454,
2953 343, 104, 419, 535, 500, 13, 211, 15, 16, 421,
2954 18, 422, 20, 57, 71, 56, 58, 76, 81, 74,
2955 257, 75, 565, -71, 185, 25, 566, 567, 105, 576,
2956 93, 99, 100, 525, 30, 31, 32, 563, 228, 96,
2957 505, 229, 474, 113, 101, 102, 534, 117, 98, 577,
2958 271, 106, 118, 258, 109, 95, 574, 521, 434, 136,
2959 344, 279, 248, 467, 141, 475, 587, 57, 506, 112,
2960 363, 476, 585, 74, 473, 75, 594, 280, 399, 115,
2961 287, 375, 400, 119, 334, 376, 141, 404, 526, 514,
2962 160, 136, 136, 336, 337, 116, 449, 496, 440, 161,
2963 441, 99, 100, 385, 386, 182, 101, 102, 121, 182,
2964 182, 163, 411, 497, 101, 102, 236, 237, 230, 185,
2965 231, -155, 182, 71, 56, 58, 76, 81, 472, 285,
2966 593, 244, 291, 292, 293, 294, 295, 296, 297, 298,
2967 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
2968 309, 310, 311, 312, 313, 314, 103, 251, 247, 319,
2969 320, 321, 322, 323, 324, 325, 326, 327, 328, 329,
2970 330, 331, 332, 333, 141, 335, 57, 99, 100, 136,
2971 252, 346, 74, 463, 75, 317, 254, 255, 453, 455,
2972 101, 102, 99, 100, 256, 71, 56, 352, 382, 374,
2973 136, 259, 141, 317, 378, 101, 102, 338, 260, 262,
2974 263, 358, 269, 272, 339, 315, 340, 420, 494, 2,
2975 341, 369, 136, 136, 172, 546, -72, 274, 316, 275,
2976 99, 100, 276, 13, 277, 15, 16, 278, 18, 282,
2977 20, 283, 465, 101, 102, 345, 568, -115, 443, 359,
2978 446, 360, 367, 25, 257, 99, 100, 99, 100, 482,
2979 373, 525, 30, 31, 32, 209, 210, 211, 101, 102,
2980 101, 102, 271, 379, 381, 383, 389, 388, 393, 99,
2981 100, 387, 271, 391, 397, 398, 464, 409, 430, -332,
2982 317, 315, 101, 102, 406, -334, -333, 227, 597, 228,
2983 403, 481, 229, 446, 172, 412, 368, 141, 414, 71,
2984 56, 352, 485, 170, 173, 317, 526, 71, 56, 352,
2985 175, 413, 416, 418, 495, 496, 362, 425, 170, -114,
2986 122, 427, 123, 369, 177, 124, 125, 126, 428, 170,
2987 438, 497, 426, 429, 315, 434, 484, 439, 524, -156,
2988 458, 444, 459, 410, 442, 460, 448, 462, 450, 451,
2989 466, 136, 489, 493, 519, 209, 210, 211, 470, 431,
2990 469, 315, 488, 421, 513, 531, 141, 468, 71, 56,
2991 352, 483, 504, 511, 537, 515, 317, 222, 223, 224,
2992 225, 226, 544, 522, 545, 2, 516, 227, 533, 228,
2993 538, 107, 229, 3, 4, 543, 5, 6, 7, 13,
2994 556, 15, 16, 557, 18, 558, 20, 14, 562, 170,
2995 569, 170, 19, 570, 21, 571, 22, 23, 575, 25,
2996 578, 209, 210, 211, 579, 583, 580, 584, 30, 31,
2997 32, 588, 589, 29, 532, 590, 592, 591, 595, 596,
2998 527, 34, 536, 35, 36, 224, 225, 226, 162, 417,
2999 273, 491, 180, 227, 172, 228, 166, 264, 229, 40,
3000 436, 517, 518, 539, 173, 559, 540, 582, 573, 174,
3001 175, 572, 492, 550, 548, 549, 554, 555, 402, 527,
3002 41, 42, 176, 512, 177, 114, 0, 487, 135, 471,
3003 0, 377, 0, 0, 0, 0, 0, 0, 0, 0,
3004 0, 0, 550, 548, 549, 554, 555, 0, 0, 0,
3005 0, 0, 48, 0, 49, 0, 0, 0, 51, 0,
3006 550, 548, 549, 554, 555, -4, 0, 0, 1, 2,
3007 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3008 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
3009 20, 0, 0, 22, 23, 0, 0, 186, 0, 0,
3010 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3011 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3012 35, 36, 0, 0, 0, -335, -335, -335, 37, 38,
3013 39, 0, 0, 194, 195, 0, 40, 0, 0, 0,
3014 0, 0, 0, 0, 0, 0, 0, 0, 0, 209,
3015 210, 211, 0, 212, 213, 214, 0, 41, 42, 0,
3016 0, 0, 0, 0, 0, 0, 43, 0, 220, 221,
3017 0, 222, 223, 224, 225, 226, 44, 0, 0, 45,
3018 0, 227, 0, 228, 46, 47, 229, 0, 0, 48,
3019 0, 49, 0, 50, 0, 51, 0, 0, 0, -4,
3020 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3021 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3022 18, 19, 20, 21, 0, 22, 23, 142, 0, 143,
3023 0, 0, 0, 24, 144, 25, 26, 0, 27, 145,
3024 28, 0, 29, 146, 30, 31, 32, 0, 0, 33,
3025 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3026 37, 38, 39, 0, 147, 0, 0, 0, 40, 0,
3027 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3028 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3029 42, 0, 0, 0, 0, 0, 0, 0, 148, 0,
3030 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3031 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3032 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3033 0, 149, 1, 2, 3, 4, 0, 5, 6, 7,
3034 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3035 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3036 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3037 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3038 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3039 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3040 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3041 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3042 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3043 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3044 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3045 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3046 0, 0, 0, 270, 1, 2, 3, 4, 0, 5,
3047 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3048 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3049 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3050 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3051 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3052 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3053 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3054 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3055 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3056 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3057 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3058 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3059 0, 51, 0, 0, 0, 437, 1, 2, 3, 4,
3060 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3061 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3062 0, 22, 23, 0, 0, -335, 0, 0, 0, 24,
3063 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3064 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3065 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3066 0, -335, -335, 0, 40, 0, 0, 0, 0, 0,
3067 0, 0, 0, 0, 0, 0, 0, 209, 210, 211,
3068 0, 212, 213, 214, 0, 41, 42, 0, 0, 0,
3069 0, 0, 0, 0, 43, 0, -335, -335, 0, 222,
3070 223, 224, 225, 226, 44, 0, 0, 45, 0, 227,
3071 0, 228, 46, 47, 229, 0, 0, 48, 0, 49,
3072 0, 50, 0, 51, 0, 0, 0, -3, 1, 2,
3073 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3074 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3075 20, 0, 0, 22, 23, 0, 0, 0, 0, 0,
3076 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3077 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3078 35, 36, 0, 0, 0, 0, 0, 0, 37, 38,
3079 39, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3080 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3081 0, 0, 0, 0, 0, 0, 0, 41, 42, 0,
3082 0, 0, 0, 0, 0, 0, 347, 0, 0, 0,
3083 0, 0, 0, 0, 0, 0, 44, 0, 0, 45,
3084 0, 0, 0, 0, 46, 47, 0, 0, 0, 48,
3085 0, 49, 0, 50, 0, 51, 0, 0, 0, -15,
3086 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3087 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3088 18, 19, 20, 0, 0, 22, 23, 0, 0, 0,
3089 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
3090 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
3091 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3092 37, 38, 39, 0, 0, 0, 0, 0, 40, 0,
3093 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3094 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3095 42, 0, 0, 0, 0, 0, 0, 0, 347, 0,
3096 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3097 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3098 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3099 0, -16, 1, 2, 3, 4, 0, 5, 6, 7,
3100 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3101 16, 17, 18, 19, 20, 0, 0, 22, 23, 0,
3102 0, 0, 0, 0, 0, 24, 0, 25, 26, 0,
3103 27, 0, 28, 0, 29, 0, 30, 31, 32, 0,
3104 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3105 0, 0, 37, 38, 39, 0, 0, 0, 0, 0,
3106 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3108 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3109 547, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3110 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3111 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3112 0, 0, 0, -146, 1, 2, 3, 4, 0, 5,
3113 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3114 14, 15, 16, 17, 18, 19, 20, 0, 0, 22,
3115 23, 0, 0, 0, 0, 0, 0, 24, 0, 25,
3116 26, 0, 27, 0, 28, 0, 29, 0, 30, 31,
3117 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3118 0, 0, 0, 0, 37, 38, 39, 0, 0, 0,
3119 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3121 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3122 0, 0, 547, 0, 0, 0, 0, 0, 0, 0,
3123 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3124 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3125 0, 51, 0, -3, 0, -147, 1, 2, 3, 4,
3126 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3127 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3128 0, 22, 23, 0, 0, 0, 0, 0, 0, 24,
3129 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3130 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3131 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3132 0, 0, 0, 0, 40, 0, 0, 0, 0, 0,
3133 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3134 0, 0, 0, 0, 0, 41, 42, 0, 0, 0,
3135 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
3136 0, 0, 0, 0, 44, 0, 0, 45, 0, 0,
3137 0, 0, 46, 47, 0, 0, 0, 48, 0, 49,
3138 0, 50, 0, 51, 1, 2, 3, 4, 0, 5,
3139 6, 7, 8, 9, 10, 11, 0, -122, 0, 13,
3140 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3141 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3142 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3143 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3144 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3145 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3147 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3148 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3149 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3150 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3151 0, 51, 1, 2, 3, 4, 0, 5, 6, 7,
3152 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3153 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3154 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3155 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3156 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3157 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3158 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3160 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3161 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3162 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3163 0, 0, 0, 48, 0, 49, 0, 50, 164, 51,
3164 3, 4, 0, 5, 6, 7, 0, 0, 0, 0,
3165 0, 0, 0, 0, 14, 0, 0, 0, 0, 19,
3166 0, 21, 0, 22, 23, 0, 0, 143, 0, 0,
3167 0, 24, 0, 0, 0, 0, 0, 0, 28, 0,
3168 29, 165, 0, 0, 0, 0, 0, 0, 34, 0,
3169 35, 36, 0, 0, 0, 0, 0, 0, 0, 38,
3170 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3171 107, 0, 3, 4, 0, 5, 6, 7, 0, 0,
3172 0, 0, 0, 0, 0, 0, 14, 41, 42, 0,
3173 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3174 0, 0, 0, 24, 0, 0, 44, 0, 0, 45,
3175 28, 0, 29, 0, 46, 47, 0, 0, 0, 48,
3176 34, 49, 35, 36, 0, 51, 0, 0, 0, 0,
3177 0, 38, 0, 0, 0, 0, 0, 0, 40, 0,
3178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3179 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3180 42, 0, 0, 0, 0, 0, 186, 0, 0, 0,
3181 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3182 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3183 0, 48, 0, 49, 187, 188, 189, 51, 190, 191,
3184 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3185 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3186 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3187 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3188 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3189 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3190 0, 370, 0, 0, 187, 188, 189, 0, 190, 191,
3191 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3192 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3193 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3194 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3195 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3196 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3197 0, 415, 0, 0, 187, 188, 189, 0, 190, 191,
3198 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3199 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3200 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3201 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3202 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3203 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3204 0, 502, 0, 0, 187, 188, 189, 0, 190, 191,
3205 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3206 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3207 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3208 215, 216, 405, 217, 218, 219, 0, 220, 221, 0,
3209 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3210 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3211 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3212 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3213 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3214 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3215 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3216 0, 0, 227, 0, 228, 407, 0, 229, 187, 188,
3217 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3218 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3219 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3220 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3221 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3222 0, 0, 0, 0, 227, 0, 228, 461, 0, 229,
3223 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3224 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
3225 206, 207, 208, 0, 209, 210, 211, 0, 212, 213,
3226 214, 0, 0, 0, 186, 0, 215, 216, 0, 217,
3227 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3228 226, 0, 0, 0, 0, 0, 227, 0, 228, 501,
3229 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3230 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3231 204, 205, 206, 207, 208, 0, 209, 210, 211, 0,
3232 212, 213, 214, 0, 0, 0, 186, 0, 215, 216,
3233 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3234 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3235 228, 503, 0, 229, 187, 188, 189, 0, 190, 191,
3236 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3237 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3238 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3239 215, 216, 564, 217, 218, 219, 0, 220, 221, 0,
3240 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3241 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3242 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3243 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3244 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3245 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3246 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3247 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3248 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3249 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3250 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3251 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3252 0, 0, 221, 0, 222, 223, 224, 225, 226, 0,
3253 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3254 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3256 0, 0, 208, 0, 209, 210, 211, 0, 212, 213,
3257 214, 0, 0, 0, 186, 0, 0, 0, 0, 217,
3258 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3259 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3260 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3261 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
3262 0, 0, 0, 0, 0, 0, 209, 210, 211, 0,
3263 212, 213, 214, 0, 0, 0, 186, 0, 0, 0,
3264 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3265 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3266 228, 0, 0, 229, 187, 188, 189, 0, 190, 191,
3267 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
3268 0, 0, 0, 0, 0, 0, 0, 0, 209, 210,
3269 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3270 0, 0, 0, 0, 218, 219, 0, 220, 221, 0,
3271 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3272 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3273 190, 191, 192, 193, 194, 195, 0, 0, 0, 0,
3274 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3275 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3276 186, 0, 0, 0, 0, 0, 0, 219, 0, 220,
3277 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3278 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3279 189, 0, 190, 191, 192, 193, 194, 195, 0, 0,
3280 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3281 0, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3282 0, 0, 186, 0, 0, 0, 0, 0, 0, -335,
3283 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3284 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3285 187, 188, 189, 0, -335, -335, -335, -335, 194, 195,
3286 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3287 0, 0, 0, 0, 209, 210, 211, 0, 212, 213,
3288 214, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3289 0, 0, 0, 220, 221, 0, 222, 223, 224, 225,
3290 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3294 static const yytype_int16 yycheck[] =
3296 0, 0, 0, 0, 0, 106, 19, 67, 60, 139,
3297 97, 24, 144, 145, 117, 184, 50, 274, 3, 363,
3298 3, 50, 3, 442, 3, 38, 12, 5, 41, 42,
3299 5, 4, 45, 46, 47, 48, 49, 97, 531, 5,
3300 229, 27, 357, 500, 457, 18, 94, 20, 21, 104,
3301 23, 106, 25, 0, 54, 54, 54, 54, 54, 0,
3302 102, 0, 537, 69, 102, 38, 541, 542, 12, 562,
3303 91, 3, 4, 46, 47, 48, 49, 534, 126, 124,
3304 34, 129, 426, 27, 16, 17, 499, 124, 124, 564,
3305 150, 16, 129, 135, 3, 124, 560, 135, 104, 112,
3306 232, 35, 115, 418, 117, 27, 581, 54, 62, 124,
3307 95, 33, 576, 54, 95, 54, 591, 51, 112, 124,
3308 289, 253, 116, 16, 227, 255, 139, 316, 101, 473,
3309 3, 144, 145, 3, 4, 128, 393, 112, 3, 0,
3310 5, 3, 4, 275, 276, 128, 16, 17, 124, 128,
3311 128, 128, 341, 128, 16, 17, 128, 129, 3, 102,
3312 124, 134, 128, 163, 163, 163, 163, 163, 425, 182,
3313 589, 124, 185, 186, 187, 188, 189, 190, 191, 192,
3314 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3315 203, 204, 205, 206, 207, 208, 128, 3, 129, 212,
3316 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
3317 223, 224, 225, 226, 227, 228, 163, 3, 4, 232,
3318 104, 234, 163, 412, 163, 211, 134, 106, 397, 398,
3319 16, 17, 3, 4, 102, 235, 235, 235, 272, 252,
3320 253, 127, 255, 229, 257, 16, 17, 117, 102, 3,
3321 3, 237, 3, 128, 124, 117, 126, 360, 5, 4,
3322 130, 247, 275, 276, 16, 522, 69, 3, 130, 101,
3323 3, 4, 69, 18, 101, 20, 21, 3, 23, 3,
3324 25, 3, 414, 16, 17, 12, 543, 129, 389, 129,
3325 391, 124, 135, 38, 102, 3, 4, 3, 4, 429,
3326 135, 46, 47, 48, 49, 92, 93, 94, 16, 17,
3327 16, 17, 372, 106, 102, 134, 54, 3, 3, 3,
3328 4, 104, 382, 54, 104, 104, 413, 340, 36, 91,
3329 316, 117, 16, 17, 135, 91, 91, 124, 595, 126,
3330 126, 428, 129, 444, 16, 91, 117, 360, 124, 349,
3331 349, 349, 439, 413, 26, 341, 101, 357, 357, 357,
3332 32, 135, 134, 128, 111, 112, 3, 135, 428, 129,
3333 3, 134, 5, 359, 46, 8, 9, 10, 135, 439,
3334 101, 128, 102, 106, 117, 104, 438, 135, 489, 134,
3335 403, 15, 405, 126, 124, 408, 128, 410, 102, 134,
3336 128, 414, 102, 112, 66, 92, 93, 94, 421, 117,
3337 135, 117, 128, 104, 128, 116, 429, 134, 418, 418,
3338 418, 434, 135, 134, 106, 128, 412, 114, 115, 116,
3339 117, 118, 519, 135, 521, 4, 124, 124, 111, 126,
3340 134, 3, 129, 5, 6, 3, 8, 9, 10, 18,
3341 3, 20, 21, 26, 23, 134, 25, 19, 116, 519,
3342 128, 521, 24, 128, 26, 134, 28, 29, 134, 38,
3343 134, 92, 93, 94, 134, 3, 135, 112, 47, 48,
3344 49, 134, 124, 45, 497, 112, 134, 128, 135, 134,
3345 490, 53, 505, 55, 56, 116, 117, 118, 54, 349,
3346 163, 449, 72, 124, 16, 126, 60, 143, 129, 71,
3347 381, 479, 479, 508, 26, 529, 508, 570, 557, 31,
3348 32, 552, 450, 523, 523, 523, 523, 523, 289, 529,
3349 92, 93, 44, 471, 46, 27, -1, 444, 48, 422,
3350 -1, 256, -1, -1, -1, -1, -1, -1, -1, -1,
3351 -1, -1, 552, 552, 552, 552, 552, -1, -1, -1,
3352 -1, -1, 124, -1, 126, -1, -1, -1, 130, -1,
3353 570, 570, 570, 570, 570, 0, -1, -1, 3, 4,
3354 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3355 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
3356 25, -1, -1, 28, 29, -1, -1, 40, -1, -1,
3357 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3358 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3359 55, 56, -1, -1, -1, 68, 69, 70, 63, 64,
3360 65, -1, -1, 76, 77, -1, 71, -1, -1, -1,
3361 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3362 93, 94, -1, 96, 97, 98, -1, 92, 93, -1,
3363 -1, -1, -1, -1, -1, -1, 101, -1, 111, 112,
3364 -1, 114, 115, 116, 117, 118, 111, -1, -1, 114,
3365 -1, 124, -1, 126, 119, 120, 129, -1, -1, 124,
3366 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3367 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3368 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3369 23, 24, 25, 26, -1, 28, 29, 30, -1, 32,
3370 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
3371 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
3372 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3373 63, 64, 65, -1, 67, -1, -1, -1, 71, -1,
3374 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3375 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3376 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3377 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3378 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3379 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3380 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3381 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3382 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3383 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3384 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3385 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3386 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3387 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3388 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3389 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3390 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3391 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3392 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3393 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3394 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3395 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3396 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3397 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3398 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3399 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3400 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3401 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3402 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3403 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3404 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3405 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3406 -1, 130, -1, -1, -1, 134, 3, 4, 5, 6,
3407 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3408 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3409 -1, 28, 29, -1, -1, 40, -1, -1, -1, 36,
3410 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3411 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3412 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3413 -1, 76, 77, -1, 71, -1, -1, -1, -1, -1,
3414 -1, -1, -1, -1, -1, -1, -1, 92, 93, 94,
3415 -1, 96, 97, 98, -1, 92, 93, -1, -1, -1,
3416 -1, -1, -1, -1, 101, -1, 111, 112, -1, 114,
3417 115, 116, 117, 118, 111, -1, -1, 114, -1, 124,
3418 -1, 126, 119, 120, 129, -1, -1, 124, -1, 126,
3419 -1, 128, -1, 130, -1, -1, -1, 134, 3, 4,
3420 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3421 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3422 25, -1, -1, 28, 29, -1, -1, -1, -1, -1,
3423 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3424 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3425 55, 56, -1, -1, -1, -1, -1, -1, 63, 64,
3426 65, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3427 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3428 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
3429 -1, -1, -1, -1, -1, -1, 101, -1, -1, -1,
3430 -1, -1, -1, -1, -1, -1, 111, -1, -1, 114,
3431 -1, -1, -1, -1, 119, 120, -1, -1, -1, 124,
3432 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3433 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3434 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3435 23, 24, 25, -1, -1, 28, 29, -1, -1, -1,
3436 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3437 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3438 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3439 63, 64, 65, -1, -1, -1, -1, -1, 71, -1,
3440 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3441 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3442 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3443 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3444 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3445 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3446 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3447 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3448 21, 22, 23, 24, 25, -1, -1, 28, 29, -1,
3449 -1, -1, -1, -1, -1, 36, -1, 38, 39, -1,
3450 41, -1, 43, -1, 45, -1, 47, 48, 49, -1,
3451 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3452 -1, -1, 63, 64, 65, -1, -1, -1, -1, -1,
3453 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3454 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3455 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3456 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3457 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3458 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3459 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3460 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3461 19, 20, 21, 22, 23, 24, 25, -1, -1, 28,
3462 29, -1, -1, -1, -1, -1, -1, 36, -1, 38,
3463 39, -1, 41, -1, 43, -1, 45, -1, 47, 48,
3464 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3465 -1, -1, -1, -1, 63, 64, 65, -1, -1, -1,
3466 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3467 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3468 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3469 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3470 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3471 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3472 -1, 130, -1, 0, -1, 134, 3, 4, 5, 6,
3473 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3474 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3475 -1, 28, 29, -1, -1, -1, -1, -1, -1, 36,
3476 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3477 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3478 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3479 -1, -1, -1, -1, 71, -1, -1, -1, -1, -1,
3480 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3481 -1, -1, -1, -1, -1, 92, 93, -1, -1, -1,
3482 -1, -1, -1, -1, 101, -1, -1, -1, -1, -1,
3483 -1, -1, -1, -1, 111, -1, -1, 114, -1, -1,
3484 -1, -1, 119, 120, -1, -1, -1, 124, -1, 126,
3485 -1, 128, -1, 130, 3, 4, 5, 6, -1, 8,
3486 9, 10, 11, 12, 13, 14, -1, 16, -1, 18,
3487 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3488 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3489 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3490 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3491 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3492 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3493 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3494 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3495 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3496 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3497 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3498 -1, 130, 3, 4, 5, 6, -1, 8, 9, 10,
3499 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3500 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3501 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3502 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3503 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3504 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3505 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3506 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3507 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3508 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3509 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3510 -1, -1, -1, 124, -1, 126, -1, 128, 3, 130,
3511 5, 6, -1, 8, 9, 10, -1, -1, -1, -1,
3512 -1, -1, -1, -1, 19, -1, -1, -1, -1, 24,
3513 -1, 26, -1, 28, 29, -1, -1, 32, -1, -1,
3514 -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
3515 45, 46, -1, -1, -1, -1, -1, -1, 53, -1,
3516 55, 56, -1, -1, -1, -1, -1, -1, -1, 64,
3517 -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3518 3, -1, 5, 6, -1, 8, 9, 10, -1, -1,
3519 -1, -1, -1, -1, -1, -1, 19, 92, 93, -1,
3520 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3521 -1, -1, -1, 36, -1, -1, 111, -1, -1, 114,
3522 43, -1, 45, -1, 119, 120, -1, -1, -1, 124,
3523 53, 126, 55, 56, -1, 130, -1, -1, -1, -1,
3524 -1, 64, -1, -1, -1, -1, -1, -1, 71, -1,
3525 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3526 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3527 93, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3528 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3529 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3530 -1, 124, -1, 126, 68, 69, 70, 130, 72, 73,
3531 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3532 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3533 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3534 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3535 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3536 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3537 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3538 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3539 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3540 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3541 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3542 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3543 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3544 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3545 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3546 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3547 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3548 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3549 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3550 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3551 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3552 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3553 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3554 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3555 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3556 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3557 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3558 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3559 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3560 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3561 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3562 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3563 -1, -1, 124, -1, 126, 127, -1, 129, 68, 69,
3564 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3565 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3566 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3567 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3568 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3569 -1, -1, -1, -1, 124, -1, 126, 127, -1, 129,
3570 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3571 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3572 88, 89, 90, -1, 92, 93, 94, -1, 96, 97,
3573 98, -1, -1, -1, 40, -1, 104, 105, -1, 107,
3574 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3575 118, -1, -1, -1, -1, -1, 124, -1, 126, 127,
3576 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3577 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3578 86, 87, 88, 89, 90, -1, 92, 93, 94, -1,
3579 96, 97, 98, -1, -1, -1, 40, -1, 104, 105,
3580 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3581 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3582 126, 127, -1, 129, 68, 69, 70, -1, 72, 73,
3583 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3584 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3585 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3586 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3587 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3588 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3589 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3590 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3591 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3592 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3593 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3594 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3595 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3596 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3597 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3598 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3599 -1, -1, 112, -1, 114, 115, 116, 117, 118, -1,
3600 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3601 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3602 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3603 -1, -1, 90, -1, 92, 93, 94, -1, 96, 97,
3604 98, -1, -1, -1, 40, -1, -1, -1, -1, 107,
3605 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3606 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3607 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3608 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
3609 -1, -1, -1, -1, -1, -1, 92, 93, 94, -1,
3610 96, 97, 98, -1, -1, -1, 40, -1, -1, -1,
3611 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3612 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3613 126, -1, -1, 129, 68, 69, 70, -1, 72, 73,
3614 74, 75, 76, 77, -1, -1, -1, -1, -1, -1,
3615 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3616 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3617 -1, -1, -1, -1, 108, 109, -1, 111, 112, -1,
3618 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3619 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3620 72, 73, 74, 75, 76, 77, -1, -1, -1, -1,
3621 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3622 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3623 40, -1, -1, -1, -1, -1, -1, 109, -1, 111,
3624 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3625 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3626 70, -1, 72, 73, 74, 75, 76, 77, -1, -1,
3627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3628 -1, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3629 -1, -1, 40, -1, -1, -1, -1, -1, -1, 109,
3630 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3631 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3632 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3633 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3634 -1, -1, -1, -1, 92, 93, 94, -1, 96, 97,
3635 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3636 -1, -1, -1, 111, 112, -1, 114, 115, 116, 117,
3637 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3641 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3642 symbol of state STATE-NUM. */
3643 static const yytype_uint16 yystos[] =
3645 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3646 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3647 25, 26, 28, 29, 36, 38, 39, 41, 43, 45,
3648 47, 48, 49, 52, 53, 55, 56, 63, 64, 65,
3649 71, 92, 93, 101, 111, 114, 119, 120, 124, 126,
3650 128, 130, 137, 138, 139, 140, 146, 149, 150, 156,
3651 160, 161, 162, 163, 165, 173, 181, 184, 185, 188,
3652 191, 192, 193, 194, 198, 200, 209, 214, 215, 216,
3653 226, 234, 237, 250, 251, 252, 257, 261, 265, 266,
3654 268, 269, 270, 91, 50, 124, 124, 166, 124, 3,
3655 4, 16, 17, 128, 186, 187, 16, 3, 261, 3,
3656 236, 261, 124, 187, 240, 124, 128, 124, 129, 16,
3657 261, 124, 3, 5, 8, 9, 10, 258, 259, 260,
3658 261, 261, 261, 261, 261, 256, 261, 246, 247, 248,
3659 254, 261, 30, 32, 37, 42, 46, 67, 101, 134,
3660 145, 146, 147, 150, 152, 167, 168, 183, 192, 253,
3661 3, 0, 140, 128, 3, 46, 152, 158, 159, 257,
3662 147, 148, 16, 26, 31, 32, 44, 46, 208, 267,
3663 194, 3, 128, 221, 225, 102, 40, 68, 69, 70,
3664 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3665 82, 83, 84, 85, 86, 87, 88, 89, 90, 92,
3666 93, 94, 96, 97, 98, 104, 105, 107, 108, 109,
3667 111, 112, 114, 115, 116, 117, 118, 124, 126, 129,
3668 3, 124, 164, 148, 174, 190, 128, 129, 186, 187,
3669 239, 240, 241, 249, 124, 255, 256, 129, 261, 182,
3670 246, 3, 104, 157, 134, 106, 102, 102, 135, 127,
3671 102, 254, 3, 3, 153, 154, 255, 255, 153, 3,
3672 134, 147, 128, 138, 3, 101, 69, 101, 3, 35,
3673 51, 233, 3, 3, 210, 261, 3, 221, 227, 228,
3674 229, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3675 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3676 261, 261, 261, 261, 261, 117, 130, 186, 264, 261,
3677 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3678 261, 261, 261, 261, 246, 261, 3, 4, 117, 124,
3679 126, 130, 263, 264, 255, 12, 261, 101, 141, 142,
3680 143, 149, 150, 198, 200, 209, 234, 189, 186, 129,
3681 124, 245, 3, 95, 230, 231, 232, 135, 117, 186,
3682 135, 144, 145, 135, 261, 255, 254, 259, 261, 106,
3683 244, 102, 145, 134, 244, 255, 255, 104, 3, 54,
3684 195, 54, 196, 3, 211, 212, 222, 104, 104, 112,
3685 116, 217, 229, 126, 264, 106, 135, 127, 262, 261,
3686 126, 264, 91, 135, 124, 135, 134, 143, 128, 141,
3687 246, 104, 106, 213, 232, 135, 102, 134, 135, 106,
3688 36, 117, 241, 243, 104, 151, 154, 134, 101, 135,
3689 3, 5, 124, 241, 15, 197, 241, 242, 128, 244,
3690 102, 134, 5, 221, 5, 221, 218, 223, 261, 261,
3691 261, 127, 261, 264, 148, 255, 128, 141, 134, 135,
3692 261, 243, 244, 95, 232, 27, 33, 175, 177, 179,
3693 180, 148, 254, 261, 257, 148, 230, 242, 128, 102,
3694 201, 151, 212, 112, 5, 111, 112, 128, 219, 224,
3695 226, 127, 135, 127, 135, 34, 62, 169, 170, 171,
3696 172, 134, 213, 128, 232, 128, 124, 175, 177, 66,
3697 155, 135, 135, 199, 241, 46, 101, 192, 205, 206,
3698 207, 116, 261, 111, 226, 223, 261, 106, 134, 171,
3699 172, 238, 178, 3, 148, 148, 244, 101, 146, 150,
3700 192, 202, 203, 204, 209, 234, 3, 26, 134, 207,
3701 225, 220, 116, 223, 106, 144, 144, 144, 244, 128,
3702 128, 134, 204, 233, 218, 134, 225, 144, 134, 134,
3703 135, 235, 202, 3, 112, 218, 176, 144, 134, 124,
3704 112, 128, 134, 230, 144, 135, 134, 244
3707 #define yyerrok (yyerrstatus = 0)
3708 #define yyclearin (yychar = YYEMPTY)
3709 #define YYEMPTY (-2)
3712 #define YYACCEPT goto yyacceptlab
3713 #define YYABORT goto yyabortlab
3714 #define YYERROR goto yyerrorlab
3717 /* Like YYERROR except do call yyerror. This remains here temporarily
3718 to ease the transition to the new meaning of YYERROR, for GCC.
3719 Once GCC version 2 has supplanted version 1, this can go. */
3721 #define YYFAIL goto yyerrlab
3723 #define YYRECOVERING() (!!yyerrstatus)
3725 #define YYBACKUP(Token, Value) \
3727 if (yychar == YYEMPTY && yylen == 1) \
3731 yytoken = YYTRANSLATE (yychar); \
3737 yyerror (YY_("syntax error: cannot back up")); \
3744 #define YYERRCODE 256
3747 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3748 If N is 0, then set CURRENT to the empty location which ends
3749 the previous symbol: RHS[0] (always defined). */
3751 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3752 #ifndef YYLLOC_DEFAULT
3753 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3757 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3758 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3759 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3760 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3764 (Current).first_line = (Current).last_line = \
3765 YYRHSLOC (Rhs, 0).last_line; \
3766 (Current).first_column = (Current).last_column = \
3767 YYRHSLOC (Rhs, 0).last_column; \
3773 /* YY_LOCATION_PRINT -- Print the location on the stream.
3774 This macro was not mandated originally: define only if we know
3775 we won't break user code: when these are the locations we know. */
3777 #ifndef YY_LOCATION_PRINT
3778 # if YYLTYPE_IS_TRIVIAL
3779 # define YY_LOCATION_PRINT(File, Loc) \
3780 fprintf (File, "%d.%d-%d.%d", \
3781 (Loc).first_line, (Loc).first_column, \
3782 (Loc).last_line, (Loc).last_column)
3784 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3789 /* YYLEX -- calling `yylex' with the right arguments. */
3792 # define YYLEX yylex (YYLEX_PARAM)
3794 # define YYLEX yylex ()
3797 /* Enable debugging if requested. */
3801 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3802 # define YYFPRINTF fprintf
3805 # define YYDPRINTF(Args) \
3811 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3815 YYFPRINTF (stderr, "%s ", Title); \
3816 yy_symbol_print (stderr, \
3818 YYFPRINTF (stderr, "\n"); \
3823 /*--------------------------------.
3824 | Print this symbol on YYOUTPUT. |
3825 `--------------------------------*/
3828 #if (defined __STDC__ || defined __C99__FUNC__ \
3829 || defined __cplusplus || defined _MSC_VER)
3831 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3834 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3837 YYSTYPE const * const yyvaluep;
3843 if (yytype < YYNTOKENS)
3844 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3856 /*--------------------------------.
3857 | Print this symbol on YYOUTPUT. |
3858 `--------------------------------*/
3860 #if (defined __STDC__ || defined __C99__FUNC__ \
3861 || defined __cplusplus || defined _MSC_VER)
3863 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3866 yy_symbol_print (yyoutput, yytype, yyvaluep)
3869 YYSTYPE const * const yyvaluep;
3872 if (yytype < YYNTOKENS)
3873 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3875 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3877 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3878 YYFPRINTF (yyoutput, ")");
3881 /*------------------------------------------------------------------.
3882 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3884 `------------------------------------------------------------------*/
3886 #if (defined __STDC__ || defined __C99__FUNC__ \
3887 || defined __cplusplus || defined _MSC_VER)
3889 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3892 yy_stack_print (yybottom, yytop)
3893 yytype_int16 *yybottom;
3894 yytype_int16 *yytop;
3897 YYFPRINTF (stderr, "Stack now");
3898 for (; yybottom <= yytop; yybottom++)
3900 int yybot = *yybottom;
3901 YYFPRINTF (stderr, " %d", yybot);
3903 YYFPRINTF (stderr, "\n");
3906 # define YY_STACK_PRINT(Bottom, Top) \
3909 yy_stack_print ((Bottom), (Top)); \
3913 /*------------------------------------------------.
3914 | Report that the YYRULE is going to be reduced. |
3915 `------------------------------------------------*/
3917 #if (defined __STDC__ || defined __C99__FUNC__ \
3918 || defined __cplusplus || defined _MSC_VER)
3920 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3923 yy_reduce_print (yyvsp, yyrule)
3928 int yynrhs = yyr2[yyrule];
3930 unsigned long int yylno = yyrline[yyrule];
3931 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3933 /* The symbols being reduced. */
3934 for (yyi = 0; yyi < yynrhs; yyi++)
3936 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3937 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3938 &(yyvsp[(yyi + 1) - (yynrhs)])
3940 YYFPRINTF (stderr, "\n");
3944 # define YY_REDUCE_PRINT(Rule) \
3947 yy_reduce_print (yyvsp, Rule); \
3950 /* Nonzero means print parse trace. It is left uninitialized so that
3951 multiple parsers can coexist. */
3953 #else /* !YYDEBUG */
3954 # define YYDPRINTF(Args)
3955 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3956 # define YY_STACK_PRINT(Bottom, Top)
3957 # define YY_REDUCE_PRINT(Rule)
3958 #endif /* !YYDEBUG */
3961 /* YYINITDEPTH -- initial size of the parser's stacks. */
3963 # define YYINITDEPTH 200
3966 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3967 if the built-in stack extension method is used).
3969 Do not make this value too large; the results are undefined if
3970 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3971 evaluated with infinite-precision integer arithmetic. */
3974 # define YYMAXDEPTH 10000
3982 # if defined __GLIBC__ && defined _STRING_H
3983 # define yystrlen strlen
3985 /* Return the length of YYSTR. */
3986 #if (defined __STDC__ || defined __C99__FUNC__ \
3987 || defined __cplusplus || defined _MSC_VER)
3989 yystrlen (const char *yystr)
3997 for (yylen = 0; yystr[yylen]; yylen++)
4005 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
4006 # define yystpcpy stpcpy
4008 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
4010 #if (defined __STDC__ || defined __C99__FUNC__ \
4011 || defined __cplusplus || defined _MSC_VER)
4013 yystpcpy (char *yydest, const char *yysrc)
4016 yystpcpy (yydest, yysrc)
4022 const char *yys = yysrc;
4024 while ((*yyd++ = *yys++) != '\0')
4033 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
4034 quotes and backslashes, so that it's suitable for yyerror. The
4035 heuristic is that double-quoting is unnecessary unless the string
4036 contains an apostrophe, a comma, or backslash (other than
4037 backslash-backslash). YYSTR is taken from yytname. If YYRES is
4038 null, do not copy; instead, return the length of what the result
4041 yytnamerr (char *yyres, const char *yystr)
4046 char const *yyp = yystr;
4053 goto do_not_strip_quotes;
4057 goto do_not_strip_quotes;
4070 do_not_strip_quotes: ;
4074 return yystrlen (yystr);
4076 return yystpcpy (yyres, yystr) - yyres;
4080 /* Copy into YYRESULT an error message about the unexpected token
4081 YYCHAR while in state YYSTATE. Return the number of bytes copied,
4082 including the terminating null byte. If YYRESULT is null, do not
4083 copy anything; just return the number of bytes that would be
4084 copied. As a special case, return 0 if an ordinary "syntax error"
4085 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
4086 size calculation. */
4088 yysyntax_error (char *yyresult, int yystate, int yychar)
4090 int yyn = yypact[yystate];
4092 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
4096 int yytype = YYTRANSLATE (yychar);
4097 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4098 YYSIZE_T yysize = yysize0;
4100 int yysize_overflow = 0;
4101 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
4102 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4106 /* This is so xgettext sees the translatable formats that are
4107 constructed on the fly. */
4108 YY_("syntax error, unexpected %s");
4109 YY_("syntax error, unexpected %s, expecting %s");
4110 YY_("syntax error, unexpected %s, expecting %s or %s");
4111 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4112 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4116 static char const yyunexpected[] = "syntax error, unexpected %s";
4117 static char const yyexpecting[] = ", expecting %s";
4118 static char const yyor[] = " or %s";
4119 char yyformat[sizeof yyunexpected
4120 + sizeof yyexpecting - 1
4121 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4122 * (sizeof yyor - 1))];
4123 char const *yyprefix = yyexpecting;
4125 /* Start YYX at -YYN if negative to avoid negative indexes in
4127 int yyxbegin = yyn < 0 ? -yyn : 0;
4129 /* Stay within bounds of both yycheck and yytname. */
4130 int yychecklim = YYLAST - yyn + 1;
4131 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4134 yyarg[0] = yytname[yytype];
4135 yyfmt = yystpcpy (yyformat, yyunexpected);
4137 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4138 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4140 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4144 yyformat[sizeof yyunexpected - 1] = '\0';
4147 yyarg[yycount++] = yytname[yyx];
4148 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4149 yysize_overflow |= (yysize1 < yysize);
4151 yyfmt = yystpcpy (yyfmt, yyprefix);
4155 yyf = YY_(yyformat);
4156 yysize1 = yysize + yystrlen (yyf);
4157 yysize_overflow |= (yysize1 < yysize);
4160 if (yysize_overflow)
4161 return YYSIZE_MAXIMUM;
4165 /* Avoid sprintf, as that infringes on the user's name space.
4166 Don't have undefined behavior even if the translation
4167 produced a string with the wrong number of "%s"s. */
4168 char *yyp = yyresult;
4170 while ((*yyp = *yyf) != '\0')
4172 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4174 yyp += yytnamerr (yyp, yyarg[yyi++]);
4187 #endif /* YYERROR_VERBOSE */
4190 /*-----------------------------------------------.
4191 | Release the memory associated to this symbol. |
4192 `-----------------------------------------------*/
4195 #if (defined __STDC__ || defined __C99__FUNC__ \
4196 || defined __cplusplus || defined _MSC_VER)
4198 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4201 yydestruct (yymsg, yytype, yyvaluep)
4211 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4221 /* Prevent warnings from -Wmissing-prototypes. */
4222 #ifdef YYPARSE_PARAM
4223 #if defined __STDC__ || defined __cplusplus
4224 int yyparse (void *YYPARSE_PARAM);
4228 #else /* ! YYPARSE_PARAM */
4229 #if defined __STDC__ || defined __cplusplus
4234 #endif /* ! YYPARSE_PARAM */
4237 /* The lookahead symbol. */
4240 /* The semantic value of the lookahead symbol. */
4243 /* Number of syntax errors so far. */
4248 /*-------------------------.
4249 | yyparse or yypush_parse. |
4250 `-------------------------*/
4252 #ifdef YYPARSE_PARAM
4253 #if (defined __STDC__ || defined __C99__FUNC__ \
4254 || defined __cplusplus || defined _MSC_VER)
4256 yyparse (void *YYPARSE_PARAM)
4259 yyparse (YYPARSE_PARAM)
4260 void *YYPARSE_PARAM;
4262 #else /* ! YYPARSE_PARAM */
4263 #if (defined __STDC__ || defined __C99__FUNC__ \
4264 || defined __cplusplus || defined _MSC_VER)
4277 /* Number of tokens to shift before error messages enabled. */
4280 /* The stacks and their tools:
4281 `yyss': related to states.
4282 `yyvs': related to semantic values.
4284 Refer to the stacks thru separate pointers, to allow yyoverflow
4285 to reallocate them elsewhere. */
4287 /* The state stack. */
4288 yytype_int16 yyssa[YYINITDEPTH];
4290 yytype_int16 *yyssp;
4292 /* The semantic value stack. */
4293 YYSTYPE yyvsa[YYINITDEPTH];
4297 YYSIZE_T yystacksize;
4301 /* Lookahead token as an internal (translated) token number. */
4303 /* The variables used to return semantic value and location from the
4308 /* Buffer for error messages, and its allocated size. */
4310 char *yymsg = yymsgbuf;
4311 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4314 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4316 /* The number of symbols on the RHS of the reduced rule.
4317 Keep to zero when no symbol should be popped. */
4323 yystacksize = YYINITDEPTH;
4325 YYDPRINTF ((stderr, "Starting parse\n"));
4330 yychar = YYEMPTY; /* Cause a token to be read. */
4332 /* Initialize stack pointers.
4333 Waste one element of value and location stack
4334 so that they stay on the same level as the state stack.
4335 The wasted elements are never initialized. */
4341 /*------------------------------------------------------------.
4342 | yynewstate -- Push a new state, which is found in yystate. |
4343 `------------------------------------------------------------*/
4345 /* In all cases, when you get here, the value and location stacks
4346 have just been pushed. So pushing a state here evens the stacks. */
4352 if (yyss + yystacksize - 1 <= yyssp)
4354 /* Get the current used size of the three stacks, in elements. */
4355 YYSIZE_T yysize = yyssp - yyss + 1;
4359 /* Give user a chance to reallocate the stack. Use copies of
4360 these so that the &'s don't force the real ones into
4362 YYSTYPE *yyvs1 = yyvs;
4363 yytype_int16 *yyss1 = yyss;
4365 /* Each stack pointer address is followed by the size of the
4366 data in use in that stack, in bytes. This used to be a
4367 conditional around just the two extra args, but that might
4368 be undefined if yyoverflow is a macro. */
4369 yyoverflow (YY_("memory exhausted"),
4370 &yyss1, yysize * sizeof (*yyssp),
4371 &yyvs1, yysize * sizeof (*yyvsp),
4377 #else /* no yyoverflow */
4378 # ifndef YYSTACK_RELOCATE
4379 goto yyexhaustedlab;
4381 /* Extend the stack our own way. */
4382 if (YYMAXDEPTH <= yystacksize)
4383 goto yyexhaustedlab;
4385 if (YYMAXDEPTH < yystacksize)
4386 yystacksize = YYMAXDEPTH;
4389 yytype_int16 *yyss1 = yyss;
4390 union yyalloc *yyptr =
4391 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4393 goto yyexhaustedlab;
4394 YYSTACK_RELOCATE (yyss_alloc, yyss);
4395 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4396 # undef YYSTACK_RELOCATE
4398 YYSTACK_FREE (yyss1);
4401 #endif /* no yyoverflow */
4403 yyssp = yyss + yysize - 1;
4404 yyvsp = yyvs + yysize - 1;
4406 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4407 (unsigned long int) yystacksize));
4409 if (yyss + yystacksize - 1 <= yyssp)
4413 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4415 if (yystate == YYFINAL)
4425 /* Do appropriate processing given the current state. Read a
4426 lookahead token if we need one and don't already have one. */
4428 /* First try to decide what to do without reference to lookahead token. */
4429 yyn = yypact[yystate];
4430 if (yyn == YYPACT_NINF)
4433 /* Not known => get a lookahead token if don't already have one. */
4435 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4436 if (yychar == YYEMPTY)
4438 YYDPRINTF ((stderr, "Reading a token: "));
4442 if (yychar <= YYEOF)
4444 yychar = yytoken = YYEOF;
4445 YYDPRINTF ((stderr, "Now at end of input.\n"));
4449 yytoken = YYTRANSLATE (yychar);
4450 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4453 /* If the proper action on seeing token YYTOKEN is to reduce or to
4454 detect an error, take that action. */
4456 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4461 if (yyn == 0 || yyn == YYTABLE_NINF)
4467 /* Count tokens shifted since error; after three, turn off error
4472 /* Shift the lookahead token. */
4473 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4475 /* Discard the shifted token. */
4484 /*-----------------------------------------------------------.
4485 | yydefault -- do the default action for the current state. |
4486 `-----------------------------------------------------------*/
4488 yyn = yydefact[yystate];
4494 /*-----------------------------.
4495 | yyreduce -- Do a reduction. |
4496 `-----------------------------*/
4498 /* yyn is the number of a rule to reduce with. */
4501 /* If YYLEN is nonzero, implement the default value of the action:
4504 Otherwise, the following line sets YYVAL to garbage.
4505 This behavior is undocumented and Bison
4506 users should not rely upon it. Assigning to YYVAL
4507 unconditionally makes the parser a bit smaller, and it avoids a
4508 GCC warning that YYVAL may be used uninitialized. */
4509 yyval = yyvsp[1-yylen];
4512 YY_REDUCE_PRINT (yyn);
4519 /* Line 1464 of skeleton.m4 */
4520 #line 1899 "parser.y"
4521 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4530 /* Line 1464 of skeleton.m4 */
4531 #line 1911 "parser.y"
4532 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4541 /* Line 1464 of skeleton.m4 */
4542 #line 1914 "parser.y"
4543 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4552 /* Line 1464 of skeleton.m4 */
4553 #line 1915 "parser.y"
4554 {(yyval.code)=code_new();}
4563 /* Line 1464 of skeleton.m4 */
4564 #line 1917 "parser.y"
4566 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4576 /* Line 1464 of skeleton.m4 */
4577 #line 1920 "parser.y"
4578 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4587 /* Line 1464 of skeleton.m4 */
4588 #line 1936 "parser.y"
4589 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4598 /* Line 1464 of skeleton.m4 */
4599 #line 1937 "parser.y"
4609 /* Line 1464 of skeleton.m4 */
4610 #line 1940 "parser.y"
4620 /* Line 1464 of skeleton.m4 */
4621 #line 1947 "parser.y"
4625 (yyval.code) = (yyvsp[(3) - (4)].code);
4629 as3_pass=(yyvsp[(1) - (4)].number_int);
4639 /* Line 1464 of skeleton.m4 */
4640 #line 1959 "parser.y"
4641 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4650 /* Line 1464 of skeleton.m4 */
4651 #line 1960 "parser.y"
4652 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4661 /* Line 1464 of skeleton.m4 */
4662 #line 1964 "parser.y"
4664 code_t**cc = &global->init->method->body->code;
4665 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4675 /* Line 1464 of skeleton.m4 */
4676 #line 1971 "parser.y"
4679 (yyval.number_int)=as3_pass;
4680 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4681 if(!definitions || !dict_contains(definitions, key)) {
4694 /* Line 1464 of skeleton.m4 */
4695 #line 1990 "parser.y"
4696 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4705 /* Line 1464 of skeleton.m4 */
4706 #line 1991 "parser.y"
4707 {(yyval.node)=mkdummynode();}
4716 /* Line 1464 of skeleton.m4 */
4717 #line 1993 "parser.y"
4718 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4727 /* Line 1464 of skeleton.m4 */
4728 #line 1994 "parser.y"
4729 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4738 /* Line 1464 of skeleton.m4 */
4739 #line 1996 "parser.y"
4740 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4749 /* Line 1464 of skeleton.m4 */
4750 #line 1997 "parser.y"
4751 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4760 /* Line 1464 of skeleton.m4 */
4761 #line 2000 "parser.y"
4764 if(variable_exists((yyvsp[(1) - (3)].id)))
4765 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4767 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4772 if(state->method->uses_slots) {
4773 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4775 // this variable is stored in a slot
4777 v->type = (yyvsp[(2) - (3)].classinfo);
4783 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4786 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4788 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
4789 if(!is_subtype_of(v.t, (yyvsp[(2) - (3)].classinfo))) {
4790 syntaxerror("Can't convert %s to %s", v.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4792 if((yyvsp[(2) - (3)].classinfo)) {
4793 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4794 (yyval.code) = code_append((yyval.code), v.c);
4795 (yyval.code) = converttype((yyval.code), v.t, (yyvsp[(2) - (3)].classinfo));
4798 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4801 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4802 (yyval.code) = code_append((yyval.code), v.c);
4803 (yyval.code) = abc_coerce_a((yyval.code));
4805 // don't do anything
4807 code_free((yyval.code));
4813 (yyval.code) = abc_setslot((yyval.code), index);
4815 (yyval.code) = abc_setlocal((yyval.code), index);
4826 /* Line 1464 of skeleton.m4 */
4827 #line 2059 "parser.y"
4828 {(yyval.code) = code_new();}
4837 /* Line 1464 of skeleton.m4 */
4838 #line 2060 "parser.y"
4839 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4848 /* Line 1464 of skeleton.m4 */
4849 #line 2063 "parser.y"
4850 {PASS12 new_state();}
4859 /* Line 1464 of skeleton.m4 */
4860 #line 2063 "parser.y"
4863 (yyval.code) = code_new();
4864 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4865 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4867 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4868 if((yyvsp[(7) - (7)].code)) {
4869 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4871 myif->branch = (yyval.code) = abc_nop((yyval.code));
4872 if((yyvsp[(7) - (7)].code)) {
4873 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4874 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4876 (yyval.code) = var_block((yyval.code));
4887 /* Line 1464 of skeleton.m4 */
4888 #line 2082 "parser.y"
4889 {(yyval.code)=code_new();}
4898 /* Line 1464 of skeleton.m4 */
4899 #line 2089 "parser.y"
4901 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4902 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4912 /* Line 1464 of skeleton.m4 */
4913 #line 2093 "parser.y"
4916 (yyval.id)=(yyvsp[(1) - (1)].id);
4926 /* Line 1464 of skeleton.m4 */
4927 #line 2098 "parser.y"
4928 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4937 /* Line 1464 of skeleton.m4 */
4938 #line 2099 "parser.y"
4939 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4948 /* Line 1464 of skeleton.m4 */
4949 #line 2101 "parser.y"
4951 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4952 (yyval.code) = code_new();
4953 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4954 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4955 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4956 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4957 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4958 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4959 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4960 (yyval.code) = abc_jump((yyval.code), loopstart);
4961 code_t*out = (yyval.code) = abc_nop((yyval.code));
4962 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4963 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4966 (yyval.code) = var_block((yyval.code));
4977 /* Line 1464 of skeleton.m4 */
4978 #line 2121 "parser.y"
4980 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4982 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4985 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4986 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4987 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4988 int array = new_variable(tmp1name, 0, 0, 0);
4990 (yyval.code) = code_new();
4991 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4992 (yyval.code) = abc_coerce_a((yyval.code));
4993 (yyval.code) = abc_setlocal((yyval.code), array);
4994 (yyval.code) = abc_pushbyte((yyval.code), 0);
4995 (yyval.code) = abc_setlocal((yyval.code), it);
4997 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4999 (yyval.code) = abc_hasnext2((yyval.code), array, it);
5000 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
5001 (yyval.code) = abc_getlocal((yyval.code), array);
5002 (yyval.code) = abc_getlocal((yyval.code), it);
5003 if(!(yyvsp[(1) - (6)].for_start).each)
5004 (yyval.code) = abc_nextname((yyval.code));
5006 (yyval.code) = abc_nextvalue((yyval.code));
5007 (yyval.code) = converttype((yyval.code), 0, var->type);
5008 (yyval.code) = abc_setlocal((yyval.code), var->index);
5010 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5011 (yyval.code) = abc_jump((yyval.code), loopstart);
5013 code_t*out = (yyval.code) = abc_nop((yyval.code));
5014 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
5015 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
5019 (yyval.code) = var_block((yyval.code));
5034 /* Line 1464 of skeleton.m4 */
5035 #line 2169 "parser.y"
5036 {PASS12 new_state();}
5045 /* Line 1464 of skeleton.m4 */
5046 #line 2169 "parser.y"
5049 (yyval.code) = code_new();
5051 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
5052 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5053 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5054 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5055 myjmp->branch = cont;
5056 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5057 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5058 code_t*out = (yyval.code) = abc_nop((yyval.code));
5059 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5060 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5062 (yyval.code) = var_block((yyval.code));
5073 /* Line 1464 of skeleton.m4 */
5074 #line 2188 "parser.y"
5075 {PASS12 new_state();}
5084 /* Line 1464 of skeleton.m4 */
5085 #line 2188 "parser.y"
5087 (yyval.code) = code_new();
5088 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5089 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
5090 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5091 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
5092 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5093 code_t*out = (yyval.code) = abc_nop((yyval.code));
5094 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
5095 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
5097 (yyval.code) = var_block((yyval.code));
5108 /* Line 1464 of skeleton.m4 */
5109 #line 2203 "parser.y"
5111 (yyval.code) = abc___break__(0, "");
5121 /* Line 1464 of skeleton.m4 */
5122 #line 2206 "parser.y"
5124 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5134 /* Line 1464 of skeleton.m4 */
5135 #line 2209 "parser.y"
5137 (yyval.code) = abc___continue__(0, "");
5147 /* Line 1464 of skeleton.m4 */
5148 #line 2212 "parser.y"
5150 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5160 /* Line 1464 of skeleton.m4 */
5161 #line 2216 "parser.y"
5171 /* Line 1464 of skeleton.m4 */
5172 #line 2217 "parser.y"
5173 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5182 /* Line 1464 of skeleton.m4 */
5183 #line 2218 "parser.y"
5184 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5193 /* Line 1464 of skeleton.m4 */
5194 #line 2219 "parser.y"
5195 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5204 /* Line 1464 of skeleton.m4 */
5205 #line 2220 "parser.y"
5206 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5215 /* Line 1464 of skeleton.m4 */
5216 #line 2221 "parser.y"
5217 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5226 /* Line 1464 of skeleton.m4 */
5227 #line 2223 "parser.y"
5229 (yyval.code) = abc_getlocal(0, state->switch_var);
5230 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5231 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5232 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5233 if((yyval.code)->opcode != OPCODE___BREAK__) {
5234 (yyval.code) = abc___fallthrough__((yyval.code), "");
5236 code_t*e = (yyval.code) = abc_nop((yyval.code));
5247 /* Line 1464 of skeleton.m4 */
5248 #line 2234 "parser.y"
5250 (yyval.code) = (yyvsp[(3) - (3)].code);
5260 /* Line 1464 of skeleton.m4 */
5261 #line 2237 "parser.y"
5262 {PASS12 new_state();state->switch_var=alloc_local();}
5271 /* Line 1464 of skeleton.m4 */
5272 #line 2237 "parser.y"
5274 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5275 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5276 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5278 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5279 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5281 code_t*c = (yyval.code),*lastblock=0;
5283 if(c->opcode == OPCODE_IFNE) {
5284 if(!c->next) syntaxerror("internal error in fallthrough handling");
5286 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5288 c->opcode = OPCODE_JUMP;
5289 c->branch = lastblock;
5291 /* fall through end of switch */
5292 c->opcode = OPCODE_NOP;
5298 (yyval.code) = var_block((yyval.code));
5309 /* Line 1464 of skeleton.m4 */
5310 #line 2268 "parser.y"
5311 {PASS12 new_state();
5312 state->exception_name=(yyvsp[(3) - (5)].id);
5313 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5314 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5324 /* Line 1464 of skeleton.m4 */
5325 #line 2273 "parser.y"
5327 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5328 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5330 NEW(abc_exception_t, e)
5331 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5332 e->var_name = multiname_clone(&name);
5333 (yyval.exception) = e;
5336 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5337 e->target = c = abc_nop(0);
5338 c = abc_setlocal(c, i);
5339 c = code_append(c, code_dup(state->method->scope_code));
5340 c = code_append(c, (yyvsp[(8) - (9)].code));
5354 /* Line 1464 of skeleton.m4 */
5355 #line 2293 "parser.y"
5356 {PASS12 new_state();state->exception_name=0;}
5365 /* Line 1464 of skeleton.m4 */
5366 #line 2293 "parser.y"
5368 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5369 if(!(yyvsp[(4) - (5)].code)) {
5370 (yyval.exception)=0;
5372 NEW(abc_exception_t, e)
5373 e->exc_type = 0; //all exceptions
5374 e->var_name = 0; //no name
5377 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5378 (yyval.exception) = e;
5390 /* Line 1464 of skeleton.m4 */
5391 #line 2309 "parser.y"
5392 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5401 /* Line 1464 of skeleton.m4 */
5402 #line 2310 "parser.y"
5403 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5412 /* Line 1464 of skeleton.m4 */
5413 #line 2311 "parser.y"
5414 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5423 /* Line 1464 of skeleton.m4 */
5424 #line 2312 "parser.y"
5426 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5427 (yyval.catch_list).finally = 0;
5428 if((yyvsp[(2) - (2)].exception)) {
5429 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5430 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5441 /* Line 1464 of skeleton.m4 */
5442 #line 2320 "parser.y"
5444 (yyval.catch_list).l=list_new();
5445 (yyval.catch_list).finally = 0;
5446 if((yyvsp[(1) - (1)].exception)) {
5447 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5448 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5459 /* Line 1464 of skeleton.m4 */
5460 #line 2329 "parser.y"
5461 {PASS12 new_state();
5462 state->method->has_exceptions=1;
5463 state->method->late_binding=1;//for invariant scope_code
5473 /* Line 1464 of skeleton.m4 */
5474 #line 2332 "parser.y"
5476 code_t*out = abc_nop(0);
5478 code_t*start = abc_nop(0);
5479 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5480 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5481 (yyval.code) = abc_jump((yyval.code), out);
5483 code_t*end = (yyval.code) = abc_nop((yyval.code));
5486 if((yyvsp[(6) - (6)].catch_list).finally)
5487 tmp = new_variable("__finally__", 0, 0, 0);
5489 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5492 abc_exception_t*e = l->abc_exception;
5494 (yyval.code) = code_append((yyval.code), e->target);
5495 (yyval.code) = abc_jump((yyval.code), out);
5497 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5499 e->target = (yyval.code) = abc_nop((yyval.code));
5500 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5501 (yyval.code) = abc___rethrow__((yyval.code));
5509 (yyval.code) = code_append((yyval.code), out);
5511 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5513 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5515 (yyval.code) = var_block((yyval.code));
5526 /* Line 1464 of skeleton.m4 */
5527 #line 2378 "parser.y"
5529 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5530 (yyval.code)=abc_throw((yyval.code));
5540 /* Line 1464 of skeleton.m4 */
5541 #line 2382 "parser.y"
5543 if(!state->exception_name)
5544 syntaxerror("re-throw only possible within a catch block");
5545 variable_t*v = find_variable(state, state->exception_name);
5546 (yyval.code)=code_new();
5547 (yyval.code)=abc_getlocal((yyval.code), v->index);
5548 (yyval.code)=abc_throw((yyval.code));
5558 /* Line 1464 of skeleton.m4 */
5559 #line 2393 "parser.y"
5562 if(state->method->has_exceptions) {
5563 int v = alloc_local();
5564 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5565 state->method->scope_code = abc_pushwith(state->method->scope_code);
5566 (yyval.value_list).number = v;
5568 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5578 /* Line 1464 of skeleton.m4 */
5579 #line 2403 "parser.y"
5581 /* remove getlocal;pushwith from scope code again */
5582 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5584 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5585 if(state->method->has_exceptions) {
5586 (yyval.code) = abc_dup((yyval.code));
5587 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5589 (yyval.code) = abc_pushwith((yyval.code));
5590 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5591 (yyval.code) = abc_popscope((yyval.code));
5602 /* Line 1464 of skeleton.m4 */
5603 #line 2421 "parser.y"
5604 {PASS12 (yyval.id)="package";}
5613 /* Line 1464 of skeleton.m4 */
5614 #line 2422 "parser.y"
5615 {PASS12 (yyval.id)="namespace";}
5624 /* Line 1464 of skeleton.m4 */
5625 #line 2423 "parser.y"
5626 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5635 /* Line 1464 of skeleton.m4 */
5636 #line 2425 "parser.y"
5637 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5646 /* Line 1464 of skeleton.m4 */
5647 #line 2426 "parser.y"
5648 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5657 /* Line 1464 of skeleton.m4 */
5658 #line 2428 "parser.y"
5659 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5668 /* Line 1464 of skeleton.m4 */
5669 #line 2429 "parser.y"
5670 {PASS12 endpackage();(yyval.code)=0;}
5679 /* Line 1464 of skeleton.m4 */
5680 #line 2430 "parser.y"
5681 {PASS12 startpackage("");}
5690 /* Line 1464 of skeleton.m4 */
5691 #line 2431 "parser.y"
5692 {PASS12 endpackage();(yyval.code)=0;}
5701 /* Line 1464 of skeleton.m4 */
5702 #line 2453 "parser.y"
5705 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5706 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5707 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5709 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5711 syntaxerror("Couldn't import class\n");
5712 state_has_imports();
5713 dict_put(state->imports, c->name, c);
5714 import_toplevel(c->package);
5725 /* Line 1464 of skeleton.m4 */
5726 #line 2467 "parser.y"
5729 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5730 as3_schedule_package((yyvsp[(2) - (4)].id));
5734 i->package = (yyvsp[(2) - (4)].id);
5735 state_has_imports();
5736 list_append(state->wildcard_imports, i);
5737 import_toplevel(i->package);
5748 /* Line 1464 of skeleton.m4 */
5749 #line 2483 "parser.y"
5750 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5759 /* Line 1464 of skeleton.m4 */
5760 #line 2484 "parser.y"
5761 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5770 /* Line 1464 of skeleton.m4 */
5771 #line 2485 "parser.y"
5772 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5781 /* Line 1464 of skeleton.m4 */
5782 #line 2486 "parser.y"
5785 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5786 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5787 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5798 /* Line 1464 of skeleton.m4 */
5799 #line 2493 "parser.y"
5800 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5809 /* Line 1464 of skeleton.m4 */
5810 #line 2494 "parser.y"
5811 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5820 /* Line 1464 of skeleton.m4 */
5821 #line 2495 "parser.y"
5822 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5831 /* Line 1464 of skeleton.m4 */
5832 #line 2496 "parser.y"
5833 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5842 /* Line 1464 of skeleton.m4 */
5843 #line 2497 "parser.y"
5844 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5853 /* Line 1464 of skeleton.m4 */
5854 #line 2498 "parser.y"
5855 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5864 /* Line 1464 of skeleton.m4 */
5865 #line 2499 "parser.y"
5866 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5875 /* Line 1464 of skeleton.m4 */
5876 #line 2500 "parser.y"
5877 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5886 /* Line 1464 of skeleton.m4 */
5887 #line 2501 "parser.y"
5888 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5897 /* Line 1464 of skeleton.m4 */
5898 #line 2502 "parser.y"
5899 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5900 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5910 /* Line 1464 of skeleton.m4 */
5911 #line 2506 "parser.y"
5912 {PASS12 (yyval.classinfo)=0;}
5921 /* Line 1464 of skeleton.m4 */
5922 #line 2507 "parser.y"
5923 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5932 /* Line 1464 of skeleton.m4 */
5933 #line 2509 "parser.y"
5934 {PASS12 (yyval.classinfo_list)=list_new();}
5943 /* Line 1464 of skeleton.m4 */
5944 #line 2510 "parser.y"
5945 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5954 /* Line 1464 of skeleton.m4 */
5955 #line 2512 "parser.y"
5956 {PASS12 (yyval.classinfo_list)=list_new();}
5965 /* Line 1464 of skeleton.m4 */
5966 #line 2513 "parser.y"
5967 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5976 /* Line 1464 of skeleton.m4 */
5977 #line 2517 "parser.y"
5978 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5987 /* Line 1464 of skeleton.m4 */
5988 #line 2519 "parser.y"
5989 {PASS12 endclass();(yyval.code)=0;}
5998 /* Line 1464 of skeleton.m4 */
5999 #line 2523 "parser.y"
6000 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
6001 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
6010 /* Line 1464 of skeleton.m4 */
6011 #line 2526 "parser.y"
6012 {PASS12 endclass();(yyval.code)=0;}
6021 /* Line 1464 of skeleton.m4 */
6022 #line 2535 "parser.y"
6023 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
6032 /* Line 1464 of skeleton.m4 */
6033 #line 2539 "parser.y"
6035 code_t*c = state->cls->static_init->header;
6036 c = code_append(c, (yyvsp[(1) - (1)].code));
6037 state->cls->static_init->header = c;
6047 /* Line 1464 of skeleton.m4 */
6048 #line 2550 "parser.y"
6050 syntaxerror("variable declarations not allowed in interfaces");
6060 /* Line 1464 of skeleton.m4 */
6061 #line 2553 "parser.y"
6064 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
6065 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
6066 syntaxerror("invalid method modifiers: interface methods always need to be public");
6068 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
6069 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
6070 list_deep_free((yyvsp[(6) - (8)].params).list);
6080 /* Line 1464 of skeleton.m4 */
6081 #line 2623 "parser.y"
6082 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
6091 /* Line 1464 of skeleton.m4 */
6092 #line 2623 "parser.y"
6093 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
6102 /* Line 1464 of skeleton.m4 */
6103 #line 2625 "parser.y"
6104 {PASS12 (yyval.code)=0;}
6113 /* Line 1464 of skeleton.m4 */
6114 #line 2626 "parser.y"
6115 {PASS12 (yyval.code)=0;}
6124 /* Line 1464 of skeleton.m4 */
6125 #line 2629 "parser.y"
6128 int flags = slotstate_flags->flags;
6129 namespace_t ns = modifiers2access(slotstate_flags);
6133 varinfo_t* info = 0;
6135 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6137 check_override(i, flags);
6139 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6141 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6143 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6145 if(ns.name && ns.name[0]) {
6146 syntaxerror("namespaces not allowed on package-level variables");
6148 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6151 info->type = (yyvsp[(2) - (3)].classinfo);
6152 info->flags = flags;
6154 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6158 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6162 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6164 if((yyvsp[(2) - (3)].classinfo)) {
6165 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6166 t->type_name = multiname_clone(&m);
6168 info->slot = t->slot_id;
6170 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6171 FIXME: is there a way to use slots and still don't have conflicting overrides?
6173 info->slot = t->slot_id = 0;
6175 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6176 if(cval.type!=CONSTANT_UNKNOWN) {
6177 /* compile time constant */
6178 t->value = malloc(sizeof(constant_t));
6179 memcpy(t->value, &cval, sizeof(constant_t));
6180 info->value = constant_clone(t->value);
6182 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6183 /* initalization code (if needed) */
6185 if(v.c && !is_pushundefined(v.c)) {
6186 c = abc_getlocal_0(c);
6187 c = code_append(c, v.c);
6188 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6190 c = abc_initproperty2(c, &mname);
6192 c = abc_setslot(c, t->slot_id);
6195 *code = code_append(*code, c);
6198 if(slotstate_varconst==KW_CONST) {
6199 t->kind= TRAIT_CONST;
6200 info->flags |= FLAG_CONST;
6214 /* Line 1464 of skeleton.m4 */
6215 #line 2712 "parser.y"
6216 {(yyval.constant)=0;}
6225 /* Line 1464 of skeleton.m4 */
6226 #line 2713 "parser.y"
6228 (yyval.constant) = malloc(sizeof(constant_t));
6229 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6230 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6231 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6242 /* Line 1464 of skeleton.m4 */
6243 #line 2722 "parser.y"
6244 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6253 /* Line 1464 of skeleton.m4 */
6254 #line 2723 "parser.y"
6256 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6266 /* Line 1464 of skeleton.m4 */
6267 #line 2726 "parser.y"
6268 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6277 /* Line 1464 of skeleton.m4 */
6278 #line 2727 "parser.y"
6279 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6288 /* Line 1464 of skeleton.m4 */
6289 #line 2728 "parser.y"
6290 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6299 /* Line 1464 of skeleton.m4 */
6300 #line 2729 "parser.y"
6301 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6310 /* Line 1464 of skeleton.m4 */
6311 #line 2730 "parser.y"
6312 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6321 /* Line 1464 of skeleton.m4 */
6322 #line 2731 "parser.y"
6323 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6332 /* Line 1464 of skeleton.m4 */
6333 #line 2732 "parser.y"
6334 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6343 /* Line 1464 of skeleton.m4 */
6344 #line 2752 "parser.y"
6345 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6354 /* Line 1464 of skeleton.m4 */
6355 #line 2753 "parser.y"
6356 {PASS_ALWAYS tokenizer_begin_xmltext();}
6365 /* Line 1464 of skeleton.m4 */
6366 #line 2754 "parser.y"
6367 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6376 /* Line 1464 of skeleton.m4 */
6377 #line 2756 "parser.y"
6378 {PASS_ALWAYS tokenizer_begin_xmltext();}
6387 /* Line 1464 of skeleton.m4 */
6388 #line 2756 "parser.y"
6390 (yyval.id)=strdup("{...}");
6391 as3_warning("xml string substitution not yet supported");
6401 /* Line 1464 of skeleton.m4 */
6402 #line 2760 "parser.y"
6403 {PASS_ALWAYS tokenizer_begin_xml();}
6412 /* Line 1464 of skeleton.m4 */
6413 #line 2760 "parser.y"
6415 (yyval.id)=strdup("{...}");
6416 as3_warning("xml string substitution not yet supported");
6426 /* Line 1464 of skeleton.m4 */
6427 #line 2764 "parser.y"
6437 /* Line 1464 of skeleton.m4 */
6438 #line 2765 "parser.y"
6440 (yyval.id) = concat2((yyvsp[(1) - (2)].id), "{...}");
6450 /* Line 1464 of skeleton.m4 */
6451 #line 2768 "parser.y"
6452 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), string_cstr(&(yyvsp[(2) - (2)].str)));}
6461 /* Line 1464 of skeleton.m4 */
6462 #line 2769 "parser.y"
6463 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), ">");}
6472 /* Line 1464 of skeleton.m4 */
6473 #line 2771 "parser.y"
6474 {(yyval.id)=concat2((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].id));}
6483 /* Line 1464 of skeleton.m4 */
6484 #line 2772 "parser.y"
6485 {(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));}
6494 /* Line 1464 of skeleton.m4 */
6495 #line 2774 "parser.y"
6496 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6505 /* Line 1464 of skeleton.m4 */
6506 #line 2775 "parser.y"
6507 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6516 /* Line 1464 of skeleton.m4 */
6517 #line 2777 "parser.y"
6519 (yyval.id) = allocprintf("<%s%s>%s</%s>", (yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].id), (yyvsp[(5) - (10)].id), (yyvsp[(8) - (10)].id));
6520 free((yyvsp[(2) - (10)].id));free((yyvsp[(3) - (10)].id));free((yyvsp[(5) - (10)].id));free((yyvsp[(8) - (10)].id));
6530 /* Line 1464 of skeleton.m4 */
6531 #line 2781 "parser.y"
6533 (yyval.id) = allocprintf("<%s%s/>", (yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].id));
6543 /* Line 1464 of skeleton.m4 */
6544 #line 2784 "parser.y"
6546 (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));
6547 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));
6557 /* Line 1464 of skeleton.m4 */
6558 #line 2789 "parser.y"
6559 {(yyval.id)=strdup("");}
6568 /* Line 1464 of skeleton.m4 */
6569 #line 2790 "parser.y"
6570 {(yyval.id)=concat2(" ",(yyvsp[(1) - (1)].id));}
6579 /* Line 1464 of skeleton.m4 */
6580 #line 2791 "parser.y"
6581 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6590 /* Line 1464 of skeleton.m4 */
6591 #line 2792 "parser.y"
6592 {(yyval.id)=concat3((yyvsp[(1) - (2)].id)," ",(yyvsp[(2) - (2)].id));free((yyvsp[(1) - (2)].id));free((yyvsp[(2) - (2)].id));}
6601 /* Line 1464 of skeleton.m4 */
6602 #line 2794 "parser.y"
6604 (yyval.id) = strdup("{...}");
6614 /* Line 1464 of skeleton.m4 */
6615 #line 2797 "parser.y"
6617 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6618 (yyval.id) = concat2("{...}=",str);
6628 /* Line 1464 of skeleton.m4 */
6629 #line 2801 "parser.y"
6631 (yyval.id) = strdup("{...}={...}");
6641 /* Line 1464 of skeleton.m4 */
6642 #line 2804 "parser.y"
6644 (yyval.id) = concat2((yyvsp[(1) - (3)].id),"={...}");
6654 /* Line 1464 of skeleton.m4 */
6655 #line 2807 "parser.y"
6657 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6658 (yyval.id)=allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str);
6660 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6670 /* Line 1464 of skeleton.m4 */
6671 #line 2817 "parser.y"
6674 memset(&(yyval.params),0,sizeof((yyval.params)));
6684 /* Line 1464 of skeleton.m4 */
6685 #line 2821 "parser.y"
6688 (yyval.params)=(yyvsp[(1) - (1)].params);
6698 /* Line 1464 of skeleton.m4 */
6699 #line 2827 "parser.y"
6702 memset(&(yyval.params),0,sizeof((yyval.params)));
6703 (yyval.params).varargs=1;
6704 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6714 /* Line 1464 of skeleton.m4 */
6715 #line 2833 "parser.y"
6718 (yyval.params) =(yyvsp[(1) - (4)].params);
6719 (yyval.params).varargs=1;
6720 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6730 /* Line 1464 of skeleton.m4 */
6731 #line 2841 "parser.y"
6734 (yyval.params) = (yyvsp[(1) - (3)].params);
6735 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6745 /* Line 1464 of skeleton.m4 */
6746 #line 2846 "parser.y"
6749 memset(&(yyval.params),0,sizeof((yyval.params)));
6750 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6760 /* Line 1464 of skeleton.m4 */
6761 #line 2852 "parser.y"
6764 (yyval.param) = rfx_calloc(sizeof(param_t));
6765 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6766 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6768 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6778 /* Line 1464 of skeleton.m4 */
6779 #line 2860 "parser.y"
6782 (yyval.param) = rfx_calloc(sizeof(param_t));
6783 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6784 (yyval.param)->type = TYPE_ANY;
6786 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6796 /* Line 1464 of skeleton.m4 */
6797 #line 2870 "parser.y"
6798 {PASS12 (yyval.token)=0;}
6807 /* Line 1464 of skeleton.m4 */
6808 #line 2873 "parser.y"
6809 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6818 /* Line 1464 of skeleton.m4 */
6819 #line 2874 "parser.y"
6822 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6824 if(!state->method->info) syntaxerror("internal error");
6826 code_t*c = method_header(state->method);
6827 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6829 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6831 list_deep_free((yyvsp[(6) - (12)].params).list);
6842 /* Line 1464 of skeleton.m4 */
6843 #line 2890 "parser.y"
6844 {PASS12 (yyval.id)=0;}
6853 /* Line 1464 of skeleton.m4 */
6854 #line 2892 "parser.y"
6855 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6864 /* Line 1464 of skeleton.m4 */
6865 #line 2893 "parser.y"
6868 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6870 methodinfo_t*f = state->method->info;
6871 if(!f || !f->kind) syntaxerror("internal error");
6873 code_t*c = method_header(state->method);
6874 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6876 int index = state->method->var_index;
6877 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6879 (yyval.value).c = abc_getlocal(0, index);
6880 (yyval.value).t = TYPE_FUNCTION(f);
6882 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6892 /* Line 1464 of skeleton.m4 */
6893 #line 2915 "parser.y"
6895 PASS1 NEW(unresolvedinfo_t,c);
6896 memset(c, 0, sizeof(*c));
6897 c->kind = INFOTYPE_UNRESOLVED;
6898 c->name = (yyvsp[(1) - (1)].id);
6899 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6901 c->nsset = get_current_imports();
6902 /* make the compiler look for this class in the current directory,
6904 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6906 (yyval.classinfo) = (classinfo_t*)c;
6908 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6909 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6910 (yyval.classinfo) = (classinfo_t*)s;
6920 /* Line 1464 of skeleton.m4 */
6921 #line 2934 "parser.y"
6923 PASS1 NEW(unresolvedinfo_t,c);
6924 memset(c, 0, sizeof(*c));
6925 c->kind = INFOTYPE_UNRESOLVED;
6926 c->package = (yyvsp[(1) - (3)].id);
6927 c->name = (yyvsp[(3) - (3)].id);
6928 (yyval.classinfo) = (classinfo_t*)c;
6930 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6931 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6932 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6933 (yyval.classinfo) = (classinfo_t*)s;
6943 /* Line 1464 of skeleton.m4 */
6944 #line 2951 "parser.y"
6945 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6954 /* Line 1464 of skeleton.m4 */
6955 #line 2952 "parser.y"
6956 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6965 /* Line 1464 of skeleton.m4 */
6966 #line 2954 "parser.y"
6967 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6976 /* Line 1464 of skeleton.m4 */
6977 #line 2955 "parser.y"
6978 {PASS12 (yyval.classinfo)=TYPE_ANY;}
6987 /* Line 1464 of skeleton.m4 */
6988 #line 2956 "parser.y"
6989 {PASS12 (yyval.classinfo)=TYPE_VOID;}
6998 /* Line 1464 of skeleton.m4 */
6999 #line 2965 "parser.y"
7000 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
7009 /* Line 1464 of skeleton.m4 */
7010 #line 2966 "parser.y"
7011 {PASS12 (yyval.classinfo)=0;}
7020 /* Line 1464 of skeleton.m4 */
7021 #line 2970 "parser.y"
7022 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7031 /* Line 1464 of skeleton.m4 */
7032 #line 2971 "parser.y"
7033 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
7042 /* Line 1464 of skeleton.m4 */
7043 #line 2973 "parser.y"
7044 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7053 /* Line 1464 of skeleton.m4 */
7054 #line 2977 "parser.y"
7055 {(yyval.value_list).number=1;
7056 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
7066 /* Line 1464 of skeleton.m4 */
7067 #line 2981 "parser.y"
7068 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
7077 /* Line 1464 of skeleton.m4 */
7078 #line 2982 "parser.y"
7080 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
7081 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
7091 /* Line 1464 of skeleton.m4 */
7092 #line 2988 "parser.y"
7094 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
7095 (yyval.value).c = v.c;
7096 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
7098 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
7099 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7100 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7101 (yyval.value).c = code_cutlast((yyval.value).c);
7102 (yyval.value).c = code_append((yyval.value).c, paramcode);
7103 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
7104 multiname_destroy(name);
7105 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7106 code_free((yyval.value).c);
7107 classinfo_t*c = v.t->data;
7109 (yyval.value).c = abc_findpropstrict2(0, &m);
7110 (yyval.value).c = code_append((yyval.value).c, paramcode);
7111 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
7112 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
7113 int slot = (int)(ptroff_t)$$.c->data[0];
7114 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
7115 multiname_t*name = t->name;
7116 $$.c = code_cutlast($$.c);
7117 $$.c = code_append($$.c, paramcode);
7118 $$.c = abc_constructprop2($$.c, name, $4.number);*/
7120 (yyval.value).c = code_append((yyval.value).c, paramcode);
7121 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
7124 (yyval.value).t = TYPE_ANY;
7125 if(TYPE_IS_CLASS(v.t) && v.t->data) {
7126 (yyval.value).t = v.t->data;
7128 (yyval.value).c = abc_coerce_a((yyval.value).c);
7129 (yyval.value).t = TYPE_ANY;
7140 /* Line 1464 of skeleton.m4 */
7141 #line 3032 "parser.y"
7144 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
7145 (yyval.value).c = v.c;
7146 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7147 (yyval.value).c = code_cutlast((yyval.value).c);
7149 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
7151 (yyval.value).t = TYPE_ANY;
7152 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7153 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7154 (yyval.value).c = code_cutlast((yyval.value).c);
7155 (yyval.value).c = code_append((yyval.value).c, paramcode);
7156 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7157 multiname_destroy(name);
7158 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7159 int slot = (int)(ptroff_t)$$.c->data[0];
7160 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7161 if(t->kind!=TRAIT_METHOD) {
7162 //ok: flash allows to assign closures to members.
7164 multiname_t*name = t->name;
7165 $$.c = code_cutlast($$.c);
7166 $$.c = code_append($$.c, paramcode);
7167 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7168 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7169 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7170 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7171 (yyval.value).c = code_cutlast((yyval.value).c);
7172 (yyval.value).c = code_append((yyval.value).c, paramcode);
7173 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7174 multiname_destroy(name);
7176 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7177 (yyval.value).c = code_append((yyval.value).c, paramcode);
7178 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7181 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7182 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7183 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7184 // calling a class is like a typecast
7185 (yyval.value).t = (classinfo_t*)v.t->data;
7187 (yyval.value).c = abc_coerce_a((yyval.value).c);
7188 (yyval.value).t = TYPE_ANY;
7199 /* Line 1464 of skeleton.m4 */
7200 #line 3082 "parser.y"
7202 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7203 if(!state->method) syntaxerror("super() not allowed outside of a function");
7204 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7206 (yyval.value).c = code_new();
7207 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7209 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7211 this is dependent on the control path, check this somewhere else
7212 if(state->method->has_super)
7213 syntaxerror("constructor may call super() only once");
7215 state->method->has_super = 1;
7217 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7218 (yyval.value).c = abc_pushundefined((yyval.value).c);
7219 (yyval.value).t = TYPE_ANY;
7229 /* Line 1464 of skeleton.m4 */
7230 #line 3103 "parser.y"
7232 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7233 (yyval.value).c = v.c;
7234 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7235 (yyval.value).c = code_cutlast((yyval.value).c);
7237 multiname_t*name = 0;
7238 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7239 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7240 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7241 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7242 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7243 (yyval.value).c = code_cutlast((yyval.value).c);
7244 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7246 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7247 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7248 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7250 (yyval.value).t = TYPE_BOOLEAN;
7260 /* Line 1464 of skeleton.m4 */
7261 #line 3125 "parser.y"
7263 (yyval.code) = abc_returnvoid(0);
7273 /* Line 1464 of skeleton.m4 */
7274 #line 3128 "parser.y"
7276 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7277 (yyval.code) = abc_returnvalue((yyval.code));
7287 /* Line 1464 of skeleton.m4 */
7288 #line 3135 "parser.y"
7290 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7300 /* Line 1464 of skeleton.m4 */
7301 #line 3138 "parser.y"
7303 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7313 /* Line 1464 of skeleton.m4 */
7314 #line 3141 "parser.y"
7316 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7326 /* Line 1464 of skeleton.m4 */
7327 #line 3144 "parser.y"
7329 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7339 /* Line 1464 of skeleton.m4 */
7340 #line 3147 "parser.y"
7342 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7352 /* Line 1464 of skeleton.m4 */
7353 #line 3150 "parser.y"
7355 (yyval.code) = (yyvsp[(1) - (3)].code);
7356 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7366 /* Line 1464 of skeleton.m4 */
7367 #line 3155 "parser.y"
7368 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7377 /* Line 1464 of skeleton.m4 */
7378 #line 3156 "parser.y"
7379 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7388 /* Line 1464 of skeleton.m4 */
7389 #line 3158 "parser.y"
7390 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7399 /* Line 1464 of skeleton.m4 */
7400 #line 3159 "parser.y"
7401 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7410 /* Line 1464 of skeleton.m4 */
7411 #line 3160 "parser.y"
7412 {syntaxerror("dictionary keys must be strings");}
7421 /* Line 1464 of skeleton.m4 */
7422 #line 3161 "parser.y"
7423 {syntaxerror("dictionary keys must be strings");}
7432 /* Line 1464 of skeleton.m4 */
7433 #line 3162 "parser.y"
7434 {syntaxerror("dictionary keys must be strings");}
7443 /* Line 1464 of skeleton.m4 */
7444 #line 3164 "parser.y"
7446 (yyval.value_list).cc = 0;
7447 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7448 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7449 (yyval.value_list).number = 2;
7459 /* Line 1464 of skeleton.m4 */
7460 #line 3170 "parser.y"
7462 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7463 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7464 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7465 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7475 /* Line 1464 of skeleton.m4 */
7476 #line 3179 "parser.y"
7477 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7486 /* Line 1464 of skeleton.m4 */
7487 #line 3180 "parser.y"
7488 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7497 /* Line 1464 of skeleton.m4 */
7498 #line 3181 "parser.y"
7499 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7508 /* Line 1464 of skeleton.m4 */
7509 #line 3182 "parser.y"
7510 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7519 /* Line 1464 of skeleton.m4 */
7520 #line 3183 "parser.y"
7521 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7530 /* Line 1464 of skeleton.m4 */
7531 #line 3184 "parser.y"
7532 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7541 /* Line 1464 of skeleton.m4 */
7542 #line 3186 "parser.y"
7544 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7554 /* Line 1464 of skeleton.m4 */
7555 #line 3190 "parser.y"
7559 multiname_t m = {QNAME, &stdns, 0, "XML"};
7560 v.c = abc_getlex2(v.c, &m);
7561 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].id));
7562 v.c = abc_construct(v.c, 1);
7564 (yyval.node) = mkcodenode(v);
7574 /* Line 1464 of skeleton.m4 */
7575 #line 3202 "parser.y"
7579 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7580 if(!(yyvsp[(1) - (1)].regexp).options) {
7581 v.c = abc_getlex2(v.c, &m);
7582 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7583 v.c = abc_construct(v.c, 1);
7585 v.c = abc_getlex2(v.c, &m);
7586 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7587 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7588 v.c = abc_construct(v.c, 2);
7591 (yyval.node) = mkcodenode(v);
7601 /* Line 1464 of skeleton.m4 */
7602 #line 3220 "parser.y"
7605 state->method->need_arguments = 1;
7608 v.c = abc_getlocal(0, state->method->need_arguments);
7610 (yyval.node) = mkcodenode(v);
7620 /* Line 1464 of skeleton.m4 */
7621 #line 3231 "parser.y"
7625 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7626 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7627 v.t = registry_getarrayclass();
7628 (yyval.node) = mkcodenode(v);
7638 /* Line 1464 of skeleton.m4 */
7639 #line 3241 "parser.y"
7643 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7644 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7645 v.t = registry_getobjectclass();
7646 (yyval.node) = mkcodenode(v);
7656 /* Line 1464 of skeleton.m4 */
7657 #line 3250 "parser.y"
7658 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7667 /* Line 1464 of skeleton.m4 */
7668 #line 3251 "parser.y"
7669 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7678 /* Line 1464 of skeleton.m4 */
7679 #line 3252 "parser.y"
7680 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7689 /* Line 1464 of skeleton.m4 */
7690 #line 3253 "parser.y"
7691 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7700 /* Line 1464 of skeleton.m4 */
7701 #line 3254 "parser.y"
7702 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7711 /* Line 1464 of skeleton.m4 */
7712 #line 3255 "parser.y"
7713 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7722 /* Line 1464 of skeleton.m4 */
7723 #line 3256 "parser.y"
7724 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7733 /* Line 1464 of skeleton.m4 */
7734 #line 3257 "parser.y"
7735 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7744 /* Line 1464 of skeleton.m4 */
7745 #line 3258 "parser.y"
7746 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7755 /* Line 1464 of skeleton.m4 */
7756 #line 3259 "parser.y"
7757 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7766 /* Line 1464 of skeleton.m4 */
7767 #line 3260 "parser.y"
7768 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7777 /* Line 1464 of skeleton.m4 */
7778 #line 3261 "parser.y"
7779 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7788 /* Line 1464 of skeleton.m4 */
7789 #line 3262 "parser.y"
7790 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7799 /* Line 1464 of skeleton.m4 */
7800 #line 3263 "parser.y"
7801 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7810 /* Line 1464 of skeleton.m4 */
7811 #line 3264 "parser.y"
7812 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7821 /* Line 1464 of skeleton.m4 */
7822 #line 3265 "parser.y"
7823 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7832 /* Line 1464 of skeleton.m4 */
7833 #line 3266 "parser.y"
7834 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7843 /* Line 1464 of skeleton.m4 */
7844 #line 3267 "parser.y"
7845 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7854 /* Line 1464 of skeleton.m4 */
7855 #line 3268 "parser.y"
7856 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7865 /* Line 1464 of skeleton.m4 */
7866 #line 3269 "parser.y"
7867 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7876 /* Line 1464 of skeleton.m4 */
7877 #line 3270 "parser.y"
7878 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7887 /* Line 1464 of skeleton.m4 */
7888 #line 3271 "parser.y"
7889 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7898 /* Line 1464 of skeleton.m4 */
7899 #line 3272 "parser.y"
7900 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7909 /* Line 1464 of skeleton.m4 */
7910 #line 3273 "parser.y"
7911 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7920 /* Line 1464 of skeleton.m4 */
7921 #line 3274 "parser.y"
7922 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7931 /* Line 1464 of skeleton.m4 */
7932 #line 3275 "parser.y"
7933 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7942 /* Line 1464 of skeleton.m4 */
7943 #line 3276 "parser.y"
7944 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7953 /* Line 1464 of skeleton.m4 */
7954 #line 3277 "parser.y"
7955 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(3) - (4)].node));}
7964 /* Line 1464 of skeleton.m4 */
7965 #line 3278 "parser.y"
7966 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
7975 /* Line 1464 of skeleton.m4 */
7976 #line 3279 "parser.y"
7977 { (yyval.node) = mkconstnode(constant_new_undefined());}
7986 /* Line 1464 of skeleton.m4 */
7987 #line 3280 "parser.y"
7988 { (yyval.node)=(yyvsp[(2) - (3)].node);}
7997 /* Line 1464 of skeleton.m4 */
7998 #line 3281 "parser.y"
7999 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
8008 /* Line 1464 of skeleton.m4 */
8009 #line 3282 "parser.y"
8010 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
8019 /* Line 1464 of skeleton.m4 */
8020 #line 3283 "parser.y"
8021 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8030 /* Line 1464 of skeleton.m4 */
8031 #line 3284 "parser.y"
8032 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8041 /* Line 1464 of skeleton.m4 */
8042 #line 3285 "parser.y"
8043 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8052 /* Line 1464 of skeleton.m4 */
8053 #line 3286 "parser.y"
8054 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8063 /* Line 1464 of skeleton.m4 */
8064 #line 3287 "parser.y"
8065 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8074 /* Line 1464 of skeleton.m4 */
8075 #line 3288 "parser.y"
8076 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8085 /* Line 1464 of skeleton.m4 */
8086 #line 3289 "parser.y"
8087 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8096 /* Line 1464 of skeleton.m4 */
8097 #line 3290 "parser.y"
8098 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8107 /* Line 1464 of skeleton.m4 */
8108 #line 3291 "parser.y"
8109 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8118 /* Line 1464 of skeleton.m4 */
8119 #line 3292 "parser.y"
8120 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8129 /* Line 1464 of skeleton.m4 */
8130 #line 3293 "parser.y"
8131 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8140 /* Line 1464 of skeleton.m4 */
8141 #line 3294 "parser.y"
8142 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8151 /* Line 1464 of skeleton.m4 */
8152 #line 3295 "parser.y"
8153 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
8162 /* Line 1464 of skeleton.m4 */
8163 #line 3297 "parser.y"
8164 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
8173 /* Line 1464 of skeleton.m4 */
8174 #line 3298 "parser.y"
8175 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
8184 /* Line 1464 of skeleton.m4 */
8185 #line 3299 "parser.y"
8186 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
8195 /* Line 1464 of skeleton.m4 */
8196 #line 3300 "parser.y"
8197 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
8206 /* Line 1464 of skeleton.m4 */
8207 #line 3303 "parser.y"
8208 { if(!state->cls->info)
8209 syntaxerror("super keyword not allowed outside a class");
8210 classinfo_t*t = state->cls->info->superclass;
8211 if(!t) t = TYPE_OBJECT;
8212 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8213 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8216 v.c = abc_getlocal_0(v.c);
8217 v.c = abc_getsuper2(v.c, &m);
8218 v.t = slotinfo_gettype((slotinfo_t*)f);
8219 (yyval.node) = mkcodenode(v);
8229 /* Line 1464 of skeleton.m4 */
8230 #line 3317 "parser.y"
8233 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
8234 v.c = abc_getlex2(0, &m);
8236 (yyval.node) = mkcodenode(v);
8246 /* Line 1464 of skeleton.m4 */
8247 #line 3325 "parser.y"
8248 {PASS12 new_state();state->xmlfilter=1;}
8257 /* Line 1464 of skeleton.m4 */
8258 #line 3325 "parser.y"
8262 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8263 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8265 int index = alloc_local();
8266 int result = alloc_local();
8267 int tmp = alloc_local();
8268 int xml = alloc_local();
8270 c = code_append(c, v.c);
8271 c = abc_checkfilter(c);
8272 c = abc_coerce_a(c); //hasnext2 converts to *
8273 c = abc_setlocal(c, xml);
8274 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8275 c = abc_getlex2(c, &m);
8276 c = abc_construct(c, 0);
8277 c = abc_setlocal(c, result);
8278 c = abc_pushbyte(c, 0);
8279 c = abc_setlocal(c, index);
8280 code_t*jmp = c = abc_jump(c, 0);
8281 code_t*loop = c = abc_label(c);
8282 c = abc_getlocal(c, xml);
8283 c = abc_getlocal(c, index);
8284 c = abc_nextvalue(c);
8286 c = abc_setlocal(c, tmp);
8287 c = abc_pushwith(c);
8288 c = code_append(c, w.c);
8289 c = abc_popscope(c);
8290 code_t*b = c = abc_iffalse(c, 0);
8291 c = abc_getlocal(c, result);
8292 c = abc_getlocal(c, index);
8293 c = abc_getlocal(c, tmp);
8294 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8295 c = abc_setproperty2(c, &m2);
8296 c = b->branch = jmp->branch = abc_nop(c);
8297 c = abc_kill(c, tmp);
8298 c = abc_hasnext2(c, xml, index);
8299 c = abc_iftrue(c, loop);
8300 c = abc_getlocal(c, result);
8301 c = abc_kill(c, xml);
8302 c = abc_kill(c, result);
8303 c = abc_kill(c, index);
8310 (yyval.node) = mkcodenode(r);
8320 /* Line 1464 of skeleton.m4 */
8321 #line 3379 "parser.y"
8322 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8331 /* Line 1464 of skeleton.m4 */
8332 #line 3380 "parser.y"
8342 /* Line 1464 of skeleton.m4 */
8343 #line 3381 "parser.y"
8344 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8353 /* Line 1464 of skeleton.m4 */
8354 #line 3383 "parser.y"
8364 /* Line 1464 of skeleton.m4 */
8365 #line 3391 "parser.y"
8367 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8368 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8369 v.c = code_append(v.c, w.c);
8370 if(!TYPE_IS_NAMESPACE(w.t)) {
8371 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8373 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8374 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8375 v.c = abc_getproperty2(v.c, &m);
8376 if(TYPE_IS_XML(v.t)) {
8379 v.c = abc_coerce_a(v.c);
8382 (yyval.node) = mkcodenode(v);
8392 /* Line 1464 of skeleton.m4 */
8393 #line 3409 "parser.y"
8395 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8396 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8397 v.c = abc_getdescendants2(v.c, &m);
8399 (yyval.node) = mkcodenode(v);
8409 /* Line 1464 of skeleton.m4 */
8410 #line 3416 "parser.y"
8412 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8413 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8414 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8415 v.c = code_append(v.c, w.c);
8416 v.c = converttype(w.c, w.t, TYPE_STRING);
8417 v.c = abc_getproperty2(v.c, &m);
8419 (yyval.node) = mkcodenode(v);
8429 /* Line 1464 of skeleton.m4 */
8430 #line 3427 "parser.y"
8432 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8433 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8434 v.c = abc_getproperty2(v.c, &m);
8436 (yyval.node) = mkcodenode(v);
8446 /* Line 1464 of skeleton.m4 */
8447 #line 3434 "parser.y"
8449 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8450 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8451 v.c = abc_getdescendants2(v.c, &m);
8453 (yyval.node) = mkcodenode(v);
8463 /* Line 1464 of skeleton.m4 */
8464 #line 3441 "parser.y"
8466 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8467 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8468 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8469 v.c = code_append(v.c, w.c);
8470 v.c = converttype(w.c, w.t, TYPE_STRING);
8471 v.c = abc_getproperty2(v.c, &m);
8473 (yyval.node) = mkcodenode(v);
8483 /* Line 1464 of skeleton.m4 */
8484 #line 3451 "parser.y"
8486 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8487 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8488 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8489 v.c = code_append(v.c, w.c);
8490 v.c = converttype(w.c, w.t, TYPE_STRING);
8491 v.c = abc_getdescendants2(v.c, &m);
8493 (yyval.node) = mkcodenode(v);
8503 /* Line 1464 of skeleton.m4 */
8504 #line 3462 "parser.y"
8506 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8507 (yyval.value).c = v1.c;
8508 classinfo_t*t = v1.t;
8510 if(TYPE_IS_CLASS(t) && t->data) {
8514 if(TYPE_IS_XML(t)) {
8515 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8516 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8517 (yyval.value).c = abc_coerce_a((yyval.value).c);
8518 (yyval.value).t = TYPE_XMLLIST;
8520 if(t->subtype==INFOTYPE_UNRESOLVED) {
8521 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8523 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8525 if(f && !is_static != !(f->flags&FLAG_STATIC))
8527 if(f && f->slot && !noslot) {
8528 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8531 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8533 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8534 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8536 /* determine type */
8537 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8538 if(!(yyval.value).t)
8539 (yyval.value).c = abc_coerce_a((yyval.value).c);
8541 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8542 string_t*package = v1.c->data[0];
8543 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8545 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8547 (yyval.value) = push_class(a);
8548 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8549 registry_ispackage(package2)) {
8550 (yyval.value).c = v1.c;
8551 (yyval.value).c->data[0] = string_new4(package2);
8552 (yyval.value).t = 0;
8554 syntaxerror("couldn't resolve %s", package2);
8557 /* when resolving a property on an unknown type, we do know the
8558 name of the property (and don't seem to need the package), but
8559 we need to make avm2 try out all access modes */
8560 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8561 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8562 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8563 (yyval.value).c = abc_coerce_a((yyval.value).c);
8564 (yyval.value).t = TYPE_ANY;
8575 /* Line 1464 of skeleton.m4 */
8576 #line 3640 "parser.y"
8579 /* Queue unresolved identifiers for checking against the parent
8580 function's variables.
8581 We consider everything which is not a local variable "unresolved".
8582 This encompasses class names, members of the surrounding class
8583 etc. which is *correct* because local variables of the parent function
8587 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8588 if(state->method->inner) {
8589 unknown_variable((yyvsp[(1) - (1)].id));
8591 /* let the compiler know that it might want to check the current directory/package
8592 for this identifier- maybe there's a file $1.as defining $1. */
8593 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8599 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8609 /* Line 1464 of skeleton.m4 */
8610 #line 3676 "parser.y"
8613 NEW(namespace_decl_t,n);
8614 n->name = (yyvsp[(2) - (2)].id);
8615 n->url = (yyvsp[(2) - (2)].id);
8616 (yyval.namespace_decl)=n;
8626 /* Line 1464 of skeleton.m4 */
8627 #line 3683 "parser.y"
8630 NEW(namespace_decl_t,n);
8631 n->name = (yyvsp[(2) - (4)].id);
8632 n->url = (yyvsp[(4) - (4)].id);
8633 (yyval.namespace_decl)=n;
8643 /* Line 1464 of skeleton.m4 */
8644 #line 3690 "parser.y"
8647 NEW(namespace_decl_t,n);
8648 n->name = (yyvsp[(2) - (4)].id);
8649 n->url = (yyvsp[(4) - (4)].str).str;
8650 (yyval.namespace_decl)=n;
8660 /* Line 1464 of skeleton.m4 */
8661 #line 3697 "parser.y"
8664 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8666 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8667 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8668 var->type = TYPE_NAMESPACE;
8670 ns.access = ACCESS_NAMESPACE;
8671 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8672 var->value = constant_new_namespace(&ns);
8675 MULTINAME(m, TYPE_NAMESPACE);
8676 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8677 t->value = var->value;
8678 t->type_name = multiname_clone(&m);
8691 /* Line 1464 of skeleton.m4 */
8692 #line 3720 "parser.y"
8694 as3_warning("default xml namespaces not supported yet");
8704 /* Line 1464 of skeleton.m4 */
8705 #line 3724 "parser.y"
8708 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8710 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8711 if(s->kind == INFOTYPE_UNRESOLVED) {
8712 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8714 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8717 if(!s || s->kind != INFOTYPE_VAR)
8718 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8719 if(!s->value || !NS_TYPE(s->value->type))
8720 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8721 url = s->value->ns->name;
8723 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8724 add_active_url(url);
8733 /* Line 1464 of skeleton.m4 */
8734 #line 8735 "parser.tab.c"
8737 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8741 YY_STACK_PRINT (yyss, yyssp);
8745 /* Now `shift' the result of the reduction. Determine what state
8746 that goes to, based on the state we popped back to and the rule
8747 number reduced by. */
8751 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8752 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8753 yystate = yytable[yystate];
8755 yystate = yydefgoto[yyn - YYNTOKENS];
8760 /*------------------------------------.
8761 | yyerrlab -- here on detecting error |
8762 `------------------------------------*/
8764 /* If not already recovering from an error, report this error. */
8768 #if ! YYERROR_VERBOSE
8769 yyerror (YY_("syntax error"));
8772 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8773 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8775 YYSIZE_T yyalloc = 2 * yysize;
8776 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8777 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8778 if (yymsg != yymsgbuf)
8779 YYSTACK_FREE (yymsg);
8780 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8782 yymsg_alloc = yyalloc;
8786 yymsg_alloc = sizeof yymsgbuf;
8790 if (0 < yysize && yysize <= yymsg_alloc)
8792 (void) yysyntax_error (yymsg, yystate, yychar);
8797 yyerror (YY_("syntax error"));
8799 goto yyexhaustedlab;
8807 if (yyerrstatus == 3)
8809 /* If just tried and failed to reuse lookahead token after an
8810 error, discard it. */
8812 if (yychar <= YYEOF)
8814 /* Return failure if at end of input. */
8815 if (yychar == YYEOF)
8820 yydestruct ("Error: discarding",
8826 /* Else will try to reuse lookahead token after shifting the error
8831 /*---------------------------------------------------.
8832 | yyerrorlab -- error raised explicitly by YYERROR. |
8833 `---------------------------------------------------*/
8836 /* Pacify compilers like GCC when the user code never invokes
8837 YYERROR and the label yyerrorlab therefore never appears in user
8839 if (/*CONSTCOND*/ 0)
8842 /* Do not reclaim the symbols of the rule which action triggered
8846 YY_STACK_PRINT (yyss, yyssp);
8851 /*-------------------------------------------------------------.
8852 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8853 `-------------------------------------------------------------*/
8855 yyerrstatus = 3; /* Each real token shifted decrements this. */
8859 yyn = yypact[yystate];
8860 if (yyn != YYPACT_NINF)
8863 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8871 /* Pop the current state because it cannot handle the error token. */
8876 yydestruct ("Error: popping",
8877 yystos[yystate], yyvsp);
8880 YY_STACK_PRINT (yyss, yyssp);
8886 /* Shift the error token. */
8887 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8893 /*-------------------------------------.
8894 | yyacceptlab -- YYACCEPT comes here. |
8895 `-------------------------------------*/
8900 /*-----------------------------------.
8901 | yyabortlab -- YYABORT comes here. |
8902 `-----------------------------------*/
8907 #if !defined(yyoverflow) || YYERROR_VERBOSE
8908 /*-------------------------------------------------.
8909 | yyexhaustedlab -- memory exhaustion comes here. |
8910 `-------------------------------------------------*/
8912 yyerror (YY_("memory exhausted"));
8918 if (yychar != YYEMPTY)
8919 yydestruct ("Cleanup: discarding lookahead",
8921 /* Do not reclaim the symbols of the rule which action triggered
8922 this YYABORT or YYACCEPT. */
8924 YY_STACK_PRINT (yyss, yyssp);
8925 while (yyssp != yyss)
8927 yydestruct ("Cleanup: popping",
8928 yystos[*yyssp], yyvsp);
8933 YYSTACK_FREE (yyss);
8936 if (yymsg != yymsgbuf)
8937 YYSTACK_FREE (yymsg);
8939 /* Make sure YYID is used. */
8940 return YYID (yyresult);