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);
594 state->method->variable_count = 0;
596 syntaxerror("internal error: skewed tokencount");
597 function_initvars(state->method, 0, 0, 0, 1);
604 if(!state || state->level!=1) {
605 syntaxerror("unexpected end of file in pass %d", as3_pass);
609 dict_del(global->file2token2info, current_filename);
610 code_t*header = method_header(state->method);
611 //if(global->init->method->body->code || global->init->traits) {
613 code_t*c = wrap_function(header, 0, global->init->method->body->code);
614 global->init->method->body->code = abc_returnvoid(c);
615 free(state->method);state->method=0;
619 //free(state->package);state->package=0; // used in registry
620 state_destroy(state);state=0;
623 void initialize_parser()
625 global = rfx_calloc(sizeof(global_t));
626 global->file = abc_file_new();
627 global->file->flags &= ~ABCFILE_LAZY;
628 global->file2token2info = dict_new();
629 global->token2info = 0;
630 global->classinit = abc_initscript(global->file);
633 void* finish_parser()
635 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
636 global->token2info=0;
638 initcode_add_classlist(global->classinit, global->classes);
643 typedef struct _variable {
648 methodstate_t*is_inner_method;
651 static variable_t* find_variable(state_t*s, char*name)
656 v = dict_lookup(s->vars, name);
658 if(s->new_vars) break;
661 return dict_lookup(top->allvars, name);
663 static variable_t* find_slot(state_t*s, const char*name)
665 if(s->method && s->method->slots)
666 return dict_lookup(s->method->slots, name);
670 static variable_t* find_variable_safe(state_t*s, char*name)
672 variable_t* v = find_variable(s, name);
674 syntaxerror("undefined variable: %s", name);
678 static char variable_exists(char*name)
680 return dict_contains(state->vars, name);
683 static code_t*defaultvalue(code_t*c, classinfo_t*type)
685 if(TYPE_IS_INT(type)) {
686 c = abc_pushbyte(c, 0);
687 } else if(TYPE_IS_UINT(type)) {
688 c = abc_pushuint(c, 0);
689 } else if(TYPE_IS_FLOAT(type)) {
691 } else if(TYPE_IS_BOOLEAN(type)) {
692 c = abc_pushfalse(c);
693 } else if(TYPE_IS_STRING(type)) {
697 //c = abc_pushundefined(c);
698 syntaxerror("internal error: can't generate default value for * type");
702 c = abc_coerce2(c, &m);
707 static int alloc_local()
709 return state->method->variable_count++;
712 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
715 variable_t*v = find_slot(state, name);
723 v->index = alloc_local();
728 dict_put(state->vars, name, v);
729 dict_put(state->allvars, name, v);
734 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
736 return new_variable2(name, type, init, maybeslot)->index;
739 #define TEMPVARNAME "__as3_temp__"
742 variable_t*v = find_variable(state, TEMPVARNAME);
747 i = new_variable(TEMPVARNAME, 0, 0, 0);
752 static code_t* var_block(code_t*body)
758 DICT_ITERATE_DATA(state->vars, variable_t*, v) {
759 if(v->type && v->init) {
760 c = defaultvalue(c, v->type);
761 c = abc_setlocal(c, v->index);
762 k = abc_kill(k, v->index);
770 if(x->opcode== OPCODE___BREAK__ ||
771 x->opcode== OPCODE___CONTINUE__) {
772 /* link kill code before break/continue */
773 code_t*e = code_dup(k);
774 code_t*s = code_start(e);
786 c = code_append(c, body);
787 c = code_append(c, k);
791 static void unknown_variable(char*name)
793 if(!state->method->unresolved_variables)
794 state->method->unresolved_variables = dict_new();
795 if(!dict_contains(state->method->unresolved_variables, name))
796 dict_put(state->method->unresolved_variables, name, 0);
799 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
801 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
802 c = abc_getlocal_0(c);
803 c = abc_pushscope(c);
806 /* FIXME: this alloc_local() causes variable indexes to be
807 different in pass2 than in pass1 */
808 if(!m->activation_var) {
809 m->activation_var = alloc_local();
812 c = abc_newactivation(c);
814 c = abc_pushscope(c);
815 c = abc_setlocal(c, m->activation_var);
817 c = abc_getlocal(c, m->activation_var);
818 c = abc_pushscope(c);
824 static code_t* method_header(methodstate_t*m)
828 c = add_scope_code(c, m, 1);
830 methodstate_list_t*l = m->innerfunctions;
832 parserassert(l->methodstate->abc);
833 if(m->uses_slots && l->methodstate->is_a_slot) {
834 c = abc_getscopeobject(c, 1);
835 c = abc_newfunction(c, l->methodstate->abc);
837 c = abc_setlocal(c, l->methodstate->var_index);
838 c = abc_setslot(c, l->methodstate->slot_index);
840 c = abc_newfunction(c, l->methodstate->abc);
841 c = abc_setlocal(c, l->methodstate->var_index);
843 free(l->methodstate);l->methodstate=0;
847 c = code_append(c, m->header);
850 if(m->is_constructor && !m->has_super) {
851 // call default constructor
852 c = abc_getlocal_0(c);
853 c = abc_constructsuper(c, 0);
857 /* all parameters that are used by inner functions
858 need to be copied from local to slot */
859 parserassert(m->activation_var);
860 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
861 if(v->is_parameter) {
862 c = abc_getlocal(c, m->activation_var);
863 c = abc_getlocal(c, v->index);
864 c = abc_setslot(c, v->index);
868 list_free(m->innerfunctions);
869 m->innerfunctions = 0;
874 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
876 c = code_append(c, header);
877 c = code_append(c, var_block(body));
878 /* append return if necessary */
879 if(!c || (c->opcode != OPCODE_RETURNVOID &&
880 c->opcode != OPCODE_RETURNVALUE)) {
881 c = abc_returnvoid(c);
886 static void startpackage(char*name)
889 state->package = strdup(name);
891 static void endpackage()
893 //used e.g. in classinfo_register:
894 //free(state->package);state->package=0;
898 #define FLAG_PUBLIC 256
899 #define FLAG_PROTECTED 512
900 #define FLAG_PRIVATE 1024
901 #define FLAG_PACKAGEINTERNAL 2048
902 #define FLAG_NAMESPACE 4096
904 static namespace_t modifiers2access(modifiers_t*mod)
909 if(mod->flags&FLAG_NAMESPACE) {
910 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
911 syntaxerror("invalid combination of access levels and namespaces");
912 ns.access = ACCESS_NAMESPACE;
914 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
916 /* shouldn't happen- the tokenizer only reports something as a namespace
917 if it was already registered */
918 trie_dump(active_namespaces);
919 syntaxerror("unknown namespace: %s", mod->ns);
922 } else if(mod->flags&FLAG_PUBLIC) {
923 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
924 syntaxerror("invalid combination of access levels");
925 ns.access = ACCESS_PACKAGE;
926 } else if(mod->flags&FLAG_PRIVATE) {
927 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
928 syntaxerror("invalid combination of access levels");
929 ns.access = ACCESS_PRIVATE;
930 } else if(mod->flags&FLAG_PROTECTED) {
931 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
932 syntaxerror("invalid combination of access levels");
933 ns.access = ACCESS_PROTECTED;
935 ns.access = ACCESS_PACKAGEINTERNAL;
939 static slotinfo_t* find_class(const char*name);
941 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
943 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
946 static void innerfunctions2vars(methodstate_t*m)
948 methodstate_list_t*l = m->innerfunctions;
950 methodstate_t*m = l->methodstate;
952 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 0);
953 m->var_index = v->index;
955 m->slot_index = m->is_a_slot;
956 v->is_inner_method = m;
961 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
966 index = new_variable("this", 0, 0, 0);
967 else if(!m->is_global)
968 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
970 index = new_variable("globalscope", 0, 0, 0);
972 printf("pass: %d\n", as3_pass);
973 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
974 printf("%d) %s\n", v->index, name);
976 printf("count: %d\n", state->method->variable_count);
978 parserassert(!index);
983 for(p=params->list;p;p=p->next) {
984 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
987 if(as3_pass==2 && m->need_arguments) {
988 /* arguments can never be used by an innerfunction (the inner functions
989 have their own arguments var), so it's ok to not initialize this until
990 pass 2. (We don't know whether we need it before, anyway) */
991 variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0);
992 m->need_arguments = v->index;
996 innerfunctions2vars(m);
999 m->scope_code = add_scope_code(m->scope_code, m, 0);
1001 /* exchange unresolved identifiers with the actual objects */
1002 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
1003 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
1004 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
1005 if(!type || type->kind != INFOTYPE_CLASS) {
1006 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1016 char*as3_globalclass=0;
1017 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1020 syntaxerror("inner classes now allowed");
1025 classinfo_list_t*mlist=0;
1027 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1028 syntaxerror("invalid modifier(s)");
1030 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1031 syntaxerror("public and internal not supported at the same time.");
1033 if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC))
1034 syntaxerror("protected and static not supported at the same time.");
1036 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1037 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1038 // all classes extend object
1039 extends = registry_getobjectclass();
1042 /* create the class name, together with the proper attributes */
1046 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1047 access = ACCESS_PRIVATE; package = internal_filename_package;
1048 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1049 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1050 } else if(state->package!=internal_filename_package) {
1051 access = ACCESS_PACKAGE; package = state->package;
1053 syntaxerror("public classes only allowed inside a package");
1057 state->cls = rfx_calloc(sizeof(classstate_t));
1058 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1059 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1060 state->cls->static_init->is_static=FLAG_STATIC;
1061 state->cls->static_init->variable_count=1;
1062 /* notice: we make no effort to initialize the top variable (local0) here,
1063 even though it has special meaning. We just rely on the fact
1064 that pass 1 won't do anything with variables */
1066 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1068 /* set current method to constructor- all code within the class-level (except
1069 static variable initializations) will be executed during construction time */
1070 state->method = state->cls->init;
1072 if(registry_find(package, classname)) {
1073 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1075 /* build info struct */
1076 int num_interfaces = (list_length(implements));
1077 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1078 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1079 state->cls->info->superclass = extends;
1082 classinfo_list_t*l = implements;
1083 for(l=implements;l;l=l->next) {
1084 state->cls->info->interfaces[pos++] = l->classinfo;
1089 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1091 state->method = state->cls->init;
1092 parserassert(state->cls && state->cls->info);
1094 function_initvars(state->cls->init, 0, 0, 0, 1);
1095 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1097 if(extends && (extends->flags & FLAG_FINAL))
1098 syntaxerror("Can't extend final class '%s'", extends->name);
1101 while(state->cls->info->interfaces[pos]) {
1102 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1103 syntaxerror("'%s' is not an interface",
1104 state->cls->info->interfaces[pos]->name);
1108 /* generate the abc code for this class */
1109 MULTINAME(classname2,state->cls->info);
1110 multiname_t*extends2 = sig2mname(extends);
1112 /* don't add the class to the class index just yet- that will be done later
1114 state->cls->abc = abc_class_new(0, &classname2, extends2);
1115 state->cls->abc->file = global->file;
1117 multiname_destroy(extends2);
1118 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1119 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1120 if(state->cls->info->flags&FLAG_INTERFACE) {
1121 abc_class_interface(state->cls->abc);
1124 for(mlist=implements;mlist;mlist=mlist->next) {
1125 MULTINAME(m, mlist->classinfo);
1126 abc_class_add_interface(state->cls->abc, &m);
1129 state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc);
1130 list_append(global->classes, state->cls->dependencies);
1132 /* flash.display.MovieClip handling */
1133 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1134 if(state->package && state->package[0]) {
1135 as3_globalclass = concat3(state->package, ".", classname);
1137 as3_globalclass = strdup(classname);
1143 static void endclass()
1146 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1148 c = abc_getlocal_0(c);
1149 c = abc_constructsuper(c, 0);
1150 state->cls->init->header = code_append(state->cls->init->header, c);
1151 state->cls->has_constructor=1;
1153 if(state->cls->init) {
1154 if(state->cls->info->flags&FLAG_INTERFACE) {
1155 if(state->cls->init->header)
1156 syntaxerror("interface can not have class-level code");
1158 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1159 code_t*c = method_header(state->cls->init);
1160 m->body->code = wrap_function(c, 0, m->body->code);
1163 if(state->cls->static_init) {
1164 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1165 code_t*c = method_header(state->cls->static_init);
1166 m->body->code = wrap_function(c, 0, m->body->code);
1169 trait_list_t*trait = state->cls->abc->traits;
1170 /* switch all protected members to the protected ns of this class */
1172 trait_t*t = trait->trait;
1173 if(t->name->ns->access == ACCESS_PROTECTED) {
1174 if(!state->cls->abc->protectedNS) {
1175 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1176 state->cls->abc->protectedNS = namespace_new_protected(n);
1177 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1179 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1181 trait = trait->next;
1188 void check_code_for_break(code_t*c)
1191 if(c->opcode == OPCODE___BREAK__) {
1192 char*name = string_cstr(c->data[0]);
1193 syntaxerror("Unresolved \"break %s\"", name);
1195 if(c->opcode == OPCODE___CONTINUE__) {
1196 char*name = string_cstr(c->data[0]);
1197 syntaxerror("Unresolved \"continue %s\"", name);
1199 if(c->opcode == OPCODE___RETHROW__) {
1200 syntaxerror("Unresolved \"rethrow\"");
1202 if(c->opcode == OPCODE___FALLTHROUGH__) {
1203 syntaxerror("Unresolved \"fallthrough\"");
1205 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1206 char*name = string_cstr(c->data[0]);
1207 syntaxerror("Can't reference a package (%s) as such", name);
1213 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1215 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1216 if(TYPE_IS_NUMBER(t)) {
1217 xassert(c->type == CONSTANT_FLOAT
1218 || c->type == CONSTANT_INT
1219 || c->type == CONSTANT_UINT);
1220 } else if(TYPE_IS_UINT(t)) {
1221 xassert(c->type == CONSTANT_UINT ||
1222 (c->type == CONSTANT_INT && c->i>=0));
1223 } else if(TYPE_IS_INT(t)) {
1224 xassert(c->type == CONSTANT_INT);
1225 } else if(TYPE_IS_BOOLEAN(t)) {
1226 xassert(c->type == CONSTANT_TRUE
1227 || c->type == CONSTANT_FALSE);
1231 static void check_override(memberinfo_t*m, int flags)
1235 if(m->parent == state->cls->info)
1236 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1238 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1239 if(m->access==ACCESS_PRIVATE)
1241 if(m->flags & FLAG_FINAL)
1242 syntaxerror("can't override final member %s", m->name);
1244 /* allow this. it's no issue.
1245 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1246 syntaxerror("can't override static member %s", m->name);*/
1248 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1249 syntaxerror("can't override non-static member %s with static declaration", m->name);
1251 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1252 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1253 if(m->kind == INFOTYPE_METHOD)
1254 syntaxerror("can't override without explicit 'override' declaration");
1256 syntaxerror("can't override '%s'", m->name);
1261 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1263 methodinfo_t*minfo = 0;
1264 namespace_t ns = modifiers2access(mod);
1267 minfo = methodinfo_register_global(ns.access, state->package, name);
1268 minfo->return_type = return_type;
1269 } else if(getset != KW_GET && getset != KW_SET) {
1271 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1273 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1275 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1276 minfo->return_type = return_type;
1277 // getslot on a member slot only returns "undefined", so no need
1278 // to actually store these
1279 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1281 //class getter/setter
1282 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1284 if(getset == KW_GET) {
1286 } else if(params->list && params->list->param && !params->list->next) {
1287 type = params->list->param->type;
1289 syntaxerror("setter function needs to take exactly one argument");
1290 // not sure wether to look into superclasses here, too
1291 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1293 if(minfo->kind!=INFOTYPE_VAR)
1294 syntaxerror("class already contains a method called '%s'", name);
1295 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1296 syntaxerror("class already contains a field called '%s'", name);
1297 if(minfo->subtype & gs)
1298 syntaxerror("getter/setter for '%s' already defined", name);
1299 /* make a setter or getter into a getset */
1300 minfo->subtype |= gs;
1303 FIXME: this check needs to be done in pass 2
1305 if((!minfo->return_type != !type) ||
1306 (minfo->return_type && type &&
1307 !strcmp(minfo->return_type->name, type->name))) {
1308 syntaxerror("different type in getter and setter: %s and %s",
1309 minfo->return_type?minfo->return_type->name:"*",
1310 type?type->name:"*");
1313 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1314 minfo->kind = INFOTYPE_VAR; //hack
1315 minfo->subtype = gs;
1316 minfo->return_type = type;
1319 /* can't assign a slot as getter and setter might have different slots */
1320 //minfo->slot = slot;
1322 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1323 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1324 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1329 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1331 //parserassert(state->method && state->method->info);
1333 methodstate_t*parent_method = state->method;
1336 return_type = 0; // not valid in pass 1
1340 state->new_vars = 1;
1341 state->allvars = dict_new();
1344 state->method = rfx_calloc(sizeof(methodstate_t));
1345 state->method->inner = 1;
1346 state->method->is_static = parent_method->is_static;
1347 state->method->variable_count = 0;
1348 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1350 NEW(methodinfo_t,minfo);
1351 minfo->kind = INFOTYPE_METHOD;
1352 minfo->access = ACCESS_PACKAGEINTERNAL;
1354 state->method->info = minfo;
1357 list_append(parent_method->innerfunctions, state->method);
1359 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1361 function_initvars(state->method, 1, params, 0, 1);
1365 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1366 state->method->variable_count = 0;
1367 parserassert(state->method);
1369 state->method->info->return_type = return_type;
1370 function_initvars(state->method, 1, params, 0, 1);
1374 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1375 params_t*params, classinfo_t*return_type)
1377 if(state->method && state->method->info) {
1378 syntaxerror("not able to start another method scope");
1381 state->new_vars = 1;
1382 state->allvars = dict_new();
1385 state->method = rfx_calloc(sizeof(methodstate_t));
1386 state->method->has_super = 0;
1387 state->method->is_static = mod->flags&FLAG_STATIC;
1390 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1392 state->method->is_global = 1;
1393 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1395 if(state->method->is_constructor)
1396 name = "__as3_constructor__";
1398 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1400 function_initvars(state->method, 1, params, mod->flags, 1);
1402 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1406 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1407 state->method->variable_count = 0;
1408 parserassert(state->method);
1411 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1412 check_override(m, mod->flags);
1416 state->cls->has_constructor |= state->method->is_constructor;
1419 function_initvars(state->method, 1, params, mod->flags, 1);
1423 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1424 params_t*params, classinfo_t*return_type, code_t*body)
1427 innerfunctions2vars(state->method);
1429 methodstate_list_t*ml = state->method->innerfunctions;
1431 dict_t*xvars = dict_new();
1434 methodstate_t*m = ml->methodstate;
1435 parserassert(m->inner);
1436 if(m->unresolved_variables) {
1437 dict_t*d = m->unresolved_variables;
1439 DICT_ITERATE_KEY(d, char*, id) {
1440 /* check parent method's variables */
1442 if((v=find_variable(state, id))) {
1443 m->uses_parent_function = 1;
1444 state->method->uses_slots = 1;
1445 dict_put(xvars, id, 0);
1448 dict_destroy(m->unresolved_variables);m->unresolved_variables = 0;
1453 if(state->method->uses_slots) {
1454 state->method->slots = dict_new();
1456 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1457 if(!name) syntaxerror("internal error");
1458 if(v->index && dict_contains(xvars, name)) {
1461 if(v->is_inner_method) {
1462 v->is_inner_method->is_a_slot = i;
1465 dict_put(state->method->slots, name, v);
1468 state->method->uses_slots = i;
1469 dict_destroy(state->vars);state->vars = 0;
1470 parserassert(state->new_vars);
1471 dict_destroy(state->allvars);state->allvars = 0;
1478 /*if(state->method->uses_parent_function){
1479 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1484 multiname_t*type2 = sig2mname(return_type);
1486 if(state->method->inner) {
1487 f = state->method->abc;
1488 abc_method_init(f, global->file, type2, 1);
1489 } else if(state->method->is_constructor) {
1490 f = abc_class_getconstructor(state->cls->abc, type2);
1491 } else if(!state->method->is_global) {
1492 namespace_t ns = modifiers2access(mod);
1493 multiname_t mname = {QNAME, &ns, 0, name};
1494 if(mod->flags&FLAG_STATIC)
1495 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1497 f = abc_class_method(state->cls->abc, type2, &mname);
1498 slot = f->trait->slot_id;
1500 namespace_t mname_ns = {state->method->info->access, state->package};
1501 multiname_t mname = {QNAME, &mname_ns, 0, name};
1503 f = abc_method_new(global->file, type2, 1);
1504 if(!global->init) global->init = abc_initscript(global->file);
1505 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1506 //abc_code_t*c = global->init->method->body->code;
1508 //flash doesn't seem to allow us to access function slots
1509 //state->method->info->slot = slot;
1511 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1512 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1513 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1514 if(params->varargs) f->flags |= METHOD_NEED_REST;
1515 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1519 for(p=params->list;p;p=p->next) {
1520 if(params->varargs && !p->next) {
1521 break; //varargs: omit last parameter in function signature
1523 multiname_t*m = sig2mname(p->param->type);
1524 list_append(f->parameters, m);
1525 if(p->param->value) {
1526 check_constant_against_type(p->param->type, p->param->value);
1527 opt=1;list_append(f->optional_parameters, p->param->value);
1529 syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name);
1532 if(state->method->slots) {
1533 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1535 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1536 multiname_t*type = sig2mname(v->type);
1537 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1538 t->slot_id = v->index;
1543 check_code_for_break(body);
1545 /* Seems this works now.
1546 if(state->method->exceptions && state->method->uses_slots) {
1547 as3_warning("try/catch and activation not supported yet within the same method");
1551 f->body->code = body;
1552 f->body->exceptions = state->method->exceptions;
1553 } else { //interface
1555 syntaxerror("interface methods can't have a method body");
1565 void breakjumpsto(code_t*c, char*name, code_t*jump)
1568 if(c->opcode == OPCODE___BREAK__) {
1569 string_t*name2 = c->data[0];
1570 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1571 c->opcode = OPCODE_JUMP;
1578 void continuejumpsto(code_t*c, char*name, code_t*jump)
1581 if(c->opcode == OPCODE___CONTINUE__) {
1582 string_t*name2 = c->data[0];
1583 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1584 c->opcode = OPCODE_JUMP;
1592 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1597 return abc_coerce_a(c);
1601 // cast an "any" type to a specific type. subject to
1602 // runtime exceptions
1603 return abc_coerce2(c, &m);
1606 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1607 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1608 // allow conversion between number types
1609 if(TYPE_IS_UINT(to))
1610 return abc_convert_u(c);
1611 else if(TYPE_IS_INT(to))
1612 return abc_convert_i(c);
1613 else if(TYPE_IS_NUMBER(to))
1614 return abc_convert_d(c);
1615 return abc_coerce2(c, &m);
1618 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1621 if(TYPE_IS_BOOLEAN(to))
1622 return abc_convert_b(c);
1623 if(TYPE_IS_STRING(to))
1624 return abc_convert_s(c);
1625 if(TYPE_IS_OBJECT(to))
1626 return abc_coerce2(c, &m);
1627 if(TYPE_IS_OBJECT(from) && TYPE_IS_XMLLIST(to))
1628 return abc_coerce2(c, &m);
1629 if(TYPE_IS_OBJECT(from) && TYPE_IS_ARRAY(to))
1630 return abc_coerce2(c, &m);
1632 classinfo_t*supertype = from;
1634 if(supertype == to) {
1635 /* target type is one of from's superclasses.
1636 (not sure we need this coerce - as far as the verifier
1637 is concerned, object==object (i think) */
1638 return abc_coerce2(c, &m);
1641 while(supertype->interfaces[t]) {
1642 if(supertype->interfaces[t]==to) {
1643 // target type is one of from's interfaces
1644 return abc_coerce2(c, &m);
1648 supertype = supertype->superclass;
1650 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1652 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1654 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1657 as3_error("can't convert type %s%s%s to %s%s%s",
1658 from->package, from->package[0]?".":"", from->name,
1659 to->package, to->package[0]?".":"", to->name);
1663 code_t* coerce_to_type(code_t*c, classinfo_t*t)
1666 return abc_coerce_a(c);
1667 } else if(TYPE_IS_STRING(t)) {
1668 return abc_coerce_s(c);
1671 return abc_coerce2(c, &m);
1675 char is_pushundefined(code_t*c)
1677 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1680 static const char* get_package_from_name(const char*name)
1682 /* try explicit imports */
1683 dictentry_t* e = dict_get_slot(state->imports, name);
1685 if(!strcmp(e->key, name)) {
1686 slotinfo_t*c = (slotinfo_t*)e->data;
1687 if(c) return c->package;
1693 static namespace_list_t*get_current_imports()
1695 namespace_list_t*searchlist = 0;
1697 list_append(searchlist, namespace_new_package(state->package));
1699 import_list_t*l = state->wildcard_imports;
1701 namespace_t*ns = namespace_new_package(l->import->package);
1702 list_append(searchlist, ns);
1705 list_append(searchlist, namespace_new_package(""));
1706 list_append(searchlist, namespace_new_package(internal_filename_package));
1710 static slotinfo_t* find_class(const char*name)
1714 c = registry_find(state->package, name);
1717 /* try explicit imports */
1718 dictentry_t* e = dict_get_slot(state->imports, name);
1721 if(!strcmp(e->key, name)) {
1722 c = (slotinfo_t*)e->data;
1728 /* try package.* imports */
1729 import_list_t*l = state->wildcard_imports;
1731 //printf("does package %s contain a class %s?\n", l->import->package, name);
1732 c = registry_find(l->import->package, name);
1737 /* try global package */
1738 c = registry_find("", name);
1741 /* try local "filename" package */
1742 c = registry_find(internal_filename_package, name);
1747 typedcode_t push_class(slotinfo_t*a)
1752 if(a->access == ACCESS_PACKAGEINTERNAL &&
1753 strcmp(a->package, state->package) &&
1754 strcmp(a->package, internal_filename_package)
1756 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1757 infotypename(a), a->name, a->package, state->package);
1761 if(a->kind != INFOTYPE_CLASS) {
1763 x.c = abc_findpropstrict2(x.c, &m);
1764 x.c = abc_getproperty2(x.c, &m);
1765 if(a->kind == INFOTYPE_METHOD) {
1766 methodinfo_t*f = (methodinfo_t*)a;
1767 x.t = TYPE_FUNCTION(f);
1769 varinfo_t*v = (varinfo_t*)a;
1774 if(state->cls && state->method == state->cls->static_init) {
1775 /* we're in the static initializer.
1776 record the fact that we're using this class here */
1777 parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a);
1779 classinfo_t*c = (classinfo_t*)a;
1781 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1782 x.c = abc_getglobalscope(x.c);
1783 x.c = abc_getslot(x.c, c->slot);
1786 x.c = abc_getlex2(x.c, &m);
1788 x.t = TYPE_CLASS(c);
1794 char is_break_or_jump(code_t*c)
1798 if(c->opcode == OPCODE_JUMP ||
1799 c->opcode == OPCODE___BREAK__ ||
1800 c->opcode == OPCODE___CONTINUE__ ||
1801 c->opcode == OPCODE_THROW ||
1802 c->opcode == OPCODE_RETURNVOID ||
1803 c->opcode == OPCODE_RETURNVALUE) {
1809 #define IS_FINALLY_TARGET(op) \
1810 ((op) == OPCODE___CONTINUE__ || \
1811 (op) == OPCODE___BREAK__ || \
1812 (op) == OPCODE_RETURNVOID || \
1813 (op) == OPCODE_RETURNVALUE || \
1814 (op) == OPCODE___RETHROW__)
1816 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1818 #define NEED_EXTRA_STACK_ARG
1819 code_t*finally_label = abc_nop(0);
1820 NEW(lookupswitch_t, l);
1826 code_t*prev = i->prev;
1827 if(IS_FINALLY_TARGET(i->opcode)) {
1830 if(i->opcode == OPCODE___RETHROW__ ||
1831 i->opcode == OPCODE_RETURNVALUE) {
1832 if(i->opcode == OPCODE___RETHROW__)
1833 i->opcode = OPCODE_THROW;
1835 p = abc_coerce_a(p);
1836 p = abc_setlocal(p, tempvar);
1838 p = abc_pushbyte(p, count++);
1839 p = abc_jump(p, finally_label);
1840 code_t*target = p = abc_label(p);
1841 #ifdef NEED_EXTRA_STACK_ARG
1845 p = abc_getlocal(p, tempvar);
1848 p->next = i;i->prev = p;
1849 list_append(l->targets, target);
1855 c = abc_pushbyte(c, -1);
1856 c = code_append(c, finally_label);
1857 c = code_append(c, finally);
1859 #ifdef NEED_EXTRA_STACK_ARG
1862 c = abc_lookupswitch(c, l);
1863 c = l->def = abc_label(c);
1864 #ifdef NEED_EXTRA_STACK_ARG
1871 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1875 code_t*prev = i->prev;
1876 if(IS_FINALLY_TARGET(i->opcode)) {
1877 if(i->opcode == OPCODE___RETHROW__)
1878 i->opcode = OPCODE_THROW;
1879 code_t*end = code_dup(finally);
1880 code_t*start = code_start(end);
1881 if(prev) prev->next = start;
1888 return code_append(c, finally);
1891 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1897 int num_insertion_points=0;
1899 if(IS_FINALLY_TARGET(i->opcode))
1900 num_insertion_points++;
1907 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1912 int simple_version_cost = (1+num_insertion_points)*code_size;
1913 int lookup_version_cost = 4*num_insertion_points + 5;
1915 if(cantdup || simple_version_cost > lookup_version_cost) {
1916 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1917 return insert_finally_lookup(c, finally, tempvar);
1919 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1920 return insert_finally_simple(c, finally, tempvar);
1924 #define PASS1 }} if(as3_pass == 1) {{
1925 #define PASS1END }} if(as3_pass == 2) {{
1926 #define PASS2 }} if(as3_pass == 2) {{
1927 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1928 #define PASS12END }} if(as3_pass == 2) {{
1929 #define PASS_ALWAYS }} {{
1933 /* Line 273 of skeleton.m4 */
1934 #line 1935 "parser.tab.c"
1935 /* Unqualified %code blocks. */
1937 /* Line 274 of skeleton.m4 */
1938 #line 2017 "parser.y"
1940 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1946 /* Line 274 of skeleton.m4 */
1947 #line 2468 "parser.y"
1949 static void state_has_imports()
1951 state->wildcard_imports = list_clone(state->wildcard_imports);
1952 state->imports = dict_clone(state->imports);
1953 state->has_own_imports = 1;
1955 static void import_toplevel(const char*package)
1957 char* s = strdup(package);
1959 dict_put(state->import_toplevel_packages, s, 0);
1960 char*x = strrchr(s, '.');
1969 /* Line 274 of skeleton.m4 */
1970 #line 2607 "parser.y"
1972 static int slotstate_varconst = 0;
1973 static modifiers_t*slotstate_flags = 0;
1974 static void setslotstate(modifiers_t* flags, int varconst)
1976 slotstate_varconst = varconst;
1977 slotstate_flags = flags;
1980 if(flags->flags&FLAG_STATIC) {
1981 state->method = state->cls->static_init;
1983 state->method = state->cls->init;
1986 // reset to "default" state (all in class code is static by default) */
1987 state->method = state->cls->static_init;
1990 parserassert(state->method);
1993 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
1995 int flags = modifiers->flags;
1996 namespace_t ns = modifiers2access(modifiers);
1999 multiname_t mname = {QNAME, &ns, 0, name};
2001 trait_list_t**traits;
2005 if(!global->init) global->init = abc_initscript(global->file);
2006 ns.name = state->package;
2007 traits = &global->init->traits;
2008 code = &global->init->method->body->code;
2009 } else if(flags&FLAG_STATIC) {
2011 traits = &state->cls->abc->static_traits;
2012 code = &state->cls->static_init->header;
2014 // instance variable
2015 traits = &state->cls->abc->traits;
2016 code = &state->cls->init->header;
2018 if(ns.access == ACCESS_PROTECTED) {
2019 ns.name = concat3(state->cls->info->package,":",state->cls->info->name);
2025 *m = *multiname_clone(&mname);
2027 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
2031 /* Line 274 of skeleton.m4 */
2032 #line 2787 "parser.y"
2034 static int xml_level = 0;
2037 /* Line 274 of skeleton.m4 */
2038 #line 3566 "parser.y"
2040 node_t* resolve_identifier(char*name)
2050 /* look at variables */
2051 if((v = find_variable(state, name))) {
2052 // name is a local variable
2053 o.c = abc_getlocal(o.c, v->index);
2055 return mkcodenode(o);
2057 if((v = find_slot(state, name))) {
2058 o.c = abc_getscopeobject(o.c, 1);
2059 o.c = abc_getslot(o.c, v->index);
2061 return mkcodenode(o);
2064 int i_am_static = state->method->is_static;
2066 /* look at current class' members */
2067 if(!state->method->inner &&
2068 !state->xmlfilter &&
2070 (f = findmember_nsset(state->cls->info, name, 1)))
2072 // name is a member or attribute in this class
2073 int var_is_static = (f->flags&FLAG_STATIC);
2075 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2076 /* if the variable is a constant (and we know what is evaluates to), we
2077 can just use the value itself */
2078 varinfo_t*v = (varinfo_t*)f;
2080 return mkconstnode(v->value);
2084 if(var_is_static >= i_am_static) {
2085 if(f->kind == INFOTYPE_METHOD) {
2086 o.t = TYPE_FUNCTION(f);
2091 if(var_is_static && !i_am_static) {
2092 /* access to a static member from a non-static location.
2093 do this via findpropstrict:
2094 there doesn't seem to be any non-lookup way to access
2095 static properties of a class */
2096 state->method->late_binding = 1;
2098 namespace_t ns = {f->access, f->package};
2099 multiname_t m = {QNAME, &ns, 0, name};
2100 o.c = abc_findpropstrict2(o.c, &m);
2101 o.c = abc_getproperty2(o.c, &m);
2102 return mkcodenode(o);
2103 } else if(f->slot>0) {
2104 o.c = abc_getlocal_0(o.c);
2105 o.c = abc_getslot(o.c, f->slot);
2106 return mkcodenode(o);
2108 MEMBER_MULTINAME(m, f, name);
2109 o.c = abc_getlocal_0(o.c);
2110 o.c = abc_getproperty2(o.c, &m);
2111 return mkcodenode(o);
2116 /* look at actual classes, in the current package and imported */
2117 if(!state->xmlfilter && (a = find_class(name))) {
2118 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2119 o.c = abc_getlocal_0(0);
2120 o.t = TYPE_CLASS((classinfo_t*)a);
2124 return mkcodenode(o);
2127 /* look through package prefixes */
2128 if(!state->xmlfilter &&
2129 (dict_contains(state->import_toplevel_packages, name) ||
2130 registry_ispackage(name))) {
2131 o.c = abc___pushpackage__(o.c, name);
2133 return mkcodenode(o); //?
2136 /* unknown object, let the avm2 resolve it */
2138 if(!state->method->inner && !state->xmlfilter) {
2139 /* we really should make inner functions aware of the class context */
2140 as3_warning("Couldn't resolve '%s', doing late binding", name);
2142 state->method->late_binding = 1;
2144 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2147 o.c = abc_findpropstrict2(o.c, &m);
2148 o.c = abc_getproperty2(o.c, &m);
2149 return mkcodenode(o);
2154 /* Line 274 of skeleton.m4 */
2155 #line 3708 "parser.y"
2157 void add_active_url(const char*url)
2161 list_append(state->active_namespace_urls, n);
2166 /* Line 274 of skeleton.m4 */
2167 #line 2168 "parser.tab.c"
2174 typedef YYTYPE_UINT8 yytype_uint8;
2176 typedef unsigned char yytype_uint8;
2180 typedef YYTYPE_INT8 yytype_int8;
2181 #elif (defined __STDC__ || defined __C99__FUNC__ \
2182 || defined __cplusplus || defined _MSC_VER)
2183 typedef signed char yytype_int8;
2185 typedef short int yytype_int8;
2188 #ifdef YYTYPE_UINT16
2189 typedef YYTYPE_UINT16 yytype_uint16;
2191 typedef unsigned short int yytype_uint16;
2195 typedef YYTYPE_INT16 yytype_int16;
2197 typedef short int yytype_int16;
2201 # ifdef __SIZE_TYPE__
2202 # define YYSIZE_T __SIZE_TYPE__
2203 # elif defined size_t
2204 # define YYSIZE_T size_t
2205 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2206 || defined __cplusplus || defined _MSC_VER)
2207 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2208 # define YYSIZE_T size_t
2210 # define YYSIZE_T unsigned int
2214 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2219 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2220 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2224 # define YY_(msgid) msgid
2228 /* Suppress unused-variable warnings by "using" E. */
2229 #if ! defined lint || defined __GNUC__
2230 # define YYUSE(e) ((void) (e))
2232 # define YYUSE(e) /* empty */
2235 /* Identity function, used to suppress warnings about constant conditions. */
2237 # define YYID(n) (n)
2239 #if (defined __STDC__ || defined __C99__FUNC__ \
2240 || defined __cplusplus || defined _MSC_VER)
2253 #if ! defined yyoverflow || YYERROR_VERBOSE
2255 /* The parser invokes alloca or malloc; define the necessary symbols. */
2257 # ifdef YYSTACK_USE_ALLOCA
2258 # if YYSTACK_USE_ALLOCA
2260 # define YYSTACK_ALLOC __builtin_alloca
2261 # elif defined __BUILTIN_VA_ARG_INCR
2262 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2264 # define YYSTACK_ALLOC __alloca
2265 # elif defined _MSC_VER
2266 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2267 # define alloca _alloca
2269 # define YYSTACK_ALLOC alloca
2270 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2271 || defined __cplusplus || defined _MSC_VER)
2272 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2274 # define _STDLIB_H 1
2281 # ifdef YYSTACK_ALLOC
2282 /* Pacify GCC's `empty if-body' warning. */
2283 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2284 # ifndef YYSTACK_ALLOC_MAXIMUM
2285 /* The OS might guarantee only one guard page at the bottom of the stack,
2286 and a page size can be as small as 4096 bytes. So we cannot safely
2287 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2288 to allow for a few compiler-allocated temporary stack slots. */
2289 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2292 # define YYSTACK_ALLOC YYMALLOC
2293 # define YYSTACK_FREE YYFREE
2294 # ifndef YYSTACK_ALLOC_MAXIMUM
2295 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2297 # if (defined __cplusplus && ! defined _STDLIB_H \
2298 && ! ((defined YYMALLOC || defined malloc) \
2299 && (defined YYFREE || defined free)))
2300 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2302 # define _STDLIB_H 1
2306 # define YYMALLOC malloc
2307 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2308 || defined __cplusplus || defined _MSC_VER)
2309 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2313 # define YYFREE free
2314 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2315 || defined __cplusplus || defined _MSC_VER)
2316 void free (void *); /* INFRINGES ON USER NAME SPACE */
2320 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2323 #if (! defined yyoverflow \
2324 && (! defined __cplusplus \
2325 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2327 /* A type that is properly aligned for any stack member. */
2330 yytype_int16 yyss_alloc;
2334 /* The size of the maximum gap between one aligned stack and the next. */
2335 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2337 /* The size of an array large to enough to hold all stacks, each with
2339 # define YYSTACK_BYTES(N) \
2340 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2341 + YYSTACK_GAP_MAXIMUM)
2343 /* Copy COUNT objects from FROM to TO. The source and destination do
2346 # if defined __GNUC__ && 1 < __GNUC__
2347 # define YYCOPY(To, From, Count) \
2348 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2350 # define YYCOPY(To, From, Count) \
2354 for (yyi = 0; yyi < (Count); yyi++) \
2355 (To)[yyi] = (From)[yyi]; \
2361 /* Relocate STACK from its old location to the new one. The
2362 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2363 elements in the stack, and YYPTR gives the new location of the
2364 stack. Advance YYPTR to a properly aligned location for the next
2366 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2369 YYSIZE_T yynewbytes; \
2370 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2371 Stack = &yyptr->Stack_alloc; \
2372 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2373 yyptr += yynewbytes / sizeof (*yyptr); \
2379 /* YYFINAL -- State number of the termination state. */
2381 /* YYLAST -- Last index in YYTABLE. */
2384 /* YYNTOKENS -- Number of terminals. */
2385 #define YYNTOKENS 136
2386 /* YYNNTS -- Number of nonterminals. */
2388 /* YYNRULES -- Number of rules. */
2389 #define YYNRULES 353
2390 /* YYNRULES -- Number of states. */
2391 #define YYNSTATES 598
2393 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2394 #define YYUNDEFTOK 2
2395 #define YYMAXUTOK 365
2397 #define YYTRANSLATE(YYX) \
2398 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2400 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2401 static const yytype_uint8 yytranslate[] =
2403 0, 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, 120, 2, 2, 2, 118, 109, 2,
2407 124, 135, 117, 115, 102, 114, 129, 116, 2, 2,
2408 2, 2, 2, 2, 2, 2, 2, 2, 106, 101,
2409 111, 104, 112, 105, 130, 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, 126, 2, 127, 108, 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, 128, 107, 134, 119, 2, 2, 2,
2416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2428 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2429 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2430 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2431 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2432 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2433 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2434 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2435 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2436 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2437 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2438 95, 96, 97, 98, 99, 100, 103, 110, 113, 121,
2439 122, 123, 125, 131, 132, 133
2443 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2445 static const yytype_uint16 yyprhs[] =
2447 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2448 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2449 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2450 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2451 85, 87, 89, 91, 95, 98, 100, 102, 104, 106,
2452 108, 110, 112, 117, 120, 122, 124, 128, 131, 132,
2453 135, 138, 140, 144, 148, 149, 152, 153, 161, 162,
2454 164, 166, 170, 172, 175, 179, 188, 195, 196, 203,
2455 204, 212, 214, 217, 219, 222, 223, 225, 227, 230,
2456 232, 235, 240, 244, 245, 254, 255, 265, 266, 272,
2457 274, 277, 279, 282, 284, 285, 292, 295, 297, 302,
2458 305, 307, 309, 311, 313, 315, 319, 321, 322, 329,
2459 330, 336, 339, 342, 347, 348, 350, 352, 355, 357,
2460 359, 361, 363, 365, 367, 369, 371, 373, 375, 376,
2461 379, 380, 383, 384, 387, 388, 398, 399, 408, 409,
2462 411, 413, 416, 418, 423, 425, 427, 429, 430, 432,
2463 434, 437, 439, 442, 451, 453, 455, 456, 461, 463,
2464 467, 471, 472, 475, 477, 479, 481, 483, 485, 487,
2465 489, 491, 493, 495, 497, 499, 500, 501, 506, 507,
2466 512, 513, 516, 519, 522, 525, 529, 531, 533, 544,
2467 551, 563, 564, 566, 568, 571, 573, 577, 581, 585,
2468 589, 590, 592, 595, 600, 604, 606, 611, 614, 616,
2469 618, 619, 620, 633, 635, 636, 637, 648, 650, 654,
2470 656, 658, 660, 664, 666, 668, 670, 673, 674, 675,
2471 679, 680, 682, 684, 686, 689, 692, 693, 698, 703,
2472 708, 711, 713, 716, 718, 720, 722, 726, 728, 732,
2473 733, 735, 737, 739, 741, 743, 745, 749, 755, 757,
2474 759, 761, 763, 765, 767, 769, 771, 773, 775, 779,
2475 783, 787, 791, 795, 799, 803, 807, 811, 815, 819,
2476 823, 826, 829, 833, 837, 841, 845, 849, 853, 857,
2477 861, 865, 869, 873, 877, 881, 885, 889, 892, 895,
2478 897, 901, 904, 909, 913, 917, 921, 925, 929, 933,
2479 937, 941, 945, 949, 953, 957, 963, 966, 969, 972,
2480 975, 979, 982, 983, 990, 992, 994, 996, 998, 1000,
2481 1006, 1010, 1016, 1021, 1026, 1033, 1040, 1044, 1046, 1049,
2482 1054, 1059, 1062, 1067
2485 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2486 static const yytype_int16 yyrhs[] =
2488 137, 0, -1, 138, -1, -1, 139, -1, 140, -1,
2489 139, 140, -1, 188, -1, 200, -1, 198, -1, 234,
2490 -1, 209, -1, 149, -1, 150, 128, 138, 134, -1,
2491 101, -1, -1, 142, -1, 143, -1, 142, 143, -1,
2492 200, -1, 198, -1, 234, -1, 209, -1, 149, -1,
2493 150, 128, 141, 134, -1, 101, -1, 145, -1, -1,
2494 145, 147, -1, 147, -1, 269, -1, 191, -1, 161,
2495 -1, 162, -1, 163, -1, 165, -1, 173, -1, 156,
2496 -1, 185, -1, 181, -1, 257, -1, 270, -1, 268,
2497 -1, 128, 145, 134, -1, 128, 134, -1, 101, -1,
2498 146, -1, 152, -1, 167, -1, 168, -1, 253, -1,
2499 183, -1, 150, 128, 145, 134, -1, 147, 101, -1,
2500 147, -1, 146, -1, 3, 91, 3, -1, 104, 261,
2501 -1, -1, 46, 153, -1, 32, 153, -1, 154, -1,
2502 153, 102, 154, -1, 3, 244, 151, -1, -1, 66,
2503 148, -1, -1, 65, 124, 157, 255, 135, 148, 155,
2504 -1, -1, 152, -1, 257, -1, 46, 3, 244, -1,
2505 3, -1, 11, 124, -1, 11, 50, 124, -1, 160,
2506 158, 101, 255, 101, 257, 135, 148, -1, 160, 159,
2507 69, 255, 135, 148, -1, -1, 12, 124, 164, 255,
2508 135, 148, -1, -1, 13, 166, 148, 12, 124, 255,
2509 135, -1, 67, -1, 67, 3, -1, 30, -1, 30,
2510 3, -1, -1, 170, -1, 172, -1, 170, 172, -1,
2511 171, -1, 170, 171, -1, 34, 261, 106, 144, -1,
2512 62, 106, 144, -1, -1, 14, 124, 174, 261, 135,
2513 128, 169, 134, -1, -1, 33, 124, 3, 244, 135,
2514 176, 128, 144, 134, -1, -1, 27, 128, 178, 144,
2515 134, -1, 175, -1, 179, 175, -1, 179, -1, 179,
2516 177, -1, 177, -1, -1, 52, 128, 182, 144, 134,
2517 180, -1, 37, 255, -1, 37, -1, 39, 124, 255,
2518 135, -1, 184, 148, -1, 3, -1, 17, -1, 16,
2519 -1, 29, -1, 4, -1, 187, 129, 186, -1, 186,
2520 -1, -1, 17, 187, 128, 189, 141, 134, -1, -1,
2521 17, 128, 190, 141, 134, -1, 41, 3, -1, 41,
2522 240, -1, 41, 187, 129, 117, -1, -1, 193, -1,
2523 194, -1, 193, 194, -1, 20, -1, 21, -1, 18,
2524 -1, 38, -1, 47, -1, 49, -1, 48, -1, 25,
2525 -1, 23, -1, 4, -1, -1, 54, 241, -1, -1,
2526 54, 242, -1, -1, 15, 242, -1, -1, 192, 31,
2527 3, 195, 197, 128, 199, 202, 134, -1, -1, 192,
2528 44, 3, 196, 128, 201, 205, 134, -1, -1, 203,
2529 -1, 204, -1, 203, 204, -1, 101, -1, 150, 128,
2530 202, 134, -1, 209, -1, 234, -1, 146, -1, -1,
2531 206, -1, 207, -1, 206, 207, -1, 101, -1, 46,
2532 3, -1, 192, 26, 233, 3, 124, 230, 135, 244,
2533 -1, 46, -1, 32, -1, -1, 192, 208, 210, 211,
2534 -1, 212, -1, 211, 102, 212, -1, 3, 244, 151,
2535 -1, -1, 104, 261, -1, 8, -1, 9, -1, 10,
2536 -1, 5, -1, 56, -1, 55, -1, 45, -1, 28,
2537 -1, 29, -1, 226, -1, 111, -1, 112, -1, -1,
2538 -1, 128, 261, 220, 134, -1, -1, 128, 261, 222,
2539 134, -1, -1, 223, 219, -1, 223, 5, -1, 223,
2540 112, -1, 226, 223, -1, 224, 226, 223, -1, 3,
2541 -1, 221, -1, 216, 225, 227, 217, 223, 111, 116,
2542 225, 218, 112, -1, 216, 225, 227, 116, 218, 112,
2543 -1, 216, 225, 227, 217, 223, 224, 111, 116, 225,
2544 218, 112, -1, -1, 228, -1, 229, -1, 228, 229,
2545 -1, 221, -1, 221, 104, 5, -1, 221, 104, 221,
2546 -1, 3, 104, 221, -1, 3, 104, 5, -1, -1,
2547 231, -1, 95, 232, -1, 231, 102, 95, 232, -1,
2548 231, 102, 232, -1, 232, -1, 3, 106, 243, 213,
2549 -1, 3, 213, -1, 51, -1, 35, -1, -1, -1,
2550 192, 26, 233, 3, 124, 230, 135, 244, 128, 235,
2551 144, 134, -1, 3, -1, -1, -1, 26, 236, 124,
2552 230, 135, 244, 128, 238, 144, 134, -1, 186, -1,
2553 187, 129, 186, -1, 240, -1, 239, -1, 241, -1,
2554 242, 102, 241, -1, 241, -1, 117, -1, 36, -1,
2555 106, 243, -1, -1, -1, 124, 246, 135, -1, -1,
2556 247, -1, 248, -1, 254, -1, 247, 102, -1, 248,
2557 254, -1, -1, 24, 261, 249, 245, -1, 261, 124,
2558 246, 135, -1, 53, 124, 246, 135, -1, 64, 261,
2559 -1, 42, -1, 42, 255, -1, 261, -1, 256, -1,
2560 261, -1, 256, 102, 261, -1, 261, -1, 257, 102,
2561 261, -1, -1, 260, -1, 3, -1, 5, -1, 8,
2562 -1, 9, -1, 10, -1, 259, 106, 254, -1, 260,
2563 102, 259, 106, 254, -1, 237, -1, 265, -1, 250,
2564 -1, 252, -1, 251, -1, 266, -1, 214, -1, 215,
2565 -1, 6, -1, 19, -1, 126, 246, 127, -1, 71,
2566 258, 134, -1, 261, 111, 261, -1, 261, 112, 261,
2567 -1, 261, 76, 261, -1, 261, 77, 261, -1, 261,
2568 72, 261, -1, 261, 73, 261, -1, 261, 75, 261,
2569 -1, 261, 74, 261, -1, 261, 89, 261, -1, 261,
2570 90, 261, -1, 120, 261, -1, 119, 261, -1, 261,
2571 109, 261, -1, 261, 108, 261, -1, 261, 107, 261,
2572 -1, 261, 98, 261, -1, 261, 97, 261, -1, 261,
2573 96, 261, -1, 261, 116, 261, -1, 261, 118, 261,
2574 -1, 261, 115, 261, -1, 261, 114, 261, -1, 261,
2575 117, 261, -1, 261, 69, 261, -1, 261, 70, 261,
2576 -1, 261, 40, 261, -1, 261, 68, 261, -1, 43,
2577 261, -1, 36, 261, -1, 36, -1, 124, 256, 135,
2578 -1, 114, 261, -1, 261, 126, 261, 127, -1, 261,
2579 81, 261, -1, 261, 80, 261, -1, 261, 87, 261,
2580 -1, 261, 86, 261, -1, 261, 88, 261, -1, 261,
2581 79, 261, -1, 261, 78, 261, -1, 261, 85, 261,
2582 -1, 261, 82, 261, -1, 261, 83, 261, -1, 261,
2583 84, 261, -1, 261, 104, 261, -1, 261, 105, 261,
2584 106, 261, -1, 261, 93, -1, 261, 92, -1, 93,
2585 261, -1, 92, 261, -1, 53, 129, 3, -1, 130,
2586 3, -1, -1, 261, 129, 124, 262, 261, 135, -1,
2587 3, -1, 117, -1, 4, -1, 186, -1, 117, -1,
2588 261, 129, 263, 91, 264, -1, 261, 94, 264, -1,
2589 261, 129, 126, 261, 127, -1, 261, 129, 130, 264,
2590 -1, 261, 94, 130, 264, -1, 261, 129, 130, 126,
2591 261, 127, -1, 261, 94, 130, 126, 261, 127, -1,
2592 261, 129, 264, -1, 3, -1, 16, 3, -1, 16,
2593 3, 104, 3, -1, 16, 3, 104, 5, -1, 192,
2594 267, -1, 63, 16, 104, 261, -1, 22, 16, 241,
2598 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2599 static const yytype_uint16 yyrline[] =
2601 0, 1917, 1917, 1919, 1919, 1920, 1921, 1923, 1924, 1925,
2602 1926, 1927, 1928, 1929, 1930, 1932, 1932, 1933, 1934, 1936,
2603 1937, 1938, 1939, 1940, 1941, 1942, 1944, 1945, 1947, 1950,
2604 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962,
2605 1963, 1964, 1965, 1966, 1967, 1970, 1971, 1972, 1973, 1974,
2606 1975, 1976, 1977, 1989, 1990, 1994, 2005, 2024, 2025, 2027,
2607 2028, 2030, 2031, 2033, 2093, 2094, 2097, 2097, 2116, 2117,
2608 2118, 2123, 2127, 2132, 2133, 2135, 2155, 2203, 2203, 2222,
2609 2222, 2237, 2240, 2243, 2246, 2250, 2251, 2252, 2253, 2254,
2610 2255, 2257, 2268, 2271, 2271, 2302, 2302, 2327, 2327, 2343,
2611 2344, 2345, 2346, 2354, 2363, 2363, 2412, 2416, 2427, 2437,
2612 2454, 2455, 2456, 2457, 2458, 2460, 2461, 2463, 2463, 2465,
2613 2465, 2489, 2497, 2508, 2524, 2525, 2526, 2527, 2534, 2535,
2614 2536, 2537, 2538, 2539, 2540, 2541, 2542, 2543, 2547, 2548,
2615 2550, 2551, 2553, 2554, 2558, 2556, 2564, 2562, 2571, 2572,
2616 2573, 2574, 2575, 2576, 2577, 2578, 2580, 2586, 2587, 2588,
2617 2589, 2590, 2591, 2594, 2667, 2667, 2669, 2669, 2671, 2672,
2618 2674, 2758, 2759, 2768, 2769, 2772, 2773, 2774, 2775, 2776,
2619 2777, 2778, 2791, 2793, 2794, 2795, 2797, 2797, 2801, 2801,
2620 2805, 2806, 2809, 2810, 2812, 2813, 2815, 2816, 2818, 2822,
2621 2825, 2830, 2831, 2832, 2833, 2835, 2838, 2842, 2845, 2848,
2622 2858, 2862, 2868, 2874, 2882, 2887, 2893, 2901, 2909, 2910,
2623 2911, 2914, 2913, 2930, 2931, 2933, 2932, 2956, 2975, 2989,
2624 2990, 2992, 2993, 2995, 2996, 2997, 3006, 3007, 3011, 3012,
2625 3014, 3015, 3016, 3018, 3022, 3023, 3028, 3029, 3073, 3123,
2626 3144, 3166, 3169, 3176, 3179, 3182, 3185, 3188, 3191, 3196,
2627 3197, 3199, 3200, 3201, 3202, 3203, 3205, 3211, 3220, 3221,
2628 3222, 3223, 3224, 3225, 3227, 3231, 3243, 3261, 3272, 3282,
2629 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300,
2630 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310,
2631 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320,
2632 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330,
2633 3331, 3332, 3333, 3334, 3335, 3336, 3338, 3339, 3340, 3341,
2634 3343, 3358, 3366, 3366, 3420, 3421, 3422, 3423, 3424, 3432,
2635 3450, 3457, 3468, 3475, 3482, 3492, 3503, 3681, 3717, 3724,
2636 3731, 3738, 3760, 3766
2640 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2641 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2642 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2643 static const char *const yytname[] =
2645 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2646 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2647 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2648 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2649 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2650 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2651 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2652 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2653 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2654 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2655 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2656 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2657 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"",
2658 "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"",
2659 "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"",
2660 "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"",
2661 "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"",
2662 "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"",
2663 "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2664 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2665 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2666 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2667 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2668 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2669 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2670 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2671 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2672 "PACKAGE_INITCODE", "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION",
2673 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2674 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2675 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2676 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2677 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2678 "TRY", "$@7", "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE",
2679 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2680 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2681 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2682 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2683 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2684 "SLOT_DECLARATION", "$@12", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT",
2685 "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@13",
2686 "XMLEXPR2", "$@14", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", "XMLNODE",
2687 "MAYBE_XMLATTRIBUTES", "XMLATTRIBUTES", "XMLATTRIBUTE",
2688 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2689 "FUNCTION_DECLARATION", "$@15", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2690 "$@16", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2691 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2692 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2693 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2694 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2695 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@17", "ID_OR_NS", "SUBNODE",
2696 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2697 "DEFAULT_NAMESPACE", "USE_NAMESPACE", 0
2702 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2704 static const yytype_uint16 yytoknum[] =
2706 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2707 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2708 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2709 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2710 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2711 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2712 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2713 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2714 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2715 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2716 355, 59, 44, 356, 61, 63, 58, 124, 94, 38,
2717 357, 60, 62, 358, 45, 43, 47, 42, 37, 126,
2718 33, 359, 360, 361, 40, 362, 91, 93, 123, 46,
2719 64, 363, 364, 365, 125, 41
2723 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2724 static const yytype_uint16 yyr1[] =
2726 0, 136, 137, 138, 138, 139, 139, 140, 140, 140,
2727 140, 140, 140, 140, 140, 141, 141, 142, 142, 143,
2728 143, 143, 143, 143, 143, 143, 144, 144, 145, 145,
2729 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
2730 146, 146, 146, 146, 146, 147, 147, 147, 147, 147,
2731 147, 147, 147, 148, 148, 149, 150, 151, 151, 152,
2732 152, 153, 153, 154, 155, 155, 157, 156, 158, 158,
2733 158, 159, 159, 160, 160, 161, 162, 164, 163, 166,
2734 165, 167, 167, 168, 168, 169, 169, 169, 169, 170,
2735 170, 171, 172, 174, 173, 176, 175, 178, 177, 179,
2736 179, 180, 180, 180, 182, 181, 183, 183, 184, 185,
2737 186, 186, 186, 186, 186, 187, 187, 189, 188, 190,
2738 188, 191, 191, 191, 192, 192, 193, 193, 194, 194,
2739 194, 194, 194, 194, 194, 194, 194, 194, 195, 195,
2740 196, 196, 197, 197, 199, 198, 201, 200, 202, 202,
2741 203, 203, 204, 204, 204, 204, 204, 205, 205, 206,
2742 206, 207, 207, 207, 208, 208, 210, 209, 211, 211,
2743 212, 213, 213, 214, 214, 214, 214, 214, 214, 214,
2744 214, 214, 215, 216, 217, 218, 220, 219, 222, 221,
2745 223, 223, 223, 223, 224, 224, 225, 225, 226, 226,
2746 226, 227, 227, 228, 228, 229, 229, 229, 229, 229,
2747 230, 230, 230, 230, 231, 231, 232, 232, 233, 233,
2748 233, 235, 234, 236, 236, 238, 237, 239, 240, 241,
2749 241, 242, 242, 243, 243, 243, 244, 244, 245, 245,
2750 246, 246, 246, 247, 248, 247, 249, 250, 251, 251,
2751 252, 253, 253, 254, 255, 256, 256, 257, 257, 258,
2752 258, 259, 259, 259, 259, 259, 260, 260, 261, 261,
2753 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2754 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2755 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2756 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2757 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2758 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2759 261, 261, 262, 261, 263, 263, 263, 264, 264, 261,
2760 261, 261, 261, 261, 261, 261, 265, 266, 267, 267,
2764 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2765 static const yytype_uint8 yyr2[] =
2767 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2768 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2769 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2770 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2771 1, 1, 1, 3, 2, 1, 1, 1, 1, 1,
2772 1, 1, 4, 2, 1, 1, 3, 2, 0, 2,
2773 2, 1, 3, 3, 0, 2, 0, 7, 0, 1,
2774 1, 3, 1, 2, 3, 8, 6, 0, 6, 0,
2775 7, 1, 2, 1, 2, 0, 1, 1, 2, 1,
2776 2, 4, 3, 0, 8, 0, 9, 0, 5, 1,
2777 2, 1, 2, 1, 0, 6, 2, 1, 4, 2,
2778 1, 1, 1, 1, 1, 3, 1, 0, 6, 0,
2779 5, 2, 2, 4, 0, 1, 1, 2, 1, 1,
2780 1, 1, 1, 1, 1, 1, 1, 1, 0, 2,
2781 0, 2, 0, 2, 0, 9, 0, 8, 0, 1,
2782 1, 2, 1, 4, 1, 1, 1, 0, 1, 1,
2783 2, 1, 2, 8, 1, 1, 0, 4, 1, 3,
2784 3, 0, 2, 1, 1, 1, 1, 1, 1, 1,
2785 1, 1, 1, 1, 1, 0, 0, 4, 0, 4,
2786 0, 2, 2, 2, 2, 3, 1, 1, 10, 6,
2787 11, 0, 1, 1, 2, 1, 3, 3, 3, 3,
2788 0, 1, 2, 4, 3, 1, 4, 2, 1, 1,
2789 0, 0, 12, 1, 0, 0, 10, 1, 3, 1,
2790 1, 1, 3, 1, 1, 1, 2, 0, 0, 3,
2791 0, 1, 1, 1, 2, 2, 0, 4, 4, 4,
2792 2, 1, 2, 1, 1, 1, 3, 1, 3, 0,
2793 1, 1, 1, 1, 1, 1, 3, 5, 1, 1,
2794 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
2795 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2796 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
2797 3, 3, 3, 3, 3, 3, 3, 2, 2, 1,
2798 3, 2, 4, 3, 3, 3, 3, 3, 3, 3,
2799 3, 3, 3, 3, 3, 5, 2, 2, 2, 2,
2800 3, 2, 0, 6, 1, 1, 1, 1, 1, 5,
2801 3, 5, 4, 4, 6, 6, 3, 1, 2, 4,
2805 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2806 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2807 means the default is an error. */
2808 static const yytype_uint16 yydefact[] =
2810 124, 347, 137, 176, 276, 173, 174, 175, 0, 0,
2811 79, 0, 0, 130, 277, 128, 129, 0, 136, 0,
2812 135, 224, 180, 181, 309, 131, 0, 0, 0, 179,
2813 132, 134, 133, 0, 0, 178, 177, 0, 0, 0,
2814 259, 0, 0, 14, 183, 0, 0, 0, 0, 240,
2815 124, 0, 0, 2, 124, 5, 55, 12, 0, 37,
2816 68, 32, 33, 34, 35, 36, 39, 124, 38, 7,
2817 31, 0, 125, 126, 9, 8, 11, 274, 275, 0,
2818 182, 10, 268, 270, 272, 271, 40, 257, 269, 273,
2819 42, 30, 41, 0, 0, 73, 77, 124, 93, 110,
2820 114, 112, 111, 113, 119, 116, 0, 0, 347, 246,
2821 223, 0, 308, 0, 121, 0, 122, 307, 104, 240,
2822 0, 0, 250, 66, 261, 262, 263, 264, 265, 0,
2823 0, 260, 329, 328, 311, 291, 290, 0, 255, 0,
2824 241, 242, 243, 253, 83, 0, 107, 251, 0, 81,
2825 45, 44, 124, 46, 29, 0, 47, 48, 49, 51,
2826 0, 50, 331, 1, 6, 124, 347, 0, 69, 0,
2827 0, 70, 54, 109, 0, 220, 0, 165, 0, 164,
2828 166, 351, 127, 196, 0, 197, 201, 0, 0, 0,
2829 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2830 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2831 0, 327, 326, 0, 0, 0, 0, 0, 0, 0,
2832 0, 0, 0, 0, 0, 0, 0, 0, 0, 240,
2833 0, 0, 56, 74, 0, 0, 0, 124, 117, 0,
2834 227, 0, 230, 229, 353, 238, 210, 0, 254, 0,
2835 27, 0, 330, 0, 0, 279, 0, 0, 0, 310,
2836 278, 244, 245, 84, 237, 60, 61, 106, 252, 59,
2837 82, 43, 28, 124, 0, 237, 0, 0, 53, 348,
2838 219, 218, 0, 138, 140, 0, 188, 0, 205, 0,
2839 202, 203, 258, 305, 306, 303, 304, 284, 285, 287,
2840 286, 282, 283, 319, 318, 314, 313, 321, 322, 323,
2841 320, 316, 315, 317, 288, 289, 338, 0, 337, 340,
2842 297, 296, 295, 324, 0, 294, 293, 292, 280, 281,
2843 301, 300, 298, 302, 299, 0, 0, 110, 114, 338,
2844 332, 0, 0, 0, 346, 0, 0, 0, 25, 0,
2845 124, 17, 23, 0, 20, 19, 22, 21, 124, 115,
2846 0, 240, 247, 171, 0, 0, 211, 215, 108, 123,
2847 228, 0, 26, 249, 352, 0, 266, 0, 256, 0,
2848 58, 0, 124, 13, 58, 0, 0, 0, 0, 0,
2849 142, 0, 0, 237, 167, 168, 0, 0, 0, 184,
2850 185, 190, 204, 0, 343, 0, 248, 312, 0, 0,
2851 0, 342, 0, 124, 0, 0, 120, 18, 124, 0,
2852 0, 0, 0, 217, 212, 237, 0, 0, 124, 0,
2853 235, 234, 233, 236, 0, 63, 62, 52, 0, 124,
2854 349, 350, 210, 139, 0, 0, 231, 141, 146, 58,
2855 0, 189, 209, 208, 206, 207, 0, 0, 0, 325,
2856 0, 341, 0, 339, 78, 0, 85, 0, 118, 239,
2857 172, 171, 0, 0, 214, 0, 0, 99, 103, 101,
2858 105, 64, 267, 57, 0, 76, 0, 143, 144, 0,
2859 124, 170, 169, 199, 192, 183, 193, 0, 191, 0,
2860 190, 345, 333, 344, 80, 0, 0, 0, 86, 89,
2861 87, 24, 216, 225, 213, 97, 0, 100, 102, 124,
2862 67, 124, 237, 124, 232, 0, 161, 0, 0, 124,
2863 159, 0, 186, 183, 190, 194, 0, 27, 94, 90,
2864 88, 27, 27, 237, 65, 75, 0, 152, 156, 0,
2865 0, 0, 124, 150, 154, 155, 162, 220, 147, 160,
2866 185, 0, 0, 195, 27, 92, 0, 0, 0, 221,
2867 124, 145, 151, 0, 0, 187, 185, 91, 226, 98,
2868 95, 27, 0, 0, 198, 0, 0, 0, 153, 210,
2869 200, 27, 222, 0, 0, 237, 96, 163
2872 /* YYDEFGOTO[NTERM-NUM]. */
2873 static const yytype_int16 yydefgoto[] =
2875 -1, 52, 53, 54, 55, 349, 350, 351, 371, 372,
2876 153, 154, 173, 352, 155, 435, 156, 269, 266, 520,
2877 59, 254, 169, 170, 60, 61, 62, 63, 234, 64,
2878 97, 157, 158, 507, 508, 509, 510, 65, 236, 477,
2879 586, 478, 542, 479, 480, 66, 250, 159, 67, 68,
2880 240, 241, 69, 358, 237, 70, 160, 72, 73, 390,
2881 392, 445, 354, 523, 355, 490, 551, 552, 553, 528,
2882 529, 530, 180, 356, 285, 394, 395, 423, 77, 78,
2883 79, 401, 456, 498, 561, 185, 396, 457, 499, 186,
2884 80, 289, 290, 291, 365, 366, 367, 282, 357, 581,
2885 111, 82, 541, 242, 243, 432, 447, 433, 380, 362,
2886 139, 140, 141, 245, 83, 84, 85, 161, 142, 247,
2887 248, 86, 129, 130, 131, 87, 408, 343, 319, 88,
2891 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2893 #define YYPACT_NINF -490
2894 static const yytype_int16 yypact[] =
2896 1763, -22, -490, -490, -490, -490, -490, -490, -28, -44,
2897 -490, -38, 94, -490, -490, -490, -490, 73, -490, 2217,
2898 -490, 102, -490, -490, 247, -490, -12, 547, 2217, -490,
2899 -490, -490, -490, 10, -36, -490, -490, 120, 2217, 5,
2900 147, 2217, 2217, -490, -490, 2217, 2217, 2217, 2217, 2217,
2901 707, 136, 141, -490, 575, -490, -490, -490, 20, -490,
2902 2145, -490, -490, -490, -490, -490, -490, 2019, -490, -490,
2903 -490, 338, 286, -490, -490, -490, -490, -490, -490, 17,
2904 -490, -490, -490, -490, -490, -490, 49, 2850, -490, -490,
2905 -490, -490, -490, 151, 34, -490, -490, 2019, -490, -490,
2906 -490, -490, -490, -490, -490, -490, -9, 671, -490, -27,
2907 -490, 35, 406, 2217, 32, 41, -490, 406, -490, 2217,
2908 160, 68, 406, -490, -490, -490, -490, -490, -490, 39,
2909 92, 118, 406, 406, 378, 406, 406, -41, 2788, 99,
2910 125, 2217, -490, 2788, 225, 229, 2217, 2217, 229, 230,
2911 -490, -490, 839, -490, -490, 103, -490, -490, -490, -490,
2912 218, -490, -490, -490, -490, 1103, 166, 233, -490, 145,
2913 178, 49, 161, -490, 258, 28, 264, -490, 265, -490,
2914 -490, -490, -490, -490, 2217, -490, 18, 2217, 2217, 2217,
2915 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2916 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2917 2217, -490, -490, 23, 2217, 2217, 2217, 2217, 2217, 2217,
2918 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2919 2217, 327, -490, -490, 2217, 260, 2217, 1235, -490, 671,
2920 149, 150, -490, -490, -490, 146, 40, 153, 182, 358,
2921 1891, 154, -490, 2217, 2217, -490, 2217, 147, 2217, -490,
2922 -490, -490, -490, -490, 179, 184, -490, -490, -490, 184,
2923 -490, -490, -490, 2019, 163, 179, 2217, 2217, -490, 190,
2924 -490, -490, 296, 251, 256, 298, 2788, 209, 210, -8,
2925 18, -490, 2788, 1095, 567, 567, 567, 3222, 3222, 3222,
2926 3222, 1095, 1095, 2788, 2788, 2788, 2788, 2788, 2788, 2788,
2927 2788, 2788, 2788, 2788, 2912, 2974, -490, 396, -490, -490,
2928 362, 362, 362, 2788, 2416, 3036, 3098, 3160, 1095, 1095,
2929 378, 378, 406, 406, 406, 181, 2478, 226, 232, 234,
2930 -490, 2217, 420, 235, -490, 185, 195, 2276, -490, 193,
2931 1367, -490, -490, 201, -490, -490, -490, -490, 1235, -490,
2932 671, 2217, -490, 11, 334, 203, 239, -490, -490, -490,
2933 213, 211, 1891, -490, 2788, 214, -490, 257, 2788, 279,
2934 253, 229, 971, -490, -1, 266, 231, 113, 241, 671,
2935 357, 671, 248, 179, 276, -490, 249, 71, 72, -490,
2936 -490, -490, -490, 2217, -490, 2217, -490, -490, 2217, 2540,
2937 2217, -490, 431, 2019, 2217, 261, -490, -490, 1235, 259,
2938 246, 2217, 279, -490, -490, 179, 42, 57, 2019, 2217,
2939 -490, -490, -490, -490, 2217, -490, -490, -490, 2217, 2019,
2940 -490, -490, 40, -490, 671, 275, -490, 283, -490, 253,
2941 298, -490, -490, -490, -490, -490, 282, 137, 2602, 2788,
2942 2346, -490, 2664, -490, -490, 271, 8, 277, -490, -490,
2943 2788, 306, 287, 334, -490, 289, 290, -490, -490, 57,
2944 -490, 360, -490, 2788, -40, -490, 293, 283, -490, 671,
2945 26, -490, -490, -490, -490, 322, -490, 2217, -490, 328,
2946 -490, -490, -490, -490, -490, 2217, 335, 308, 8, -490,
2947 -490, -490, -490, -490, -490, -490, 437, -490, -490, 2019,
2948 -490, 2019, 179, 1499, -490, 440, -490, 419, 312, 384,
2949 -490, 17, 2788, 336, -490, 19, 2726, 1891, -490, -490,
2950 -490, 1891, 1891, 179, -490, -490, 330, -490, -490, 337,
2951 228, 329, 1631, -490, -490, -490, -490, 28, -490, -490,
2952 -490, 339, 17, 19, 1891, -490, 340, 347, 333, -490,
2953 1499, -490, -490, 461, 370, -490, -490, -490, -490, -490,
2954 -490, 1891, 349, 345, -490, 375, 365, 363, -490, 40,
2955 -490, 1891, -490, 366, 369, 179, -490, -490
2958 /* YYPGOTO[NTERM-NUM]. */
2959 static const yytype_int16 yypgoto[] =
2961 -490, -490, 343, -490, 451, -327, -490, 159, -75, -31,
2962 1, -60, -92, 53, 2, 61, 452, 372, 130, -490,
2963 -490, -490, -490, -490, -490, -490, -490, -490, -490, -490,
2964 -490, -490, -490, -490, -490, 6, 7, -490, -490, 52,
2965 -490, 55, -490, -490, -490, -490, -490, -490, -490, -490,
2966 38, 54, -490, -490, -490, -490, 0, -490, 447, -490,
2967 -490, -490, 59, -490, 60, -490, -50, -490, -24, -490,
2968 -490, 9, -490, 3, -490, -490, 83, 50, -490, -490,
2969 -490, -490, -489, -490, -490, -168, -490, -452, -490, -453,
2970 -416, -490, -490, 250, -425, -490, -341, -21, 4, -490,
2971 -490, -490, -490, -490, 512, -98, 97, 121, -263, -490,
2972 -103, -490, -490, -490, -490, -490, -490, -490, -131, -133,
2973 494, -52, -490, 288, -490, -13, -490, -490, -193, -490,
2974 -490, -490, -490, -490, -490
2977 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2978 positive, shift that token. If negative, reduce the rule which
2979 number is the opposite. If zero, do what YYDEFACT says.
2980 If YYTABLE_NINF, syntax error. */
2981 #define YYTABLE_NINF -337
2982 static const yytype_int16 yytable[] =
2984 71, 56, 58, 76, 81, 235, 109, 172, 171, 244,
2985 262, 112, 384, 267, 268, 117, 251, 486, 288, 152,
2986 183, 287, 94, 424, 494, 122, 99, 100, 132, 133,
2987 2, 419, 134, 135, 136, 138, 143, 172, 344, 101,
2988 102, 500, 505, 363, 13, 363, 15, 16, 535, 18,
2989 105, 20, 103, 57, 71, 56, 58, 76, 81, 74,
2990 75, 258, 187, 280, 25, 105, 106, 213, -71, 93,
2991 506, 574, 525, 30, 31, 32, 452, 454, 560, 281,
2992 96, 115, 563, 534, 475, 474, 98, 585, 119, 107,
2993 476, 467, 272, 120, 259, 521, 95, 99, 100, 230,
2994 138, 345, 231, 434, 399, 110, 143, 57, 400, 576,
2995 101, 102, 113, 74, 75, 421, 440, 422, 441, 238,
2996 239, 375, 288, 103, 404, 376, 335, 526, 143, 123,
2997 449, 496, 514, 138, 138, 364, 121, 473, 118, 162,
2998 316, 163, 494, 385, 386, 184, 184, 497, 165, 411,
2999 124, 187, 125, 317, 232, 126, 127, 128, 233, 246,
3000 -157, -110, 472, 252, 593, 71, 56, 58, 76, 81,
3001 249, 286, 253, 255, 292, 293, 294, 295, 296, 297,
3002 298, 299, 300, 301, 302, 303, 304, 305, 306, 307,
3003 308, 309, 310, 311, 312, 313, 314, 315, 256, 184,
3004 184, 320, 321, 322, 323, 324, 325, 326, 327, 328,
3005 329, 330, 331, 332, 333, 334, 143, 336, 57, 463,
3006 257, 138, 104, 347, 74, 75, 260, 261, 263, 453,
3007 455, 273, 264, 270, 174, -72, 275, 71, 56, 353,
3008 374, 138, 382, 143, 174, 378, 276, 277, 495, 496,
3009 108, 318, 3, 4, 175, 5, 6, 7, 420, 546,
3010 177, 279, 278, 138, 138, 497, 14, 283, 284, 318,
3011 361, 19, 346, 21, 179, 22, 23, 359, -116, 360,
3012 568, 465, 99, 100, 258, 379, 381, 370, 368, 373,
3013 2, 443, 29, 446, 387, 101, 102, 383, 482, 388,
3014 34, 393, 35, 36, 13, 389, 15, 16, 103, 18,
3015 391, 20, 272, 397, 398, 430, 406, -334, 40, 414,
3016 413, 464, 272, -336, 25, -335, 412, 416, 409, 418,
3017 337, 338, 597, 30, 31, 32, 481, 363, 425, 41,
3018 42, 426, -115, 101, 102, 427, 446, 485, 143, 428,
3019 71, 56, 353, 172, 174, 318, 103, 434, 71, 56,
3020 353, 99, 100, 429, 175, 442, 439, 438, 172, 176,
3021 177, 48, 444, 49, 101, 102, 448, 51, 450, 172,
3022 318, 469, 178, 451, 179, 489, 484, 103, 2, 466,
3023 458, 524, 459, 468, 493, 460, 431, 462, 370, 99,
3024 100, 138, 13, 488, 15, 16, 504, 18, 470, 20,
3025 421, 511, 101, 102, 516, 513, 143, 515, 71, 56,
3026 353, 483, 25, 99, 100, 103, 519, 544, 522, 545,
3027 525, 30, 31, 32, 99, 100, 101, 102, 531, 533,
3028 543, 537, 538, 556, 339, 557, 558, 101, 102, 103,
3029 318, 340, 562, 341, 211, 212, 213, 342, 569, 172,
3030 103, 172, 565, 571, 583, 570, 566, 567, 580, 589,
3031 211, 212, 213, 575, 578, 369, 224, 225, 226, 227,
3032 228, 579, 584, 588, 532, 526, 229, 590, 230, 577,
3033 527, 231, 536, 591, 226, 227, 228, 592, 211, 212,
3034 213, 595, 229, 596, 230, 164, 587, 231, 274, 417,
3035 491, 436, 168, 316, 539, 540, 594, 265, -158, 182,
3036 582, 512, 403, 550, 548, 549, 554, 555, 572, 527,
3037 229, 517, 230, 492, 518, 231, 573, 316, 559, 116,
3038 402, 487, 137, 471, 0, 377, 410, 0, 316, 0,
3039 114, 100, 550, 548, 549, 554, 555, 0, 0, 0,
3040 0, 0, 0, 101, 102, 0, 0, 0, 0, 0,
3041 550, 548, 549, 554, 555, -4, 103, 0, 1, 2,
3042 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3043 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
3044 20, 0, 0, 22, 23, 0, 0, 188, 0, 0,
3045 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3046 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3047 35, 36, 0, 0, 0, -337, -337, -337, 37, 38,
3048 39, 0, 0, 196, 197, 0, 40, 0, 0, 0,
3049 0, 0, 0, 0, 0, 0, 0, 0, 0, 211,
3050 212, 213, 0, 214, 215, 216, 0, 41, 42, 0,
3051 0, 0, 0, 0, 99, 100, 43, 0, 222, 223,
3052 0, 224, 225, 226, 227, 228, 44, 101, 102, 45,
3053 0, 229, 0, 230, 46, 47, 231, 0, 0, 48,
3054 103, 49, 0, 50, 0, 51, 0, 0, 0, -4,
3055 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3056 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3057 18, 19, 20, 21, 0, 22, 23, 144, 0, 145,
3058 0, 0, 0, 24, 146, 25, 26, 0, 27, 147,
3059 28, 0, 29, 148, 30, 31, 32, 0, 0, 33,
3060 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3061 37, 38, 39, 0, 149, 0, 0, 0, 40, 0,
3062 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3063 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3064 42, 0, 0, 0, 0, 0, 0, 0, 150, 0,
3065 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3066 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3067 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3068 0, 151, 1, 2, 3, 4, 0, 5, 6, 7,
3069 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3070 16, 17, 18, 19, 20, 21, 0, 22, 23, 144,
3071 0, 145, 0, 0, 0, 24, 146, 25, 26, 0,
3072 27, 147, 28, 0, 29, 148, 30, 31, 32, 0,
3073 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3074 0, 0, 37, 38, 39, 0, 149, 0, 0, 0,
3075 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3076 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3077 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3078 150, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3079 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3080 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3081 0, 0, 0, 271, 1, 2, 3, 4, 0, 5,
3082 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3083 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3084 23, 144, 0, 145, 0, 0, 0, 24, 146, 25,
3085 26, 0, 27, 147, 28, 0, 29, 148, 30, 31,
3086 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3087 0, 0, 0, 0, 37, 38, 39, 0, 149, 0,
3088 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3089 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3090 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3091 0, 0, 150, 0, 0, 0, 0, 0, 0, 0,
3092 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3093 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3094 0, 51, 0, 0, 0, 437, 1, 2, 3, 4,
3095 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3096 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3097 0, 22, 23, 0, 0, -337, 0, 0, 0, 24,
3098 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3099 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3100 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3101 0, -337, -337, 0, 40, 0, 0, 0, 0, 0,
3102 0, 0, 0, 0, 0, 0, 0, 211, 212, 213,
3103 0, 214, 215, 216, 0, 41, 42, 0, 0, 0,
3104 0, 0, 0, 0, 43, 0, -337, -337, 0, 224,
3105 225, 226, 227, 228, 44, 0, 0, 45, 0, 229,
3106 0, 230, 46, 47, 231, 0, 0, 48, 0, 49,
3107 0, 50, 0, 51, 0, 0, 0, -3, 1, 2,
3108 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3109 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3110 20, 0, 0, 22, 23, 0, 0, 0, 0, 0,
3111 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3112 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3113 35, 36, 0, 0, 0, 0, 0, 0, 37, 38,
3114 39, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3116 0, 0, 0, 0, 0, 0, 0, 41, 42, 0,
3117 0, 0, 0, 0, 0, 0, 348, 0, 0, 0,
3118 0, 0, 0, 0, 0, 0, 44, 0, 0, 45,
3119 0, 0, 0, 0, 46, 47, 0, 0, 0, 48,
3120 0, 49, 0, 50, 0, 51, 0, 0, 0, -15,
3121 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3122 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3123 18, 19, 20, 0, 0, 22, 23, 0, 0, 0,
3124 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
3125 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
3126 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3127 37, 38, 39, 0, 0, 0, 0, 0, 40, 0,
3128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3129 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3130 42, 0, 0, 0, 0, 0, 0, 0, 348, 0,
3131 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3132 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3133 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3134 0, -16, 1, 2, 3, 4, 0, 5, 6, 7,
3135 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3136 16, 17, 18, 19, 20, 0, 0, 22, 23, 0,
3137 0, 0, 0, 0, 0, 24, 0, 25, 26, 0,
3138 27, 0, 28, 0, 29, 0, 30, 31, 32, 0,
3139 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3140 0, 0, 37, 38, 39, 0, 0, 0, 0, 0,
3141 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3143 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3144 547, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3145 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3146 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3147 0, 0, 0, -148, 1, 2, 3, 4, 0, 5,
3148 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3149 14, 15, 16, 17, 18, 19, 20, 0, 0, 22,
3150 23, 0, 0, 0, 0, 0, 0, 24, 0, 25,
3151 26, 0, 27, 0, 28, 0, 29, 0, 30, 31,
3152 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3153 0, 0, 0, 0, 37, 38, 39, 0, 0, 0,
3154 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3156 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3157 0, 0, 547, 0, 0, 0, 0, 0, 0, 0,
3158 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3159 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3160 0, 51, 0, -3, 0, -149, 1, 2, 3, 4,
3161 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3162 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3163 0, 22, 23, 0, 0, 0, 0, 0, 0, 24,
3164 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3165 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3166 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3167 0, 0, 0, 0, 40, 0, 0, 0, 0, 0,
3168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3169 0, 0, 0, 0, 0, 41, 42, 0, 0, 0,
3170 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
3171 0, 0, 0, 0, 44, 0, 0, 45, 0, 0,
3172 0, 0, 46, 47, 0, 0, 0, 48, 0, 49,
3173 0, 50, 0, 51, 1, 2, 3, 4, 0, 5,
3174 6, 7, 8, 9, 10, 11, 0, -124, 0, 13,
3175 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3176 23, 144, 0, 145, 0, 0, 0, 24, 146, 25,
3177 26, 0, 27, 147, 28, 0, 29, 148, 30, 31,
3178 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3179 0, 0, 0, 0, 37, 38, 39, 0, 149, 0,
3180 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3182 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3183 0, 0, 150, 0, 0, 0, 0, 0, 0, 0,
3184 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3185 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3186 0, 51, 1, 2, 3, 4, 0, 5, 6, 7,
3187 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3188 16, 17, 18, 19, 20, 21, 0, 22, 23, 144,
3189 0, 145, 0, 0, 0, 24, 146, 25, 26, 0,
3190 27, 147, 28, 0, 29, 148, 30, 31, 32, 0,
3191 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3192 0, 0, 37, 38, 39, 0, 149, 0, 0, 0,
3193 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3194 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3195 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3196 150, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3197 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3198 0, 0, 0, 48, 0, 49, 0, 50, 166, 51,
3199 3, 4, 0, 5, 6, 7, 0, 0, 0, 0,
3200 0, 0, 0, 0, 14, 0, 0, 0, 0, 19,
3201 0, 21, 0, 22, 23, 0, 0, 145, 0, 0,
3202 0, 24, 0, 0, 0, 0, 0, 0, 28, 0,
3203 29, 167, 0, 0, 0, 0, 0, 0, 34, 0,
3204 35, 36, 0, 0, 0, 0, 0, 0, 0, 38,
3205 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3206 108, 0, 3, 4, 0, 5, 6, 7, 0, 0,
3207 0, 0, 0, 0, 0, 0, 14, 41, 42, 0,
3208 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3209 0, 0, 0, 24, 0, 0, 44, 0, 0, 45,
3210 28, 0, 29, 0, 46, 47, 0, 0, 0, 48,
3211 34, 49, 35, 36, 0, 51, 0, 0, 0, 0,
3212 0, 38, 0, 0, 0, 0, 0, 0, 40, 0,
3213 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3214 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3215 42, 0, 0, 0, 0, 0, 188, 0, 0, 0,
3216 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3217 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3218 0, 48, 0, 49, 189, 190, 191, 51, 192, 193,
3219 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3220 204, 205, 206, 207, 208, 209, 210, 0, 211, 212,
3221 213, 0, 214, 215, 216, 0, 0, 0, 0, 0,
3222 217, 218, 0, 219, 220, 221, 188, 222, 223, 0,
3223 224, 225, 226, 227, 228, 0, 0, 0, 0, 0,
3224 229, 0, 230, 0, 0, 231, 0, 0, 0, 0,
3225 0, 415, 0, 0, 189, 190, 191, 0, 192, 193,
3226 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3227 204, 205, 206, 207, 208, 209, 210, 0, 211, 212,
3228 213, 0, 214, 215, 216, 0, 0, 0, 0, 0,
3229 217, 218, 0, 219, 220, 221, 188, 222, 223, 0,
3230 224, 225, 226, 227, 228, 0, 0, 0, 0, 0,
3231 229, 0, 230, 0, 0, 231, 0, 0, 0, 0,
3232 0, 502, 0, 0, 189, 190, 191, 0, 192, 193,
3233 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3234 204, 205, 206, 207, 208, 209, 210, 0, 211, 212,
3235 213, 0, 214, 215, 216, 0, 0, 0, 188, 0,
3236 217, 218, 405, 219, 220, 221, 0, 222, 223, 0,
3237 224, 225, 226, 227, 228, 0, 0, 0, 0, 0,
3238 229, 0, 230, 0, 0, 231, 189, 190, 191, 0,
3239 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3240 202, 203, 204, 205, 206, 207, 208, 209, 210, 0,
3241 211, 212, 213, 0, 214, 215, 216, 0, 0, 0,
3242 188, 0, 217, 218, 0, 219, 220, 221, 0, 222,
3243 223, 0, 224, 225, 226, 227, 228, 0, 0, 0,
3244 0, 0, 229, 0, 230, 407, 0, 231, 189, 190,
3245 191, 0, 192, 193, 194, 195, 196, 197, 198, 199,
3246 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
3247 210, 0, 211, 212, 213, 0, 214, 215, 216, 0,
3248 0, 0, 188, 0, 217, 218, 0, 219, 220, 221,
3249 0, 222, 223, 0, 224, 225, 226, 227, 228, 0,
3250 0, 0, 0, 0, 229, 0, 230, 461, 0, 231,
3251 189, 190, 191, 0, 192, 193, 194, 195, 196, 197,
3252 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3253 208, 209, 210, 0, 211, 212, 213, 0, 214, 215,
3254 216, 0, 0, 0, 188, 0, 217, 218, 0, 219,
3255 220, 221, 0, 222, 223, 0, 224, 225, 226, 227,
3256 228, 0, 0, 0, 0, 0, 229, 0, 230, 501,
3257 0, 231, 189, 190, 191, 0, 192, 193, 194, 195,
3258 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
3259 206, 207, 208, 209, 210, 0, 211, 212, 213, 0,
3260 214, 215, 216, 0, 0, 0, 188, 0, 217, 218,
3261 0, 219, 220, 221, 0, 222, 223, 0, 224, 225,
3262 226, 227, 228, 0, 0, 0, 0, 0, 229, 0,
3263 230, 503, 0, 231, 189, 190, 191, 0, 192, 193,
3264 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3265 204, 205, 206, 207, 208, 209, 210, 0, 211, 212,
3266 213, 0, 214, 215, 216, 0, 0, 0, 188, 0,
3267 217, 218, 564, 219, 220, 221, 0, 222, 223, 0,
3268 224, 225, 226, 227, 228, 0, 0, 0, 0, 0,
3269 229, 0, 230, 0, 0, 231, 189, 190, 191, 0,
3270 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3271 202, 203, 204, 205, 206, 207, 208, 209, 210, 0,
3272 211, 212, 213, 0, 214, 215, 216, 0, 0, 0,
3273 188, 0, 217, 218, 0, 219, 220, 221, 0, 222,
3274 223, 0, 224, 225, 226, 227, 228, 0, 0, 0,
3275 0, 0, 229, 0, 230, 0, 0, 231, 189, 190,
3276 191, 0, 192, 193, 194, 195, 196, 197, 198, 199,
3277 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
3278 210, 0, 211, 212, 213, 0, 214, 215, 216, 0,
3279 0, 0, 188, 0, 217, 218, 0, 219, 220, 221,
3280 0, 0, 223, 0, 224, 225, 226, 227, 228, 0,
3281 0, 0, 0, 0, 229, 0, 230, 0, 0, 231,
3282 189, 190, 191, 0, 192, 193, 194, 195, 196, 197,
3283 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3284 0, 0, 210, 0, 211, 212, 213, 0, 214, 215,
3285 216, 0, 0, 0, 188, 0, 0, 0, 0, 219,
3286 220, 221, 0, 222, 223, 0, 224, 225, 226, 227,
3287 228, 0, 0, 0, 0, 0, 229, 0, 230, 0,
3288 0, 231, 189, 190, 191, 0, 192, 193, 194, 195,
3289 196, 197, 0, 0, 0, 0, 0, 0, 0, 0,
3290 0, 0, 0, 0, 0, 0, 211, 212, 213, 0,
3291 214, 215, 216, 0, 0, 0, 188, 0, 0, 0,
3292 0, 219, 220, 221, 0, 222, 223, 0, 224, 225,
3293 226, 227, 228, 0, 0, 0, 0, 0, 229, 0,
3294 230, 0, 0, 231, 189, 190, 191, 0, 192, 193,
3295 194, 195, 196, 197, 0, 0, 0, 0, 0, 0,
3296 0, 0, 0, 0, 0, 0, 0, 0, 211, 212,
3297 213, 0, 214, 215, 216, 0, 0, 0, 188, 0,
3298 0, 0, 0, 0, 220, 221, 0, 222, 223, 0,
3299 224, 225, 226, 227, 228, 0, 0, 0, 0, 0,
3300 229, 0, 230, 0, 0, 231, 189, 190, 191, 0,
3301 192, 193, 194, 195, 196, 197, 0, 0, 0, 0,
3302 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3303 211, 212, 213, 0, 214, 215, 216, 0, 0, 0,
3304 188, 0, 0, 0, 0, 0, 0, 221, 0, 222,
3305 223, 0, 224, 225, 226, 227, 228, 0, 0, 0,
3306 0, 0, 229, 0, 230, 0, 0, 231, 189, 190,
3307 191, 0, 192, 193, 194, 195, 196, 197, 0, 0,
3308 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3309 0, 0, 211, 212, 213, 0, 214, 215, 216, 0,
3310 0, 0, 188, 0, 0, 0, 0, 0, 0, -337,
3311 0, 222, 223, 0, 224, 225, 226, 227, 228, 0,
3312 0, 0, 0, 0, 229, 0, 230, 0, 0, 231,
3313 189, 190, 191, 0, -337, -337, -337, -337, 196, 197,
3314 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3315 0, 0, 0, 0, 211, 212, 213, 0, 214, 215,
3316 216, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3317 0, 0, 0, 222, 223, 0, 224, 225, 226, 227,
3318 228, 0, 0, 0, 0, 0, 229, 0, 230, 0,
3322 static const yytype_int16 yycheck[] =
3324 0, 0, 0, 0, 0, 97, 19, 67, 60, 107,
3325 141, 24, 275, 146, 147, 28, 119, 442, 186, 50,
3326 3, 3, 50, 364, 5, 38, 3, 4, 41, 42,
3327 4, 358, 45, 46, 47, 48, 49, 97, 231, 16,
3328 17, 457, 34, 3, 18, 3, 20, 21, 500, 23,
3329 12, 25, 29, 0, 54, 54, 54, 54, 54, 0,
3330 0, 102, 102, 35, 38, 27, 12, 94, 69, 91,
3331 62, 560, 46, 47, 48, 49, 5, 5, 531, 51,
3332 124, 27, 534, 499, 27, 426, 124, 576, 124, 16,
3333 33, 418, 152, 129, 135, 135, 124, 3, 4, 126,
3334 113, 234, 129, 104, 112, 3, 119, 54, 116, 562,
3335 16, 17, 124, 54, 54, 104, 3, 106, 5, 128,
3336 129, 254, 290, 29, 317, 256, 229, 101, 141, 124,
3337 393, 112, 473, 146, 147, 95, 16, 95, 128, 3,
3338 117, 0, 5, 276, 277, 128, 128, 128, 128, 342,
3339 3, 102, 5, 130, 3, 8, 9, 10, 124, 124,
3340 134, 129, 425, 3, 589, 165, 165, 165, 165, 165,
3341 129, 184, 104, 134, 187, 188, 189, 190, 191, 192,
3342 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3343 203, 204, 205, 206, 207, 208, 209, 210, 106, 128,
3344 128, 214, 215, 216, 217, 218, 219, 220, 221, 222,
3345 223, 224, 225, 226, 227, 228, 229, 230, 165, 412,
3346 102, 234, 128, 236, 165, 165, 127, 102, 3, 397,
3347 398, 128, 3, 3, 16, 69, 3, 237, 237, 237,
3348 253, 254, 273, 256, 16, 258, 101, 69, 111, 112,
3349 3, 213, 5, 6, 26, 8, 9, 10, 361, 522,
3350 32, 3, 101, 276, 277, 128, 19, 3, 3, 231,
3351 124, 24, 12, 26, 46, 28, 29, 239, 129, 129,
3352 543, 414, 3, 4, 102, 106, 102, 249, 135, 135,
3353 4, 389, 45, 391, 104, 16, 17, 134, 429, 3,
3354 53, 3, 55, 56, 18, 54, 20, 21, 29, 23,
3355 54, 25, 372, 104, 104, 36, 135, 91, 71, 124,
3356 135, 413, 382, 91, 38, 91, 91, 134, 341, 128,
3357 3, 4, 595, 47, 48, 49, 428, 3, 135, 92,
3358 93, 102, 129, 16, 17, 134, 444, 439, 361, 135,
3359 350, 350, 350, 413, 16, 317, 29, 104, 358, 358,
3360 358, 3, 4, 106, 26, 124, 135, 101, 428, 31,
3361 32, 124, 15, 126, 16, 17, 128, 130, 102, 439,
3362 342, 135, 44, 134, 46, 102, 438, 29, 4, 128,
3363 403, 489, 405, 134, 112, 408, 117, 410, 360, 3,
3364 4, 414, 18, 128, 20, 21, 135, 23, 421, 25,
3365 104, 134, 16, 17, 124, 128, 429, 128, 418, 418,
3366 418, 434, 38, 3, 4, 29, 66, 519, 135, 521,
3367 46, 47, 48, 49, 3, 4, 16, 17, 116, 111,
3368 3, 106, 134, 3, 117, 26, 134, 16, 17, 29,
3369 412, 124, 116, 126, 92, 93, 94, 130, 128, 519,
3370 29, 521, 537, 134, 3, 128, 541, 542, 135, 124,
3371 92, 93, 94, 134, 134, 117, 114, 115, 116, 117,
3372 118, 134, 112, 134, 497, 101, 124, 112, 126, 564,
3373 490, 129, 505, 128, 116, 117, 118, 134, 92, 93,
3374 94, 135, 124, 134, 126, 54, 581, 129, 165, 350,
3375 449, 381, 60, 117, 508, 508, 591, 145, 134, 72,
3376 570, 471, 126, 523, 523, 523, 523, 523, 552, 529,
3377 124, 479, 126, 450, 479, 129, 557, 117, 529, 27,
3378 290, 444, 48, 422, -1, 257, 126, -1, 117, -1,
3379 3, 4, 552, 552, 552, 552, 552, -1, -1, -1,
3380 -1, -1, -1, 16, 17, -1, -1, -1, -1, -1,
3381 570, 570, 570, 570, 570, 0, 29, -1, 3, 4,
3382 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3383 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
3384 25, -1, -1, 28, 29, -1, -1, 40, -1, -1,
3385 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3386 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3387 55, 56, -1, -1, -1, 68, 69, 70, 63, 64,
3388 65, -1, -1, 76, 77, -1, 71, -1, -1, -1,
3389 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3390 93, 94, -1, 96, 97, 98, -1, 92, 93, -1,
3391 -1, -1, -1, -1, 3, 4, 101, -1, 111, 112,
3392 -1, 114, 115, 116, 117, 118, 111, 16, 17, 114,
3393 -1, 124, -1, 126, 119, 120, 129, -1, -1, 124,
3394 29, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3395 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3396 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3397 23, 24, 25, 26, -1, 28, 29, 30, -1, 32,
3398 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
3399 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
3400 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3401 63, 64, 65, -1, 67, -1, -1, -1, 71, -1,
3402 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3403 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3404 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3405 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3406 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3407 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3408 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3409 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3410 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3411 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3412 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3413 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3414 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3415 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3416 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3417 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3418 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3419 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3420 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3421 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3422 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3423 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3424 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3425 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3426 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3427 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3428 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3429 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3430 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3431 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3432 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3433 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3434 -1, 130, -1, -1, -1, 134, 3, 4, 5, 6,
3435 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3436 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3437 -1, 28, 29, -1, -1, 40, -1, -1, -1, 36,
3438 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3439 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3440 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3441 -1, 76, 77, -1, 71, -1, -1, -1, -1, -1,
3442 -1, -1, -1, -1, -1, -1, -1, 92, 93, 94,
3443 -1, 96, 97, 98, -1, 92, 93, -1, -1, -1,
3444 -1, -1, -1, -1, 101, -1, 111, 112, -1, 114,
3445 115, 116, 117, 118, 111, -1, -1, 114, -1, 124,
3446 -1, 126, 119, 120, 129, -1, -1, 124, -1, 126,
3447 -1, 128, -1, 130, -1, -1, -1, 134, 3, 4,
3448 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3449 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3450 25, -1, -1, 28, 29, -1, -1, -1, -1, -1,
3451 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3452 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3453 55, 56, -1, -1, -1, -1, -1, -1, 63, 64,
3454 65, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3455 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3456 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
3457 -1, -1, -1, -1, -1, -1, 101, -1, -1, -1,
3458 -1, -1, -1, -1, -1, -1, 111, -1, -1, 114,
3459 -1, -1, -1, -1, 119, 120, -1, -1, -1, 124,
3460 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3461 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3462 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3463 23, 24, 25, -1, -1, 28, 29, -1, -1, -1,
3464 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3465 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3466 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3467 63, 64, 65, -1, -1, -1, -1, -1, 71, -1,
3468 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3469 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3470 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3471 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3472 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3473 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3474 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3475 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3476 21, 22, 23, 24, 25, -1, -1, 28, 29, -1,
3477 -1, -1, -1, -1, -1, 36, -1, 38, 39, -1,
3478 41, -1, 43, -1, 45, -1, 47, 48, 49, -1,
3479 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3480 -1, -1, 63, 64, 65, -1, -1, -1, -1, -1,
3481 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3482 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3483 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3484 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3485 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3486 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3487 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3488 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3489 19, 20, 21, 22, 23, 24, 25, -1, -1, 28,
3490 29, -1, -1, -1, -1, -1, -1, 36, -1, 38,
3491 39, -1, 41, -1, 43, -1, 45, -1, 47, 48,
3492 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3493 -1, -1, -1, -1, 63, 64, 65, -1, -1, -1,
3494 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3495 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3496 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3497 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3498 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3499 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3500 -1, 130, -1, 0, -1, 134, 3, 4, 5, 6,
3501 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3502 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3503 -1, 28, 29, -1, -1, -1, -1, -1, -1, 36,
3504 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3505 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3506 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3507 -1, -1, -1, -1, 71, -1, -1, -1, -1, -1,
3508 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3509 -1, -1, -1, -1, -1, 92, 93, -1, -1, -1,
3510 -1, -1, -1, -1, 101, -1, -1, -1, -1, -1,
3511 -1, -1, -1, -1, 111, -1, -1, 114, -1, -1,
3512 -1, -1, 119, 120, -1, -1, -1, 124, -1, 126,
3513 -1, 128, -1, 130, 3, 4, 5, 6, -1, 8,
3514 9, 10, 11, 12, 13, 14, -1, 16, -1, 18,
3515 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3516 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3517 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3518 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3519 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3520 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3521 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3522 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3523 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3524 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3525 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3526 -1, 130, 3, 4, 5, 6, -1, 8, 9, 10,
3527 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3528 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3529 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3530 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3531 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3532 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3533 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3534 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3535 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3536 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3537 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3538 -1, -1, -1, 124, -1, 126, -1, 128, 3, 130,
3539 5, 6, -1, 8, 9, 10, -1, -1, -1, -1,
3540 -1, -1, -1, -1, 19, -1, -1, -1, -1, 24,
3541 -1, 26, -1, 28, 29, -1, -1, 32, -1, -1,
3542 -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
3543 45, 46, -1, -1, -1, -1, -1, -1, 53, -1,
3544 55, 56, -1, -1, -1, -1, -1, -1, -1, 64,
3545 -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3546 3, -1, 5, 6, -1, 8, 9, 10, -1, -1,
3547 -1, -1, -1, -1, -1, -1, 19, 92, 93, -1,
3548 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3549 -1, -1, -1, 36, -1, -1, 111, -1, -1, 114,
3550 43, -1, 45, -1, 119, 120, -1, -1, -1, 124,
3551 53, 126, 55, 56, -1, 130, -1, -1, -1, -1,
3552 -1, 64, -1, -1, -1, -1, -1, -1, 71, -1,
3553 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3554 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3555 93, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3556 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3557 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3558 -1, 124, -1, 126, 68, 69, 70, 130, 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, 29, 128, 186, 187, 16, 3, 261,
3677 3, 236, 261, 124, 3, 187, 240, 261, 128, 124,
3678 129, 16, 261, 124, 3, 5, 8, 9, 10, 258,
3679 259, 260, 261, 261, 261, 261, 261, 256, 261, 246,
3680 247, 248, 254, 261, 30, 32, 37, 42, 46, 67,
3681 101, 134, 145, 146, 147, 150, 152, 167, 168, 183,
3682 192, 253, 3, 0, 140, 128, 3, 46, 152, 158,
3683 159, 257, 147, 148, 16, 26, 31, 32, 44, 46,
3684 208, 267, 194, 3, 128, 221, 225, 102, 40, 68,
3685 69, 70, 72, 73, 74, 75, 76, 77, 78, 79,
3686 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3687 90, 92, 93, 94, 96, 97, 98, 104, 105, 107,
3688 108, 109, 111, 112, 114, 115, 116, 117, 118, 124,
3689 126, 129, 3, 124, 164, 148, 174, 190, 128, 129,
3690 186, 187, 239, 240, 241, 249, 124, 255, 256, 129,
3691 182, 246, 3, 104, 157, 134, 106, 102, 102, 135,
3692 127, 102, 254, 3, 3, 153, 154, 255, 255, 153,
3693 3, 134, 147, 128, 138, 3, 101, 69, 101, 3,
3694 35, 51, 233, 3, 3, 210, 261, 3, 221, 227,
3695 228, 229, 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, 261, 117, 130, 186, 264,
3698 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3699 261, 261, 261, 261, 261, 246, 261, 3, 4, 117,
3700 124, 126, 130, 263, 264, 255, 12, 261, 101, 141,
3701 142, 143, 149, 150, 198, 200, 209, 234, 189, 186,
3702 129, 124, 245, 3, 95, 230, 231, 232, 135, 117,
3703 186, 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 1929 "parser.y"
4542 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4551 /* Line 1464 of skeleton.m4 */
4552 #line 1941 "parser.y"
4553 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4562 /* Line 1464 of skeleton.m4 */
4563 #line 1944 "parser.y"
4564 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4573 /* Line 1464 of skeleton.m4 */
4574 #line 1945 "parser.y"
4575 {(yyval.code)=code_new();}
4584 /* Line 1464 of skeleton.m4 */
4585 #line 1947 "parser.y"
4587 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4597 /* Line 1464 of skeleton.m4 */
4598 #line 1950 "parser.y"
4599 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4608 /* Line 1464 of skeleton.m4 */
4609 #line 1966 "parser.y"
4610 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4619 /* Line 1464 of skeleton.m4 */
4620 #line 1967 "parser.y"
4630 /* Line 1464 of skeleton.m4 */
4631 #line 1970 "parser.y"
4641 /* Line 1464 of skeleton.m4 */
4642 #line 1977 "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 1989 "parser.y"
4662 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4671 /* Line 1464 of skeleton.m4 */
4672 #line 1990 "parser.y"
4673 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4682 /* Line 1464 of skeleton.m4 */
4683 #line 1994 "parser.y"
4685 if((yyvsp[(1) - (1)].code)) {
4687 global->init = abc_initscript(global->file);
4688 code_t**cc = &global->init->method->body->code;
4689 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4700 /* Line 1464 of skeleton.m4 */
4701 #line 2005 "parser.y"
4704 (yyval.number_int)=as3_pass;
4705 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4706 if(!definitions || !dict_contains(definitions, key)) {
4719 /* Line 1464 of skeleton.m4 */
4720 #line 2024 "parser.y"
4721 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4730 /* Line 1464 of skeleton.m4 */
4731 #line 2025 "parser.y"
4732 {(yyval.node)=mkdummynode();}
4741 /* Line 1464 of skeleton.m4 */
4742 #line 2027 "parser.y"
4743 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4752 /* Line 1464 of skeleton.m4 */
4753 #line 2028 "parser.y"
4754 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4763 /* Line 1464 of skeleton.m4 */
4764 #line 2030 "parser.y"
4765 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4774 /* Line 1464 of skeleton.m4 */
4775 #line 2031 "parser.y"
4776 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4785 /* Line 1464 of skeleton.m4 */
4786 #line 2034 "parser.y"
4789 if(variable_exists((yyvsp[(1) - (3)].id)))
4790 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4792 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4797 if(state->method->uses_slots) {
4798 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4800 // this variable is stored in a slot
4802 v->type = (yyvsp[(2) - (3)].classinfo);
4808 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4811 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4813 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
4814 if(!is_subtype_of(v.t, (yyvsp[(2) - (3)].classinfo))) {
4815 syntaxerror("Can't convert %s to %s", v.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4817 if((yyvsp[(2) - (3)].classinfo)) {
4818 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4819 (yyval.code) = code_append((yyval.code), v.c);
4820 (yyval.code) = converttype((yyval.code), v.t, (yyvsp[(2) - (3)].classinfo));
4823 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4826 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4827 (yyval.code) = code_append((yyval.code), v.c);
4828 (yyval.code) = abc_coerce_a((yyval.code));
4830 // don't do anything
4832 code_free((yyval.code));
4838 (yyval.code) = abc_setslot((yyval.code), index);
4840 (yyval.code) = abc_setlocal((yyval.code), index);
4851 /* Line 1464 of skeleton.m4 */
4852 #line 2093 "parser.y"
4853 {(yyval.code) = code_new();}
4862 /* Line 1464 of skeleton.m4 */
4863 #line 2094 "parser.y"
4864 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4873 /* Line 1464 of skeleton.m4 */
4874 #line 2097 "parser.y"
4875 {PASS12 new_state();}
4884 /* Line 1464 of skeleton.m4 */
4885 #line 2097 "parser.y"
4888 (yyval.code) = code_new();
4889 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4890 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4892 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4893 if((yyvsp[(7) - (7)].code)) {
4894 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4896 myif->branch = (yyval.code) = abc_nop((yyval.code));
4897 if((yyvsp[(7) - (7)].code)) {
4898 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4899 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4901 (yyval.code) = var_block((yyval.code));
4912 /* Line 1464 of skeleton.m4 */
4913 #line 2116 "parser.y"
4914 {(yyval.code)=code_new();}
4923 /* Line 1464 of skeleton.m4 */
4924 #line 2123 "parser.y"
4926 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4927 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4937 /* Line 1464 of skeleton.m4 */
4938 #line 2127 "parser.y"
4941 (yyval.id)=(yyvsp[(1) - (1)].id);
4951 /* Line 1464 of skeleton.m4 */
4952 #line 2132 "parser.y"
4953 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4962 /* Line 1464 of skeleton.m4 */
4963 #line 2133 "parser.y"
4964 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4973 /* Line 1464 of skeleton.m4 */
4974 #line 2135 "parser.y"
4976 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4977 (yyval.code) = code_new();
4978 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4979 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4980 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4981 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4982 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4983 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4984 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4985 (yyval.code) = abc_jump((yyval.code), loopstart);
4986 code_t*out = (yyval.code) = abc_nop((yyval.code));
4987 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4988 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4991 (yyval.code) = var_block((yyval.code));
5002 /* Line 1464 of skeleton.m4 */
5003 #line 2155 "parser.y"
5005 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
5007 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
5010 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
5011 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
5012 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
5013 int array = new_variable(tmp1name, 0, 0, 0);
5015 (yyval.code) = code_new();
5016 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5017 (yyval.code) = abc_coerce_a((yyval.code));
5018 (yyval.code) = abc_setlocal((yyval.code), array);
5019 (yyval.code) = abc_pushbyte((yyval.code), 0);
5020 (yyval.code) = abc_setlocal((yyval.code), it);
5022 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5024 (yyval.code) = abc_hasnext2((yyval.code), array, it);
5025 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
5026 (yyval.code) = abc_getlocal((yyval.code), array);
5027 (yyval.code) = abc_getlocal((yyval.code), it);
5028 if(!(yyvsp[(1) - (6)].for_start).each)
5029 (yyval.code) = abc_nextname((yyval.code));
5031 (yyval.code) = abc_nextvalue((yyval.code));
5032 (yyval.code) = converttype((yyval.code), 0, var->type);
5033 (yyval.code) = abc_setlocal((yyval.code), var->index);
5035 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5036 (yyval.code) = abc_jump((yyval.code), loopstart);
5038 code_t*out = (yyval.code) = abc_nop((yyval.code));
5039 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
5040 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
5044 (yyval.code) = var_block((yyval.code));
5059 /* Line 1464 of skeleton.m4 */
5060 #line 2203 "parser.y"
5061 {PASS12 new_state();}
5070 /* Line 1464 of skeleton.m4 */
5071 #line 2203 "parser.y"
5074 (yyval.code) = code_new();
5076 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
5077 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5078 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5079 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5080 myjmp->branch = cont;
5081 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5082 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5083 code_t*out = (yyval.code) = abc_nop((yyval.code));
5084 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5085 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5087 (yyval.code) = var_block((yyval.code));
5098 /* Line 1464 of skeleton.m4 */
5099 #line 2222 "parser.y"
5100 {PASS12 new_state();}
5109 /* Line 1464 of skeleton.m4 */
5110 #line 2222 "parser.y"
5112 (yyval.code) = code_new();
5113 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5114 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
5115 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5116 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
5117 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5118 code_t*out = (yyval.code) = abc_nop((yyval.code));
5119 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
5120 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
5122 (yyval.code) = var_block((yyval.code));
5133 /* Line 1464 of skeleton.m4 */
5134 #line 2237 "parser.y"
5136 (yyval.code) = abc___break__(0, "");
5146 /* Line 1464 of skeleton.m4 */
5147 #line 2240 "parser.y"
5149 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5159 /* Line 1464 of skeleton.m4 */
5160 #line 2243 "parser.y"
5162 (yyval.code) = abc___continue__(0, "");
5172 /* Line 1464 of skeleton.m4 */
5173 #line 2246 "parser.y"
5175 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5185 /* Line 1464 of skeleton.m4 */
5186 #line 2250 "parser.y"
5196 /* Line 1464 of skeleton.m4 */
5197 #line 2251 "parser.y"
5198 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5207 /* Line 1464 of skeleton.m4 */
5208 #line 2252 "parser.y"
5209 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5218 /* Line 1464 of skeleton.m4 */
5219 #line 2253 "parser.y"
5220 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5229 /* Line 1464 of skeleton.m4 */
5230 #line 2254 "parser.y"
5231 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5240 /* Line 1464 of skeleton.m4 */
5241 #line 2255 "parser.y"
5242 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5251 /* Line 1464 of skeleton.m4 */
5252 #line 2257 "parser.y"
5254 (yyval.code) = abc_getlocal(0, state->switch_var);
5255 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5256 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5257 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5258 if((yyval.code)->opcode != OPCODE___BREAK__) {
5259 (yyval.code) = abc___fallthrough__((yyval.code), "");
5261 code_t*e = (yyval.code) = abc_nop((yyval.code));
5272 /* Line 1464 of skeleton.m4 */
5273 #line 2268 "parser.y"
5275 (yyval.code) = (yyvsp[(3) - (3)].code);
5285 /* Line 1464 of skeleton.m4 */
5286 #line 2271 "parser.y"
5287 {PASS12 new_state();state->switch_var=alloc_local();}
5296 /* Line 1464 of skeleton.m4 */
5297 #line 2271 "parser.y"
5299 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5300 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5301 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5303 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5304 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5306 code_t*c = (yyval.code),*lastblock=0;
5308 if(c->opcode == OPCODE_IFNE) {
5309 if(!c->next) syntaxerror("internal error in fallthrough handling");
5311 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5313 c->opcode = OPCODE_JUMP;
5314 c->branch = lastblock;
5316 /* fall through end of switch */
5317 c->opcode = OPCODE_NOP;
5323 (yyval.code) = var_block((yyval.code));
5334 /* Line 1464 of skeleton.m4 */
5335 #line 2302 "parser.y"
5336 {PASS12 new_state();
5337 state->exception_name=(yyvsp[(3) - (5)].id);
5338 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5339 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5349 /* Line 1464 of skeleton.m4 */
5350 #line 2307 "parser.y"
5352 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5353 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5355 NEW(abc_exception_t, e)
5356 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5357 e->var_name = multiname_clone(&name);
5358 (yyval.exception) = e;
5361 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5362 e->target = c = abc_nop(0);
5363 c = abc_setlocal(c, i);
5364 c = code_append(c, code_dup(state->method->scope_code));
5365 c = code_append(c, (yyvsp[(8) - (9)].code));
5379 /* Line 1464 of skeleton.m4 */
5380 #line 2327 "parser.y"
5381 {PASS12 new_state();state->exception_name=0;}
5390 /* Line 1464 of skeleton.m4 */
5391 #line 2327 "parser.y"
5393 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5394 if(!(yyvsp[(4) - (5)].code)) {
5395 (yyval.exception)=0;
5397 NEW(abc_exception_t, e)
5398 e->exc_type = 0; //all exceptions
5399 e->var_name = 0; //no name
5402 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5403 (yyval.exception) = e;
5415 /* Line 1464 of skeleton.m4 */
5416 #line 2343 "parser.y"
5417 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5426 /* Line 1464 of skeleton.m4 */
5427 #line 2344 "parser.y"
5428 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5437 /* Line 1464 of skeleton.m4 */
5438 #line 2345 "parser.y"
5439 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5448 /* Line 1464 of skeleton.m4 */
5449 #line 2346 "parser.y"
5451 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5452 (yyval.catch_list).finally = 0;
5453 if((yyvsp[(2) - (2)].exception)) {
5454 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5455 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5466 /* Line 1464 of skeleton.m4 */
5467 #line 2354 "parser.y"
5469 (yyval.catch_list).l=list_new();
5470 (yyval.catch_list).finally = 0;
5471 if((yyvsp[(1) - (1)].exception)) {
5472 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5473 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5484 /* Line 1464 of skeleton.m4 */
5485 #line 2363 "parser.y"
5486 {PASS12 new_state();
5487 state->method->has_exceptions=1;
5488 state->method->late_binding=1;//for invariant scope_code
5498 /* Line 1464 of skeleton.m4 */
5499 #line 2366 "parser.y"
5501 code_t*out = abc_nop(0);
5503 code_t*start = abc_nop(0);
5504 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5505 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5506 (yyval.code) = abc_jump((yyval.code), out);
5508 code_t*end = (yyval.code) = abc_nop((yyval.code));
5511 if((yyvsp[(6) - (6)].catch_list).finally)
5512 tmp = new_variable("__finally__", 0, 0, 0);
5514 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5517 abc_exception_t*e = l->abc_exception;
5519 (yyval.code) = code_append((yyval.code), e->target);
5520 (yyval.code) = abc_jump((yyval.code), out);
5522 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5524 e->target = (yyval.code) = abc_nop((yyval.code));
5525 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5526 (yyval.code) = abc___rethrow__((yyval.code));
5534 (yyval.code) = code_append((yyval.code), out);
5536 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5538 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5540 (yyval.code) = var_block((yyval.code));
5551 /* Line 1464 of skeleton.m4 */
5552 #line 2412 "parser.y"
5554 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5555 (yyval.code)=abc_throw((yyval.code));
5565 /* Line 1464 of skeleton.m4 */
5566 #line 2416 "parser.y"
5568 if(!state->exception_name)
5569 syntaxerror("re-throw only possible within a catch block");
5570 variable_t*v = find_variable(state, state->exception_name);
5571 (yyval.code)=code_new();
5572 (yyval.code)=abc_getlocal((yyval.code), v->index);
5573 (yyval.code)=abc_throw((yyval.code));
5583 /* Line 1464 of skeleton.m4 */
5584 #line 2427 "parser.y"
5587 if(state->method->has_exceptions) {
5588 int v = alloc_local();
5589 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5590 state->method->scope_code = abc_pushwith(state->method->scope_code);
5591 (yyval.value_list).number = v;
5593 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5603 /* Line 1464 of skeleton.m4 */
5604 #line 2437 "parser.y"
5606 /* remove getlocal;pushwith from scope code again */
5607 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5609 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5610 if(state->method->has_exceptions) {
5611 (yyval.code) = abc_dup((yyval.code));
5612 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5614 (yyval.code) = abc_pushwith((yyval.code));
5615 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5616 (yyval.code) = abc_popscope((yyval.code));
5627 /* Line 1464 of skeleton.m4 */
5628 #line 2455 "parser.y"
5629 {PASS12 (yyval.id)="package";}
5638 /* Line 1464 of skeleton.m4 */
5639 #line 2456 "parser.y"
5640 {PASS12 (yyval.id)="namespace";}
5649 /* Line 1464 of skeleton.m4 */
5650 #line 2457 "parser.y"
5651 {PASS12 (yyval.id)="NaN";}
5660 /* Line 1464 of skeleton.m4 */
5661 #line 2458 "parser.y"
5662 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5671 /* Line 1464 of skeleton.m4 */
5672 #line 2460 "parser.y"
5673 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5682 /* Line 1464 of skeleton.m4 */
5683 #line 2461 "parser.y"
5684 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5693 /* Line 1464 of skeleton.m4 */
5694 #line 2463 "parser.y"
5695 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5704 /* Line 1464 of skeleton.m4 */
5705 #line 2464 "parser.y"
5706 {PASS12 endpackage();(yyval.code)=0;}
5715 /* Line 1464 of skeleton.m4 */
5716 #line 2465 "parser.y"
5717 {PASS12 startpackage("");}
5726 /* Line 1464 of skeleton.m4 */
5727 #line 2466 "parser.y"
5728 {PASS12 endpackage();(yyval.code)=0;}
5737 /* Line 1464 of skeleton.m4 */
5738 #line 2489 "parser.y"
5741 slotinfo_t*s = registry_find(state->package, (yyvsp[(2) - (2)].id));
5742 if(!s && as3_pass==1) {as3_schedule_class(state->package, (yyvsp[(2) - (2)].id));}
5743 state_has_imports();
5744 dict_put(state->imports, state->package, (yyvsp[(2) - (2)].id));
5755 /* Line 1464 of skeleton.m4 */
5756 #line 2497 "parser.y"
5759 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5760 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5761 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5763 state_has_imports();
5764 dict_put(state->imports, (yyvsp[(2) - (2)].classinfo)->name, (yyvsp[(2) - (2)].classinfo));
5765 import_toplevel((yyvsp[(2) - (2)].classinfo)->package);
5776 /* Line 1464 of skeleton.m4 */
5777 #line 2508 "parser.y"
5780 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5781 as3_schedule_package((yyvsp[(2) - (4)].id));
5785 i->package = (yyvsp[(2) - (4)].id);
5786 state_has_imports();
5787 list_append(state->wildcard_imports, i);
5788 import_toplevel(i->package);
5799 /* Line 1464 of skeleton.m4 */
5800 #line 2524 "parser.y"
5801 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5810 /* Line 1464 of skeleton.m4 */
5811 #line 2525 "parser.y"
5812 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5821 /* Line 1464 of skeleton.m4 */
5822 #line 2526 "parser.y"
5823 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5832 /* Line 1464 of skeleton.m4 */
5833 #line 2527 "parser.y"
5836 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5837 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5838 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5849 /* Line 1464 of skeleton.m4 */
5850 #line 2534 "parser.y"
5851 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5860 /* Line 1464 of skeleton.m4 */
5861 #line 2535 "parser.y"
5862 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5871 /* Line 1464 of skeleton.m4 */
5872 #line 2536 "parser.y"
5873 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5882 /* Line 1464 of skeleton.m4 */
5883 #line 2537 "parser.y"
5884 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5893 /* Line 1464 of skeleton.m4 */
5894 #line 2538 "parser.y"
5895 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5904 /* Line 1464 of skeleton.m4 */
5905 #line 2539 "parser.y"
5906 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5915 /* Line 1464 of skeleton.m4 */
5916 #line 2540 "parser.y"
5917 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5926 /* Line 1464 of skeleton.m4 */
5927 #line 2541 "parser.y"
5928 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5937 /* Line 1464 of skeleton.m4 */
5938 #line 2542 "parser.y"
5939 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5948 /* Line 1464 of skeleton.m4 */
5949 #line 2543 "parser.y"
5950 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5951 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5961 /* Line 1464 of skeleton.m4 */
5962 #line 2547 "parser.y"
5963 {PASS12 (yyval.classinfo)=0;}
5972 /* Line 1464 of skeleton.m4 */
5973 #line 2548 "parser.y"
5974 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5983 /* Line 1464 of skeleton.m4 */
5984 #line 2550 "parser.y"
5985 {PASS12 (yyval.classinfo_list)=list_new();}
5994 /* Line 1464 of skeleton.m4 */
5995 #line 2551 "parser.y"
5996 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
6005 /* Line 1464 of skeleton.m4 */
6006 #line 2553 "parser.y"
6007 {PASS12 (yyval.classinfo_list)=list_new();}
6016 /* Line 1464 of skeleton.m4 */
6017 #line 2554 "parser.y"
6018 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
6027 /* Line 1464 of skeleton.m4 */
6028 #line 2558 "parser.y"
6029 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
6038 /* Line 1464 of skeleton.m4 */
6039 #line 2560 "parser.y"
6040 {PASS12 endclass();(yyval.code)=0;}
6049 /* Line 1464 of skeleton.m4 */
6050 #line 2564 "parser.y"
6051 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
6052 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
6061 /* Line 1464 of skeleton.m4 */
6062 #line 2567 "parser.y"
6063 {PASS12 endclass();(yyval.code)=0;}
6072 /* Line 1464 of skeleton.m4 */
6073 #line 2576 "parser.y"
6074 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
6083 /* Line 1464 of skeleton.m4 */
6084 #line 2580 "parser.y"
6086 code_t*c = state->cls->static_init->header;
6087 c = code_append(c, (yyvsp[(1) - (1)].code));
6088 state->cls->static_init->header = c;
6098 /* Line 1464 of skeleton.m4 */
6099 #line 2591 "parser.y"
6101 syntaxerror("variable declarations not allowed in interfaces");
6111 /* Line 1464 of skeleton.m4 */
6112 #line 2594 "parser.y"
6115 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
6116 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
6117 syntaxerror("invalid method modifiers: interface methods always need to be public");
6119 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
6120 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
6121 list_deep_free((yyvsp[(6) - (8)].params).list);
6131 /* Line 1464 of skeleton.m4 */
6132 #line 2669 "parser.y"
6133 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
6142 /* Line 1464 of skeleton.m4 */
6143 #line 2669 "parser.y"
6144 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
6153 /* Line 1464 of skeleton.m4 */
6154 #line 2671 "parser.y"
6155 {PASS12 (yyval.code)=0;}
6164 /* Line 1464 of skeleton.m4 */
6165 #line 2672 "parser.y"
6166 {PASS12 (yyval.code)=0;}
6175 /* Line 1464 of skeleton.m4 */
6176 #line 2675 "parser.y"
6179 int flags = slotstate_flags->flags;
6180 namespace_t ns = modifiers2access(slotstate_flags);
6184 varinfo_t* info = 0;
6186 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6188 check_override(i, flags);
6190 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6192 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6194 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6196 if(ns.name && ns.name[0]) {
6197 syntaxerror("namespaces not allowed on package-level variables");
6199 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6202 info->type = (yyvsp[(2) - (3)].classinfo);
6203 info->flags = flags;
6205 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6209 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6213 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6215 if((yyvsp[(2) - (3)].classinfo)) {
6216 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6217 t->type_name = multiname_clone(&m);
6219 info->slot = t->slot_id;
6221 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6222 FIXME: is there a way to use slots and still don't have conflicting overrides?
6224 info->slot = t->slot_id = 0;
6226 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6227 if(cval.type!=CONSTANT_UNKNOWN) {
6228 /* compile time constant */
6229 t->value = malloc(sizeof(constant_t));
6230 memcpy(t->value, &cval, sizeof(constant_t));
6231 info->value = constant_clone(t->value);
6233 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6234 /* initalization code (if needed) */
6236 if(v.c && !is_pushundefined(v.c)) {
6237 c = abc_getlocal_0(c);
6238 c = code_append(c, v.c);
6239 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6241 c = abc_initproperty2(c, &mname);
6243 c = abc_setslot(c, t->slot_id);
6246 *code = code_append(*code, c);
6249 if(slotstate_varconst==KW_CONST) {
6250 t->kind= TRAIT_CONST;
6251 info->flags |= FLAG_CONST;
6265 /* Line 1464 of skeleton.m4 */
6266 #line 2758 "parser.y"
6267 {(yyval.constant)=0;}
6276 /* Line 1464 of skeleton.m4 */
6277 #line 2759 "parser.y"
6279 (yyval.constant) = malloc(sizeof(constant_t));
6280 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6281 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6282 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6293 /* Line 1464 of skeleton.m4 */
6294 #line 2768 "parser.y"
6295 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6304 /* Line 1464 of skeleton.m4 */
6305 #line 2769 "parser.y"
6307 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6317 /* Line 1464 of skeleton.m4 */
6318 #line 2772 "parser.y"
6319 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6328 /* Line 1464 of skeleton.m4 */
6329 #line 2773 "parser.y"
6330 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6339 /* Line 1464 of skeleton.m4 */
6340 #line 2774 "parser.y"
6341 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6350 /* Line 1464 of skeleton.m4 */
6351 #line 2775 "parser.y"
6352 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6361 /* Line 1464 of skeleton.m4 */
6362 #line 2776 "parser.y"
6363 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6372 /* Line 1464 of skeleton.m4 */
6373 #line 2777 "parser.y"
6374 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6383 /* Line 1464 of skeleton.m4 */
6384 #line 2778 "parser.y"
6385 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6394 /* Line 1464 of skeleton.m4 */
6395 #line 2793 "parser.y"
6396 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6405 /* Line 1464 of skeleton.m4 */
6406 #line 2794 "parser.y"
6407 {PASS_ALWAYS tokenizer_begin_xmltext();}
6416 /* Line 1464 of skeleton.m4 */
6417 #line 2795 "parser.y"
6418 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6427 /* Line 1464 of skeleton.m4 */
6428 #line 2797 "parser.y"
6429 {PASS_ALWAYS tokenizer_begin_xmltext();}
6438 /* Line 1464 of skeleton.m4 */
6439 #line 2797 "parser.y"
6441 (yyval.id)=strdup("{...}");
6442 as3_warning("xml string substitution not yet supported");
6452 /* Line 1464 of skeleton.m4 */
6453 #line 2801 "parser.y"
6454 {PASS_ALWAYS tokenizer_begin_xml();}
6463 /* Line 1464 of skeleton.m4 */
6464 #line 2801 "parser.y"
6466 (yyval.id)=strdup("{...}");
6467 as3_warning("xml string substitution not yet supported");
6477 /* Line 1464 of skeleton.m4 */
6478 #line 2805 "parser.y"
6488 /* Line 1464 of skeleton.m4 */
6489 #line 2806 "parser.y"
6491 (yyval.id) = concat2((yyvsp[(1) - (2)].id), "{...}");
6501 /* Line 1464 of skeleton.m4 */
6502 #line 2809 "parser.y"
6503 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), string_cstr(&(yyvsp[(2) - (2)].str)));}
6512 /* Line 1464 of skeleton.m4 */
6513 #line 2810 "parser.y"
6514 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), ">");}
6523 /* Line 1464 of skeleton.m4 */
6524 #line 2812 "parser.y"
6525 {(yyval.id)=concat2((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].id));}
6534 /* Line 1464 of skeleton.m4 */
6535 #line 2813 "parser.y"
6536 {(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));}
6545 /* Line 1464 of skeleton.m4 */
6546 #line 2815 "parser.y"
6547 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6556 /* Line 1464 of skeleton.m4 */
6557 #line 2816 "parser.y"
6558 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6567 /* Line 1464 of skeleton.m4 */
6568 #line 2818 "parser.y"
6570 (yyval.id) = allocprintf("<%s%s>%s</%s>", (yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].id), (yyvsp[(5) - (10)].id), (yyvsp[(8) - (10)].id));
6571 free((yyvsp[(2) - (10)].id));free((yyvsp[(3) - (10)].id));free((yyvsp[(5) - (10)].id));free((yyvsp[(8) - (10)].id));
6581 /* Line 1464 of skeleton.m4 */
6582 #line 2822 "parser.y"
6584 (yyval.id) = allocprintf("<%s%s/>", (yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].id));
6594 /* Line 1464 of skeleton.m4 */
6595 #line 2825 "parser.y"
6597 (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));
6598 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));
6608 /* Line 1464 of skeleton.m4 */
6609 #line 2830 "parser.y"
6610 {(yyval.id)=strdup("");}
6619 /* Line 1464 of skeleton.m4 */
6620 #line 2831 "parser.y"
6621 {(yyval.id)=concat2(" ",(yyvsp[(1) - (1)].id));}
6630 /* Line 1464 of skeleton.m4 */
6631 #line 2832 "parser.y"
6632 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6641 /* Line 1464 of skeleton.m4 */
6642 #line 2833 "parser.y"
6643 {(yyval.id)=concat3((yyvsp[(1) - (2)].id)," ",(yyvsp[(2) - (2)].id));free((yyvsp[(1) - (2)].id));free((yyvsp[(2) - (2)].id));}
6652 /* Line 1464 of skeleton.m4 */
6653 #line 2835 "parser.y"
6655 (yyval.id) = strdup("{...}");
6665 /* Line 1464 of skeleton.m4 */
6666 #line 2838 "parser.y"
6668 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6669 (yyval.id) = concat2("{...}=",str);
6679 /* Line 1464 of skeleton.m4 */
6680 #line 2842 "parser.y"
6682 (yyval.id) = strdup("{...}={...}");
6692 /* Line 1464 of skeleton.m4 */
6693 #line 2845 "parser.y"
6695 (yyval.id) = concat2((yyvsp[(1) - (3)].id),"={...}");
6705 /* Line 1464 of skeleton.m4 */
6706 #line 2848 "parser.y"
6708 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6709 (yyval.id)=allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str);
6711 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6721 /* Line 1464 of skeleton.m4 */
6722 #line 2858 "parser.y"
6725 memset(&(yyval.params),0,sizeof((yyval.params)));
6735 /* Line 1464 of skeleton.m4 */
6736 #line 2862 "parser.y"
6739 (yyval.params)=(yyvsp[(1) - (1)].params);
6749 /* Line 1464 of skeleton.m4 */
6750 #line 2868 "parser.y"
6753 memset(&(yyval.params),0,sizeof((yyval.params)));
6754 (yyval.params).varargs=1;
6755 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6765 /* Line 1464 of skeleton.m4 */
6766 #line 2874 "parser.y"
6769 (yyval.params) =(yyvsp[(1) - (4)].params);
6770 (yyval.params).varargs=1;
6771 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6781 /* Line 1464 of skeleton.m4 */
6782 #line 2882 "parser.y"
6785 (yyval.params) = (yyvsp[(1) - (3)].params);
6786 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6796 /* Line 1464 of skeleton.m4 */
6797 #line 2887 "parser.y"
6800 memset(&(yyval.params),0,sizeof((yyval.params)));
6801 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6811 /* Line 1464 of skeleton.m4 */
6812 #line 2893 "parser.y"
6815 (yyval.param) = rfx_calloc(sizeof(param_t));
6816 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6817 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6819 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6829 /* Line 1464 of skeleton.m4 */
6830 #line 2901 "parser.y"
6833 (yyval.param) = rfx_calloc(sizeof(param_t));
6834 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6835 (yyval.param)->type = TYPE_ANY;
6837 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6847 /* Line 1464 of skeleton.m4 */
6848 #line 2911 "parser.y"
6849 {PASS12 (yyval.token)=0;}
6858 /* Line 1464 of skeleton.m4 */
6859 #line 2914 "parser.y"
6860 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6869 /* Line 1464 of skeleton.m4 */
6870 #line 2915 "parser.y"
6873 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6875 if(!state->method->info) syntaxerror("internal error");
6877 code_t*c = method_header(state->method);
6878 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6880 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6882 list_deep_free((yyvsp[(6) - (12)].params).list);
6893 /* Line 1464 of skeleton.m4 */
6894 #line 2931 "parser.y"
6895 {PASS12 (yyval.id)=0;}
6904 /* Line 1464 of skeleton.m4 */
6905 #line 2933 "parser.y"
6906 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6915 /* Line 1464 of skeleton.m4 */
6916 #line 2934 "parser.y"
6919 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6921 methodinfo_t*f = state->method->info;
6922 if(!f || !f->kind) syntaxerror("internal error");
6924 code_t*c = method_header(state->method);
6925 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6927 int index = state->method->var_index;
6928 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6930 (yyval.value).c = abc_getlocal(0, index);
6931 (yyval.value).t = TYPE_FUNCTION(f);
6933 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6943 /* Line 1464 of skeleton.m4 */
6944 #line 2956 "parser.y"
6946 PASS1 NEW(unresolvedinfo_t,c);
6947 memset(c, 0, sizeof(*c));
6948 c->kind = INFOTYPE_UNRESOLVED;
6949 c->name = (yyvsp[(1) - (1)].id);
6950 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6952 c->nsset = get_current_imports();
6953 /* make the compiler look for this class in the current directory,
6955 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6957 (yyval.classinfo) = (classinfo_t*)c;
6959 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6960 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6961 (yyval.classinfo) = (classinfo_t*)s;
6971 /* Line 1464 of skeleton.m4 */
6972 #line 2975 "parser.y"
6974 PASS1 NEW(unresolvedinfo_t,c);
6975 memset(c, 0, sizeof(*c));
6976 c->kind = INFOTYPE_UNRESOLVED;
6977 c->package = (yyvsp[(1) - (3)].id);
6978 c->name = (yyvsp[(3) - (3)].id);
6979 (yyval.classinfo) = (classinfo_t*)c;
6981 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6982 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6983 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6984 (yyval.classinfo) = (classinfo_t*)s;
6994 /* Line 1464 of skeleton.m4 */
6995 #line 2992 "parser.y"
6996 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
7005 /* Line 1464 of skeleton.m4 */
7006 #line 2993 "parser.y"
7007 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
7016 /* Line 1464 of skeleton.m4 */
7017 #line 2995 "parser.y"
7018 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
7027 /* Line 1464 of skeleton.m4 */
7028 #line 2996 "parser.y"
7029 {PASS12 (yyval.classinfo)=TYPE_ANY;}
7038 /* Line 1464 of skeleton.m4 */
7039 #line 2997 "parser.y"
7040 {PASS12 (yyval.classinfo)=TYPE_VOID;}
7049 /* Line 1464 of skeleton.m4 */
7050 #line 3006 "parser.y"
7051 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
7060 /* Line 1464 of skeleton.m4 */
7061 #line 3007 "parser.y"
7062 {PASS12 (yyval.classinfo)=0;}
7071 /* Line 1464 of skeleton.m4 */
7072 #line 3011 "parser.y"
7073 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7082 /* Line 1464 of skeleton.m4 */
7083 #line 3012 "parser.y"
7084 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
7093 /* Line 1464 of skeleton.m4 */
7094 #line 3014 "parser.y"
7095 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7104 /* Line 1464 of skeleton.m4 */
7105 #line 3018 "parser.y"
7106 {(yyval.value_list).number=1;
7107 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
7117 /* Line 1464 of skeleton.m4 */
7118 #line 3022 "parser.y"
7119 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
7128 /* Line 1464 of skeleton.m4 */
7129 #line 3023 "parser.y"
7131 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
7132 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
7142 /* Line 1464 of skeleton.m4 */
7143 #line 3029 "parser.y"
7145 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
7146 (yyval.value).c = v.c;
7147 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
7149 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
7150 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7151 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7152 (yyval.value).c = code_cutlast((yyval.value).c);
7153 (yyval.value).c = code_append((yyval.value).c, paramcode);
7154 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
7155 multiname_destroy(name);
7156 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7157 code_free((yyval.value).c);
7158 classinfo_t*c = v.t->data;
7160 (yyval.value).c = abc_findpropstrict2(0, &m);
7161 (yyval.value).c = code_append((yyval.value).c, paramcode);
7162 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
7163 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
7164 int slot = (int)(ptroff_t)$$.c->data[0];
7165 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
7166 multiname_t*name = t->name;
7167 $$.c = code_cutlast($$.c);
7168 $$.c = code_append($$.c, paramcode);
7169 $$.c = abc_constructprop2($$.c, name, $4.number);*/
7171 (yyval.value).c = code_append((yyval.value).c, paramcode);
7172 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
7175 (yyval.value).t = TYPE_ANY;
7176 if(TYPE_IS_CLASS(v.t) && v.t->data) {
7177 (yyval.value).t = v.t->data;
7179 (yyval.value).c = abc_coerce_a((yyval.value).c);
7180 (yyval.value).t = TYPE_ANY;
7191 /* Line 1464 of skeleton.m4 */
7192 #line 3073 "parser.y"
7195 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
7196 (yyval.value).c = v.c;
7197 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7198 (yyval.value).c = code_cutlast((yyval.value).c);
7200 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
7202 (yyval.value).t = TYPE_ANY;
7203 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7204 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7205 (yyval.value).c = code_cutlast((yyval.value).c);
7206 (yyval.value).c = code_append((yyval.value).c, paramcode);
7207 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7208 multiname_destroy(name);
7209 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7210 int slot = (int)(ptroff_t)$$.c->data[0];
7211 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7212 if(t->kind!=TRAIT_METHOD) {
7213 //ok: flash allows to assign closures to members.
7215 multiname_t*name = t->name;
7216 $$.c = code_cutlast($$.c);
7217 $$.c = code_append($$.c, paramcode);
7218 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7219 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7220 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7221 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7222 (yyval.value).c = code_cutlast((yyval.value).c);
7223 (yyval.value).c = code_append((yyval.value).c, paramcode);
7224 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7225 multiname_destroy(name);
7227 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7228 (yyval.value).c = code_append((yyval.value).c, paramcode);
7229 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7232 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7233 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7234 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7235 // calling a class is like a typecast
7236 (yyval.value).t = (classinfo_t*)v.t->data;
7238 (yyval.value).t = TYPE_ANY;
7239 (yyval.value).c = abc_coerce_a((yyval.value).c);
7250 /* Line 1464 of skeleton.m4 */
7251 #line 3123 "parser.y"
7253 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7254 if(!state->method) syntaxerror("super() not allowed outside of a function");
7255 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7257 (yyval.value).c = code_new();
7258 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7260 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7262 this is dependent on the control path, check this somewhere else
7263 if(state->method->has_super)
7264 syntaxerror("constructor may call super() only once");
7266 state->method->has_super = 1;
7268 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7269 (yyval.value).c = abc_pushundefined((yyval.value).c);
7270 (yyval.value).t = TYPE_ANY;
7280 /* Line 1464 of skeleton.m4 */
7281 #line 3144 "parser.y"
7283 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7284 (yyval.value).c = v.c;
7285 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7286 (yyval.value).c = code_cutlast((yyval.value).c);
7288 multiname_t*name = 0;
7289 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7290 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7291 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7292 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7293 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7294 (yyval.value).c = code_cutlast((yyval.value).c);
7295 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7297 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7298 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7299 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7301 (yyval.value).t = TYPE_BOOLEAN;
7311 /* Line 1464 of skeleton.m4 */
7312 #line 3166 "parser.y"
7314 (yyval.code) = abc_returnvoid(0);
7324 /* Line 1464 of skeleton.m4 */
7325 #line 3169 "parser.y"
7327 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7328 (yyval.code) = abc_returnvalue((yyval.code));
7338 /* Line 1464 of skeleton.m4 */
7339 #line 3176 "parser.y"
7341 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7351 /* Line 1464 of skeleton.m4 */
7352 #line 3179 "parser.y"
7354 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7364 /* Line 1464 of skeleton.m4 */
7365 #line 3182 "parser.y"
7367 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7377 /* Line 1464 of skeleton.m4 */
7378 #line 3185 "parser.y"
7380 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7390 /* Line 1464 of skeleton.m4 */
7391 #line 3188 "parser.y"
7393 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7403 /* Line 1464 of skeleton.m4 */
7404 #line 3191 "parser.y"
7406 (yyval.code) = (yyvsp[(1) - (3)].code);
7407 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7417 /* Line 1464 of skeleton.m4 */
7418 #line 3196 "parser.y"
7419 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7428 /* Line 1464 of skeleton.m4 */
7429 #line 3197 "parser.y"
7430 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7439 /* Line 1464 of skeleton.m4 */
7440 #line 3199 "parser.y"
7441 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7450 /* Line 1464 of skeleton.m4 */
7451 #line 3200 "parser.y"
7452 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7461 /* Line 1464 of skeleton.m4 */
7462 #line 3201 "parser.y"
7463 {syntaxerror("dictionary keys must be strings");}
7472 /* Line 1464 of skeleton.m4 */
7473 #line 3202 "parser.y"
7474 {syntaxerror("dictionary keys must be strings");}
7483 /* Line 1464 of skeleton.m4 */
7484 #line 3203 "parser.y"
7485 {syntaxerror("dictionary keys must be strings");}
7494 /* Line 1464 of skeleton.m4 */
7495 #line 3205 "parser.y"
7497 (yyval.value_list).cc = 0;
7498 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7499 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7500 (yyval.value_list).number = 2;
7510 /* Line 1464 of skeleton.m4 */
7511 #line 3211 "parser.y"
7513 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7514 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7515 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7516 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7526 /* Line 1464 of skeleton.m4 */
7527 #line 3220 "parser.y"
7528 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7537 /* Line 1464 of skeleton.m4 */
7538 #line 3221 "parser.y"
7539 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7548 /* Line 1464 of skeleton.m4 */
7549 #line 3222 "parser.y"
7550 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7559 /* Line 1464 of skeleton.m4 */
7560 #line 3223 "parser.y"
7561 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7570 /* Line 1464 of skeleton.m4 */
7571 #line 3224 "parser.y"
7572 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7581 /* Line 1464 of skeleton.m4 */
7582 #line 3225 "parser.y"
7583 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7592 /* Line 1464 of skeleton.m4 */
7593 #line 3227 "parser.y"
7595 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7605 /* Line 1464 of skeleton.m4 */
7606 #line 3231 "parser.y"
7610 multiname_t m = {QNAME, &stdns, 0, "XML"};
7611 v.c = abc_getlex2(v.c, &m);
7612 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].id));
7613 v.c = abc_construct(v.c, 1);
7615 (yyval.node) = mkcodenode(v);
7625 /* Line 1464 of skeleton.m4 */
7626 #line 3243 "parser.y"
7630 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7631 if(!(yyvsp[(1) - (1)].regexp).options) {
7632 v.c = abc_getlex2(v.c, &m);
7633 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7634 v.c = abc_construct(v.c, 1);
7636 v.c = abc_getlex2(v.c, &m);
7637 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7638 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7639 v.c = abc_construct(v.c, 2);
7642 (yyval.node) = mkcodenode(v);
7652 /* Line 1464 of skeleton.m4 */
7653 #line 3261 "parser.y"
7656 state->method->need_arguments = 1;
7659 v.c = abc_getlocal(0, state->method->need_arguments);
7661 (yyval.node) = mkcodenode(v);
7671 /* Line 1464 of skeleton.m4 */
7672 #line 3272 "parser.y"
7676 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7677 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7678 v.t = registry_getarrayclass();
7679 (yyval.node) = mkcodenode(v);
7689 /* Line 1464 of skeleton.m4 */
7690 #line 3282 "parser.y"
7694 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7695 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7696 v.t = registry_getobjectclass();
7697 (yyval.node) = mkcodenode(v);
7707 /* Line 1464 of skeleton.m4 */
7708 #line 3291 "parser.y"
7709 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7718 /* Line 1464 of skeleton.m4 */
7719 #line 3292 "parser.y"
7720 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7729 /* Line 1464 of skeleton.m4 */
7730 #line 3293 "parser.y"
7731 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7740 /* Line 1464 of skeleton.m4 */
7741 #line 3294 "parser.y"
7742 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7751 /* Line 1464 of skeleton.m4 */
7752 #line 3295 "parser.y"
7753 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7762 /* Line 1464 of skeleton.m4 */
7763 #line 3296 "parser.y"
7764 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7773 /* Line 1464 of skeleton.m4 */
7774 #line 3297 "parser.y"
7775 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7784 /* Line 1464 of skeleton.m4 */
7785 #line 3298 "parser.y"
7786 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7795 /* Line 1464 of skeleton.m4 */
7796 #line 3299 "parser.y"
7797 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7806 /* Line 1464 of skeleton.m4 */
7807 #line 3300 "parser.y"
7808 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7817 /* Line 1464 of skeleton.m4 */
7818 #line 3301 "parser.y"
7819 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7828 /* Line 1464 of skeleton.m4 */
7829 #line 3302 "parser.y"
7830 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7839 /* Line 1464 of skeleton.m4 */
7840 #line 3303 "parser.y"
7841 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7850 /* Line 1464 of skeleton.m4 */
7851 #line 3304 "parser.y"
7852 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7861 /* Line 1464 of skeleton.m4 */
7862 #line 3305 "parser.y"
7863 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7872 /* Line 1464 of skeleton.m4 */
7873 #line 3306 "parser.y"
7874 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7883 /* Line 1464 of skeleton.m4 */
7884 #line 3307 "parser.y"
7885 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7894 /* Line 1464 of skeleton.m4 */
7895 #line 3308 "parser.y"
7896 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7905 /* Line 1464 of skeleton.m4 */
7906 #line 3309 "parser.y"
7907 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7916 /* Line 1464 of skeleton.m4 */
7917 #line 3310 "parser.y"
7918 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7927 /* Line 1464 of skeleton.m4 */
7928 #line 3311 "parser.y"
7929 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7938 /* Line 1464 of skeleton.m4 */
7939 #line 3312 "parser.y"
7940 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7949 /* Line 1464 of skeleton.m4 */
7950 #line 3313 "parser.y"
7951 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7960 /* Line 1464 of skeleton.m4 */
7961 #line 3314 "parser.y"
7962 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7971 /* Line 1464 of skeleton.m4 */
7972 #line 3315 "parser.y"
7973 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7982 /* Line 1464 of skeleton.m4 */
7983 #line 3316 "parser.y"
7984 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7993 /* Line 1464 of skeleton.m4 */
7994 #line 3317 "parser.y"
7995 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8004 /* Line 1464 of skeleton.m4 */
8005 #line 3318 "parser.y"
8006 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(2) - (2)].node));}
8015 /* Line 1464 of skeleton.m4 */
8016 #line 3319 "parser.y"
8017 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
8026 /* Line 1464 of skeleton.m4 */
8027 #line 3320 "parser.y"
8028 { (yyval.node) = mkconstnode(constant_new_undefined());}
8037 /* Line 1464 of skeleton.m4 */
8038 #line 3321 "parser.y"
8039 { (yyval.node)=(yyvsp[(2) - (3)].node);}
8048 /* Line 1464 of skeleton.m4 */
8049 #line 3322 "parser.y"
8050 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
8059 /* Line 1464 of skeleton.m4 */
8060 #line 3323 "parser.y"
8061 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
8070 /* Line 1464 of skeleton.m4 */
8071 #line 3324 "parser.y"
8072 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8081 /* Line 1464 of skeleton.m4 */
8082 #line 3325 "parser.y"
8083 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8092 /* Line 1464 of skeleton.m4 */
8093 #line 3326 "parser.y"
8094 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8103 /* Line 1464 of skeleton.m4 */
8104 #line 3327 "parser.y"
8105 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8114 /* Line 1464 of skeleton.m4 */
8115 #line 3328 "parser.y"
8116 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8125 /* Line 1464 of skeleton.m4 */
8126 #line 3329 "parser.y"
8127 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8136 /* Line 1464 of skeleton.m4 */
8137 #line 3330 "parser.y"
8138 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8147 /* Line 1464 of skeleton.m4 */
8148 #line 3331 "parser.y"
8149 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8158 /* Line 1464 of skeleton.m4 */
8159 #line 3332 "parser.y"
8160 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8169 /* Line 1464 of skeleton.m4 */
8170 #line 3333 "parser.y"
8171 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8180 /* Line 1464 of skeleton.m4 */
8181 #line 3334 "parser.y"
8182 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8191 /* Line 1464 of skeleton.m4 */
8192 #line 3335 "parser.y"
8193 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8202 /* Line 1464 of skeleton.m4 */
8203 #line 3336 "parser.y"
8204 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
8213 /* Line 1464 of skeleton.m4 */
8214 #line 3338 "parser.y"
8215 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
8224 /* Line 1464 of skeleton.m4 */
8225 #line 3339 "parser.y"
8226 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
8235 /* Line 1464 of skeleton.m4 */
8236 #line 3340 "parser.y"
8237 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
8246 /* Line 1464 of skeleton.m4 */
8247 #line 3341 "parser.y"
8248 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
8257 /* Line 1464 of skeleton.m4 */
8258 #line 3344 "parser.y"
8259 { if(!state->cls->info)
8260 syntaxerror("super keyword not allowed outside a class");
8261 classinfo_t*t = state->cls->info->superclass;
8262 if(!t) t = TYPE_OBJECT;
8263 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8264 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8267 v.c = abc_getlocal_0(v.c);
8268 v.c = abc_getsuper2(v.c, &m);
8269 v.t = slotinfo_gettype((slotinfo_t*)f);
8270 (yyval.node) = mkcodenode(v);
8280 /* Line 1464 of skeleton.m4 */
8281 #line 3358 "parser.y"
8284 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
8285 v.c = abc_getlex2(0, &m);
8287 (yyval.node) = mkcodenode(v);
8297 /* Line 1464 of skeleton.m4 */
8298 #line 3366 "parser.y"
8299 {PASS12 new_state();state->xmlfilter=1;}
8308 /* Line 1464 of skeleton.m4 */
8309 #line 3366 "parser.y"
8313 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8314 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8316 int index = alloc_local();
8317 int result = alloc_local();
8318 int tmp = alloc_local();
8319 int xml = alloc_local();
8321 c = code_append(c, v.c);
8322 c = abc_checkfilter(c);
8323 c = abc_coerce_a(c); //hasnext2 converts to *
8324 c = abc_setlocal(c, xml);
8325 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8326 c = abc_getlex2(c, &m);
8327 c = abc_construct(c, 0);
8328 c = abc_setlocal(c, result);
8329 c = abc_pushbyte(c, 0);
8330 c = abc_setlocal(c, index);
8331 code_t*jmp = c = abc_jump(c, 0);
8332 code_t*loop = c = abc_label(c);
8333 c = abc_getlocal(c, xml);
8334 c = abc_getlocal(c, index);
8335 c = abc_nextvalue(c);
8337 c = abc_setlocal(c, tmp);
8338 c = abc_pushwith(c);
8339 c = code_append(c, w.c);
8340 c = abc_popscope(c);
8341 code_t*b = c = abc_iffalse(c, 0);
8342 c = abc_getlocal(c, result);
8343 c = abc_getlocal(c, index);
8344 c = abc_getlocal(c, tmp);
8345 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8346 c = abc_setproperty2(c, &m2);
8347 c = b->branch = jmp->branch = abc_nop(c);
8348 c = abc_kill(c, tmp);
8349 c = abc_hasnext2(c, xml, index);
8350 c = abc_iftrue(c, loop);
8351 c = abc_getlocal(c, result);
8352 c = abc_kill(c, xml);
8353 c = abc_kill(c, result);
8354 c = abc_kill(c, index);
8361 (yyval.node) = mkcodenode(r);
8371 /* Line 1464 of skeleton.m4 */
8372 #line 3420 "parser.y"
8373 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8382 /* Line 1464 of skeleton.m4 */
8383 #line 3421 "parser.y"
8393 /* Line 1464 of skeleton.m4 */
8394 #line 3422 "parser.y"
8395 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8404 /* Line 1464 of skeleton.m4 */
8405 #line 3424 "parser.y"
8415 /* Line 1464 of skeleton.m4 */
8416 #line 3432 "parser.y"
8418 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8419 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8420 v.c = code_append(v.c, w.c);
8421 if(!TYPE_IS_NAMESPACE(w.t)) {
8422 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8424 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8425 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8426 v.c = abc_getproperty2(v.c, &m);
8427 if(TYPE_IS_XML(v.t)) {
8430 v.c = abc_coerce_a(v.c);
8433 (yyval.node) = mkcodenode(v);
8443 /* Line 1464 of skeleton.m4 */
8444 #line 3450 "parser.y"
8446 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8447 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8448 v.c = abc_getdescendants2(v.c, &m);
8450 (yyval.node) = mkcodenode(v);
8460 /* Line 1464 of skeleton.m4 */
8461 #line 3457 "parser.y"
8463 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8464 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8465 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8466 v.c = code_append(v.c, w.c);
8467 v.c = converttype(w.c, w.t, TYPE_STRING);
8468 v.c = abc_getproperty2(v.c, &m);
8470 (yyval.node) = mkcodenode(v);
8480 /* Line 1464 of skeleton.m4 */
8481 #line 3468 "parser.y"
8483 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8484 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8485 v.c = abc_getproperty2(v.c, &m);
8487 (yyval.node) = mkcodenode(v);
8497 /* Line 1464 of skeleton.m4 */
8498 #line 3475 "parser.y"
8500 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8501 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8502 v.c = abc_getdescendants2(v.c, &m);
8504 (yyval.node) = mkcodenode(v);
8514 /* Line 1464 of skeleton.m4 */
8515 #line 3482 "parser.y"
8517 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8518 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8519 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8520 v.c = code_append(v.c, w.c);
8521 v.c = converttype(w.c, w.t, TYPE_STRING);
8522 v.c = abc_getproperty2(v.c, &m);
8524 (yyval.node) = mkcodenode(v);
8534 /* Line 1464 of skeleton.m4 */
8535 #line 3492 "parser.y"
8537 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8538 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8539 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8540 v.c = code_append(v.c, w.c);
8541 v.c = converttype(w.c, w.t, TYPE_STRING);
8542 v.c = abc_getdescendants2(v.c, &m);
8544 (yyval.node) = mkcodenode(v);
8554 /* Line 1464 of skeleton.m4 */
8555 #line 3503 "parser.y"
8557 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8558 (yyval.value).c = v1.c;
8559 classinfo_t*t = v1.t;
8561 if(TYPE_IS_CLASS(t) && t->data) {
8565 if(TYPE_IS_XML(t)) {
8566 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8567 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8568 (yyval.value).c = abc_coerce_a((yyval.value).c);
8569 (yyval.value).t = TYPE_XMLLIST;
8571 if(t->subtype==INFOTYPE_UNRESOLVED) {
8572 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8574 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8576 if(f && !is_static != !(f->flags&FLAG_STATIC))
8578 if(f && f->slot && !noslot) {
8579 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8582 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8584 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8585 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8587 /* determine type */
8588 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8589 if(!(yyval.value).t)
8590 (yyval.value).c = abc_coerce_a((yyval.value).c);
8592 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8593 string_t*package = v1.c->data[0];
8594 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8596 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8598 (yyval.value) = push_class(a);
8599 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8600 registry_ispackage(package2)) {
8601 (yyval.value).c = v1.c;
8602 (yyval.value).c->data[0] = string_new4(package2);
8603 (yyval.value).t = 0;
8605 syntaxerror("couldn't resolve %s", package2);
8608 /* when resolving a property on an unknown type, we do know the
8609 name of the property (and don't seem to need the package), but
8610 we need to make avm2 try out all access modes */
8611 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8612 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8613 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8614 (yyval.value).c = abc_coerce_a((yyval.value).c);
8615 (yyval.value).t = TYPE_ANY;
8626 /* Line 1464 of skeleton.m4 */
8627 #line 3681 "parser.y"
8630 /* Queue unresolved identifiers for checking against the parent
8631 function's variables.
8632 We consider everything which is not a local variable "unresolved".
8633 This encompasses class names, members of the surrounding class
8634 etc. which is *correct* because local variables of the parent function
8638 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8639 if(state->method->inner) {
8640 unknown_variable((yyvsp[(1) - (1)].id));
8642 /* let the compiler know that it might want to check the current directory/package
8643 for this identifier- maybe there's a file $1.as defining $1. */
8644 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8650 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8660 /* Line 1464 of skeleton.m4 */
8661 #line 3717 "parser.y"
8664 NEW(namespace_decl_t,n);
8665 n->name = (yyvsp[(2) - (2)].id);
8666 n->url = (yyvsp[(2) - (2)].id);
8667 (yyval.namespace_decl)=n;
8677 /* Line 1464 of skeleton.m4 */
8678 #line 3724 "parser.y"
8681 NEW(namespace_decl_t,n);
8682 n->name = (yyvsp[(2) - (4)].id);
8683 n->url = (yyvsp[(4) - (4)].id);
8684 (yyval.namespace_decl)=n;
8694 /* Line 1464 of skeleton.m4 */
8695 #line 3731 "parser.y"
8698 NEW(namespace_decl_t,n);
8699 n->name = (yyvsp[(2) - (4)].id);
8700 n->url = (yyvsp[(4) - (4)].str).str;
8701 (yyval.namespace_decl)=n;
8711 /* Line 1464 of skeleton.m4 */
8712 #line 3738 "parser.y"
8715 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8717 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8718 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8719 var->type = TYPE_NAMESPACE;
8721 ns.access = ACCESS_NAMESPACE;
8722 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8723 var->value = constant_new_namespace(&ns);
8726 MULTINAME(m, TYPE_NAMESPACE);
8727 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8728 t->value = var->value;
8729 t->type_name = multiname_clone(&m);
8742 /* Line 1464 of skeleton.m4 */
8743 #line 3761 "parser.y"
8745 as3_warning("default xml namespaces not supported yet");
8756 /* Line 1464 of skeleton.m4 */
8757 #line 3766 "parser.y"
8760 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8762 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8763 if(s->kind == INFOTYPE_UNRESOLVED) {
8764 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8766 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8769 if(!s || s->kind != INFOTYPE_VAR)
8770 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8771 if(!s->value || !NS_TYPE(s->value->type))
8772 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8773 url = s->value->ns->name;
8775 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8776 add_active_url(url);
8785 /* Line 1464 of skeleton.m4 */
8786 #line 8787 "parser.tab.c"
8789 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8793 YY_STACK_PRINT (yyss, yyssp);
8797 /* Now `shift' the result of the reduction. Determine what state
8798 that goes to, based on the state we popped back to and the rule
8799 number reduced by. */
8803 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8804 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8805 yystate = yytable[yystate];
8807 yystate = yydefgoto[yyn - YYNTOKENS];
8812 /*------------------------------------.
8813 | yyerrlab -- here on detecting error |
8814 `------------------------------------*/
8816 /* If not already recovering from an error, report this error. */
8820 #if ! YYERROR_VERBOSE
8821 yyerror (YY_("syntax error"));
8824 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8825 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8827 YYSIZE_T yyalloc = 2 * yysize;
8828 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8829 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8830 if (yymsg != yymsgbuf)
8831 YYSTACK_FREE (yymsg);
8832 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8834 yymsg_alloc = yyalloc;
8838 yymsg_alloc = sizeof yymsgbuf;
8842 if (0 < yysize && yysize <= yymsg_alloc)
8844 (void) yysyntax_error (yymsg, yystate, yychar);
8849 yyerror (YY_("syntax error"));
8851 goto yyexhaustedlab;
8859 if (yyerrstatus == 3)
8861 /* If just tried and failed to reuse lookahead token after an
8862 error, discard it. */
8864 if (yychar <= YYEOF)
8866 /* Return failure if at end of input. */
8867 if (yychar == YYEOF)
8872 yydestruct ("Error: discarding",
8878 /* Else will try to reuse lookahead token after shifting the error
8883 /*---------------------------------------------------.
8884 | yyerrorlab -- error raised explicitly by YYERROR. |
8885 `---------------------------------------------------*/
8888 /* Pacify compilers like GCC when the user code never invokes
8889 YYERROR and the label yyerrorlab therefore never appears in user
8891 if (/*CONSTCOND*/ 0)
8894 /* Do not reclaim the symbols of the rule which action triggered
8898 YY_STACK_PRINT (yyss, yyssp);
8903 /*-------------------------------------------------------------.
8904 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8905 `-------------------------------------------------------------*/
8907 yyerrstatus = 3; /* Each real token shifted decrements this. */
8911 yyn = yypact[yystate];
8912 if (yyn != YYPACT_NINF)
8915 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8923 /* Pop the current state because it cannot handle the error token. */
8928 yydestruct ("Error: popping",
8929 yystos[yystate], yyvsp);
8932 YY_STACK_PRINT (yyss, yyssp);
8938 /* Shift the error token. */
8939 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8945 /*-------------------------------------.
8946 | yyacceptlab -- YYACCEPT comes here. |
8947 `-------------------------------------*/
8952 /*-----------------------------------.
8953 | yyabortlab -- YYABORT comes here. |
8954 `-----------------------------------*/
8959 #if !defined(yyoverflow) || YYERROR_VERBOSE
8960 /*-------------------------------------------------.
8961 | yyexhaustedlab -- memory exhaustion comes here. |
8962 `-------------------------------------------------*/
8964 yyerror (YY_("memory exhausted"));
8970 if (yychar != YYEMPTY)
8971 yydestruct ("Cleanup: discarding lookahead",
8973 /* Do not reclaim the symbols of the rule which action triggered
8974 this YYABORT or YYACCEPT. */
8976 YY_STACK_PRINT (yyss, yyssp);
8977 while (yyssp != yyss)
8979 yydestruct ("Cleanup: popping",
8980 yystos[*yyssp], yyvsp);
8985 YYSTACK_FREE (yyss);
8988 if (yymsg != yymsgbuf)
8989 YYSTACK_FREE (yymsg);
8991 /* Make sure YYID is used. */
8992 return YYID (yyresult);