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);
689 } else if(TYPE_IS_STRING(type)) {
693 //c = abc_pushundefined(c);
694 syntaxerror("internal error: can't generate default value for * type");
698 c = abc_coerce2(c, &m);
703 static int alloc_local()
705 return state->method->variable_count++;
708 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
711 variable_t*v = find_slot(state, name);
719 v->index = alloc_local();
724 dict_put(state->vars, name, v);
725 dict_put(state->allvars, name, v);
730 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
732 return new_variable2(name, type, init, maybeslot)->index;
735 #define TEMPVARNAME "__as3_temp__"
738 variable_t*v = find_variable(state, TEMPVARNAME);
743 i = new_variable(TEMPVARNAME, 0, 0, 0);
748 static code_t* var_block(code_t*body)
754 DICT_ITERATE_DATA(state->vars, variable_t*, v) {
755 if(v->type && v->init) {
756 c = defaultvalue(c, v->type);
757 c = abc_setlocal(c, v->index);
758 k = abc_kill(k, v->index);
766 if(x->opcode== OPCODE___BREAK__ ||
767 x->opcode== OPCODE___CONTINUE__) {
768 /* link kill code before break/continue */
769 code_t*e = code_dup(k);
770 code_t*s = code_start(e);
782 c = code_append(c, body);
783 c = code_append(c, k);
787 static void unknown_variable(char*name)
789 if(!state->method->unresolved_variables)
790 state->method->unresolved_variables = dict_new();
791 if(!dict_contains(state->method->unresolved_variables, name))
792 dict_put(state->method->unresolved_variables, name, 0);
795 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
797 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
798 c = abc_getlocal_0(c);
799 c = abc_pushscope(c);
802 /* FIXME: this alloc_local() causes variable indexes to be
803 different in pass2 than in pass1 */
804 if(!m->activation_var) {
805 m->activation_var = alloc_local();
808 c = abc_newactivation(c);
810 c = abc_pushscope(c);
811 c = abc_setlocal(c, m->activation_var);
813 c = abc_getlocal(c, m->activation_var);
814 c = abc_pushscope(c);
820 static code_t* method_header(methodstate_t*m)
824 c = add_scope_code(c, m, 1);
826 methodstate_list_t*l = m->innerfunctions;
828 parserassert(l->methodstate->abc);
829 if(m->uses_slots && l->methodstate->is_a_slot) {
830 c = abc_getscopeobject(c, 1);
831 c = abc_newfunction(c, l->methodstate->abc);
833 c = abc_setlocal(c, l->methodstate->var_index);
834 c = abc_setslot(c, l->methodstate->slot_index);
836 c = abc_newfunction(c, l->methodstate->abc);
837 c = abc_setlocal(c, l->methodstate->var_index);
839 free(l->methodstate);l->methodstate=0;
843 c = code_append(c, m->header);
846 if(m->is_constructor && !m->has_super) {
847 // call default constructor
848 c = abc_getlocal_0(c);
849 c = abc_constructsuper(c, 0);
853 /* all parameters that are used by inner functions
854 need to be copied from local to slot */
855 parserassert(m->activation_var);
856 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
857 if(v->is_parameter) {
858 c = abc_getlocal(c, m->activation_var);
859 c = abc_getlocal(c, v->index);
860 c = abc_setslot(c, v->index);
864 list_free(m->innerfunctions);
865 m->innerfunctions = 0;
870 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
872 c = code_append(c, header);
873 c = code_append(c, var_block(body));
874 /* append return if necessary */
875 if(!c || (c->opcode != OPCODE_RETURNVOID &&
876 c->opcode != OPCODE_RETURNVALUE)) {
877 c = abc_returnvoid(c);
882 static void startpackage(char*name)
885 state->package = strdup(name);
887 static void endpackage()
889 //used e.g. in classinfo_register:
890 //free(state->package);state->package=0;
894 #define FLAG_PUBLIC 256
895 #define FLAG_PROTECTED 512
896 #define FLAG_PRIVATE 1024
897 #define FLAG_PACKAGEINTERNAL 2048
898 #define FLAG_NAMESPACE 4096
900 static namespace_t modifiers2access(modifiers_t*mod)
905 if(mod->flags&FLAG_NAMESPACE) {
906 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
907 syntaxerror("invalid combination of access levels and namespaces");
908 ns.access = ACCESS_NAMESPACE;
910 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
912 /* shouldn't happen- the tokenizer only reports something as a namespace
913 if it was already registered */
914 trie_dump(active_namespaces);
915 syntaxerror("unknown namespace: %s", mod->ns);
918 } else if(mod->flags&FLAG_PUBLIC) {
919 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
920 syntaxerror("invalid combination of access levels");
921 ns.access = ACCESS_PACKAGE;
922 } else if(mod->flags&FLAG_PRIVATE) {
923 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
924 syntaxerror("invalid combination of access levels");
925 ns.access = ACCESS_PRIVATE;
926 } else if(mod->flags&FLAG_PROTECTED) {
927 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
928 syntaxerror("invalid combination of access levels");
929 ns.access = ACCESS_PROTECTED;
931 ns.access = ACCESS_PACKAGEINTERNAL;
935 static slotinfo_t* find_class(const char*name);
937 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
939 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
942 static void innerfunctions2vars(methodstate_t*m)
944 methodstate_list_t*l = m->innerfunctions;
946 methodstate_t*m = l->methodstate;
948 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 0);
949 m->var_index = v->index;
951 m->slot_index = m->is_a_slot;
952 v->is_inner_method = m;
957 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
962 index = new_variable("this", 0, 0, 0);
963 else if(!m->is_global)
964 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
966 index = new_variable("globalscope", 0, 0, 0);
967 parserassert(!index);
972 for(p=params->list;p;p=p->next) {
973 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
976 if(as3_pass==2 && m->need_arguments) {
977 /* arguments can never be used by an innerfunction (the inner functions
978 have their own arguments var), so it's ok to not initialize this until
979 pass 2. (We don't know whether we need it before, anyway) */
980 variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0);
981 m->need_arguments = v->index;
985 innerfunctions2vars(m);
988 m->scope_code = add_scope_code(m->scope_code, m, 0);
990 /* exchange unresolved identifiers with the actual objects */
991 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
992 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
993 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
994 if(!type || type->kind != INFOTYPE_CLASS) {
995 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1005 char*as3_globalclass=0;
1006 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1009 syntaxerror("inner classes now allowed");
1014 classinfo_list_t*mlist=0;
1016 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1017 syntaxerror("invalid modifier(s)");
1019 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1020 syntaxerror("public and internal not supported at the same time.");
1022 if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC))
1023 syntaxerror("protected and static not supported at the same time.");
1025 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1026 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1027 // all classes extend object
1028 extends = registry_getobjectclass();
1031 /* create the class name, together with the proper attributes */
1035 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1036 access = ACCESS_PRIVATE; package = internal_filename_package;
1037 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1038 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1039 } else if(state->package!=internal_filename_package) {
1040 access = ACCESS_PACKAGE; package = state->package;
1042 syntaxerror("public classes only allowed inside a package");
1046 state->cls = rfx_calloc(sizeof(classstate_t));
1047 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1048 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1049 state->cls->static_init->is_static=FLAG_STATIC;
1050 state->cls->static_init->variable_count=1;
1051 /* notice: we make no effort to initialize the top variable (local0) here,
1052 even though it has special meaning. We just rely on the fact
1053 that pass 1 won't do anything with variables */
1055 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1057 /* set current method to constructor- all code within the class-level (except
1058 static variable initializations) will be executed during construction time */
1059 state->method = state->cls->init;
1061 if(registry_find(package, classname)) {
1062 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1064 /* build info struct */
1065 int num_interfaces = (list_length(implements));
1066 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1067 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1068 state->cls->info->superclass = extends;
1071 classinfo_list_t*l = implements;
1072 for(l=implements;l;l=l->next) {
1073 state->cls->info->interfaces[pos++] = l->classinfo;
1078 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1080 state->method = state->cls->init;
1081 parserassert(state->cls && state->cls->info);
1083 function_initvars(state->cls->init, 0, 0, 0, 1);
1084 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1086 if(extends && (extends->flags & FLAG_FINAL))
1087 syntaxerror("Can't extend final class '%s'", extends->name);
1090 while(state->cls->info->interfaces[pos]) {
1091 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1092 syntaxerror("'%s' is not an interface",
1093 state->cls->info->interfaces[pos]->name);
1097 /* generate the abc code for this class */
1098 MULTINAME(classname2,state->cls->info);
1099 multiname_t*extends2 = sig2mname(extends);
1101 /* don't add the class to the class index just yet- that will be done later
1103 state->cls->abc = abc_class_new(0, &classname2, extends2);
1104 state->cls->abc->file = global->file;
1106 multiname_destroy(extends2);
1107 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1108 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1109 if(state->cls->info->flags&FLAG_INTERFACE) {
1110 abc_class_interface(state->cls->abc);
1113 for(mlist=implements;mlist;mlist=mlist->next) {
1114 MULTINAME(m, mlist->classinfo);
1115 abc_class_add_interface(state->cls->abc, &m);
1118 state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc);
1119 list_append(global->classes, state->cls->dependencies);
1121 /* flash.display.MovieClip handling */
1122 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1123 if(state->package && state->package[0]) {
1124 as3_globalclass = concat3(state->package, ".", classname);
1126 as3_globalclass = strdup(classname);
1132 static void endclass()
1135 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1137 c = abc_getlocal_0(c);
1138 c = abc_constructsuper(c, 0);
1139 state->cls->init->header = code_append(state->cls->init->header, c);
1140 state->cls->has_constructor=1;
1142 if(state->cls->init) {
1143 if(state->cls->info->flags&FLAG_INTERFACE) {
1144 if(state->cls->init->header)
1145 syntaxerror("interface can not have class-level code");
1147 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1148 code_t*c = method_header(state->cls->init);
1149 m->body->code = wrap_function(c, 0, m->body->code);
1152 if(state->cls->static_init) {
1153 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1154 code_t*c = method_header(state->cls->static_init);
1155 m->body->code = wrap_function(c, 0, m->body->code);
1158 trait_list_t*trait = state->cls->abc->traits;
1159 /* switch all protected members to the protected ns of this class */
1161 trait_t*t = trait->trait;
1162 if(t->name->ns->access == ACCESS_PROTECTED) {
1163 if(!state->cls->abc->protectedNS) {
1164 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1165 state->cls->abc->protectedNS = namespace_new_protected(n);
1166 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1168 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1170 trait = trait->next;
1177 void check_code_for_break(code_t*c)
1180 if(c->opcode == OPCODE___BREAK__) {
1181 char*name = string_cstr(c->data[0]);
1182 syntaxerror("Unresolved \"break %s\"", name);
1184 if(c->opcode == OPCODE___CONTINUE__) {
1185 char*name = string_cstr(c->data[0]);
1186 syntaxerror("Unresolved \"continue %s\"", name);
1188 if(c->opcode == OPCODE___RETHROW__) {
1189 syntaxerror("Unresolved \"rethrow\"");
1191 if(c->opcode == OPCODE___FALLTHROUGH__) {
1192 syntaxerror("Unresolved \"fallthrough\"");
1194 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1195 char*name = string_cstr(c->data[0]);
1196 syntaxerror("Can't reference a package (%s) as such", name);
1202 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1204 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1205 if(TYPE_IS_NUMBER(t)) {
1206 xassert(c->type == CONSTANT_FLOAT
1207 || c->type == CONSTANT_INT
1208 || c->type == CONSTANT_UINT);
1209 } else if(TYPE_IS_UINT(t)) {
1210 xassert(c->type == CONSTANT_UINT ||
1211 (c->type == CONSTANT_INT && c->i>=0));
1212 } else if(TYPE_IS_INT(t)) {
1213 xassert(c->type == CONSTANT_INT);
1214 } else if(TYPE_IS_BOOLEAN(t)) {
1215 xassert(c->type == CONSTANT_TRUE
1216 || c->type == CONSTANT_FALSE);
1220 static void check_override(memberinfo_t*m, int flags)
1224 if(m->parent == state->cls->info)
1225 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1227 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1228 if(m->access==ACCESS_PRIVATE)
1230 if(m->flags & FLAG_FINAL)
1231 syntaxerror("can't override final member %s", m->name);
1233 /* allow this. it's no issue.
1234 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1235 syntaxerror("can't override static member %s", m->name);*/
1237 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1238 syntaxerror("can't override non-static member %s with static declaration", m->name);
1240 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1241 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1242 if(m->kind == INFOTYPE_METHOD)
1243 syntaxerror("can't override without explicit 'override' declaration");
1245 syntaxerror("can't override '%s'", m->name);
1250 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1252 methodinfo_t*minfo = 0;
1253 namespace_t ns = modifiers2access(mod);
1256 minfo = methodinfo_register_global(ns.access, state->package, name);
1257 minfo->return_type = return_type;
1258 } else if(getset != KW_GET && getset != KW_SET) {
1260 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1262 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1264 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1265 minfo->return_type = return_type;
1266 // getslot on a member slot only returns "undefined", so no need
1267 // to actually store these
1268 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1270 //class getter/setter
1271 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1273 if(getset == KW_GET) {
1275 } else if(params->list && params->list->param && !params->list->next) {
1276 type = params->list->param->type;
1278 syntaxerror("setter function needs to take exactly one argument");
1279 // not sure wether to look into superclasses here, too
1280 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1282 if(minfo->kind!=INFOTYPE_VAR)
1283 syntaxerror("class already contains a method called '%s'", name);
1284 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1285 syntaxerror("class already contains a field called '%s'", name);
1286 if(minfo->subtype & gs)
1287 syntaxerror("getter/setter for '%s' already defined", name);
1288 /* make a setter or getter into a getset */
1289 minfo->subtype |= gs;
1292 FIXME: this check needs to be done in pass 2
1294 if((!minfo->return_type != !type) ||
1295 (minfo->return_type && type &&
1296 !strcmp(minfo->return_type->name, type->name))) {
1297 syntaxerror("different type in getter and setter: %s and %s",
1298 minfo->return_type?minfo->return_type->name:"*",
1299 type?type->name:"*");
1302 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1303 minfo->kind = INFOTYPE_VAR; //hack
1304 minfo->subtype = gs;
1305 minfo->return_type = type;
1308 /* can't assign a slot as getter and setter might have different slots */
1309 //minfo->slot = slot;
1311 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1312 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1313 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1318 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1320 //parserassert(state->method && state->method->info);
1322 methodstate_t*parent_method = state->method;
1325 return_type = 0; // not valid in pass 1
1329 state->new_vars = 1;
1330 state->allvars = dict_new();
1333 state->method = rfx_calloc(sizeof(methodstate_t));
1334 state->method->inner = 1;
1335 state->method->is_static = parent_method->is_static;
1336 state->method->variable_count = 0;
1337 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1339 NEW(methodinfo_t,minfo);
1340 minfo->kind = INFOTYPE_METHOD;
1341 minfo->access = ACCESS_PACKAGEINTERNAL;
1343 state->method->info = minfo;
1346 list_append(parent_method->innerfunctions, state->method);
1348 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1350 function_initvars(state->method, 1, params, 0, 1);
1354 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1355 state->method->variable_count = 0;
1356 parserassert(state->method);
1358 state->method->info->return_type = return_type;
1359 function_initvars(state->method, 1, params, 0, 1);
1363 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1364 params_t*params, classinfo_t*return_type)
1366 if(state->method && state->method->info) {
1367 syntaxerror("not able to start another method scope");
1370 state->new_vars = 1;
1371 state->allvars = dict_new();
1374 state->method = rfx_calloc(sizeof(methodstate_t));
1375 state->method->has_super = 0;
1376 state->method->is_static = mod->flags&FLAG_STATIC;
1379 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1381 state->method->is_global = 1;
1382 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1384 if(state->method->is_constructor)
1385 name = "__as3_constructor__";
1387 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1389 function_initvars(state->method, 1, params, mod->flags, 1);
1391 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1395 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1396 state->method->variable_count = 0;
1397 parserassert(state->method);
1400 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1401 check_override(m, mod->flags);
1405 state->cls->has_constructor |= state->method->is_constructor;
1408 function_initvars(state->method, 1, params, mod->flags, 1);
1412 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1413 params_t*params, classinfo_t*return_type, code_t*body)
1416 innerfunctions2vars(state->method);
1418 methodstate_list_t*ml = state->method->innerfunctions;
1420 dict_t*xvars = dict_new();
1423 methodstate_t*m = ml->methodstate;
1424 parserassert(m->inner);
1425 if(m->unresolved_variables) {
1426 dict_t*d = m->unresolved_variables;
1428 DICT_ITERATE_KEY(d, char*, id) {
1429 /* check parent method's variables */
1431 if((v=find_variable(state, id))) {
1432 m->uses_parent_function = 1;
1433 state->method->uses_slots = 1;
1434 dict_put(xvars, id, 0);
1437 dict_destroy(m->unresolved_variables);m->unresolved_variables = 0;
1442 if(state->method->uses_slots) {
1443 state->method->slots = dict_new();
1445 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1446 if(!name) syntaxerror("internal error");
1447 if(v->index && dict_contains(xvars, name)) {
1450 if(v->is_inner_method) {
1451 v->is_inner_method->is_a_slot = i;
1454 dict_put(state->method->slots, name, v);
1457 state->method->uses_slots = i;
1458 dict_destroy(state->vars);state->vars = 0;
1459 parserassert(state->new_vars);
1460 dict_destroy(state->allvars);state->allvars = 0;
1467 /*if(state->method->uses_parent_function){
1468 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1473 multiname_t*type2 = sig2mname(return_type);
1475 if(state->method->inner) {
1476 f = state->method->abc;
1477 abc_method_init(f, global->file, type2, 1);
1478 } else if(state->method->is_constructor) {
1479 f = abc_class_getconstructor(state->cls->abc, type2);
1480 } else if(!state->method->is_global) {
1481 namespace_t ns = modifiers2access(mod);
1482 multiname_t mname = {QNAME, &ns, 0, name};
1483 if(mod->flags&FLAG_STATIC)
1484 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1486 f = abc_class_method(state->cls->abc, type2, &mname);
1487 slot = f->trait->slot_id;
1489 namespace_t mname_ns = {state->method->info->access, state->package};
1490 multiname_t mname = {QNAME, &mname_ns, 0, name};
1492 f = abc_method_new(global->file, type2, 1);
1493 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1494 //abc_code_t*c = global->init->method->body->code;
1496 //flash doesn't seem to allow us to access function slots
1497 //state->method->info->slot = slot;
1499 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1500 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1501 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1502 if(params->varargs) f->flags |= METHOD_NEED_REST;
1503 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1507 for(p=params->list;p;p=p->next) {
1508 if(params->varargs && !p->next) {
1509 break; //varargs: omit last parameter in function signature
1511 multiname_t*m = sig2mname(p->param->type);
1512 list_append(f->parameters, m);
1513 if(p->param->value) {
1514 check_constant_against_type(p->param->type, p->param->value);
1515 opt=1;list_append(f->optional_parameters, p->param->value);
1517 syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name);
1520 if(state->method->slots) {
1521 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1523 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1524 multiname_t*type = sig2mname(v->type);
1525 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1526 t->slot_id = v->index;
1531 check_code_for_break(body);
1533 /* Seems this works now.
1534 if(state->method->exceptions && state->method->uses_slots) {
1535 as3_warning("try/catch and activation not supported yet within the same method");
1539 f->body->code = body;
1540 f->body->exceptions = state->method->exceptions;
1541 } else { //interface
1543 syntaxerror("interface methods can't have a method body");
1553 void breakjumpsto(code_t*c, char*name, code_t*jump)
1556 if(c->opcode == OPCODE___BREAK__) {
1557 string_t*name2 = c->data[0];
1558 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1559 c->opcode = OPCODE_JUMP;
1566 void continuejumpsto(code_t*c, char*name, code_t*jump)
1569 if(c->opcode == OPCODE___CONTINUE__) {
1570 string_t*name2 = c->data[0];
1571 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1572 c->opcode = OPCODE_JUMP;
1580 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1585 return abc_coerce_a(c);
1589 // cast an "any" type to a specific type. subject to
1590 // runtime exceptions
1591 return abc_coerce2(c, &m);
1594 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1595 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1596 // allow conversion between number types
1597 if(TYPE_IS_UINT(to))
1598 return abc_convert_u(c);
1599 else if(TYPE_IS_INT(to))
1600 return abc_convert_i(c);
1601 else if(TYPE_IS_NUMBER(to))
1602 return abc_convert_d(c);
1603 return abc_coerce2(c, &m);
1606 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1609 if(TYPE_IS_BOOLEAN(to))
1610 return abc_convert_b(c);
1611 if(TYPE_IS_STRING(to))
1612 return abc_convert_s(c);
1613 if(TYPE_IS_OBJECT(to))
1614 return abc_coerce2(c, &m);
1615 if(TYPE_IS_OBJECT(from) && TYPE_IS_XMLLIST(to))
1616 return abc_coerce2(c, &m);
1617 if(TYPE_IS_OBJECT(from) && TYPE_IS_ARRAY(to))
1618 return abc_coerce2(c, &m);
1620 classinfo_t*supertype = from;
1622 if(supertype == to) {
1623 /* target type is one of from's superclasses.
1624 (not sure we need this coerce - as far as the verifier
1625 is concerned, object==object (i think) */
1626 return abc_coerce2(c, &m);
1629 while(supertype->interfaces[t]) {
1630 if(supertype->interfaces[t]==to) {
1631 // target type is one of from's interfaces
1632 return abc_coerce2(c, &m);
1636 supertype = supertype->superclass;
1638 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1640 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1642 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1645 as3_error("can't convert type %s%s%s to %s%s%s",
1646 from->package, from->package[0]?".":"", from->name,
1647 to->package, to->package[0]?".":"", to->name);
1651 code_t* coerce_to_type(code_t*c, classinfo_t*t)
1654 return abc_coerce_a(c);
1655 } else if(TYPE_IS_STRING(t)) {
1656 return abc_coerce_s(c);
1659 return abc_coerce2(c, &m);
1663 char is_pushundefined(code_t*c)
1665 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1668 static const char* get_package_from_name(const char*name)
1670 /* try explicit imports */
1671 dictentry_t* e = dict_get_slot(state->imports, name);
1673 if(!strcmp(e->key, name)) {
1674 slotinfo_t*c = (slotinfo_t*)e->data;
1675 if(c) return c->package;
1681 static namespace_list_t*get_current_imports()
1683 namespace_list_t*searchlist = 0;
1685 list_append(searchlist, namespace_new_package(state->package));
1687 import_list_t*l = state->wildcard_imports;
1689 namespace_t*ns = namespace_new_package(l->import->package);
1690 list_append(searchlist, ns);
1693 list_append(searchlist, namespace_new_package(""));
1694 list_append(searchlist, namespace_new_package(internal_filename_package));
1698 static slotinfo_t* find_class(const char*name)
1702 c = registry_find(state->package, name);
1705 /* try explicit imports */
1706 dictentry_t* e = dict_get_slot(state->imports, name);
1709 if(!strcmp(e->key, name)) {
1710 c = (slotinfo_t*)e->data;
1716 /* try package.* imports */
1717 import_list_t*l = state->wildcard_imports;
1719 //printf("does package %s contain a class %s?\n", l->import->package, name);
1720 c = registry_find(l->import->package, name);
1725 /* try global package */
1726 c = registry_find("", name);
1729 /* try local "filename" package */
1730 c = registry_find(internal_filename_package, name);
1735 typedcode_t push_class(slotinfo_t*a)
1740 if(a->access == ACCESS_PACKAGEINTERNAL &&
1741 strcmp(a->package, state->package) &&
1742 strcmp(a->package, internal_filename_package)
1744 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1745 infotypename(a), a->name, a->package, state->package);
1749 if(a->kind != INFOTYPE_CLASS) {
1751 x.c = abc_findpropstrict2(x.c, &m);
1752 x.c = abc_getproperty2(x.c, &m);
1753 if(a->kind == INFOTYPE_METHOD) {
1754 methodinfo_t*f = (methodinfo_t*)a;
1755 x.t = TYPE_FUNCTION(f);
1757 varinfo_t*v = (varinfo_t*)a;
1762 if(state->cls && state->method == state->cls->static_init) {
1763 /* we're in the static initializer.
1764 record the fact that we're using this class here */
1765 parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a);
1767 classinfo_t*c = (classinfo_t*)a;
1769 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1770 x.c = abc_getglobalscope(x.c);
1771 x.c = abc_getslot(x.c, c->slot);
1774 x.c = abc_getlex2(x.c, &m);
1776 x.t = TYPE_CLASS(c);
1782 char is_break_or_jump(code_t*c)
1786 if(c->opcode == OPCODE_JUMP ||
1787 c->opcode == OPCODE___BREAK__ ||
1788 c->opcode == OPCODE___CONTINUE__ ||
1789 c->opcode == OPCODE_THROW ||
1790 c->opcode == OPCODE_RETURNVOID ||
1791 c->opcode == OPCODE_RETURNVALUE) {
1797 #define IS_FINALLY_TARGET(op) \
1798 ((op) == OPCODE___CONTINUE__ || \
1799 (op) == OPCODE___BREAK__ || \
1800 (op) == OPCODE_RETURNVOID || \
1801 (op) == OPCODE_RETURNVALUE || \
1802 (op) == OPCODE___RETHROW__)
1804 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1806 #define NEED_EXTRA_STACK_ARG
1807 code_t*finally_label = abc_nop(0);
1808 NEW(lookupswitch_t, l);
1814 code_t*prev = i->prev;
1815 if(IS_FINALLY_TARGET(i->opcode)) {
1818 if(i->opcode == OPCODE___RETHROW__ ||
1819 i->opcode == OPCODE_RETURNVALUE) {
1820 if(i->opcode == OPCODE___RETHROW__)
1821 i->opcode = OPCODE_THROW;
1823 p = abc_coerce_a(p);
1824 p = abc_setlocal(p, tempvar);
1826 p = abc_pushbyte(p, count++);
1827 p = abc_jump(p, finally_label);
1828 code_t*target = p = abc_label(p);
1829 #ifdef NEED_EXTRA_STACK_ARG
1833 p = abc_getlocal(p, tempvar);
1836 p->next = i;i->prev = p;
1837 list_append(l->targets, target);
1843 c = abc_pushbyte(c, -1);
1844 c = code_append(c, finally_label);
1845 c = code_append(c, finally);
1847 #ifdef NEED_EXTRA_STACK_ARG
1850 c = abc_lookupswitch(c, l);
1851 c = l->def = abc_label(c);
1852 #ifdef NEED_EXTRA_STACK_ARG
1859 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1863 code_t*prev = i->prev;
1864 if(IS_FINALLY_TARGET(i->opcode)) {
1865 if(i->opcode == OPCODE___RETHROW__)
1866 i->opcode = OPCODE_THROW;
1867 code_t*end = code_dup(finally);
1868 code_t*start = code_start(end);
1869 if(prev) prev->next = start;
1876 return code_append(c, finally);
1879 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1885 int num_insertion_points=0;
1887 if(IS_FINALLY_TARGET(i->opcode))
1888 num_insertion_points++;
1895 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1900 int simple_version_cost = (1+num_insertion_points)*code_size;
1901 int lookup_version_cost = 4*num_insertion_points + 5;
1903 if(cantdup || simple_version_cost > lookup_version_cost) {
1904 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1905 return insert_finally_lookup(c, finally, tempvar);
1907 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1908 return insert_finally_simple(c, finally, tempvar);
1912 #define PASS1 }} if(as3_pass == 1) {{
1913 #define PASS1END }} if(as3_pass == 2) {{
1914 #define PASS2 }} if(as3_pass == 2) {{
1915 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1916 #define PASS12END }} if(as3_pass == 2) {{
1917 #define PASS_ALWAYS }} {{
1921 /* Line 273 of skeleton.m4 */
1922 #line 1923 "parser.tab.c"
1923 /* Unqualified %code blocks. */
1925 /* Line 274 of skeleton.m4 */
1926 #line 2000 "parser.y"
1928 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1934 /* Line 274 of skeleton.m4 */
1935 #line 2450 "parser.y"
1937 static void state_has_imports()
1939 state->wildcard_imports = list_clone(state->wildcard_imports);
1940 state->imports = dict_clone(state->imports);
1941 state->has_own_imports = 1;
1943 static void import_toplevel(const char*package)
1945 char* s = strdup(package);
1947 dict_put(state->import_toplevel_packages, s, 0);
1948 char*x = strrchr(s, '.');
1957 /* Line 274 of skeleton.m4 */
1958 #line 2583 "parser.y"
1960 static int slotstate_varconst = 0;
1961 static modifiers_t*slotstate_flags = 0;
1962 static void setslotstate(modifiers_t* flags, int varconst)
1964 slotstate_varconst = varconst;
1965 slotstate_flags = flags;
1968 if(flags->flags&FLAG_STATIC) {
1969 state->method = state->cls->static_init;
1971 state->method = state->cls->init;
1974 // reset to "default" state (all in class code is static by default) */
1975 state->method = state->cls->static_init;
1978 parserassert(state->method);
1981 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
1983 int flags = modifiers->flags;
1984 namespace_t ns = modifiers2access(modifiers);
1987 multiname_t mname = {QNAME, &ns, 0, name};
1989 trait_list_t**traits;
1993 ns.name = state->package;
1994 traits = &global->init->traits;
1995 code = &global->init->method->body->code;
1996 } else if(flags&FLAG_STATIC) {
1998 traits = &state->cls->abc->static_traits;
1999 code = &state->cls->static_init->header;
2001 // instance variable
2002 traits = &state->cls->abc->traits;
2003 code = &state->cls->init->header;
2005 if(ns.access == ACCESS_PROTECTED) {
2006 ns.name = concat3(state->cls->info->package,":",state->cls->info->name);
2012 *m = *multiname_clone(&mname);
2014 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
2018 /* Line 274 of skeleton.m4 */
2019 #line 2767 "parser.y"
2021 static int xml_level = 0;
2024 /* Line 274 of skeleton.m4 */
2025 #line 3546 "parser.y"
2027 node_t* resolve_identifier(char*name)
2037 /* look at variables */
2038 if((v = find_variable(state, name))) {
2039 // name is a local variable
2040 o.c = abc_getlocal(o.c, v->index);
2042 return mkcodenode(o);
2044 if((v = find_slot(state, name))) {
2045 o.c = abc_getscopeobject(o.c, 1);
2046 o.c = abc_getslot(o.c, v->index);
2048 return mkcodenode(o);
2051 int i_am_static = state->method->is_static;
2053 /* look at current class' members */
2054 if(!state->method->inner &&
2055 !state->xmlfilter &&
2057 (f = findmember_nsset(state->cls->info, name, 1)))
2059 // name is a member or attribute in this class
2060 int var_is_static = (f->flags&FLAG_STATIC);
2062 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2063 /* if the variable is a constant (and we know what is evaluates to), we
2064 can just use the value itself */
2065 varinfo_t*v = (varinfo_t*)f;
2067 return mkconstnode(v->value);
2071 if(var_is_static >= i_am_static) {
2072 if(f->kind == INFOTYPE_METHOD) {
2073 o.t = TYPE_FUNCTION(f);
2078 if(var_is_static && !i_am_static) {
2079 /* access to a static member from a non-static location.
2080 do this via findpropstrict:
2081 there doesn't seem to be any non-lookup way to access
2082 static properties of a class */
2083 state->method->late_binding = 1;
2085 namespace_t ns = {f->access, f->package};
2086 multiname_t m = {QNAME, &ns, 0, name};
2087 o.c = abc_findpropstrict2(o.c, &m);
2088 o.c = abc_getproperty2(o.c, &m);
2089 return mkcodenode(o);
2090 } else if(f->slot>0) {
2091 o.c = abc_getlocal_0(o.c);
2092 o.c = abc_getslot(o.c, f->slot);
2093 return mkcodenode(o);
2095 MEMBER_MULTINAME(m, f, name);
2096 o.c = abc_getlocal_0(o.c);
2097 o.c = abc_getproperty2(o.c, &m);
2098 return mkcodenode(o);
2103 /* look at actual classes, in the current package and imported */
2104 if(!state->xmlfilter && (a = find_class(name))) {
2105 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2106 o.c = abc_getlocal_0(0);
2107 o.t = TYPE_CLASS((classinfo_t*)a);
2111 return mkcodenode(o);
2114 /* look through package prefixes */
2115 if(!state->xmlfilter &&
2116 (dict_contains(state->import_toplevel_packages, name) ||
2117 registry_ispackage(name))) {
2118 o.c = abc___pushpackage__(o.c, name);
2120 return mkcodenode(o); //?
2123 /* unknown object, let the avm2 resolve it */
2125 if(!state->method->inner && !state->xmlfilter) {
2126 /* we really should make inner functions aware of the class context */
2127 as3_warning("Couldn't resolve '%s', doing late binding", name);
2129 state->method->late_binding = 1;
2131 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2134 o.c = abc_findpropstrict2(o.c, &m);
2135 o.c = abc_getproperty2(o.c, &m);
2136 return mkcodenode(o);
2141 /* Line 274 of skeleton.m4 */
2142 #line 3688 "parser.y"
2144 void add_active_url(const char*url)
2148 list_append(state->active_namespace_urls, n);
2153 /* Line 274 of skeleton.m4 */
2154 #line 2155 "parser.tab.c"
2161 typedef YYTYPE_UINT8 yytype_uint8;
2163 typedef unsigned char yytype_uint8;
2167 typedef YYTYPE_INT8 yytype_int8;
2168 #elif (defined __STDC__ || defined __C99__FUNC__ \
2169 || defined __cplusplus || defined _MSC_VER)
2170 typedef signed char yytype_int8;
2172 typedef short int yytype_int8;
2175 #ifdef YYTYPE_UINT16
2176 typedef YYTYPE_UINT16 yytype_uint16;
2178 typedef unsigned short int yytype_uint16;
2182 typedef YYTYPE_INT16 yytype_int16;
2184 typedef short int yytype_int16;
2188 # ifdef __SIZE_TYPE__
2189 # define YYSIZE_T __SIZE_TYPE__
2190 # elif defined size_t
2191 # define YYSIZE_T size_t
2192 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2193 || defined __cplusplus || defined _MSC_VER)
2194 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2195 # define YYSIZE_T size_t
2197 # define YYSIZE_T unsigned int
2201 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2206 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2207 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2211 # define YY_(msgid) msgid
2215 /* Suppress unused-variable warnings by "using" E. */
2216 #if ! defined lint || defined __GNUC__
2217 # define YYUSE(e) ((void) (e))
2219 # define YYUSE(e) /* empty */
2222 /* Identity function, used to suppress warnings about constant conditions. */
2224 # define YYID(n) (n)
2226 #if (defined __STDC__ || defined __C99__FUNC__ \
2227 || defined __cplusplus || defined _MSC_VER)
2240 #if ! defined yyoverflow || YYERROR_VERBOSE
2242 /* The parser invokes alloca or malloc; define the necessary symbols. */
2244 # ifdef YYSTACK_USE_ALLOCA
2245 # if YYSTACK_USE_ALLOCA
2247 # define YYSTACK_ALLOC __builtin_alloca
2248 # elif defined __BUILTIN_VA_ARG_INCR
2249 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2251 # define YYSTACK_ALLOC __alloca
2252 # elif defined _MSC_VER
2253 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2254 # define alloca _alloca
2256 # define YYSTACK_ALLOC alloca
2257 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2258 || defined __cplusplus || defined _MSC_VER)
2259 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2261 # define _STDLIB_H 1
2268 # ifdef YYSTACK_ALLOC
2269 /* Pacify GCC's `empty if-body' warning. */
2270 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2271 # ifndef YYSTACK_ALLOC_MAXIMUM
2272 /* The OS might guarantee only one guard page at the bottom of the stack,
2273 and a page size can be as small as 4096 bytes. So we cannot safely
2274 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2275 to allow for a few compiler-allocated temporary stack slots. */
2276 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2279 # define YYSTACK_ALLOC YYMALLOC
2280 # define YYSTACK_FREE YYFREE
2281 # ifndef YYSTACK_ALLOC_MAXIMUM
2282 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2284 # if (defined __cplusplus && ! defined _STDLIB_H \
2285 && ! ((defined YYMALLOC || defined malloc) \
2286 && (defined YYFREE || defined free)))
2287 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2289 # define _STDLIB_H 1
2293 # define YYMALLOC malloc
2294 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2295 || defined __cplusplus || defined _MSC_VER)
2296 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2300 # define YYFREE free
2301 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2302 || defined __cplusplus || defined _MSC_VER)
2303 void free (void *); /* INFRINGES ON USER NAME SPACE */
2307 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2310 #if (! defined yyoverflow \
2311 && (! defined __cplusplus \
2312 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2314 /* A type that is properly aligned for any stack member. */
2317 yytype_int16 yyss_alloc;
2321 /* The size of the maximum gap between one aligned stack and the next. */
2322 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2324 /* The size of an array large to enough to hold all stacks, each with
2326 # define YYSTACK_BYTES(N) \
2327 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2328 + YYSTACK_GAP_MAXIMUM)
2330 /* Copy COUNT objects from FROM to TO. The source and destination do
2333 # if defined __GNUC__ && 1 < __GNUC__
2334 # define YYCOPY(To, From, Count) \
2335 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2337 # define YYCOPY(To, From, Count) \
2341 for (yyi = 0; yyi < (Count); yyi++) \
2342 (To)[yyi] = (From)[yyi]; \
2348 /* Relocate STACK from its old location to the new one. The
2349 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2350 elements in the stack, and YYPTR gives the new location of the
2351 stack. Advance YYPTR to a properly aligned location for the next
2353 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2356 YYSIZE_T yynewbytes; \
2357 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2358 Stack = &yyptr->Stack_alloc; \
2359 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2360 yyptr += yynewbytes / sizeof (*yyptr); \
2366 /* YYFINAL -- State number of the termination state. */
2368 /* YYLAST -- Last index in YYTABLE. */
2371 /* YYNTOKENS -- Number of terminals. */
2372 #define YYNTOKENS 136
2373 /* YYNNTS -- Number of nonterminals. */
2375 /* YYNRULES -- Number of rules. */
2376 #define YYNRULES 351
2377 /* YYNRULES -- Number of states. */
2378 #define YYNSTATES 598
2380 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2381 #define YYUNDEFTOK 2
2382 #define YYMAXUTOK 365
2384 #define YYTRANSLATE(YYX) \
2385 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2387 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2388 static const yytype_uint8 yytranslate[] =
2390 0, 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, 120, 2, 2, 2, 118, 109, 2,
2394 124, 135, 117, 115, 102, 114, 129, 116, 2, 2,
2395 2, 2, 2, 2, 2, 2, 2, 2, 106, 101,
2396 111, 104, 112, 105, 130, 2, 2, 2, 2, 2,
2397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2399 2, 126, 2, 127, 108, 2, 2, 2, 2, 2,
2400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2402 2, 2, 2, 128, 107, 134, 119, 2, 2, 2,
2403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2415 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2416 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2417 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2418 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2419 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2420 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2421 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2422 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2423 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2424 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2425 95, 96, 97, 98, 99, 100, 103, 110, 113, 121,
2426 122, 123, 125, 131, 132, 133
2430 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2432 static const yytype_uint16 yyprhs[] =
2434 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2435 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2436 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2437 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2438 85, 87, 89, 91, 95, 98, 100, 102, 104, 106,
2439 108, 110, 112, 117, 120, 122, 124, 128, 131, 132,
2440 135, 138, 140, 144, 148, 149, 152, 153, 161, 162,
2441 164, 166, 170, 172, 175, 179, 188, 195, 196, 203,
2442 204, 212, 214, 217, 219, 222, 223, 225, 227, 230,
2443 232, 235, 240, 244, 245, 254, 255, 265, 266, 272,
2444 274, 277, 279, 282, 284, 285, 292, 295, 297, 302,
2445 305, 307, 309, 311, 313, 317, 319, 320, 327, 328,
2446 334, 337, 342, 343, 345, 347, 350, 352, 354, 356,
2447 358, 360, 362, 364, 366, 368, 370, 371, 374, 375,
2448 378, 379, 382, 383, 393, 394, 403, 404, 406, 408,
2449 411, 413, 418, 420, 422, 424, 425, 427, 429, 432,
2450 434, 437, 446, 448, 450, 451, 456, 458, 462, 466,
2451 467, 470, 472, 474, 476, 478, 480, 482, 484, 486,
2452 488, 490, 492, 494, 495, 496, 501, 502, 507, 508,
2453 511, 514, 517, 520, 524, 526, 528, 539, 546, 558,
2454 559, 561, 563, 566, 568, 572, 576, 580, 584, 585,
2455 587, 590, 595, 599, 601, 606, 609, 611, 613, 614,
2456 615, 628, 630, 631, 632, 643, 645, 649, 651, 653,
2457 655, 659, 661, 663, 665, 668, 669, 670, 674, 675,
2458 677, 679, 681, 684, 687, 688, 693, 698, 703, 706,
2459 708, 711, 713, 715, 717, 721, 723, 727, 728, 730,
2460 732, 734, 736, 738, 740, 744, 750, 752, 754, 756,
2461 758, 760, 762, 764, 766, 768, 770, 774, 778, 782,
2462 786, 790, 794, 798, 802, 806, 810, 814, 818, 821,
2463 824, 828, 832, 836, 840, 844, 848, 852, 856, 860,
2464 864, 868, 872, 876, 880, 884, 889, 892, 894, 898,
2465 901, 906, 910, 914, 918, 922, 926, 930, 934, 938,
2466 942, 946, 950, 954, 960, 963, 966, 969, 972, 976,
2467 979, 980, 987, 989, 991, 993, 995, 997, 1003, 1007,
2468 1013, 1018, 1023, 1030, 1037, 1041, 1043, 1046, 1051, 1056,
2472 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2473 static const yytype_int16 yyrhs[] =
2475 137, 0, -1, 138, -1, -1, 139, -1, 140, -1,
2476 139, 140, -1, 188, -1, 200, -1, 198, -1, 234,
2477 -1, 209, -1, 149, -1, 150, 128, 138, 134, -1,
2478 101, -1, -1, 142, -1, 143, -1, 142, 143, -1,
2479 200, -1, 198, -1, 234, -1, 209, -1, 149, -1,
2480 150, 128, 141, 134, -1, 101, -1, 145, -1, -1,
2481 145, 147, -1, 147, -1, 269, -1, 191, -1, 161,
2482 -1, 162, -1, 163, -1, 165, -1, 173, -1, 156,
2483 -1, 185, -1, 181, -1, 257, -1, 270, -1, 268,
2484 -1, 128, 145, 134, -1, 128, 134, -1, 101, -1,
2485 146, -1, 152, -1, 167, -1, 168, -1, 253, -1,
2486 183, -1, 150, 128, 145, 134, -1, 147, 101, -1,
2487 147, -1, 146, -1, 3, 91, 3, -1, 104, 261,
2488 -1, -1, 46, 153, -1, 32, 153, -1, 154, -1,
2489 153, 102, 154, -1, 3, 244, 151, -1, -1, 66,
2490 148, -1, -1, 65, 124, 157, 255, 135, 148, 155,
2491 -1, -1, 152, -1, 257, -1, 46, 3, 244, -1,
2492 3, -1, 11, 124, -1, 11, 50, 124, -1, 160,
2493 158, 101, 255, 101, 257, 135, 148, -1, 160, 159,
2494 69, 255, 135, 148, -1, -1, 12, 124, 164, 255,
2495 135, 148, -1, -1, 13, 166, 148, 12, 124, 255,
2496 135, -1, 67, -1, 67, 3, -1, 30, -1, 30,
2497 3, -1, -1, 170, -1, 172, -1, 170, 172, -1,
2498 171, -1, 170, 171, -1, 34, 261, 106, 144, -1,
2499 62, 106, 144, -1, -1, 14, 124, 174, 261, 135,
2500 128, 169, 134, -1, -1, 33, 124, 3, 244, 135,
2501 176, 128, 144, 134, -1, -1, 27, 128, 178, 144,
2502 134, -1, 175, -1, 179, 175, -1, 179, -1, 179,
2503 177, -1, 177, -1, -1, 52, 128, 182, 144, 134,
2504 180, -1, 37, 255, -1, 37, -1, 39, 124, 255,
2505 135, -1, 184, 148, -1, 3, -1, 17, -1, 16,
2506 -1, 4, -1, 187, 129, 186, -1, 186, -1, -1,
2507 17, 187, 128, 189, 141, 134, -1, -1, 17, 128,
2508 190, 141, 134, -1, 41, 240, -1, 41, 187, 129,
2509 117, -1, -1, 193, -1, 194, -1, 193, 194, -1,
2510 20, -1, 21, -1, 18, -1, 38, -1, 47, -1,
2511 49, -1, 48, -1, 25, -1, 23, -1, 4, -1,
2512 -1, 54, 241, -1, -1, 54, 242, -1, -1, 15,
2513 242, -1, -1, 192, 31, 3, 195, 197, 128, 199,
2514 202, 134, -1, -1, 192, 44, 3, 196, 128, 201,
2515 205, 134, -1, -1, 203, -1, 204, -1, 203, 204,
2516 -1, 101, -1, 150, 128, 202, 134, -1, 209, -1,
2517 234, -1, 146, -1, -1, 206, -1, 207, -1, 206,
2518 207, -1, 101, -1, 46, 3, -1, 192, 26, 233,
2519 3, 124, 230, 135, 244, -1, 46, -1, 32, -1,
2520 -1, 192, 208, 210, 211, -1, 212, -1, 211, 102,
2521 212, -1, 3, 244, 151, -1, -1, 104, 261, -1,
2522 8, -1, 9, -1, 10, -1, 5, -1, 56, -1,
2523 55, -1, 45, -1, 28, -1, 29, -1, 226, -1,
2524 111, -1, 112, -1, -1, -1, 128, 261, 220, 134,
2525 -1, -1, 128, 261, 222, 134, -1, -1, 223, 219,
2526 -1, 223, 5, -1, 223, 112, -1, 226, 223, -1,
2527 224, 226, 223, -1, 3, -1, 221, -1, 216, 225,
2528 227, 217, 223, 111, 116, 225, 218, 112, -1, 216,
2529 225, 227, 116, 218, 112, -1, 216, 225, 227, 217,
2530 223, 224, 111, 116, 225, 218, 112, -1, -1, 228,
2531 -1, 229, -1, 228, 229, -1, 221, -1, 221, 104,
2532 5, -1, 221, 104, 221, -1, 3, 104, 221, -1,
2533 3, 104, 5, -1, -1, 231, -1, 95, 232, -1,
2534 231, 102, 95, 232, -1, 231, 102, 232, -1, 232,
2535 -1, 3, 106, 243, 213, -1, 3, 213, -1, 51,
2536 -1, 35, -1, -1, -1, 192, 26, 233, 3, 124,
2537 230, 135, 244, 128, 235, 144, 134, -1, 3, -1,
2538 -1, -1, 26, 236, 124, 230, 135, 244, 128, 238,
2539 144, 134, -1, 186, -1, 187, 129, 186, -1, 240,
2540 -1, 239, -1, 241, -1, 242, 102, 241, -1, 241,
2541 -1, 117, -1, 36, -1, 106, 243, -1, -1, -1,
2542 124, 246, 135, -1, -1, 247, -1, 248, -1, 254,
2543 -1, 247, 102, -1, 248, 254, -1, -1, 24, 261,
2544 249, 245, -1, 261, 124, 246, 135, -1, 53, 124,
2545 246, 135, -1, 64, 261, -1, 42, -1, 42, 255,
2546 -1, 261, -1, 256, -1, 261, -1, 256, 102, 261,
2547 -1, 261, -1, 257, 102, 261, -1, -1, 260, -1,
2548 3, -1, 5, -1, 8, -1, 9, -1, 10, -1,
2549 259, 106, 254, -1, 260, 102, 259, 106, 254, -1,
2550 237, -1, 265, -1, 250, -1, 252, -1, 251, -1,
2551 266, -1, 214, -1, 215, -1, 6, -1, 19, -1,
2552 126, 246, 127, -1, 71, 258, 134, -1, 261, 111,
2553 261, -1, 261, 112, 261, -1, 261, 76, 261, -1,
2554 261, 77, 261, -1, 261, 72, 261, -1, 261, 73,
2555 261, -1, 261, 75, 261, -1, 261, 74, 261, -1,
2556 261, 89, 261, -1, 261, 90, 261, -1, 120, 261,
2557 -1, 119, 261, -1, 261, 109, 261, -1, 261, 108,
2558 261, -1, 261, 107, 261, -1, 261, 98, 261, -1,
2559 261, 97, 261, -1, 261, 96, 261, -1, 261, 116,
2560 261, -1, 261, 118, 261, -1, 261, 115, 261, -1,
2561 261, 114, 261, -1, 261, 117, 261, -1, 261, 69,
2562 261, -1, 261, 70, 261, -1, 261, 40, 261, -1,
2563 261, 68, 261, -1, 43, 124, 261, 135, -1, 36,
2564 261, -1, 36, -1, 124, 256, 135, -1, 114, 261,
2565 -1, 261, 126, 261, 127, -1, 261, 81, 261, -1,
2566 261, 80, 261, -1, 261, 87, 261, -1, 261, 86,
2567 261, -1, 261, 88, 261, -1, 261, 79, 261, -1,
2568 261, 78, 261, -1, 261, 85, 261, -1, 261, 82,
2569 261, -1, 261, 83, 261, -1, 261, 84, 261, -1,
2570 261, 104, 261, -1, 261, 105, 261, 106, 261, -1,
2571 261, 93, -1, 261, 92, -1, 93, 261, -1, 92,
2572 261, -1, 53, 129, 3, -1, 130, 3, -1, -1,
2573 261, 129, 124, 262, 261, 135, -1, 3, -1, 117,
2574 -1, 4, -1, 186, -1, 117, -1, 261, 129, 263,
2575 91, 264, -1, 261, 94, 264, -1, 261, 129, 126,
2576 261, 127, -1, 261, 129, 130, 264, -1, 261, 94,
2577 130, 264, -1, 261, 129, 130, 126, 261, 127, -1,
2578 261, 94, 130, 126, 261, 127, -1, 261, 129, 264,
2579 -1, 3, -1, 16, 3, -1, 16, 3, 104, 3,
2580 -1, 16, 3, 104, 5, -1, 192, 267, -1, 63,
2581 16, 104, 261, -1, 22, 16, 241, -1
2584 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2585 static const yytype_uint16 yyrline[] =
2587 0, 1904, 1904, 1906, 1906, 1907, 1908, 1910, 1911, 1912,
2588 1913, 1914, 1915, 1916, 1917, 1919, 1919, 1920, 1921, 1923,
2589 1924, 1925, 1926, 1927, 1928, 1929, 1931, 1932, 1934, 1937,
2590 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949,
2591 1950, 1951, 1952, 1953, 1954, 1957, 1958, 1959, 1960, 1961,
2592 1962, 1963, 1964, 1976, 1977, 1981, 1988, 2007, 2008, 2010,
2593 2011, 2013, 2014, 2016, 2076, 2077, 2080, 2080, 2099, 2100,
2594 2101, 2106, 2110, 2115, 2116, 2118, 2138, 2186, 2186, 2205,
2595 2205, 2220, 2223, 2226, 2229, 2233, 2234, 2235, 2236, 2237,
2596 2238, 2240, 2251, 2254, 2254, 2285, 2285, 2310, 2310, 2326,
2597 2327, 2328, 2329, 2337, 2346, 2346, 2395, 2399, 2410, 2420,
2598 2437, 2438, 2439, 2440, 2442, 2443, 2445, 2445, 2447, 2447,
2599 2470, 2484, 2500, 2501, 2502, 2503, 2510, 2511, 2512, 2513,
2600 2514, 2515, 2516, 2517, 2518, 2519, 2523, 2524, 2526, 2527,
2601 2529, 2530, 2534, 2532, 2540, 2538, 2547, 2548, 2549, 2550,
2602 2551, 2552, 2553, 2554, 2556, 2562, 2563, 2564, 2565, 2566,
2603 2567, 2570, 2642, 2642, 2644, 2644, 2646, 2647, 2649, 2733,
2604 2734, 2743, 2744, 2747, 2748, 2749, 2750, 2751, 2752, 2753,
2605 2771, 2773, 2774, 2775, 2777, 2777, 2781, 2781, 2785, 2786,
2606 2789, 2790, 2792, 2793, 2795, 2796, 2798, 2802, 2805, 2810,
2607 2811, 2812, 2813, 2815, 2818, 2822, 2825, 2828, 2838, 2842,
2608 2848, 2854, 2862, 2867, 2873, 2881, 2889, 2890, 2891, 2894,
2609 2893, 2910, 2911, 2913, 2912, 2936, 2955, 2969, 2970, 2972,
2610 2973, 2975, 2976, 2977, 2986, 2987, 2991, 2992, 2994, 2995,
2611 2996, 2998, 3002, 3003, 3008, 3009, 3053, 3103, 3124, 3146,
2612 3149, 3156, 3159, 3162, 3165, 3168, 3171, 3176, 3177, 3179,
2613 3180, 3181, 3182, 3183, 3185, 3191, 3200, 3201, 3202, 3203,
2614 3204, 3205, 3207, 3211, 3223, 3241, 3252, 3262, 3271, 3272,
2615 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282,
2616 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292,
2617 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302,
2618 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312,
2619 3313, 3314, 3315, 3316, 3318, 3319, 3320, 3321, 3323, 3338,
2620 3346, 3346, 3400, 3401, 3402, 3403, 3404, 3412, 3430, 3437,
2621 3448, 3455, 3462, 3472, 3483, 3661, 3697, 3704, 3711, 3718,
2626 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2627 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2628 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2629 static const char *const yytname[] =
2631 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2632 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2633 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2634 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2635 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2636 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2637 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2638 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2639 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2640 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2641 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2642 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2643 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"",
2644 "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"",
2645 "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"",
2646 "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"",
2647 "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"",
2648 "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"",
2649 "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2650 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2651 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2652 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2653 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2654 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2655 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2656 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2657 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2658 "PACKAGE_INITCODE", "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION",
2659 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2660 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2661 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2662 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2663 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2664 "TRY", "$@7", "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE",
2665 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2666 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2667 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2668 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2669 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2670 "SLOT_DECLARATION", "$@12", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT",
2671 "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@13",
2672 "XMLEXPR2", "$@14", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", "XMLNODE",
2673 "MAYBE_XMLATTRIBUTES", "XMLATTRIBUTES", "XMLATTRIBUTE",
2674 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2675 "FUNCTION_DECLARATION", "$@15", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2676 "$@16", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2677 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2678 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2679 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2680 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2681 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@17", "ID_OR_NS", "SUBNODE",
2682 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2683 "DEFAULT_NAMESPACE", "USE_NAMESPACE", 0
2688 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2690 static const yytype_uint16 yytoknum[] =
2692 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2693 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2694 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2695 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2696 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2697 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2698 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2699 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2700 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2701 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2702 355, 59, 44, 356, 61, 63, 58, 124, 94, 38,
2703 357, 60, 62, 358, 45, 43, 47, 42, 37, 126,
2704 33, 359, 360, 361, 40, 362, 91, 93, 123, 46,
2705 64, 363, 364, 365, 125, 41
2709 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2710 static const yytype_uint16 yyr1[] =
2712 0, 136, 137, 138, 138, 139, 139, 140, 140, 140,
2713 140, 140, 140, 140, 140, 141, 141, 142, 142, 143,
2714 143, 143, 143, 143, 143, 143, 144, 144, 145, 145,
2715 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
2716 146, 146, 146, 146, 146, 147, 147, 147, 147, 147,
2717 147, 147, 147, 148, 148, 149, 150, 151, 151, 152,
2718 152, 153, 153, 154, 155, 155, 157, 156, 158, 158,
2719 158, 159, 159, 160, 160, 161, 162, 164, 163, 166,
2720 165, 167, 167, 168, 168, 169, 169, 169, 169, 170,
2721 170, 171, 172, 174, 173, 176, 175, 178, 177, 179,
2722 179, 180, 180, 180, 182, 181, 183, 183, 184, 185,
2723 186, 186, 186, 186, 187, 187, 189, 188, 190, 188,
2724 191, 191, 192, 192, 193, 193, 194, 194, 194, 194,
2725 194, 194, 194, 194, 194, 194, 195, 195, 196, 196,
2726 197, 197, 199, 198, 201, 200, 202, 202, 203, 203,
2727 204, 204, 204, 204, 204, 205, 205, 206, 206, 207,
2728 207, 207, 208, 208, 210, 209, 211, 211, 212, 213,
2729 213, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2730 215, 216, 217, 218, 220, 219, 222, 221, 223, 223,
2731 223, 223, 224, 224, 225, 225, 226, 226, 226, 227,
2732 227, 228, 228, 229, 229, 229, 229, 229, 230, 230,
2733 230, 230, 231, 231, 232, 232, 233, 233, 233, 235,
2734 234, 236, 236, 238, 237, 239, 240, 241, 241, 242,
2735 242, 243, 243, 243, 244, 244, 245, 245, 246, 246,
2736 246, 247, 248, 247, 249, 250, 251, 251, 252, 253,
2737 253, 254, 255, 256, 256, 257, 257, 258, 258, 259,
2738 259, 259, 259, 259, 260, 260, 261, 261, 261, 261,
2739 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2740 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2741 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2742 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2743 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2744 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2745 262, 261, 263, 263, 263, 264, 264, 261, 261, 261,
2746 261, 261, 261, 261, 265, 266, 267, 267, 267, 268,
2750 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2751 static const yytype_uint8 yyr2[] =
2753 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2754 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2755 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2756 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2757 1, 1, 1, 3, 2, 1, 1, 1, 1, 1,
2758 1, 1, 4, 2, 1, 1, 3, 2, 0, 2,
2759 2, 1, 3, 3, 0, 2, 0, 7, 0, 1,
2760 1, 3, 1, 2, 3, 8, 6, 0, 6, 0,
2761 7, 1, 2, 1, 2, 0, 1, 1, 2, 1,
2762 2, 4, 3, 0, 8, 0, 9, 0, 5, 1,
2763 2, 1, 2, 1, 0, 6, 2, 1, 4, 2,
2764 1, 1, 1, 1, 3, 1, 0, 6, 0, 5,
2765 2, 4, 0, 1, 1, 2, 1, 1, 1, 1,
2766 1, 1, 1, 1, 1, 1, 0, 2, 0, 2,
2767 0, 2, 0, 9, 0, 8, 0, 1, 1, 2,
2768 1, 4, 1, 1, 1, 0, 1, 1, 2, 1,
2769 2, 8, 1, 1, 0, 4, 1, 3, 3, 0,
2770 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2771 1, 1, 1, 0, 0, 4, 0, 4, 0, 2,
2772 2, 2, 2, 3, 1, 1, 10, 6, 11, 0,
2773 1, 1, 2, 1, 3, 3, 3, 3, 0, 1,
2774 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2775 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2776 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2777 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2778 2, 1, 1, 1, 3, 1, 3, 0, 1, 1,
2779 1, 1, 1, 1, 3, 5, 1, 1, 1, 1,
2780 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
2781 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2782 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2783 3, 3, 3, 3, 3, 4, 2, 1, 3, 2,
2784 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2785 3, 3, 3, 5, 2, 2, 2, 2, 3, 2,
2786 0, 6, 1, 1, 1, 1, 1, 5, 3, 5,
2787 4, 4, 6, 6, 3, 1, 2, 4, 4, 2,
2791 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2792 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2793 means the default is an error. */
2794 static const yytype_uint16 yydefact[] =
2796 122, 345, 135, 174, 274, 171, 172, 173, 0, 0,
2797 79, 0, 0, 128, 275, 126, 127, 0, 134, 0,
2798 133, 222, 178, 179, 307, 129, 0, 0, 0, 177,
2799 130, 132, 131, 0, 0, 176, 175, 0, 0, 0,
2800 257, 0, 0, 14, 181, 0, 0, 0, 0, 238,
2801 122, 0, 0, 2, 122, 5, 55, 12, 0, 37,
2802 68, 32, 33, 34, 35, 36, 39, 122, 38, 7,
2803 31, 0, 123, 124, 9, 8, 11, 272, 273, 0,
2804 180, 10, 266, 268, 270, 269, 40, 255, 267, 271,
2805 42, 30, 41, 0, 0, 73, 77, 122, 93, 110,
2806 113, 112, 111, 118, 115, 0, 0, 345, 244, 221,
2807 0, 306, 0, 0, 120, 0, 104, 238, 0, 0,
2808 248, 66, 259, 260, 261, 262, 263, 0, 0, 258,
2809 327, 326, 309, 289, 288, 0, 253, 0, 239, 240,
2810 241, 251, 83, 0, 107, 249, 0, 81, 45, 44,
2811 122, 46, 29, 0, 47, 48, 49, 51, 0, 50,
2812 329, 1, 6, 122, 345, 0, 69, 0, 0, 70,
2813 54, 109, 0, 218, 0, 163, 0, 162, 164, 349,
2814 125, 194, 0, 195, 199, 0, 0, 0, 0, 0,
2815 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2816 0, 0, 0, 0, 0, 0, 0, 0, 0, 325,
2817 324, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2818 0, 0, 0, 0, 0, 0, 0, 238, 0, 0,
2819 56, 74, 0, 0, 0, 122, 116, 0, 225, 0,
2820 228, 227, 351, 236, 208, 0, 252, 0, 0, 27,
2821 0, 328, 0, 0, 277, 0, 0, 0, 308, 276,
2822 242, 243, 84, 235, 60, 61, 106, 250, 59, 82,
2823 43, 28, 122, 0, 235, 0, 0, 53, 346, 217,
2824 216, 0, 136, 138, 0, 186, 0, 203, 0, 200,
2825 201, 256, 303, 304, 301, 302, 282, 283, 285, 284,
2826 280, 281, 317, 316, 312, 311, 319, 320, 321, 318,
2827 314, 313, 315, 286, 287, 336, 0, 335, 338, 295,
2828 294, 293, 322, 0, 292, 291, 290, 278, 279, 299,
2829 298, 296, 300, 297, 0, 0, 110, 113, 336, 330,
2830 0, 0, 0, 344, 0, 0, 0, 25, 0, 122,
2831 17, 23, 0, 20, 19, 22, 21, 122, 114, 0,
2832 238, 245, 169, 0, 0, 209, 213, 108, 121, 226,
2833 305, 0, 26, 247, 350, 0, 264, 0, 254, 0,
2834 58, 0, 122, 13, 58, 0, 0, 0, 0, 0,
2835 140, 0, 0, 235, 165, 166, 0, 0, 0, 182,
2836 183, 188, 202, 0, 341, 0, 246, 310, 0, 0,
2837 0, 340, 0, 122, 0, 0, 119, 18, 122, 0,
2838 0, 0, 0, 215, 210, 235, 0, 0, 122, 0,
2839 233, 232, 231, 234, 0, 63, 62, 52, 0, 122,
2840 347, 348, 208, 137, 0, 0, 229, 139, 144, 58,
2841 0, 187, 207, 206, 204, 205, 0, 0, 0, 323,
2842 0, 339, 0, 337, 78, 0, 85, 0, 117, 237,
2843 170, 169, 0, 0, 212, 0, 0, 99, 103, 101,
2844 105, 64, 265, 57, 0, 76, 0, 141, 142, 0,
2845 122, 168, 167, 197, 190, 181, 191, 0, 189, 0,
2846 188, 343, 331, 342, 80, 0, 0, 0, 86, 89,
2847 87, 24, 214, 223, 211, 97, 0, 100, 102, 122,
2848 67, 122, 235, 122, 230, 0, 159, 0, 0, 122,
2849 157, 0, 184, 181, 188, 192, 0, 27, 94, 90,
2850 88, 27, 27, 235, 65, 75, 0, 150, 154, 0,
2851 0, 0, 122, 148, 152, 153, 160, 218, 145, 158,
2852 183, 0, 0, 193, 27, 92, 0, 0, 0, 219,
2853 122, 143, 149, 0, 0, 185, 183, 91, 224, 98,
2854 95, 27, 0, 0, 196, 0, 0, 0, 151, 208,
2855 198, 27, 220, 0, 0, 235, 96, 161
2858 /* YYDEFGOTO[NTERM-NUM]. */
2859 static const yytype_int16 yydefgoto[] =
2861 -1, 52, 53, 54, 55, 348, 349, 350, 371, 372,
2862 151, 152, 171, 351, 153, 435, 154, 268, 265, 520,
2863 59, 253, 167, 168, 60, 61, 62, 63, 232, 64,
2864 97, 155, 156, 507, 508, 509, 510, 65, 234, 477,
2865 586, 478, 542, 479, 480, 66, 249, 157, 67, 68,
2866 238, 239, 69, 357, 235, 70, 158, 72, 73, 390,
2867 392, 445, 353, 523, 354, 490, 551, 552, 553, 528,
2868 529, 530, 178, 355, 284, 394, 395, 423, 77, 78,
2869 79, 401, 456, 498, 561, 183, 396, 457, 499, 184,
2870 80, 288, 289, 290, 364, 365, 366, 281, 356, 581,
2871 110, 82, 541, 240, 241, 432, 447, 433, 380, 361,
2872 137, 138, 139, 243, 83, 84, 85, 159, 140, 245,
2873 246, 86, 127, 128, 129, 87, 408, 342, 318, 88,
2877 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2879 #define YYPACT_NINF -494
2880 static const yytype_int16 yypact[] =
2882 1763, -21, -494, -494, -494, -494, -494, -494, -29, -45,
2883 -494, -36, 68, -494, -494, -494, -494, 75, -494, 2217,
2884 -494, 91, -494, -494, 438, -494, -15, 316, -5, -494,
2885 -494, -494, -494, 7, -37, -494, -494, 107, 2217, 24,
2886 367, 2217, 2217, -494, -494, 2217, 2217, 2217, 2217, 2217,
2887 707, 127, 139, -494, 575, -494, -494, -494, 23, -494,
2888 2145, -494, -494, -494, -494, -494, -494, 2019, -494, -494,
2889 -494, 488, 431, -494, -494, -494, -494, -494, -494, 17,
2890 -494, -494, -494, -494, -494, -494, 57, 2920, -494, -494,
2891 -494, -494, -494, 155, 36, -494, -494, 2019, -494, -494,
2892 -494, -494, -494, -494, -494, 28, 316, -494, -48, -494,
2893 47, 213, 2217, 69, -494, 2217, -494, 2217, 194, 116,
2894 213, -494, -494, -494, -494, -494, -494, 92, 121, 132,
2895 213, 213, 379, 213, 213, -42, 2858, 114, 146, 2217,
2896 -494, 2858, 246, 247, 2217, 2217, 247, 249, -494, -494,
2897 839, -494, -494, 125, -494, -494, -494, -494, 248, -494,
2898 -494, -494, -494, 1103, 197, 264, -494, 168, 203, 57,
2899 173, -494, 274, 66, 276, -494, 278, -494, -494, -494,
2900 -494, -494, 2217, -494, 21, 2217, 2217, 2217, 2217, 2217,
2901 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2902 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, -494,
2903 -494, 138, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2904 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 130,
2905 -494, -494, 2217, 273, 2217, 1235, -494, 316, 158, 160,
2906 -494, -494, -494, 167, 15, 157, 192, 229, 2276, 1891,
2907 165, -494, 2217, 2217, -494, 2217, 367, 2217, -494, -494,
2908 -494, -494, -494, 207, 212, -494, -494, -494, 212, -494,
2909 -494, -494, 2019, 181, 207, 2217, 2217, -494, 217, -494,
2910 -494, 314, 262, 269, 315, 2858, 220, 221, 6, 21,
2911 -494, 2858, 1095, 567, 567, 567, 3292, 3292, 3292, 3292,
2912 1095, 1095, 2858, 2858, 2858, 2858, 2858, 2858, 2858, 2858,
2913 2858, 2858, 2858, 2982, 3044, -494, 214, -494, -494, 313,
2914 313, 313, 2858, 2486, 3106, 3168, 3230, 1095, 1095, 379,
2915 379, 213, 213, 213, 199, 2548, 238, 244, 245, -494,
2916 2217, 267, 254, -494, 226, 224, 2346, -494, 228, 1367,
2917 -494, -494, 235, -494, -494, -494, -494, 1235, -494, 316,
2918 2217, -494, -55, 363, 232, 280, -494, -494, -494, 240,
2919 -494, 237, 1891, -494, 2858, 243, -494, 277, 2858, 292,
2920 281, 247, 971, -494, -6, 279, 252, 135, 270, 316,
2921 376, 316, 268, 207, 296, -494, 265, 22, 34, -494,
2922 -494, -494, -494, 2217, -494, 2217, -494, -494, 2217, 2610,
2923 2217, -494, 294, 2019, 2217, 272, -494, -494, 1235, 283,
2924 275, 2217, 292, -494, -494, 207, 19, 78, 2019, 2217,
2925 -494, -494, -494, -494, 2217, -494, -494, -494, 2217, 2019,
2926 -494, -494, 15, -494, 316, 284, -494, 300, -494, 281,
2927 315, -494, -494, -494, -494, -494, 291, 253, 2672, 2858,
2928 2416, -494, 2734, -494, -494, 287, 46, 289, -494, -494,
2929 2858, 309, 286, 363, -494, 297, 312, -494, -494, 78,
2930 -494, 338, -494, 2858, -38, -494, 298, 300, -494, 316,
2931 27, -494, -494, -494, -494, 299, -494, 2217, -494, 327,
2932 -494, -494, -494, -494, -494, 2217, 318, 306, 46, -494,
2933 -494, -494, -494, -494, -494, -494, 442, -494, -494, 2019,
2934 -494, 2019, 207, 1499, -494, 447, -494, 427, 321, 255,
2935 -494, 17, 2858, 342, -494, 25, 2796, 1891, -494, -494,
2936 -494, 1891, 1891, 207, -494, -494, 332, -494, -494, 335,
2937 328, 331, 1631, -494, -494, -494, -494, 66, -494, -494,
2938 -494, 334, 17, 25, 1891, -494, 336, 340, 341, -494,
2939 1499, -494, -494, 472, 365, -494, -494, -494, -494, -494,
2940 -494, 1891, 347, 358, -494, 373, 359, 352, -494, 15,
2941 -494, 1891, -494, 353, 355, 207, -494, -494
2944 /* YYPGOTO[NTERM-NUM]. */
2945 static const yytype_int16 yypgoto[] =
2947 -494, -494, 337, -494, 444, -315, -494, 150, -475, -34,
2948 1, -60, -87, 53, 2, 52, 446, 364, 129, -494,
2949 -494, -494, -494, -494, -494, -494, -494, -494, -494, -494,
2950 -494, -494, -494, -494, -494, 5, 8, -494, -494, 32,
2951 -494, 33, -494, -494, -494, -494, -494, -494, -494, -494,
2952 14, 56, -494, -494, -494, -494, 0, -494, 430, -494,
2953 -494, -494, 59, -494, 61, -494, -53, -494, -31, -494,
2954 -494, -14, -494, 3, -494, -494, 72, 62, -494, -494,
2955 -494, -494, -464, -494, -494, -169, -494, -457, -494, -493,
2956 -413, -494, -494, 239, -419, -494, -344, -39, 4, -494,
2957 -494, -494, -494, -494, 508, -101, 93, 117, -257, -494,
2958 -103, -494, -494, -494, -494, -494, -494, -494, -130, -132,
2959 490, -52, -494, 285, -494, -13, -494, -494, -189, -494,
2960 -494, -494, -494, -494, -494
2963 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2964 positive, shift that token. If negative, reduce the rule which
2965 number is the opposite. If zero, do what YYDEFACT says.
2966 If YYTABLE_NINF, syntax error. */
2967 #define YYTABLE_NINF -335
2968 static const yytype_int16 yytable[] =
2970 71, 56, 58, 76, 81, 242, 108, 170, 169, 261,
2971 233, 111, 266, 267, 250, 287, 150, 384, 362, 424,
2972 181, 94, 362, 486, 286, 120, 104, 452, 130, 131,
2973 494, 2, 132, 133, 134, 136, 141, 170, 560, 454,
2974 343, 104, 419, 535, 500, 13, 211, 15, 16, 421,
2975 18, 422, 20, 57, 71, 56, 58, 76, 81, 74,
2976 257, 75, 565, -71, 185, 25, 566, 567, 105, 576,
2977 93, 99, 100, 525, 30, 31, 32, 563, 228, 96,
2978 505, 229, 474, 113, 101, 102, 534, 117, 98, 577,
2979 271, 106, 118, 258, 109, 95, 574, 521, 434, 136,
2980 344, 279, 248, 467, 141, 475, 587, 57, 506, 112,
2981 363, 476, 585, 74, 473, 75, 594, 280, 399, 115,
2982 287, 375, 400, 119, 334, 376, 141, 404, 526, 514,
2983 160, 136, 136, 336, 337, 116, 449, 496, 440, 161,
2984 441, 99, 100, 385, 386, 182, 101, 102, 121, 182,
2985 182, 163, 411, 497, 101, 102, 236, 237, 230, 185,
2986 231, -155, 182, 71, 56, 58, 76, 81, 472, 285,
2987 593, 244, 291, 292, 293, 294, 295, 296, 297, 298,
2988 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
2989 309, 310, 311, 312, 313, 314, 103, 251, 247, 319,
2990 320, 321, 322, 323, 324, 325, 326, 327, 328, 329,
2991 330, 331, 332, 333, 141, 335, 57, 99, 100, 136,
2992 252, 346, 74, 463, 75, 317, 254, 255, 453, 455,
2993 101, 102, 99, 100, 256, 71, 56, 352, 382, 374,
2994 136, 259, 141, 317, 378, 101, 102, 338, 260, 262,
2995 263, 358, 269, 272, 339, 315, 340, 420, 494, 2,
2996 341, 369, 136, 136, 172, 546, -72, 274, 316, 275,
2997 99, 100, 276, 13, 277, 15, 16, 278, 18, 282,
2998 20, 283, 465, 101, 102, 345, 568, -115, 443, 359,
2999 446, 360, 367, 25, 257, 99, 100, 99, 100, 482,
3000 373, 525, 30, 31, 32, 209, 210, 211, 101, 102,
3001 101, 102, 271, 379, 381, 383, 389, 388, 393, 99,
3002 100, 387, 271, 391, 397, 398, 464, 409, 430, -332,
3003 317, 315, 101, 102, 406, -334, -333, 227, 597, 228,
3004 403, 481, 229, 446, 172, 412, 368, 141, 414, 71,
3005 56, 352, 485, 170, 173, 317, 526, 71, 56, 352,
3006 175, 413, 416, 418, 495, 496, 362, 425, 170, -114,
3007 122, 427, 123, 369, 177, 124, 125, 126, 428, 170,
3008 438, 497, 426, 429, 315, 434, 484, 439, 524, -156,
3009 458, 444, 459, 410, 442, 460, 448, 462, 450, 451,
3010 466, 136, 489, 493, 519, 209, 210, 211, 470, 431,
3011 469, 315, 488, 421, 513, 531, 141, 468, 71, 56,
3012 352, 483, 504, 511, 537, 515, 317, 222, 223, 224,
3013 225, 226, 544, 522, 545, 2, 516, 227, 533, 228,
3014 538, 107, 229, 3, 4, 543, 5, 6, 7, 13,
3015 556, 15, 16, 557, 18, 558, 20, 14, 562, 170,
3016 569, 170, 19, 570, 21, 571, 22, 23, 575, 25,
3017 578, 209, 210, 211, 579, 583, 580, 584, 30, 31,
3018 32, 588, 589, 29, 532, 590, 592, 591, 595, 596,
3019 527, 34, 536, 35, 36, 224, 225, 226, 162, 417,
3020 273, 491, 180, 227, 172, 228, 166, 264, 229, 40,
3021 436, 517, 518, 539, 173, 559, 540, 582, 573, 174,
3022 175, 572, 492, 550, 548, 549, 554, 555, 402, 527,
3023 41, 42, 176, 512, 177, 114, 0, 487, 135, 471,
3024 0, 377, 0, 0, 0, 0, 0, 0, 0, 0,
3025 0, 0, 550, 548, 549, 554, 555, 0, 0, 0,
3026 0, 0, 48, 0, 49, 0, 0, 0, 51, 0,
3027 550, 548, 549, 554, 555, -4, 0, 0, 1, 2,
3028 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3029 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
3030 20, 0, 0, 22, 23, 0, 0, 186, 0, 0,
3031 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3032 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3033 35, 36, 0, 0, 0, -335, -335, -335, 37, 38,
3034 39, 0, 0, 194, 195, 0, 40, 0, 0, 0,
3035 0, 0, 0, 0, 0, 0, 0, 0, 0, 209,
3036 210, 211, 0, 212, 213, 214, 0, 41, 42, 0,
3037 0, 0, 0, 0, 0, 0, 43, 0, 220, 221,
3038 0, 222, 223, 224, 225, 226, 44, 0, 0, 45,
3039 0, 227, 0, 228, 46, 47, 229, 0, 0, 48,
3040 0, 49, 0, 50, 0, 51, 0, 0, 0, -4,
3041 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3042 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3043 18, 19, 20, 21, 0, 22, 23, 142, 0, 143,
3044 0, 0, 0, 24, 144, 25, 26, 0, 27, 145,
3045 28, 0, 29, 146, 30, 31, 32, 0, 0, 33,
3046 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3047 37, 38, 39, 0, 147, 0, 0, 0, 40, 0,
3048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3049 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3050 42, 0, 0, 0, 0, 0, 0, 0, 148, 0,
3051 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3052 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3053 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3054 0, 149, 1, 2, 3, 4, 0, 5, 6, 7,
3055 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3056 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3057 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3058 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3059 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3060 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3061 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3062 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3063 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3064 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3065 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3066 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3067 0, 0, 0, 270, 1, 2, 3, 4, 0, 5,
3068 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3069 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3070 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3071 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3072 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3073 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3074 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3076 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3077 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3078 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3079 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3080 0, 51, 0, 0, 0, 437, 1, 2, 3, 4,
3081 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3082 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3083 0, 22, 23, 0, 0, -335, 0, 0, 0, 24,
3084 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3085 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3086 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3087 0, -335, -335, 0, 40, 0, 0, 0, 0, 0,
3088 0, 0, 0, 0, 0, 0, 0, 209, 210, 211,
3089 0, 212, 213, 214, 0, 41, 42, 0, 0, 0,
3090 0, 0, 0, 0, 43, 0, -335, -335, 0, 222,
3091 223, 224, 225, 226, 44, 0, 0, 45, 0, 227,
3092 0, 228, 46, 47, 229, 0, 0, 48, 0, 49,
3093 0, 50, 0, 51, 0, 0, 0, -3, 1, 2,
3094 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3095 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3096 20, 0, 0, 22, 23, 0, 0, 0, 0, 0,
3097 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3098 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3099 35, 36, 0, 0, 0, 0, 0, 0, 37, 38,
3100 39, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3102 0, 0, 0, 0, 0, 0, 0, 41, 42, 0,
3103 0, 0, 0, 0, 0, 0, 347, 0, 0, 0,
3104 0, 0, 0, 0, 0, 0, 44, 0, 0, 45,
3105 0, 0, 0, 0, 46, 47, 0, 0, 0, 48,
3106 0, 49, 0, 50, 0, 51, 0, 0, 0, -15,
3107 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3108 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3109 18, 19, 20, 0, 0, 22, 23, 0, 0, 0,
3110 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
3111 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
3112 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3113 37, 38, 39, 0, 0, 0, 0, 0, 40, 0,
3114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3115 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3116 42, 0, 0, 0, 0, 0, 0, 0, 347, 0,
3117 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3118 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3119 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3120 0, -16, 1, 2, 3, 4, 0, 5, 6, 7,
3121 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3122 16, 17, 18, 19, 20, 0, 0, 22, 23, 0,
3123 0, 0, 0, 0, 0, 24, 0, 25, 26, 0,
3124 27, 0, 28, 0, 29, 0, 30, 31, 32, 0,
3125 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3126 0, 0, 37, 38, 39, 0, 0, 0, 0, 0,
3127 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3129 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3130 547, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3131 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3132 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3133 0, 0, 0, -146, 1, 2, 3, 4, 0, 5,
3134 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3135 14, 15, 16, 17, 18, 19, 20, 0, 0, 22,
3136 23, 0, 0, 0, 0, 0, 0, 24, 0, 25,
3137 26, 0, 27, 0, 28, 0, 29, 0, 30, 31,
3138 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3139 0, 0, 0, 0, 37, 38, 39, 0, 0, 0,
3140 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3142 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3143 0, 0, 547, 0, 0, 0, 0, 0, 0, 0,
3144 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3145 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3146 0, 51, 0, -3, 0, -147, 1, 2, 3, 4,
3147 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3148 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3149 0, 22, 23, 0, 0, 0, 0, 0, 0, 24,
3150 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3151 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3152 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3153 0, 0, 0, 0, 40, 0, 0, 0, 0, 0,
3154 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3155 0, 0, 0, 0, 0, 41, 42, 0, 0, 0,
3156 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
3157 0, 0, 0, 0, 44, 0, 0, 45, 0, 0,
3158 0, 0, 46, 47, 0, 0, 0, 48, 0, 49,
3159 0, 50, 0, 51, 1, 2, 3, 4, 0, 5,
3160 6, 7, 8, 9, 10, 11, 0, -122, 0, 13,
3161 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3162 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3163 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3164 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3165 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3166 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3168 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3169 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3170 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3171 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3172 0, 51, 1, 2, 3, 4, 0, 5, 6, 7,
3173 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3174 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3175 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3176 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3177 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3178 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3179 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3181 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3182 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3183 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3184 0, 0, 0, 48, 0, 49, 0, 50, 164, 51,
3185 3, 4, 0, 5, 6, 7, 0, 0, 0, 0,
3186 0, 0, 0, 0, 14, 0, 0, 0, 0, 19,
3187 0, 21, 0, 22, 23, 0, 0, 143, 0, 0,
3188 0, 24, 0, 0, 0, 0, 0, 0, 28, 0,
3189 29, 165, 0, 0, 0, 0, 0, 0, 34, 0,
3190 35, 36, 0, 0, 0, 0, 0, 0, 0, 38,
3191 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3192 107, 0, 3, 4, 0, 5, 6, 7, 0, 0,
3193 0, 0, 0, 0, 0, 0, 14, 41, 42, 0,
3194 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3195 0, 0, 0, 24, 0, 0, 44, 0, 0, 45,
3196 28, 0, 29, 0, 46, 47, 0, 0, 0, 48,
3197 34, 49, 35, 36, 0, 51, 0, 0, 0, 0,
3198 0, 38, 0, 0, 0, 0, 0, 0, 40, 0,
3199 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3200 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3201 42, 0, 0, 0, 0, 0, 186, 0, 0, 0,
3202 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3203 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3204 0, 48, 0, 49, 187, 188, 189, 51, 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, 0, 0,
3208 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3209 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3210 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3211 0, 370, 0, 0, 187, 188, 189, 0, 190, 191,
3212 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3213 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3214 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3215 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3216 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3217 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3218 0, 415, 0, 0, 187, 188, 189, 0, 190, 191,
3219 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3220 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3221 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3222 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3223 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3224 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3225 0, 502, 0, 0, 187, 188, 189, 0, 190, 191,
3226 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3227 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3228 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3229 215, 216, 405, 217, 218, 219, 0, 220, 221, 0,
3230 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3231 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3232 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3233 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3234 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3235 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3236 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3237 0, 0, 227, 0, 228, 407, 0, 229, 187, 188,
3238 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3239 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3240 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3241 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3242 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3243 0, 0, 0, 0, 227, 0, 228, 461, 0, 229,
3244 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3245 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
3246 206, 207, 208, 0, 209, 210, 211, 0, 212, 213,
3247 214, 0, 0, 0, 186, 0, 215, 216, 0, 217,
3248 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3249 226, 0, 0, 0, 0, 0, 227, 0, 228, 501,
3250 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3251 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3252 204, 205, 206, 207, 208, 0, 209, 210, 211, 0,
3253 212, 213, 214, 0, 0, 0, 186, 0, 215, 216,
3254 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3255 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3256 228, 503, 0, 229, 187, 188, 189, 0, 190, 191,
3257 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3258 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3259 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3260 215, 216, 564, 217, 218, 219, 0, 220, 221, 0,
3261 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3262 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3263 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3264 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3265 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3266 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3267 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3268 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3269 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3270 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3271 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3272 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3273 0, 0, 221, 0, 222, 223, 224, 225, 226, 0,
3274 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3275 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3277 0, 0, 208, 0, 209, 210, 211, 0, 212, 213,
3278 214, 0, 0, 0, 186, 0, 0, 0, 0, 217,
3279 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3280 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3281 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3282 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
3283 0, 0, 0, 0, 0, 0, 209, 210, 211, 0,
3284 212, 213, 214, 0, 0, 0, 186, 0, 0, 0,
3285 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3286 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3287 228, 0, 0, 229, 187, 188, 189, 0, 190, 191,
3288 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
3289 0, 0, 0, 0, 0, 0, 0, 0, 209, 210,
3290 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3291 0, 0, 0, 0, 218, 219, 0, 220, 221, 0,
3292 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3293 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3294 190, 191, 192, 193, 194, 195, 0, 0, 0, 0,
3295 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3296 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3297 186, 0, 0, 0, 0, 0, 0, 219, 0, 220,
3298 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3299 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3300 189, 0, 190, 191, 192, 193, 194, 195, 0, 0,
3301 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3302 0, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3303 0, 0, 186, 0, 0, 0, 0, 0, 0, -335,
3304 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3305 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3306 187, 188, 189, 0, -335, -335, -335, -335, 194, 195,
3307 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3308 0, 0, 0, 0, 209, 210, 211, 0, 212, 213,
3309 214, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3310 0, 0, 0, 220, 221, 0, 222, 223, 224, 225,
3311 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3315 static const yytype_int16 yycheck[] =
3317 0, 0, 0, 0, 0, 106, 19, 67, 60, 139,
3318 97, 24, 144, 145, 117, 184, 50, 274, 3, 363,
3319 3, 50, 3, 442, 3, 38, 12, 5, 41, 42,
3320 5, 4, 45, 46, 47, 48, 49, 97, 531, 5,
3321 229, 27, 357, 500, 457, 18, 94, 20, 21, 104,
3322 23, 106, 25, 0, 54, 54, 54, 54, 54, 0,
3323 102, 0, 537, 69, 102, 38, 541, 542, 12, 562,
3324 91, 3, 4, 46, 47, 48, 49, 534, 126, 124,
3325 34, 129, 426, 27, 16, 17, 499, 124, 124, 564,
3326 150, 16, 129, 135, 3, 124, 560, 135, 104, 112,
3327 232, 35, 115, 418, 117, 27, 581, 54, 62, 124,
3328 95, 33, 576, 54, 95, 54, 591, 51, 112, 124,
3329 289, 253, 116, 16, 227, 255, 139, 316, 101, 473,
3330 3, 144, 145, 3, 4, 128, 393, 112, 3, 0,
3331 5, 3, 4, 275, 276, 128, 16, 17, 124, 128,
3332 128, 128, 341, 128, 16, 17, 128, 129, 3, 102,
3333 124, 134, 128, 163, 163, 163, 163, 163, 425, 182,
3334 589, 124, 185, 186, 187, 188, 189, 190, 191, 192,
3335 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3336 203, 204, 205, 206, 207, 208, 128, 3, 129, 212,
3337 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
3338 223, 224, 225, 226, 227, 228, 163, 3, 4, 232,
3339 104, 234, 163, 412, 163, 211, 134, 106, 397, 398,
3340 16, 17, 3, 4, 102, 235, 235, 235, 272, 252,
3341 253, 127, 255, 229, 257, 16, 17, 117, 102, 3,
3342 3, 237, 3, 128, 124, 117, 126, 360, 5, 4,
3343 130, 247, 275, 276, 16, 522, 69, 3, 130, 101,
3344 3, 4, 69, 18, 101, 20, 21, 3, 23, 3,
3345 25, 3, 414, 16, 17, 12, 543, 129, 389, 129,
3346 391, 124, 135, 38, 102, 3, 4, 3, 4, 429,
3347 135, 46, 47, 48, 49, 92, 93, 94, 16, 17,
3348 16, 17, 372, 106, 102, 134, 54, 3, 3, 3,
3349 4, 104, 382, 54, 104, 104, 413, 340, 36, 91,
3350 316, 117, 16, 17, 135, 91, 91, 124, 595, 126,
3351 126, 428, 129, 444, 16, 91, 117, 360, 124, 349,
3352 349, 349, 439, 413, 26, 341, 101, 357, 357, 357,
3353 32, 135, 134, 128, 111, 112, 3, 135, 428, 129,
3354 3, 134, 5, 359, 46, 8, 9, 10, 135, 439,
3355 101, 128, 102, 106, 117, 104, 438, 135, 489, 134,
3356 403, 15, 405, 126, 124, 408, 128, 410, 102, 134,
3357 128, 414, 102, 112, 66, 92, 93, 94, 421, 117,
3358 135, 117, 128, 104, 128, 116, 429, 134, 418, 418,
3359 418, 434, 135, 134, 106, 128, 412, 114, 115, 116,
3360 117, 118, 519, 135, 521, 4, 124, 124, 111, 126,
3361 134, 3, 129, 5, 6, 3, 8, 9, 10, 18,
3362 3, 20, 21, 26, 23, 134, 25, 19, 116, 519,
3363 128, 521, 24, 128, 26, 134, 28, 29, 134, 38,
3364 134, 92, 93, 94, 134, 3, 135, 112, 47, 48,
3365 49, 134, 124, 45, 497, 112, 134, 128, 135, 134,
3366 490, 53, 505, 55, 56, 116, 117, 118, 54, 349,
3367 163, 449, 72, 124, 16, 126, 60, 143, 129, 71,
3368 381, 479, 479, 508, 26, 529, 508, 570, 557, 31,
3369 32, 552, 450, 523, 523, 523, 523, 523, 289, 529,
3370 92, 93, 44, 471, 46, 27, -1, 444, 48, 422,
3371 -1, 256, -1, -1, -1, -1, -1, -1, -1, -1,
3372 -1, -1, 552, 552, 552, 552, 552, -1, -1, -1,
3373 -1, -1, 124, -1, 126, -1, -1, -1, 130, -1,
3374 570, 570, 570, 570, 570, 0, -1, -1, 3, 4,
3375 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3376 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
3377 25, -1, -1, 28, 29, -1, -1, 40, -1, -1,
3378 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3379 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3380 55, 56, -1, -1, -1, 68, 69, 70, 63, 64,
3381 65, -1, -1, 76, 77, -1, 71, -1, -1, -1,
3382 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3383 93, 94, -1, 96, 97, 98, -1, 92, 93, -1,
3384 -1, -1, -1, -1, -1, -1, 101, -1, 111, 112,
3385 -1, 114, 115, 116, 117, 118, 111, -1, -1, 114,
3386 -1, 124, -1, 126, 119, 120, 129, -1, -1, 124,
3387 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3388 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3389 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3390 23, 24, 25, 26, -1, 28, 29, 30, -1, 32,
3391 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
3392 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
3393 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3394 63, 64, 65, -1, 67, -1, -1, -1, 71, -1,
3395 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3396 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3397 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3398 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3399 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3400 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3401 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3402 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3403 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3404 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3405 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3406 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3407 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3408 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3409 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3410 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3411 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3412 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3413 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3414 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3415 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3416 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3417 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3418 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3419 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3420 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3421 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3422 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3423 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3424 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3425 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3426 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3427 -1, 130, -1, -1, -1, 134, 3, 4, 5, 6,
3428 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3429 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3430 -1, 28, 29, -1, -1, 40, -1, -1, -1, 36,
3431 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3432 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3433 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3434 -1, 76, 77, -1, 71, -1, -1, -1, -1, -1,
3435 -1, -1, -1, -1, -1, -1, -1, 92, 93, 94,
3436 -1, 96, 97, 98, -1, 92, 93, -1, -1, -1,
3437 -1, -1, -1, -1, 101, -1, 111, 112, -1, 114,
3438 115, 116, 117, 118, 111, -1, -1, 114, -1, 124,
3439 -1, 126, 119, 120, 129, -1, -1, 124, -1, 126,
3440 -1, 128, -1, 130, -1, -1, -1, 134, 3, 4,
3441 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3442 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3443 25, -1, -1, 28, 29, -1, -1, -1, -1, -1,
3444 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3445 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3446 55, 56, -1, -1, -1, -1, -1, -1, 63, 64,
3447 65, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3448 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3449 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
3450 -1, -1, -1, -1, -1, -1, 101, -1, -1, -1,
3451 -1, -1, -1, -1, -1, -1, 111, -1, -1, 114,
3452 -1, -1, -1, -1, 119, 120, -1, -1, -1, 124,
3453 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3454 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3455 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3456 23, 24, 25, -1, -1, 28, 29, -1, -1, -1,
3457 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3458 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3459 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3460 63, 64, 65, -1, -1, -1, -1, -1, 71, -1,
3461 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3462 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3463 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3464 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3465 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3466 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3467 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3468 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3469 21, 22, 23, 24, 25, -1, -1, 28, 29, -1,
3470 -1, -1, -1, -1, -1, 36, -1, 38, 39, -1,
3471 41, -1, 43, -1, 45, -1, 47, 48, 49, -1,
3472 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3473 -1, -1, 63, 64, 65, -1, -1, -1, -1, -1,
3474 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3475 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3476 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3477 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3478 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3479 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3480 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3481 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3482 19, 20, 21, 22, 23, 24, 25, -1, -1, 28,
3483 29, -1, -1, -1, -1, -1, -1, 36, -1, 38,
3484 39, -1, 41, -1, 43, -1, 45, -1, 47, 48,
3485 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3486 -1, -1, -1, -1, 63, 64, 65, -1, -1, -1,
3487 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3488 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3489 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3490 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3491 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3492 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3493 -1, 130, -1, 0, -1, 134, 3, 4, 5, 6,
3494 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3495 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3496 -1, 28, 29, -1, -1, -1, -1, -1, -1, 36,
3497 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3498 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3499 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3500 -1, -1, -1, -1, 71, -1, -1, -1, -1, -1,
3501 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3502 -1, -1, -1, -1, -1, 92, 93, -1, -1, -1,
3503 -1, -1, -1, -1, 101, -1, -1, -1, -1, -1,
3504 -1, -1, -1, -1, 111, -1, -1, 114, -1, -1,
3505 -1, -1, 119, 120, -1, -1, -1, 124, -1, 126,
3506 -1, 128, -1, 130, 3, 4, 5, 6, -1, 8,
3507 9, 10, 11, 12, 13, 14, -1, 16, -1, 18,
3508 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3509 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3510 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3511 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3512 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3513 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3514 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3515 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3516 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3517 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3518 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3519 -1, 130, 3, 4, 5, 6, -1, 8, 9, 10,
3520 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3521 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3522 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3523 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3524 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3525 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3526 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3527 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3528 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3529 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3530 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3531 -1, -1, -1, 124, -1, 126, -1, 128, 3, 130,
3532 5, 6, -1, 8, 9, 10, -1, -1, -1, -1,
3533 -1, -1, -1, -1, 19, -1, -1, -1, -1, 24,
3534 -1, 26, -1, 28, 29, -1, -1, 32, -1, -1,
3535 -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
3536 45, 46, -1, -1, -1, -1, -1, -1, 53, -1,
3537 55, 56, -1, -1, -1, -1, -1, -1, -1, 64,
3538 -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3539 3, -1, 5, 6, -1, 8, 9, 10, -1, -1,
3540 -1, -1, -1, -1, -1, -1, 19, 92, 93, -1,
3541 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3542 -1, -1, -1, 36, -1, -1, 111, -1, -1, 114,
3543 43, -1, 45, -1, 119, 120, -1, -1, -1, 124,
3544 53, 126, 55, 56, -1, 130, -1, -1, -1, -1,
3545 -1, 64, -1, -1, -1, -1, -1, -1, 71, -1,
3546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3547 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3548 93, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3549 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3550 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3551 -1, 124, -1, 126, 68, 69, 70, 130, 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, -1, -1,
3555 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3556 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3557 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3558 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3559 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3560 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3561 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3562 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3563 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3564 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3565 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3566 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3567 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3568 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3569 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3570 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3571 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3572 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3573 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3574 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3575 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3576 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3577 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3578 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3579 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3580 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3581 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3582 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3583 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3584 -1, -1, 124, -1, 126, 127, -1, 129, 68, 69,
3585 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3586 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3587 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3588 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3589 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3590 -1, -1, -1, -1, 124, -1, 126, 127, -1, 129,
3591 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3592 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3593 88, 89, 90, -1, 92, 93, 94, -1, 96, 97,
3594 98, -1, -1, -1, 40, -1, 104, 105, -1, 107,
3595 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3596 118, -1, -1, -1, -1, -1, 124, -1, 126, 127,
3597 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3598 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3599 86, 87, 88, 89, 90, -1, 92, 93, 94, -1,
3600 96, 97, 98, -1, -1, -1, 40, -1, 104, 105,
3601 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3602 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3603 126, 127, -1, 129, 68, 69, 70, -1, 72, 73,
3604 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3605 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3606 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3607 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3608 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3609 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3610 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3611 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3612 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3613 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3614 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3615 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3616 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3617 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3618 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3619 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3620 -1, -1, 112, -1, 114, 115, 116, 117, 118, -1,
3621 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3622 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3623 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3624 -1, -1, 90, -1, 92, 93, 94, -1, 96, 97,
3625 98, -1, -1, -1, 40, -1, -1, -1, -1, 107,
3626 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3627 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3628 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3629 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
3630 -1, -1, -1, -1, -1, -1, 92, 93, 94, -1,
3631 96, 97, 98, -1, -1, -1, 40, -1, -1, -1,
3632 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3633 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3634 126, -1, -1, 129, 68, 69, 70, -1, 72, 73,
3635 74, 75, 76, 77, -1, -1, -1, -1, -1, -1,
3636 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3637 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3638 -1, -1, -1, -1, 108, 109, -1, 111, 112, -1,
3639 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3640 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3641 72, 73, 74, 75, 76, 77, -1, -1, -1, -1,
3642 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3643 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3644 40, -1, -1, -1, -1, -1, -1, 109, -1, 111,
3645 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3646 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3647 70, -1, 72, 73, 74, 75, 76, 77, -1, -1,
3648 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3649 -1, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3650 -1, -1, 40, -1, -1, -1, -1, -1, -1, 109,
3651 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3652 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3653 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3654 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3655 -1, -1, -1, -1, 92, 93, 94, -1, 96, 97,
3656 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3657 -1, -1, -1, 111, 112, -1, 114, 115, 116, 117,
3658 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3662 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3663 symbol of state STATE-NUM. */
3664 static const yytype_uint16 yystos[] =
3666 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3667 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3668 25, 26, 28, 29, 36, 38, 39, 41, 43, 45,
3669 47, 48, 49, 52, 53, 55, 56, 63, 64, 65,
3670 71, 92, 93, 101, 111, 114, 119, 120, 124, 126,
3671 128, 130, 137, 138, 139, 140, 146, 149, 150, 156,
3672 160, 161, 162, 163, 165, 173, 181, 184, 185, 188,
3673 191, 192, 193, 194, 198, 200, 209, 214, 215, 216,
3674 226, 234, 237, 250, 251, 252, 257, 261, 265, 266,
3675 268, 269, 270, 91, 50, 124, 124, 166, 124, 3,
3676 4, 16, 17, 128, 186, 187, 16, 3, 261, 3,
3677 236, 261, 124, 187, 240, 124, 128, 124, 129, 16,
3678 261, 124, 3, 5, 8, 9, 10, 258, 259, 260,
3679 261, 261, 261, 261, 261, 256, 261, 246, 247, 248,
3680 254, 261, 30, 32, 37, 42, 46, 67, 101, 134,
3681 145, 146, 147, 150, 152, 167, 168, 183, 192, 253,
3682 3, 0, 140, 128, 3, 46, 152, 158, 159, 257,
3683 147, 148, 16, 26, 31, 32, 44, 46, 208, 267,
3684 194, 3, 128, 221, 225, 102, 40, 68, 69, 70,
3685 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3686 82, 83, 84, 85, 86, 87, 88, 89, 90, 92,
3687 93, 94, 96, 97, 98, 104, 105, 107, 108, 109,
3688 111, 112, 114, 115, 116, 117, 118, 124, 126, 129,
3689 3, 124, 164, 148, 174, 190, 128, 129, 186, 187,
3690 239, 240, 241, 249, 124, 255, 256, 129, 261, 182,
3691 246, 3, 104, 157, 134, 106, 102, 102, 135, 127,
3692 102, 254, 3, 3, 153, 154, 255, 255, 153, 3,
3693 134, 147, 128, 138, 3, 101, 69, 101, 3, 35,
3694 51, 233, 3, 3, 210, 261, 3, 221, 227, 228,
3695 229, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3696 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3697 261, 261, 261, 261, 261, 117, 130, 186, 264, 261,
3698 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3699 261, 261, 261, 261, 246, 261, 3, 4, 117, 124,
3700 126, 130, 263, 264, 255, 12, 261, 101, 141, 142,
3701 143, 149, 150, 198, 200, 209, 234, 189, 186, 129,
3702 124, 245, 3, 95, 230, 231, 232, 135, 117, 186,
3703 135, 144, 145, 135, 261, 255, 254, 259, 261, 106,
3704 244, 102, 145, 134, 244, 255, 255, 104, 3, 54,
3705 195, 54, 196, 3, 211, 212, 222, 104, 104, 112,
3706 116, 217, 229, 126, 264, 106, 135, 127, 262, 261,
3707 126, 264, 91, 135, 124, 135, 134, 143, 128, 141,
3708 246, 104, 106, 213, 232, 135, 102, 134, 135, 106,
3709 36, 117, 241, 243, 104, 151, 154, 134, 101, 135,
3710 3, 5, 124, 241, 15, 197, 241, 242, 128, 244,
3711 102, 134, 5, 221, 5, 221, 218, 223, 261, 261,
3712 261, 127, 261, 264, 148, 255, 128, 141, 134, 135,
3713 261, 243, 244, 95, 232, 27, 33, 175, 177, 179,
3714 180, 148, 254, 261, 257, 148, 230, 242, 128, 102,
3715 201, 151, 212, 112, 5, 111, 112, 128, 219, 224,
3716 226, 127, 135, 127, 135, 34, 62, 169, 170, 171,
3717 172, 134, 213, 128, 232, 128, 124, 175, 177, 66,
3718 155, 135, 135, 199, 241, 46, 101, 192, 205, 206,
3719 207, 116, 261, 111, 226, 223, 261, 106, 134, 171,
3720 172, 238, 178, 3, 148, 148, 244, 101, 146, 150,
3721 192, 202, 203, 204, 209, 234, 3, 26, 134, 207,
3722 225, 220, 116, 223, 106, 144, 144, 144, 244, 128,
3723 128, 134, 204, 233, 218, 134, 225, 144, 134, 134,
3724 135, 235, 202, 3, 112, 218, 176, 144, 134, 124,
3725 112, 128, 134, 230, 144, 135, 134, 244
3728 #define yyerrok (yyerrstatus = 0)
3729 #define yyclearin (yychar = YYEMPTY)
3730 #define YYEMPTY (-2)
3733 #define YYACCEPT goto yyacceptlab
3734 #define YYABORT goto yyabortlab
3735 #define YYERROR goto yyerrorlab
3738 /* Like YYERROR except do call yyerror. This remains here temporarily
3739 to ease the transition to the new meaning of YYERROR, for GCC.
3740 Once GCC version 2 has supplanted version 1, this can go. */
3742 #define YYFAIL goto yyerrlab
3744 #define YYRECOVERING() (!!yyerrstatus)
3746 #define YYBACKUP(Token, Value) \
3748 if (yychar == YYEMPTY && yylen == 1) \
3752 yytoken = YYTRANSLATE (yychar); \
3758 yyerror (YY_("syntax error: cannot back up")); \
3765 #define YYERRCODE 256
3768 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3769 If N is 0, then set CURRENT to the empty location which ends
3770 the previous symbol: RHS[0] (always defined). */
3772 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3773 #ifndef YYLLOC_DEFAULT
3774 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3778 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3779 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3780 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3781 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3785 (Current).first_line = (Current).last_line = \
3786 YYRHSLOC (Rhs, 0).last_line; \
3787 (Current).first_column = (Current).last_column = \
3788 YYRHSLOC (Rhs, 0).last_column; \
3794 /* YY_LOCATION_PRINT -- Print the location on the stream.
3795 This macro was not mandated originally: define only if we know
3796 we won't break user code: when these are the locations we know. */
3798 #ifndef YY_LOCATION_PRINT
3799 # if YYLTYPE_IS_TRIVIAL
3800 # define YY_LOCATION_PRINT(File, Loc) \
3801 fprintf (File, "%d.%d-%d.%d", \
3802 (Loc).first_line, (Loc).first_column, \
3803 (Loc).last_line, (Loc).last_column)
3805 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3810 /* YYLEX -- calling `yylex' with the right arguments. */
3813 # define YYLEX yylex (YYLEX_PARAM)
3815 # define YYLEX yylex ()
3818 /* Enable debugging if requested. */
3822 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3823 # define YYFPRINTF fprintf
3826 # define YYDPRINTF(Args) \
3832 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3836 YYFPRINTF (stderr, "%s ", Title); \
3837 yy_symbol_print (stderr, \
3839 YYFPRINTF (stderr, "\n"); \
3844 /*--------------------------------.
3845 | Print this symbol on YYOUTPUT. |
3846 `--------------------------------*/
3849 #if (defined __STDC__ || defined __C99__FUNC__ \
3850 || defined __cplusplus || defined _MSC_VER)
3852 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3855 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3858 YYSTYPE const * const yyvaluep;
3864 if (yytype < YYNTOKENS)
3865 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3877 /*--------------------------------.
3878 | Print this symbol on YYOUTPUT. |
3879 `--------------------------------*/
3881 #if (defined __STDC__ || defined __C99__FUNC__ \
3882 || defined __cplusplus || defined _MSC_VER)
3884 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3887 yy_symbol_print (yyoutput, yytype, yyvaluep)
3890 YYSTYPE const * const yyvaluep;
3893 if (yytype < YYNTOKENS)
3894 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3896 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3898 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3899 YYFPRINTF (yyoutput, ")");
3902 /*------------------------------------------------------------------.
3903 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3905 `------------------------------------------------------------------*/
3907 #if (defined __STDC__ || defined __C99__FUNC__ \
3908 || defined __cplusplus || defined _MSC_VER)
3910 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3913 yy_stack_print (yybottom, yytop)
3914 yytype_int16 *yybottom;
3915 yytype_int16 *yytop;
3918 YYFPRINTF (stderr, "Stack now");
3919 for (; yybottom <= yytop; yybottom++)
3921 int yybot = *yybottom;
3922 YYFPRINTF (stderr, " %d", yybot);
3924 YYFPRINTF (stderr, "\n");
3927 # define YY_STACK_PRINT(Bottom, Top) \
3930 yy_stack_print ((Bottom), (Top)); \
3934 /*------------------------------------------------.
3935 | Report that the YYRULE is going to be reduced. |
3936 `------------------------------------------------*/
3938 #if (defined __STDC__ || defined __C99__FUNC__ \
3939 || defined __cplusplus || defined _MSC_VER)
3941 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3944 yy_reduce_print (yyvsp, yyrule)
3949 int yynrhs = yyr2[yyrule];
3951 unsigned long int yylno = yyrline[yyrule];
3952 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3954 /* The symbols being reduced. */
3955 for (yyi = 0; yyi < yynrhs; yyi++)
3957 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3958 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3959 &(yyvsp[(yyi + 1) - (yynrhs)])
3961 YYFPRINTF (stderr, "\n");
3965 # define YY_REDUCE_PRINT(Rule) \
3968 yy_reduce_print (yyvsp, Rule); \
3971 /* Nonzero means print parse trace. It is left uninitialized so that
3972 multiple parsers can coexist. */
3974 #else /* !YYDEBUG */
3975 # define YYDPRINTF(Args)
3976 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3977 # define YY_STACK_PRINT(Bottom, Top)
3978 # define YY_REDUCE_PRINT(Rule)
3979 #endif /* !YYDEBUG */
3982 /* YYINITDEPTH -- initial size of the parser's stacks. */
3984 # define YYINITDEPTH 200
3987 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3988 if the built-in stack extension method is used).
3990 Do not make this value too large; the results are undefined if
3991 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3992 evaluated with infinite-precision integer arithmetic. */
3995 # define YYMAXDEPTH 10000
4003 # if defined __GLIBC__ && defined _STRING_H
4004 # define yystrlen strlen
4006 /* Return the length of YYSTR. */
4007 #if (defined __STDC__ || defined __C99__FUNC__ \
4008 || defined __cplusplus || defined _MSC_VER)
4010 yystrlen (const char *yystr)
4018 for (yylen = 0; yystr[yylen]; yylen++)
4026 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
4027 # define yystpcpy stpcpy
4029 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
4031 #if (defined __STDC__ || defined __C99__FUNC__ \
4032 || defined __cplusplus || defined _MSC_VER)
4034 yystpcpy (char *yydest, const char *yysrc)
4037 yystpcpy (yydest, yysrc)
4043 const char *yys = yysrc;
4045 while ((*yyd++ = *yys++) != '\0')
4054 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
4055 quotes and backslashes, so that it's suitable for yyerror. The
4056 heuristic is that double-quoting is unnecessary unless the string
4057 contains an apostrophe, a comma, or backslash (other than
4058 backslash-backslash). YYSTR is taken from yytname. If YYRES is
4059 null, do not copy; instead, return the length of what the result
4062 yytnamerr (char *yyres, const char *yystr)
4067 char const *yyp = yystr;
4074 goto do_not_strip_quotes;
4078 goto do_not_strip_quotes;
4091 do_not_strip_quotes: ;
4095 return yystrlen (yystr);
4097 return yystpcpy (yyres, yystr) - yyres;
4101 /* Copy into YYRESULT an error message about the unexpected token
4102 YYCHAR while in state YYSTATE. Return the number of bytes copied,
4103 including the terminating null byte. If YYRESULT is null, do not
4104 copy anything; just return the number of bytes that would be
4105 copied. As a special case, return 0 if an ordinary "syntax error"
4106 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
4107 size calculation. */
4109 yysyntax_error (char *yyresult, int yystate, int yychar)
4111 int yyn = yypact[yystate];
4113 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
4117 int yytype = YYTRANSLATE (yychar);
4118 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4119 YYSIZE_T yysize = yysize0;
4121 int yysize_overflow = 0;
4122 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
4123 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4127 /* This is so xgettext sees the translatable formats that are
4128 constructed on the fly. */
4129 YY_("syntax error, unexpected %s");
4130 YY_("syntax error, unexpected %s, expecting %s");
4131 YY_("syntax error, unexpected %s, expecting %s or %s");
4132 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4133 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4137 static char const yyunexpected[] = "syntax error, unexpected %s";
4138 static char const yyexpecting[] = ", expecting %s";
4139 static char const yyor[] = " or %s";
4140 char yyformat[sizeof yyunexpected
4141 + sizeof yyexpecting - 1
4142 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4143 * (sizeof yyor - 1))];
4144 char const *yyprefix = yyexpecting;
4146 /* Start YYX at -YYN if negative to avoid negative indexes in
4148 int yyxbegin = yyn < 0 ? -yyn : 0;
4150 /* Stay within bounds of both yycheck and yytname. */
4151 int yychecklim = YYLAST - yyn + 1;
4152 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4155 yyarg[0] = yytname[yytype];
4156 yyfmt = yystpcpy (yyformat, yyunexpected);
4158 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4159 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4161 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4165 yyformat[sizeof yyunexpected - 1] = '\0';
4168 yyarg[yycount++] = yytname[yyx];
4169 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4170 yysize_overflow |= (yysize1 < yysize);
4172 yyfmt = yystpcpy (yyfmt, yyprefix);
4176 yyf = YY_(yyformat);
4177 yysize1 = yysize + yystrlen (yyf);
4178 yysize_overflow |= (yysize1 < yysize);
4181 if (yysize_overflow)
4182 return YYSIZE_MAXIMUM;
4186 /* Avoid sprintf, as that infringes on the user's name space.
4187 Don't have undefined behavior even if the translation
4188 produced a string with the wrong number of "%s"s. */
4189 char *yyp = yyresult;
4191 while ((*yyp = *yyf) != '\0')
4193 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4195 yyp += yytnamerr (yyp, yyarg[yyi++]);
4208 #endif /* YYERROR_VERBOSE */
4211 /*-----------------------------------------------.
4212 | Release the memory associated to this symbol. |
4213 `-----------------------------------------------*/
4216 #if (defined __STDC__ || defined __C99__FUNC__ \
4217 || defined __cplusplus || defined _MSC_VER)
4219 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4222 yydestruct (yymsg, yytype, yyvaluep)
4232 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4242 /* Prevent warnings from -Wmissing-prototypes. */
4243 #ifdef YYPARSE_PARAM
4244 #if defined __STDC__ || defined __cplusplus
4245 int yyparse (void *YYPARSE_PARAM);
4249 #else /* ! YYPARSE_PARAM */
4250 #if defined __STDC__ || defined __cplusplus
4255 #endif /* ! YYPARSE_PARAM */
4258 /* The lookahead symbol. */
4261 /* The semantic value of the lookahead symbol. */
4264 /* Number of syntax errors so far. */
4269 /*-------------------------.
4270 | yyparse or yypush_parse. |
4271 `-------------------------*/
4273 #ifdef YYPARSE_PARAM
4274 #if (defined __STDC__ || defined __C99__FUNC__ \
4275 || defined __cplusplus || defined _MSC_VER)
4277 yyparse (void *YYPARSE_PARAM)
4280 yyparse (YYPARSE_PARAM)
4281 void *YYPARSE_PARAM;
4283 #else /* ! YYPARSE_PARAM */
4284 #if (defined __STDC__ || defined __C99__FUNC__ \
4285 || defined __cplusplus || defined _MSC_VER)
4298 /* Number of tokens to shift before error messages enabled. */
4301 /* The stacks and their tools:
4302 `yyss': related to states.
4303 `yyvs': related to semantic values.
4305 Refer to the stacks thru separate pointers, to allow yyoverflow
4306 to reallocate them elsewhere. */
4308 /* The state stack. */
4309 yytype_int16 yyssa[YYINITDEPTH];
4311 yytype_int16 *yyssp;
4313 /* The semantic value stack. */
4314 YYSTYPE yyvsa[YYINITDEPTH];
4318 YYSIZE_T yystacksize;
4322 /* Lookahead token as an internal (translated) token number. */
4324 /* The variables used to return semantic value and location from the
4329 /* Buffer for error messages, and its allocated size. */
4331 char *yymsg = yymsgbuf;
4332 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4335 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4337 /* The number of symbols on the RHS of the reduced rule.
4338 Keep to zero when no symbol should be popped. */
4344 yystacksize = YYINITDEPTH;
4346 YYDPRINTF ((stderr, "Starting parse\n"));
4351 yychar = YYEMPTY; /* Cause a token to be read. */
4353 /* Initialize stack pointers.
4354 Waste one element of value and location stack
4355 so that they stay on the same level as the state stack.
4356 The wasted elements are never initialized. */
4362 /*------------------------------------------------------------.
4363 | yynewstate -- Push a new state, which is found in yystate. |
4364 `------------------------------------------------------------*/
4366 /* In all cases, when you get here, the value and location stacks
4367 have just been pushed. So pushing a state here evens the stacks. */
4373 if (yyss + yystacksize - 1 <= yyssp)
4375 /* Get the current used size of the three stacks, in elements. */
4376 YYSIZE_T yysize = yyssp - yyss + 1;
4380 /* Give user a chance to reallocate the stack. Use copies of
4381 these so that the &'s don't force the real ones into
4383 YYSTYPE *yyvs1 = yyvs;
4384 yytype_int16 *yyss1 = yyss;
4386 /* Each stack pointer address is followed by the size of the
4387 data in use in that stack, in bytes. This used to be a
4388 conditional around just the two extra args, but that might
4389 be undefined if yyoverflow is a macro. */
4390 yyoverflow (YY_("memory exhausted"),
4391 &yyss1, yysize * sizeof (*yyssp),
4392 &yyvs1, yysize * sizeof (*yyvsp),
4398 #else /* no yyoverflow */
4399 # ifndef YYSTACK_RELOCATE
4400 goto yyexhaustedlab;
4402 /* Extend the stack our own way. */
4403 if (YYMAXDEPTH <= yystacksize)
4404 goto yyexhaustedlab;
4406 if (YYMAXDEPTH < yystacksize)
4407 yystacksize = YYMAXDEPTH;
4410 yytype_int16 *yyss1 = yyss;
4411 union yyalloc *yyptr =
4412 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4414 goto yyexhaustedlab;
4415 YYSTACK_RELOCATE (yyss_alloc, yyss);
4416 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4417 # undef YYSTACK_RELOCATE
4419 YYSTACK_FREE (yyss1);
4422 #endif /* no yyoverflow */
4424 yyssp = yyss + yysize - 1;
4425 yyvsp = yyvs + yysize - 1;
4427 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4428 (unsigned long int) yystacksize));
4430 if (yyss + yystacksize - 1 <= yyssp)
4434 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4436 if (yystate == YYFINAL)
4446 /* Do appropriate processing given the current state. Read a
4447 lookahead token if we need one and don't already have one. */
4449 /* First try to decide what to do without reference to lookahead token. */
4450 yyn = yypact[yystate];
4451 if (yyn == YYPACT_NINF)
4454 /* Not known => get a lookahead token if don't already have one. */
4456 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4457 if (yychar == YYEMPTY)
4459 YYDPRINTF ((stderr, "Reading a token: "));
4463 if (yychar <= YYEOF)
4465 yychar = yytoken = YYEOF;
4466 YYDPRINTF ((stderr, "Now at end of input.\n"));
4470 yytoken = YYTRANSLATE (yychar);
4471 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4474 /* If the proper action on seeing token YYTOKEN is to reduce or to
4475 detect an error, take that action. */
4477 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4482 if (yyn == 0 || yyn == YYTABLE_NINF)
4488 /* Count tokens shifted since error; after three, turn off error
4493 /* Shift the lookahead token. */
4494 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4496 /* Discard the shifted token. */
4505 /*-----------------------------------------------------------.
4506 | yydefault -- do the default action for the current state. |
4507 `-----------------------------------------------------------*/
4509 yyn = yydefact[yystate];
4515 /*-----------------------------.
4516 | yyreduce -- Do a reduction. |
4517 `-----------------------------*/
4519 /* yyn is the number of a rule to reduce with. */
4522 /* If YYLEN is nonzero, implement the default value of the action:
4525 Otherwise, the following line sets YYVAL to garbage.
4526 This behavior is undocumented and Bison
4527 users should not rely upon it. Assigning to YYVAL
4528 unconditionally makes the parser a bit smaller, and it avoids a
4529 GCC warning that YYVAL may be used uninitialized. */
4530 yyval = yyvsp[1-yylen];
4533 YY_REDUCE_PRINT (yyn);
4540 /* Line 1464 of skeleton.m4 */
4541 #line 1916 "parser.y"
4542 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4551 /* Line 1464 of skeleton.m4 */
4552 #line 1928 "parser.y"
4553 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4562 /* Line 1464 of skeleton.m4 */
4563 #line 1931 "parser.y"
4564 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4573 /* Line 1464 of skeleton.m4 */
4574 #line 1932 "parser.y"
4575 {(yyval.code)=code_new();}
4584 /* Line 1464 of skeleton.m4 */
4585 #line 1934 "parser.y"
4587 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4597 /* Line 1464 of skeleton.m4 */
4598 #line 1937 "parser.y"
4599 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4608 /* Line 1464 of skeleton.m4 */
4609 #line 1953 "parser.y"
4610 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4619 /* Line 1464 of skeleton.m4 */
4620 #line 1954 "parser.y"
4630 /* Line 1464 of skeleton.m4 */
4631 #line 1957 "parser.y"
4641 /* Line 1464 of skeleton.m4 */
4642 #line 1964 "parser.y"
4646 (yyval.code) = (yyvsp[(3) - (4)].code);
4650 as3_pass=(yyvsp[(1) - (4)].number_int);
4660 /* Line 1464 of skeleton.m4 */
4661 #line 1976 "parser.y"
4662 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4671 /* Line 1464 of skeleton.m4 */
4672 #line 1977 "parser.y"
4673 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4682 /* Line 1464 of skeleton.m4 */
4683 #line 1981 "parser.y"
4685 code_t**cc = &global->init->method->body->code;
4686 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4696 /* Line 1464 of skeleton.m4 */
4697 #line 1988 "parser.y"
4700 (yyval.number_int)=as3_pass;
4701 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4702 if(!definitions || !dict_contains(definitions, key)) {
4715 /* Line 1464 of skeleton.m4 */
4716 #line 2007 "parser.y"
4717 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4726 /* Line 1464 of skeleton.m4 */
4727 #line 2008 "parser.y"
4728 {(yyval.node)=mkdummynode();}
4737 /* Line 1464 of skeleton.m4 */
4738 #line 2010 "parser.y"
4739 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4748 /* Line 1464 of skeleton.m4 */
4749 #line 2011 "parser.y"
4750 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4759 /* Line 1464 of skeleton.m4 */
4760 #line 2013 "parser.y"
4761 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4770 /* Line 1464 of skeleton.m4 */
4771 #line 2014 "parser.y"
4772 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4781 /* Line 1464 of skeleton.m4 */
4782 #line 2017 "parser.y"
4785 if(variable_exists((yyvsp[(1) - (3)].id)))
4786 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4788 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4793 if(state->method->uses_slots) {
4794 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4796 // this variable is stored in a slot
4798 v->type = (yyvsp[(2) - (3)].classinfo);
4804 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4807 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4809 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
4810 if(!is_subtype_of(v.t, (yyvsp[(2) - (3)].classinfo))) {
4811 syntaxerror("Can't convert %s to %s", v.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4813 if((yyvsp[(2) - (3)].classinfo)) {
4814 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4815 (yyval.code) = code_append((yyval.code), v.c);
4816 (yyval.code) = converttype((yyval.code), v.t, (yyvsp[(2) - (3)].classinfo));
4819 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4822 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4823 (yyval.code) = code_append((yyval.code), v.c);
4824 (yyval.code) = abc_coerce_a((yyval.code));
4826 // don't do anything
4828 code_free((yyval.code));
4834 (yyval.code) = abc_setslot((yyval.code), index);
4836 (yyval.code) = abc_setlocal((yyval.code), index);
4847 /* Line 1464 of skeleton.m4 */
4848 #line 2076 "parser.y"
4849 {(yyval.code) = code_new();}
4858 /* Line 1464 of skeleton.m4 */
4859 #line 2077 "parser.y"
4860 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4869 /* Line 1464 of skeleton.m4 */
4870 #line 2080 "parser.y"
4871 {PASS12 new_state();}
4880 /* Line 1464 of skeleton.m4 */
4881 #line 2080 "parser.y"
4884 (yyval.code) = code_new();
4885 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4886 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4888 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4889 if((yyvsp[(7) - (7)].code)) {
4890 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4892 myif->branch = (yyval.code) = abc_nop((yyval.code));
4893 if((yyvsp[(7) - (7)].code)) {
4894 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4895 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4897 (yyval.code) = var_block((yyval.code));
4908 /* Line 1464 of skeleton.m4 */
4909 #line 2099 "parser.y"
4910 {(yyval.code)=code_new();}
4919 /* Line 1464 of skeleton.m4 */
4920 #line 2106 "parser.y"
4922 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4923 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4933 /* Line 1464 of skeleton.m4 */
4934 #line 2110 "parser.y"
4937 (yyval.id)=(yyvsp[(1) - (1)].id);
4947 /* Line 1464 of skeleton.m4 */
4948 #line 2115 "parser.y"
4949 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4958 /* Line 1464 of skeleton.m4 */
4959 #line 2116 "parser.y"
4960 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4969 /* Line 1464 of skeleton.m4 */
4970 #line 2118 "parser.y"
4972 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4973 (yyval.code) = code_new();
4974 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4975 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4976 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4977 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4978 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4979 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4980 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4981 (yyval.code) = abc_jump((yyval.code), loopstart);
4982 code_t*out = (yyval.code) = abc_nop((yyval.code));
4983 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4984 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4987 (yyval.code) = var_block((yyval.code));
4998 /* Line 1464 of skeleton.m4 */
4999 #line 2138 "parser.y"
5001 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
5003 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
5006 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
5007 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
5008 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
5009 int array = new_variable(tmp1name, 0, 0, 0);
5011 (yyval.code) = code_new();
5012 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5013 (yyval.code) = abc_coerce_a((yyval.code));
5014 (yyval.code) = abc_setlocal((yyval.code), array);
5015 (yyval.code) = abc_pushbyte((yyval.code), 0);
5016 (yyval.code) = abc_setlocal((yyval.code), it);
5018 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5020 (yyval.code) = abc_hasnext2((yyval.code), array, it);
5021 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
5022 (yyval.code) = abc_getlocal((yyval.code), array);
5023 (yyval.code) = abc_getlocal((yyval.code), it);
5024 if(!(yyvsp[(1) - (6)].for_start).each)
5025 (yyval.code) = abc_nextname((yyval.code));
5027 (yyval.code) = abc_nextvalue((yyval.code));
5028 (yyval.code) = converttype((yyval.code), 0, var->type);
5029 (yyval.code) = abc_setlocal((yyval.code), var->index);
5031 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5032 (yyval.code) = abc_jump((yyval.code), loopstart);
5034 code_t*out = (yyval.code) = abc_nop((yyval.code));
5035 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
5036 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
5040 (yyval.code) = var_block((yyval.code));
5055 /* Line 1464 of skeleton.m4 */
5056 #line 2186 "parser.y"
5057 {PASS12 new_state();}
5066 /* Line 1464 of skeleton.m4 */
5067 #line 2186 "parser.y"
5070 (yyval.code) = code_new();
5072 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
5073 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5074 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5075 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5076 myjmp->branch = cont;
5077 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5078 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5079 code_t*out = (yyval.code) = abc_nop((yyval.code));
5080 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5081 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5083 (yyval.code) = var_block((yyval.code));
5094 /* Line 1464 of skeleton.m4 */
5095 #line 2205 "parser.y"
5096 {PASS12 new_state();}
5105 /* Line 1464 of skeleton.m4 */
5106 #line 2205 "parser.y"
5108 (yyval.code) = code_new();
5109 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5110 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
5111 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5112 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
5113 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5114 code_t*out = (yyval.code) = abc_nop((yyval.code));
5115 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
5116 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
5118 (yyval.code) = var_block((yyval.code));
5129 /* Line 1464 of skeleton.m4 */
5130 #line 2220 "parser.y"
5132 (yyval.code) = abc___break__(0, "");
5142 /* Line 1464 of skeleton.m4 */
5143 #line 2223 "parser.y"
5145 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5155 /* Line 1464 of skeleton.m4 */
5156 #line 2226 "parser.y"
5158 (yyval.code) = abc___continue__(0, "");
5168 /* Line 1464 of skeleton.m4 */
5169 #line 2229 "parser.y"
5171 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5181 /* Line 1464 of skeleton.m4 */
5182 #line 2233 "parser.y"
5192 /* Line 1464 of skeleton.m4 */
5193 #line 2234 "parser.y"
5194 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5203 /* Line 1464 of skeleton.m4 */
5204 #line 2235 "parser.y"
5205 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5214 /* Line 1464 of skeleton.m4 */
5215 #line 2236 "parser.y"
5216 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5225 /* Line 1464 of skeleton.m4 */
5226 #line 2237 "parser.y"
5227 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5236 /* Line 1464 of skeleton.m4 */
5237 #line 2238 "parser.y"
5238 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5247 /* Line 1464 of skeleton.m4 */
5248 #line 2240 "parser.y"
5250 (yyval.code) = abc_getlocal(0, state->switch_var);
5251 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5252 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5253 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5254 if((yyval.code)->opcode != OPCODE___BREAK__) {
5255 (yyval.code) = abc___fallthrough__((yyval.code), "");
5257 code_t*e = (yyval.code) = abc_nop((yyval.code));
5268 /* Line 1464 of skeleton.m4 */
5269 #line 2251 "parser.y"
5271 (yyval.code) = (yyvsp[(3) - (3)].code);
5281 /* Line 1464 of skeleton.m4 */
5282 #line 2254 "parser.y"
5283 {PASS12 new_state();state->switch_var=alloc_local();}
5292 /* Line 1464 of skeleton.m4 */
5293 #line 2254 "parser.y"
5295 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5296 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5297 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5299 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5300 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5302 code_t*c = (yyval.code),*lastblock=0;
5304 if(c->opcode == OPCODE_IFNE) {
5305 if(!c->next) syntaxerror("internal error in fallthrough handling");
5307 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5309 c->opcode = OPCODE_JUMP;
5310 c->branch = lastblock;
5312 /* fall through end of switch */
5313 c->opcode = OPCODE_NOP;
5319 (yyval.code) = var_block((yyval.code));
5330 /* Line 1464 of skeleton.m4 */
5331 #line 2285 "parser.y"
5332 {PASS12 new_state();
5333 state->exception_name=(yyvsp[(3) - (5)].id);
5334 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5335 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5345 /* Line 1464 of skeleton.m4 */
5346 #line 2290 "parser.y"
5348 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5349 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5351 NEW(abc_exception_t, e)
5352 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5353 e->var_name = multiname_clone(&name);
5354 (yyval.exception) = e;
5357 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5358 e->target = c = abc_nop(0);
5359 c = abc_setlocal(c, i);
5360 c = code_append(c, code_dup(state->method->scope_code));
5361 c = code_append(c, (yyvsp[(8) - (9)].code));
5375 /* Line 1464 of skeleton.m4 */
5376 #line 2310 "parser.y"
5377 {PASS12 new_state();state->exception_name=0;}
5386 /* Line 1464 of skeleton.m4 */
5387 #line 2310 "parser.y"
5389 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5390 if(!(yyvsp[(4) - (5)].code)) {
5391 (yyval.exception)=0;
5393 NEW(abc_exception_t, e)
5394 e->exc_type = 0; //all exceptions
5395 e->var_name = 0; //no name
5398 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5399 (yyval.exception) = e;
5411 /* Line 1464 of skeleton.m4 */
5412 #line 2326 "parser.y"
5413 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5422 /* Line 1464 of skeleton.m4 */
5423 #line 2327 "parser.y"
5424 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5433 /* Line 1464 of skeleton.m4 */
5434 #line 2328 "parser.y"
5435 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5444 /* Line 1464 of skeleton.m4 */
5445 #line 2329 "parser.y"
5447 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5448 (yyval.catch_list).finally = 0;
5449 if((yyvsp[(2) - (2)].exception)) {
5450 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5451 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5462 /* Line 1464 of skeleton.m4 */
5463 #line 2337 "parser.y"
5465 (yyval.catch_list).l=list_new();
5466 (yyval.catch_list).finally = 0;
5467 if((yyvsp[(1) - (1)].exception)) {
5468 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5469 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5480 /* Line 1464 of skeleton.m4 */
5481 #line 2346 "parser.y"
5482 {PASS12 new_state();
5483 state->method->has_exceptions=1;
5484 state->method->late_binding=1;//for invariant scope_code
5494 /* Line 1464 of skeleton.m4 */
5495 #line 2349 "parser.y"
5497 code_t*out = abc_nop(0);
5499 code_t*start = abc_nop(0);
5500 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5501 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5502 (yyval.code) = abc_jump((yyval.code), out);
5504 code_t*end = (yyval.code) = abc_nop((yyval.code));
5507 if((yyvsp[(6) - (6)].catch_list).finally)
5508 tmp = new_variable("__finally__", 0, 0, 0);
5510 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5513 abc_exception_t*e = l->abc_exception;
5515 (yyval.code) = code_append((yyval.code), e->target);
5516 (yyval.code) = abc_jump((yyval.code), out);
5518 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5520 e->target = (yyval.code) = abc_nop((yyval.code));
5521 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5522 (yyval.code) = abc___rethrow__((yyval.code));
5530 (yyval.code) = code_append((yyval.code), out);
5532 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5534 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5536 (yyval.code) = var_block((yyval.code));
5547 /* Line 1464 of skeleton.m4 */
5548 #line 2395 "parser.y"
5550 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5551 (yyval.code)=abc_throw((yyval.code));
5561 /* Line 1464 of skeleton.m4 */
5562 #line 2399 "parser.y"
5564 if(!state->exception_name)
5565 syntaxerror("re-throw only possible within a catch block");
5566 variable_t*v = find_variable(state, state->exception_name);
5567 (yyval.code)=code_new();
5568 (yyval.code)=abc_getlocal((yyval.code), v->index);
5569 (yyval.code)=abc_throw((yyval.code));
5579 /* Line 1464 of skeleton.m4 */
5580 #line 2410 "parser.y"
5583 if(state->method->has_exceptions) {
5584 int v = alloc_local();
5585 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5586 state->method->scope_code = abc_pushwith(state->method->scope_code);
5587 (yyval.value_list).number = v;
5589 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5599 /* Line 1464 of skeleton.m4 */
5600 #line 2420 "parser.y"
5602 /* remove getlocal;pushwith from scope code again */
5603 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5605 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5606 if(state->method->has_exceptions) {
5607 (yyval.code) = abc_dup((yyval.code));
5608 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5610 (yyval.code) = abc_pushwith((yyval.code));
5611 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5612 (yyval.code) = abc_popscope((yyval.code));
5623 /* Line 1464 of skeleton.m4 */
5624 #line 2438 "parser.y"
5625 {PASS12 (yyval.id)="package";}
5634 /* Line 1464 of skeleton.m4 */
5635 #line 2439 "parser.y"
5636 {PASS12 (yyval.id)="namespace";}
5645 /* Line 1464 of skeleton.m4 */
5646 #line 2440 "parser.y"
5647 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5656 /* Line 1464 of skeleton.m4 */
5657 #line 2442 "parser.y"
5658 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5667 /* Line 1464 of skeleton.m4 */
5668 #line 2443 "parser.y"
5669 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5678 /* Line 1464 of skeleton.m4 */
5679 #line 2445 "parser.y"
5680 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5689 /* Line 1464 of skeleton.m4 */
5690 #line 2446 "parser.y"
5691 {PASS12 endpackage();(yyval.code)=0;}
5700 /* Line 1464 of skeleton.m4 */
5701 #line 2447 "parser.y"
5702 {PASS12 startpackage("");}
5711 /* Line 1464 of skeleton.m4 */
5712 #line 2448 "parser.y"
5713 {PASS12 endpackage();(yyval.code)=0;}
5722 /* Line 1464 of skeleton.m4 */
5723 #line 2470 "parser.y"
5726 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5727 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5728 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5730 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5732 syntaxerror("Couldn't import class\n");
5733 state_has_imports();
5734 dict_put(state->imports, c->name, c);
5735 import_toplevel(c->package);
5746 /* Line 1464 of skeleton.m4 */
5747 #line 2484 "parser.y"
5750 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5751 as3_schedule_package((yyvsp[(2) - (4)].id));
5755 i->package = (yyvsp[(2) - (4)].id);
5756 state_has_imports();
5757 list_append(state->wildcard_imports, i);
5758 import_toplevel(i->package);
5769 /* Line 1464 of skeleton.m4 */
5770 #line 2500 "parser.y"
5771 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5780 /* Line 1464 of skeleton.m4 */
5781 #line 2501 "parser.y"
5782 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5791 /* Line 1464 of skeleton.m4 */
5792 #line 2502 "parser.y"
5793 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5802 /* Line 1464 of skeleton.m4 */
5803 #line 2503 "parser.y"
5806 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5807 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5808 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5819 /* Line 1464 of skeleton.m4 */
5820 #line 2510 "parser.y"
5821 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5830 /* Line 1464 of skeleton.m4 */
5831 #line 2511 "parser.y"
5832 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5841 /* Line 1464 of skeleton.m4 */
5842 #line 2512 "parser.y"
5843 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5852 /* Line 1464 of skeleton.m4 */
5853 #line 2513 "parser.y"
5854 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5863 /* Line 1464 of skeleton.m4 */
5864 #line 2514 "parser.y"
5865 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5874 /* Line 1464 of skeleton.m4 */
5875 #line 2515 "parser.y"
5876 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5885 /* Line 1464 of skeleton.m4 */
5886 #line 2516 "parser.y"
5887 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5896 /* Line 1464 of skeleton.m4 */
5897 #line 2517 "parser.y"
5898 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5907 /* Line 1464 of skeleton.m4 */
5908 #line 2518 "parser.y"
5909 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5918 /* Line 1464 of skeleton.m4 */
5919 #line 2519 "parser.y"
5920 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5921 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5931 /* Line 1464 of skeleton.m4 */
5932 #line 2523 "parser.y"
5933 {PASS12 (yyval.classinfo)=0;}
5942 /* Line 1464 of skeleton.m4 */
5943 #line 2524 "parser.y"
5944 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5953 /* Line 1464 of skeleton.m4 */
5954 #line 2526 "parser.y"
5955 {PASS12 (yyval.classinfo_list)=list_new();}
5964 /* Line 1464 of skeleton.m4 */
5965 #line 2527 "parser.y"
5966 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5975 /* Line 1464 of skeleton.m4 */
5976 #line 2529 "parser.y"
5977 {PASS12 (yyval.classinfo_list)=list_new();}
5986 /* Line 1464 of skeleton.m4 */
5987 #line 2530 "parser.y"
5988 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5997 /* Line 1464 of skeleton.m4 */
5998 #line 2534 "parser.y"
5999 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
6008 /* Line 1464 of skeleton.m4 */
6009 #line 2536 "parser.y"
6010 {PASS12 endclass();(yyval.code)=0;}
6019 /* Line 1464 of skeleton.m4 */
6020 #line 2540 "parser.y"
6021 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
6022 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
6031 /* Line 1464 of skeleton.m4 */
6032 #line 2543 "parser.y"
6033 {PASS12 endclass();(yyval.code)=0;}
6042 /* Line 1464 of skeleton.m4 */
6043 #line 2552 "parser.y"
6044 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
6053 /* Line 1464 of skeleton.m4 */
6054 #line 2556 "parser.y"
6056 code_t*c = state->cls->static_init->header;
6057 c = code_append(c, (yyvsp[(1) - (1)].code));
6058 state->cls->static_init->header = c;
6068 /* Line 1464 of skeleton.m4 */
6069 #line 2567 "parser.y"
6071 syntaxerror("variable declarations not allowed in interfaces");
6081 /* Line 1464 of skeleton.m4 */
6082 #line 2570 "parser.y"
6085 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
6086 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
6087 syntaxerror("invalid method modifiers: interface methods always need to be public");
6089 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
6090 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
6091 list_deep_free((yyvsp[(6) - (8)].params).list);
6101 /* Line 1464 of skeleton.m4 */
6102 #line 2644 "parser.y"
6103 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
6112 /* Line 1464 of skeleton.m4 */
6113 #line 2644 "parser.y"
6114 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
6123 /* Line 1464 of skeleton.m4 */
6124 #line 2646 "parser.y"
6125 {PASS12 (yyval.code)=0;}
6134 /* Line 1464 of skeleton.m4 */
6135 #line 2647 "parser.y"
6136 {PASS12 (yyval.code)=0;}
6145 /* Line 1464 of skeleton.m4 */
6146 #line 2650 "parser.y"
6149 int flags = slotstate_flags->flags;
6150 namespace_t ns = modifiers2access(slotstate_flags);
6154 varinfo_t* info = 0;
6156 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6158 check_override(i, flags);
6160 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6162 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6164 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6166 if(ns.name && ns.name[0]) {
6167 syntaxerror("namespaces not allowed on package-level variables");
6169 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6172 info->type = (yyvsp[(2) - (3)].classinfo);
6173 info->flags = flags;
6175 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6179 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6183 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6185 if((yyvsp[(2) - (3)].classinfo)) {
6186 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6187 t->type_name = multiname_clone(&m);
6189 info->slot = t->slot_id;
6191 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6192 FIXME: is there a way to use slots and still don't have conflicting overrides?
6194 info->slot = t->slot_id = 0;
6196 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6197 if(cval.type!=CONSTANT_UNKNOWN) {
6198 /* compile time constant */
6199 t->value = malloc(sizeof(constant_t));
6200 memcpy(t->value, &cval, sizeof(constant_t));
6201 info->value = constant_clone(t->value);
6203 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6204 /* initalization code (if needed) */
6206 if(v.c && !is_pushundefined(v.c)) {
6207 c = abc_getlocal_0(c);
6208 c = code_append(c, v.c);
6209 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6211 c = abc_initproperty2(c, &mname);
6213 c = abc_setslot(c, t->slot_id);
6216 *code = code_append(*code, c);
6219 if(slotstate_varconst==KW_CONST) {
6220 t->kind= TRAIT_CONST;
6221 info->flags |= FLAG_CONST;
6235 /* Line 1464 of skeleton.m4 */
6236 #line 2733 "parser.y"
6237 {(yyval.constant)=0;}
6246 /* Line 1464 of skeleton.m4 */
6247 #line 2734 "parser.y"
6249 (yyval.constant) = malloc(sizeof(constant_t));
6250 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6251 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6252 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6263 /* Line 1464 of skeleton.m4 */
6264 #line 2743 "parser.y"
6265 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6274 /* Line 1464 of skeleton.m4 */
6275 #line 2744 "parser.y"
6277 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6287 /* Line 1464 of skeleton.m4 */
6288 #line 2747 "parser.y"
6289 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6298 /* Line 1464 of skeleton.m4 */
6299 #line 2748 "parser.y"
6300 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6309 /* Line 1464 of skeleton.m4 */
6310 #line 2749 "parser.y"
6311 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6320 /* Line 1464 of skeleton.m4 */
6321 #line 2750 "parser.y"
6322 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6331 /* Line 1464 of skeleton.m4 */
6332 #line 2751 "parser.y"
6333 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6342 /* Line 1464 of skeleton.m4 */
6343 #line 2752 "parser.y"
6344 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6353 /* Line 1464 of skeleton.m4 */
6354 #line 2753 "parser.y"
6355 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6364 /* Line 1464 of skeleton.m4 */
6365 #line 2773 "parser.y"
6366 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6375 /* Line 1464 of skeleton.m4 */
6376 #line 2774 "parser.y"
6377 {PASS_ALWAYS tokenizer_begin_xmltext();}
6386 /* Line 1464 of skeleton.m4 */
6387 #line 2775 "parser.y"
6388 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6397 /* Line 1464 of skeleton.m4 */
6398 #line 2777 "parser.y"
6399 {PASS_ALWAYS tokenizer_begin_xmltext();}
6408 /* Line 1464 of skeleton.m4 */
6409 #line 2777 "parser.y"
6411 (yyval.id)=strdup("{...}");
6412 as3_warning("xml string substitution not yet supported");
6422 /* Line 1464 of skeleton.m4 */
6423 #line 2781 "parser.y"
6424 {PASS_ALWAYS tokenizer_begin_xml();}
6433 /* Line 1464 of skeleton.m4 */
6434 #line 2781 "parser.y"
6436 (yyval.id)=strdup("{...}");
6437 as3_warning("xml string substitution not yet supported");
6447 /* Line 1464 of skeleton.m4 */
6448 #line 2785 "parser.y"
6458 /* Line 1464 of skeleton.m4 */
6459 #line 2786 "parser.y"
6461 (yyval.id) = concat2((yyvsp[(1) - (2)].id), "{...}");
6471 /* Line 1464 of skeleton.m4 */
6472 #line 2789 "parser.y"
6473 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), string_cstr(&(yyvsp[(2) - (2)].str)));}
6482 /* Line 1464 of skeleton.m4 */
6483 #line 2790 "parser.y"
6484 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), ">");}
6493 /* Line 1464 of skeleton.m4 */
6494 #line 2792 "parser.y"
6495 {(yyval.id)=concat2((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].id));}
6504 /* Line 1464 of skeleton.m4 */
6505 #line 2793 "parser.y"
6506 {(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));}
6515 /* Line 1464 of skeleton.m4 */
6516 #line 2795 "parser.y"
6517 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6526 /* Line 1464 of skeleton.m4 */
6527 #line 2796 "parser.y"
6528 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6537 /* Line 1464 of skeleton.m4 */
6538 #line 2798 "parser.y"
6540 (yyval.id) = allocprintf("<%s%s>%s</%s>", (yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].id), (yyvsp[(5) - (10)].id), (yyvsp[(8) - (10)].id));
6541 free((yyvsp[(2) - (10)].id));free((yyvsp[(3) - (10)].id));free((yyvsp[(5) - (10)].id));free((yyvsp[(8) - (10)].id));
6551 /* Line 1464 of skeleton.m4 */
6552 #line 2802 "parser.y"
6554 (yyval.id) = allocprintf("<%s%s/>", (yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].id));
6564 /* Line 1464 of skeleton.m4 */
6565 #line 2805 "parser.y"
6567 (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));
6568 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));
6578 /* Line 1464 of skeleton.m4 */
6579 #line 2810 "parser.y"
6580 {(yyval.id)=strdup("");}
6589 /* Line 1464 of skeleton.m4 */
6590 #line 2811 "parser.y"
6591 {(yyval.id)=concat2(" ",(yyvsp[(1) - (1)].id));}
6600 /* Line 1464 of skeleton.m4 */
6601 #line 2812 "parser.y"
6602 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6611 /* Line 1464 of skeleton.m4 */
6612 #line 2813 "parser.y"
6613 {(yyval.id)=concat3((yyvsp[(1) - (2)].id)," ",(yyvsp[(2) - (2)].id));free((yyvsp[(1) - (2)].id));free((yyvsp[(2) - (2)].id));}
6622 /* Line 1464 of skeleton.m4 */
6623 #line 2815 "parser.y"
6625 (yyval.id) = strdup("{...}");
6635 /* Line 1464 of skeleton.m4 */
6636 #line 2818 "parser.y"
6638 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6639 (yyval.id) = concat2("{...}=",str);
6649 /* Line 1464 of skeleton.m4 */
6650 #line 2822 "parser.y"
6652 (yyval.id) = strdup("{...}={...}");
6662 /* Line 1464 of skeleton.m4 */
6663 #line 2825 "parser.y"
6665 (yyval.id) = concat2((yyvsp[(1) - (3)].id),"={...}");
6675 /* Line 1464 of skeleton.m4 */
6676 #line 2828 "parser.y"
6678 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6679 (yyval.id)=allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str);
6681 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6691 /* Line 1464 of skeleton.m4 */
6692 #line 2838 "parser.y"
6695 memset(&(yyval.params),0,sizeof((yyval.params)));
6705 /* Line 1464 of skeleton.m4 */
6706 #line 2842 "parser.y"
6709 (yyval.params)=(yyvsp[(1) - (1)].params);
6719 /* Line 1464 of skeleton.m4 */
6720 #line 2848 "parser.y"
6723 memset(&(yyval.params),0,sizeof((yyval.params)));
6724 (yyval.params).varargs=1;
6725 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6735 /* Line 1464 of skeleton.m4 */
6736 #line 2854 "parser.y"
6739 (yyval.params) =(yyvsp[(1) - (4)].params);
6740 (yyval.params).varargs=1;
6741 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6751 /* Line 1464 of skeleton.m4 */
6752 #line 2862 "parser.y"
6755 (yyval.params) = (yyvsp[(1) - (3)].params);
6756 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6766 /* Line 1464 of skeleton.m4 */
6767 #line 2867 "parser.y"
6770 memset(&(yyval.params),0,sizeof((yyval.params)));
6771 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6781 /* Line 1464 of skeleton.m4 */
6782 #line 2873 "parser.y"
6785 (yyval.param) = rfx_calloc(sizeof(param_t));
6786 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6787 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6789 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6799 /* Line 1464 of skeleton.m4 */
6800 #line 2881 "parser.y"
6803 (yyval.param) = rfx_calloc(sizeof(param_t));
6804 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6805 (yyval.param)->type = TYPE_ANY;
6807 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6817 /* Line 1464 of skeleton.m4 */
6818 #line 2891 "parser.y"
6819 {PASS12 (yyval.token)=0;}
6828 /* Line 1464 of skeleton.m4 */
6829 #line 2894 "parser.y"
6830 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6839 /* Line 1464 of skeleton.m4 */
6840 #line 2895 "parser.y"
6843 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6845 if(!state->method->info) syntaxerror("internal error");
6847 code_t*c = method_header(state->method);
6848 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6850 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6852 list_deep_free((yyvsp[(6) - (12)].params).list);
6863 /* Line 1464 of skeleton.m4 */
6864 #line 2911 "parser.y"
6865 {PASS12 (yyval.id)=0;}
6874 /* Line 1464 of skeleton.m4 */
6875 #line 2913 "parser.y"
6876 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6885 /* Line 1464 of skeleton.m4 */
6886 #line 2914 "parser.y"
6889 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6891 methodinfo_t*f = state->method->info;
6892 if(!f || !f->kind) syntaxerror("internal error");
6894 code_t*c = method_header(state->method);
6895 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6897 int index = state->method->var_index;
6898 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6900 (yyval.value).c = abc_getlocal(0, index);
6901 (yyval.value).t = TYPE_FUNCTION(f);
6903 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6913 /* Line 1464 of skeleton.m4 */
6914 #line 2936 "parser.y"
6916 PASS1 NEW(unresolvedinfo_t,c);
6917 memset(c, 0, sizeof(*c));
6918 c->kind = INFOTYPE_UNRESOLVED;
6919 c->name = (yyvsp[(1) - (1)].id);
6920 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6922 c->nsset = get_current_imports();
6923 /* make the compiler look for this class in the current directory,
6925 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6927 (yyval.classinfo) = (classinfo_t*)c;
6929 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6930 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6931 (yyval.classinfo) = (classinfo_t*)s;
6941 /* Line 1464 of skeleton.m4 */
6942 #line 2955 "parser.y"
6944 PASS1 NEW(unresolvedinfo_t,c);
6945 memset(c, 0, sizeof(*c));
6946 c->kind = INFOTYPE_UNRESOLVED;
6947 c->package = (yyvsp[(1) - (3)].id);
6948 c->name = (yyvsp[(3) - (3)].id);
6949 (yyval.classinfo) = (classinfo_t*)c;
6951 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6952 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6953 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6954 (yyval.classinfo) = (classinfo_t*)s;
6964 /* Line 1464 of skeleton.m4 */
6965 #line 2972 "parser.y"
6966 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6975 /* Line 1464 of skeleton.m4 */
6976 #line 2973 "parser.y"
6977 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6986 /* Line 1464 of skeleton.m4 */
6987 #line 2975 "parser.y"
6988 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6997 /* Line 1464 of skeleton.m4 */
6998 #line 2976 "parser.y"
6999 {PASS12 (yyval.classinfo)=TYPE_ANY;}
7008 /* Line 1464 of skeleton.m4 */
7009 #line 2977 "parser.y"
7010 {PASS12 (yyval.classinfo)=TYPE_VOID;}
7019 /* Line 1464 of skeleton.m4 */
7020 #line 2986 "parser.y"
7021 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
7030 /* Line 1464 of skeleton.m4 */
7031 #line 2987 "parser.y"
7032 {PASS12 (yyval.classinfo)=0;}
7041 /* Line 1464 of skeleton.m4 */
7042 #line 2991 "parser.y"
7043 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7052 /* Line 1464 of skeleton.m4 */
7053 #line 2992 "parser.y"
7054 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
7063 /* Line 1464 of skeleton.m4 */
7064 #line 2994 "parser.y"
7065 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7074 /* Line 1464 of skeleton.m4 */
7075 #line 2998 "parser.y"
7076 {(yyval.value_list).number=1;
7077 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
7087 /* Line 1464 of skeleton.m4 */
7088 #line 3002 "parser.y"
7089 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
7098 /* Line 1464 of skeleton.m4 */
7099 #line 3003 "parser.y"
7101 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
7102 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
7112 /* Line 1464 of skeleton.m4 */
7113 #line 3009 "parser.y"
7115 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
7116 (yyval.value).c = v.c;
7117 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
7119 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
7120 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7121 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7122 (yyval.value).c = code_cutlast((yyval.value).c);
7123 (yyval.value).c = code_append((yyval.value).c, paramcode);
7124 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
7125 multiname_destroy(name);
7126 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7127 code_free((yyval.value).c);
7128 classinfo_t*c = v.t->data;
7130 (yyval.value).c = abc_findpropstrict2(0, &m);
7131 (yyval.value).c = code_append((yyval.value).c, paramcode);
7132 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
7133 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
7134 int slot = (int)(ptroff_t)$$.c->data[0];
7135 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
7136 multiname_t*name = t->name;
7137 $$.c = code_cutlast($$.c);
7138 $$.c = code_append($$.c, paramcode);
7139 $$.c = abc_constructprop2($$.c, name, $4.number);*/
7141 (yyval.value).c = code_append((yyval.value).c, paramcode);
7142 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
7145 (yyval.value).t = TYPE_ANY;
7146 if(TYPE_IS_CLASS(v.t) && v.t->data) {
7147 (yyval.value).t = v.t->data;
7149 (yyval.value).c = abc_coerce_a((yyval.value).c);
7150 (yyval.value).t = TYPE_ANY;
7161 /* Line 1464 of skeleton.m4 */
7162 #line 3053 "parser.y"
7165 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
7166 (yyval.value).c = v.c;
7167 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7168 (yyval.value).c = code_cutlast((yyval.value).c);
7170 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
7172 (yyval.value).t = TYPE_ANY;
7173 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7174 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7175 (yyval.value).c = code_cutlast((yyval.value).c);
7176 (yyval.value).c = code_append((yyval.value).c, paramcode);
7177 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7178 multiname_destroy(name);
7179 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7180 int slot = (int)(ptroff_t)$$.c->data[0];
7181 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7182 if(t->kind!=TRAIT_METHOD) {
7183 //ok: flash allows to assign closures to members.
7185 multiname_t*name = t->name;
7186 $$.c = code_cutlast($$.c);
7187 $$.c = code_append($$.c, paramcode);
7188 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7189 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7190 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7191 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7192 (yyval.value).c = code_cutlast((yyval.value).c);
7193 (yyval.value).c = code_append((yyval.value).c, paramcode);
7194 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7195 multiname_destroy(name);
7197 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7198 (yyval.value).c = code_append((yyval.value).c, paramcode);
7199 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7202 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7203 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7204 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7205 // calling a class is like a typecast
7206 (yyval.value).t = (classinfo_t*)v.t->data;
7208 (yyval.value).t = TYPE_ANY;
7209 (yyval.value).c = abc_coerce_a((yyval.value).c);
7220 /* Line 1464 of skeleton.m4 */
7221 #line 3103 "parser.y"
7223 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7224 if(!state->method) syntaxerror("super() not allowed outside of a function");
7225 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7227 (yyval.value).c = code_new();
7228 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7230 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7232 this is dependent on the control path, check this somewhere else
7233 if(state->method->has_super)
7234 syntaxerror("constructor may call super() only once");
7236 state->method->has_super = 1;
7238 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7239 (yyval.value).c = abc_pushundefined((yyval.value).c);
7240 (yyval.value).t = TYPE_ANY;
7250 /* Line 1464 of skeleton.m4 */
7251 #line 3124 "parser.y"
7253 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7254 (yyval.value).c = v.c;
7255 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7256 (yyval.value).c = code_cutlast((yyval.value).c);
7258 multiname_t*name = 0;
7259 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7260 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7261 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7262 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7263 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7264 (yyval.value).c = code_cutlast((yyval.value).c);
7265 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7267 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7268 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7269 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7271 (yyval.value).t = TYPE_BOOLEAN;
7281 /* Line 1464 of skeleton.m4 */
7282 #line 3146 "parser.y"
7284 (yyval.code) = abc_returnvoid(0);
7294 /* Line 1464 of skeleton.m4 */
7295 #line 3149 "parser.y"
7297 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7298 (yyval.code) = abc_returnvalue((yyval.code));
7308 /* Line 1464 of skeleton.m4 */
7309 #line 3156 "parser.y"
7311 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7321 /* Line 1464 of skeleton.m4 */
7322 #line 3159 "parser.y"
7324 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7334 /* Line 1464 of skeleton.m4 */
7335 #line 3162 "parser.y"
7337 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7347 /* Line 1464 of skeleton.m4 */
7348 #line 3165 "parser.y"
7350 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7360 /* Line 1464 of skeleton.m4 */
7361 #line 3168 "parser.y"
7363 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7373 /* Line 1464 of skeleton.m4 */
7374 #line 3171 "parser.y"
7376 (yyval.code) = (yyvsp[(1) - (3)].code);
7377 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7387 /* Line 1464 of skeleton.m4 */
7388 #line 3176 "parser.y"
7389 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7398 /* Line 1464 of skeleton.m4 */
7399 #line 3177 "parser.y"
7400 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7409 /* Line 1464 of skeleton.m4 */
7410 #line 3179 "parser.y"
7411 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7420 /* Line 1464 of skeleton.m4 */
7421 #line 3180 "parser.y"
7422 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7431 /* Line 1464 of skeleton.m4 */
7432 #line 3181 "parser.y"
7433 {syntaxerror("dictionary keys must be strings");}
7442 /* Line 1464 of skeleton.m4 */
7443 #line 3182 "parser.y"
7444 {syntaxerror("dictionary keys must be strings");}
7453 /* Line 1464 of skeleton.m4 */
7454 #line 3183 "parser.y"
7455 {syntaxerror("dictionary keys must be strings");}
7464 /* Line 1464 of skeleton.m4 */
7465 #line 3185 "parser.y"
7467 (yyval.value_list).cc = 0;
7468 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7469 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7470 (yyval.value_list).number = 2;
7480 /* Line 1464 of skeleton.m4 */
7481 #line 3191 "parser.y"
7483 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7484 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7485 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7486 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7496 /* Line 1464 of skeleton.m4 */
7497 #line 3200 "parser.y"
7498 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7507 /* Line 1464 of skeleton.m4 */
7508 #line 3201 "parser.y"
7509 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7518 /* Line 1464 of skeleton.m4 */
7519 #line 3202 "parser.y"
7520 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7529 /* Line 1464 of skeleton.m4 */
7530 #line 3203 "parser.y"
7531 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7540 /* Line 1464 of skeleton.m4 */
7541 #line 3204 "parser.y"
7542 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7551 /* Line 1464 of skeleton.m4 */
7552 #line 3205 "parser.y"
7553 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7562 /* Line 1464 of skeleton.m4 */
7563 #line 3207 "parser.y"
7565 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7575 /* Line 1464 of skeleton.m4 */
7576 #line 3211 "parser.y"
7580 multiname_t m = {QNAME, &stdns, 0, "XML"};
7581 v.c = abc_getlex2(v.c, &m);
7582 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].id));
7583 v.c = abc_construct(v.c, 1);
7585 (yyval.node) = mkcodenode(v);
7595 /* Line 1464 of skeleton.m4 */
7596 #line 3223 "parser.y"
7600 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7601 if(!(yyvsp[(1) - (1)].regexp).options) {
7602 v.c = abc_getlex2(v.c, &m);
7603 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7604 v.c = abc_construct(v.c, 1);
7606 v.c = abc_getlex2(v.c, &m);
7607 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7608 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7609 v.c = abc_construct(v.c, 2);
7612 (yyval.node) = mkcodenode(v);
7622 /* Line 1464 of skeleton.m4 */
7623 #line 3241 "parser.y"
7626 state->method->need_arguments = 1;
7629 v.c = abc_getlocal(0, state->method->need_arguments);
7631 (yyval.node) = mkcodenode(v);
7641 /* Line 1464 of skeleton.m4 */
7642 #line 3252 "parser.y"
7646 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7647 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7648 v.t = registry_getarrayclass();
7649 (yyval.node) = mkcodenode(v);
7659 /* Line 1464 of skeleton.m4 */
7660 #line 3262 "parser.y"
7664 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7665 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7666 v.t = registry_getobjectclass();
7667 (yyval.node) = mkcodenode(v);
7677 /* Line 1464 of skeleton.m4 */
7678 #line 3271 "parser.y"
7679 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7688 /* Line 1464 of skeleton.m4 */
7689 #line 3272 "parser.y"
7690 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7699 /* Line 1464 of skeleton.m4 */
7700 #line 3273 "parser.y"
7701 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7710 /* Line 1464 of skeleton.m4 */
7711 #line 3274 "parser.y"
7712 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7721 /* Line 1464 of skeleton.m4 */
7722 #line 3275 "parser.y"
7723 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7732 /* Line 1464 of skeleton.m4 */
7733 #line 3276 "parser.y"
7734 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7743 /* Line 1464 of skeleton.m4 */
7744 #line 3277 "parser.y"
7745 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7754 /* Line 1464 of skeleton.m4 */
7755 #line 3278 "parser.y"
7756 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7765 /* Line 1464 of skeleton.m4 */
7766 #line 3279 "parser.y"
7767 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7776 /* Line 1464 of skeleton.m4 */
7777 #line 3280 "parser.y"
7778 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7787 /* Line 1464 of skeleton.m4 */
7788 #line 3281 "parser.y"
7789 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7798 /* Line 1464 of skeleton.m4 */
7799 #line 3282 "parser.y"
7800 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7809 /* Line 1464 of skeleton.m4 */
7810 #line 3283 "parser.y"
7811 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7820 /* Line 1464 of skeleton.m4 */
7821 #line 3284 "parser.y"
7822 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7831 /* Line 1464 of skeleton.m4 */
7832 #line 3285 "parser.y"
7833 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7842 /* Line 1464 of skeleton.m4 */
7843 #line 3286 "parser.y"
7844 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7853 /* Line 1464 of skeleton.m4 */
7854 #line 3287 "parser.y"
7855 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7864 /* Line 1464 of skeleton.m4 */
7865 #line 3288 "parser.y"
7866 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7875 /* Line 1464 of skeleton.m4 */
7876 #line 3289 "parser.y"
7877 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7886 /* Line 1464 of skeleton.m4 */
7887 #line 3290 "parser.y"
7888 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7897 /* Line 1464 of skeleton.m4 */
7898 #line 3291 "parser.y"
7899 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7908 /* Line 1464 of skeleton.m4 */
7909 #line 3292 "parser.y"
7910 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7919 /* Line 1464 of skeleton.m4 */
7920 #line 3293 "parser.y"
7921 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7930 /* Line 1464 of skeleton.m4 */
7931 #line 3294 "parser.y"
7932 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7941 /* Line 1464 of skeleton.m4 */
7942 #line 3295 "parser.y"
7943 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7952 /* Line 1464 of skeleton.m4 */
7953 #line 3296 "parser.y"
7954 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7963 /* Line 1464 of skeleton.m4 */
7964 #line 3297 "parser.y"
7965 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7974 /* Line 1464 of skeleton.m4 */
7975 #line 3298 "parser.y"
7976 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(3) - (4)].node));}
7985 /* Line 1464 of skeleton.m4 */
7986 #line 3299 "parser.y"
7987 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
7996 /* Line 1464 of skeleton.m4 */
7997 #line 3300 "parser.y"
7998 { (yyval.node) = mkconstnode(constant_new_undefined());}
8007 /* Line 1464 of skeleton.m4 */
8008 #line 3301 "parser.y"
8009 { (yyval.node)=(yyvsp[(2) - (3)].node);}
8018 /* Line 1464 of skeleton.m4 */
8019 #line 3302 "parser.y"
8020 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
8029 /* Line 1464 of skeleton.m4 */
8030 #line 3303 "parser.y"
8031 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
8040 /* Line 1464 of skeleton.m4 */
8041 #line 3304 "parser.y"
8042 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8051 /* Line 1464 of skeleton.m4 */
8052 #line 3305 "parser.y"
8053 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8062 /* Line 1464 of skeleton.m4 */
8063 #line 3306 "parser.y"
8064 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8073 /* Line 1464 of skeleton.m4 */
8074 #line 3307 "parser.y"
8075 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8084 /* Line 1464 of skeleton.m4 */
8085 #line 3308 "parser.y"
8086 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8095 /* Line 1464 of skeleton.m4 */
8096 #line 3309 "parser.y"
8097 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8106 /* Line 1464 of skeleton.m4 */
8107 #line 3310 "parser.y"
8108 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8117 /* Line 1464 of skeleton.m4 */
8118 #line 3311 "parser.y"
8119 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8128 /* Line 1464 of skeleton.m4 */
8129 #line 3312 "parser.y"
8130 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8139 /* Line 1464 of skeleton.m4 */
8140 #line 3313 "parser.y"
8141 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8150 /* Line 1464 of skeleton.m4 */
8151 #line 3314 "parser.y"
8152 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8161 /* Line 1464 of skeleton.m4 */
8162 #line 3315 "parser.y"
8163 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8172 /* Line 1464 of skeleton.m4 */
8173 #line 3316 "parser.y"
8174 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
8183 /* Line 1464 of skeleton.m4 */
8184 #line 3318 "parser.y"
8185 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
8194 /* Line 1464 of skeleton.m4 */
8195 #line 3319 "parser.y"
8196 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
8205 /* Line 1464 of skeleton.m4 */
8206 #line 3320 "parser.y"
8207 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
8216 /* Line 1464 of skeleton.m4 */
8217 #line 3321 "parser.y"
8218 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
8227 /* Line 1464 of skeleton.m4 */
8228 #line 3324 "parser.y"
8229 { if(!state->cls->info)
8230 syntaxerror("super keyword not allowed outside a class");
8231 classinfo_t*t = state->cls->info->superclass;
8232 if(!t) t = TYPE_OBJECT;
8233 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8234 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8237 v.c = abc_getlocal_0(v.c);
8238 v.c = abc_getsuper2(v.c, &m);
8239 v.t = slotinfo_gettype((slotinfo_t*)f);
8240 (yyval.node) = mkcodenode(v);
8250 /* Line 1464 of skeleton.m4 */
8251 #line 3338 "parser.y"
8254 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
8255 v.c = abc_getlex2(0, &m);
8257 (yyval.node) = mkcodenode(v);
8267 /* Line 1464 of skeleton.m4 */
8268 #line 3346 "parser.y"
8269 {PASS12 new_state();state->xmlfilter=1;}
8278 /* Line 1464 of skeleton.m4 */
8279 #line 3346 "parser.y"
8283 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8284 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8286 int index = alloc_local();
8287 int result = alloc_local();
8288 int tmp = alloc_local();
8289 int xml = alloc_local();
8291 c = code_append(c, v.c);
8292 c = abc_checkfilter(c);
8293 c = abc_coerce_a(c); //hasnext2 converts to *
8294 c = abc_setlocal(c, xml);
8295 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8296 c = abc_getlex2(c, &m);
8297 c = abc_construct(c, 0);
8298 c = abc_setlocal(c, result);
8299 c = abc_pushbyte(c, 0);
8300 c = abc_setlocal(c, index);
8301 code_t*jmp = c = abc_jump(c, 0);
8302 code_t*loop = c = abc_label(c);
8303 c = abc_getlocal(c, xml);
8304 c = abc_getlocal(c, index);
8305 c = abc_nextvalue(c);
8307 c = abc_setlocal(c, tmp);
8308 c = abc_pushwith(c);
8309 c = code_append(c, w.c);
8310 c = abc_popscope(c);
8311 code_t*b = c = abc_iffalse(c, 0);
8312 c = abc_getlocal(c, result);
8313 c = abc_getlocal(c, index);
8314 c = abc_getlocal(c, tmp);
8315 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8316 c = abc_setproperty2(c, &m2);
8317 c = b->branch = jmp->branch = abc_nop(c);
8318 c = abc_kill(c, tmp);
8319 c = abc_hasnext2(c, xml, index);
8320 c = abc_iftrue(c, loop);
8321 c = abc_getlocal(c, result);
8322 c = abc_kill(c, xml);
8323 c = abc_kill(c, result);
8324 c = abc_kill(c, index);
8331 (yyval.node) = mkcodenode(r);
8341 /* Line 1464 of skeleton.m4 */
8342 #line 3400 "parser.y"
8343 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8352 /* Line 1464 of skeleton.m4 */
8353 #line 3401 "parser.y"
8363 /* Line 1464 of skeleton.m4 */
8364 #line 3402 "parser.y"
8365 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8374 /* Line 1464 of skeleton.m4 */
8375 #line 3404 "parser.y"
8385 /* Line 1464 of skeleton.m4 */
8386 #line 3412 "parser.y"
8388 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8389 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8390 v.c = code_append(v.c, w.c);
8391 if(!TYPE_IS_NAMESPACE(w.t)) {
8392 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8394 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8395 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8396 v.c = abc_getproperty2(v.c, &m);
8397 if(TYPE_IS_XML(v.t)) {
8400 v.c = abc_coerce_a(v.c);
8403 (yyval.node) = mkcodenode(v);
8413 /* Line 1464 of skeleton.m4 */
8414 #line 3430 "parser.y"
8416 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8417 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8418 v.c = abc_getdescendants2(v.c, &m);
8420 (yyval.node) = mkcodenode(v);
8430 /* Line 1464 of skeleton.m4 */
8431 #line 3437 "parser.y"
8433 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8434 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8435 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8436 v.c = code_append(v.c, w.c);
8437 v.c = converttype(w.c, w.t, TYPE_STRING);
8438 v.c = abc_getproperty2(v.c, &m);
8440 (yyval.node) = mkcodenode(v);
8450 /* Line 1464 of skeleton.m4 */
8451 #line 3448 "parser.y"
8453 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8454 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8455 v.c = abc_getproperty2(v.c, &m);
8457 (yyval.node) = mkcodenode(v);
8467 /* Line 1464 of skeleton.m4 */
8468 #line 3455 "parser.y"
8470 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8471 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8472 v.c = abc_getdescendants2(v.c, &m);
8474 (yyval.node) = mkcodenode(v);
8484 /* Line 1464 of skeleton.m4 */
8485 #line 3462 "parser.y"
8487 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8488 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8489 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8490 v.c = code_append(v.c, w.c);
8491 v.c = converttype(w.c, w.t, TYPE_STRING);
8492 v.c = abc_getproperty2(v.c, &m);
8494 (yyval.node) = mkcodenode(v);
8504 /* Line 1464 of skeleton.m4 */
8505 #line 3472 "parser.y"
8507 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8508 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8509 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8510 v.c = code_append(v.c, w.c);
8511 v.c = converttype(w.c, w.t, TYPE_STRING);
8512 v.c = abc_getdescendants2(v.c, &m);
8514 (yyval.node) = mkcodenode(v);
8524 /* Line 1464 of skeleton.m4 */
8525 #line 3483 "parser.y"
8527 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8528 (yyval.value).c = v1.c;
8529 classinfo_t*t = v1.t;
8531 if(TYPE_IS_CLASS(t) && t->data) {
8535 if(TYPE_IS_XML(t)) {
8536 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8537 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8538 (yyval.value).c = abc_coerce_a((yyval.value).c);
8539 (yyval.value).t = TYPE_XMLLIST;
8541 if(t->subtype==INFOTYPE_UNRESOLVED) {
8542 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8544 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8546 if(f && !is_static != !(f->flags&FLAG_STATIC))
8548 if(f && f->slot && !noslot) {
8549 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8552 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8554 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8555 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8557 /* determine type */
8558 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8559 if(!(yyval.value).t)
8560 (yyval.value).c = abc_coerce_a((yyval.value).c);
8562 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8563 string_t*package = v1.c->data[0];
8564 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8566 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8568 (yyval.value) = push_class(a);
8569 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8570 registry_ispackage(package2)) {
8571 (yyval.value).c = v1.c;
8572 (yyval.value).c->data[0] = string_new4(package2);
8573 (yyval.value).t = 0;
8575 syntaxerror("couldn't resolve %s", package2);
8578 /* when resolving a property on an unknown type, we do know the
8579 name of the property (and don't seem to need the package), but
8580 we need to make avm2 try out all access modes */
8581 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8582 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8583 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8584 (yyval.value).c = abc_coerce_a((yyval.value).c);
8585 (yyval.value).t = TYPE_ANY;
8596 /* Line 1464 of skeleton.m4 */
8597 #line 3661 "parser.y"
8600 /* Queue unresolved identifiers for checking against the parent
8601 function's variables.
8602 We consider everything which is not a local variable "unresolved".
8603 This encompasses class names, members of the surrounding class
8604 etc. which is *correct* because local variables of the parent function
8608 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8609 if(state->method->inner) {
8610 unknown_variable((yyvsp[(1) - (1)].id));
8612 /* let the compiler know that it might want to check the current directory/package
8613 for this identifier- maybe there's a file $1.as defining $1. */
8614 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8620 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8630 /* Line 1464 of skeleton.m4 */
8631 #line 3697 "parser.y"
8634 NEW(namespace_decl_t,n);
8635 n->name = (yyvsp[(2) - (2)].id);
8636 n->url = (yyvsp[(2) - (2)].id);
8637 (yyval.namespace_decl)=n;
8647 /* Line 1464 of skeleton.m4 */
8648 #line 3704 "parser.y"
8651 NEW(namespace_decl_t,n);
8652 n->name = (yyvsp[(2) - (4)].id);
8653 n->url = (yyvsp[(4) - (4)].id);
8654 (yyval.namespace_decl)=n;
8664 /* Line 1464 of skeleton.m4 */
8665 #line 3711 "parser.y"
8668 NEW(namespace_decl_t,n);
8669 n->name = (yyvsp[(2) - (4)].id);
8670 n->url = (yyvsp[(4) - (4)].str).str;
8671 (yyval.namespace_decl)=n;
8681 /* Line 1464 of skeleton.m4 */
8682 #line 3718 "parser.y"
8685 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8687 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8688 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8689 var->type = TYPE_NAMESPACE;
8691 ns.access = ACCESS_NAMESPACE;
8692 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8693 var->value = constant_new_namespace(&ns);
8696 MULTINAME(m, TYPE_NAMESPACE);
8697 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8698 t->value = var->value;
8699 t->type_name = multiname_clone(&m);
8712 /* Line 1464 of skeleton.m4 */
8713 #line 3741 "parser.y"
8715 as3_warning("default xml namespaces not supported yet");
8725 /* Line 1464 of skeleton.m4 */
8726 #line 3745 "parser.y"
8729 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8731 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8732 if(s->kind == INFOTYPE_UNRESOLVED) {
8733 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8735 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8738 if(!s || s->kind != INFOTYPE_VAR)
8739 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8740 if(!s->value || !NS_TYPE(s->value->type))
8741 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8742 url = s->value->ns->name;
8744 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8745 add_active_url(url);
8754 /* Line 1464 of skeleton.m4 */
8755 #line 8756 "parser.tab.c"
8758 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8762 YY_STACK_PRINT (yyss, yyssp);
8766 /* Now `shift' the result of the reduction. Determine what state
8767 that goes to, based on the state we popped back to and the rule
8768 number reduced by. */
8772 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8773 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8774 yystate = yytable[yystate];
8776 yystate = yydefgoto[yyn - YYNTOKENS];
8781 /*------------------------------------.
8782 | yyerrlab -- here on detecting error |
8783 `------------------------------------*/
8785 /* If not already recovering from an error, report this error. */
8789 #if ! YYERROR_VERBOSE
8790 yyerror (YY_("syntax error"));
8793 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8794 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8796 YYSIZE_T yyalloc = 2 * yysize;
8797 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8798 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8799 if (yymsg != yymsgbuf)
8800 YYSTACK_FREE (yymsg);
8801 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8803 yymsg_alloc = yyalloc;
8807 yymsg_alloc = sizeof yymsgbuf;
8811 if (0 < yysize && yysize <= yymsg_alloc)
8813 (void) yysyntax_error (yymsg, yystate, yychar);
8818 yyerror (YY_("syntax error"));
8820 goto yyexhaustedlab;
8828 if (yyerrstatus == 3)
8830 /* If just tried and failed to reuse lookahead token after an
8831 error, discard it. */
8833 if (yychar <= YYEOF)
8835 /* Return failure if at end of input. */
8836 if (yychar == YYEOF)
8841 yydestruct ("Error: discarding",
8847 /* Else will try to reuse lookahead token after shifting the error
8852 /*---------------------------------------------------.
8853 | yyerrorlab -- error raised explicitly by YYERROR. |
8854 `---------------------------------------------------*/
8857 /* Pacify compilers like GCC when the user code never invokes
8858 YYERROR and the label yyerrorlab therefore never appears in user
8860 if (/*CONSTCOND*/ 0)
8863 /* Do not reclaim the symbols of the rule which action triggered
8867 YY_STACK_PRINT (yyss, yyssp);
8872 /*-------------------------------------------------------------.
8873 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8874 `-------------------------------------------------------------*/
8876 yyerrstatus = 3; /* Each real token shifted decrements this. */
8880 yyn = yypact[yystate];
8881 if (yyn != YYPACT_NINF)
8884 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8892 /* Pop the current state because it cannot handle the error token. */
8897 yydestruct ("Error: popping",
8898 yystos[yystate], yyvsp);
8901 YY_STACK_PRINT (yyss, yyssp);
8907 /* Shift the error token. */
8908 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8914 /*-------------------------------------.
8915 | yyacceptlab -- YYACCEPT comes here. |
8916 `-------------------------------------*/
8921 /*-----------------------------------.
8922 | yyabortlab -- YYABORT comes here. |
8923 `-----------------------------------*/
8928 #if !defined(yyoverflow) || YYERROR_VERBOSE
8929 /*-------------------------------------------------.
8930 | yyexhaustedlab -- memory exhaustion comes here. |
8931 `-------------------------------------------------*/
8933 yyerror (YY_("memory exhausted"));
8939 if (yychar != YYEMPTY)
8940 yydestruct ("Cleanup: discarding lookahead",
8942 /* Do not reclaim the symbols of the rule which action triggered
8943 this YYABORT or YYACCEPT. */
8945 YY_STACK_PRINT (yyss, yyssp);
8946 while (yyssp != yyss)
8948 yydestruct ("Cleanup: popping",
8949 yystos[*yyssp], yyvsp);
8954 YYSTACK_FREE (yyss);
8957 if (yymsg != yymsgbuf)
8958 YYSTACK_FREE (yymsg);
8960 /* Make sure YYID is used. */
8961 return YYID (yyresult);