2 /* A Bison parser, made by GNU Bison 2.4. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4"
52 #define YYSKELETON_NAME "./skeleton.m4"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse a3_parse
69 #define yyerror a3_error
70 #define yylval a3_lval
71 #define yychar a3_char
72 #define yydebug a3_debug
73 #define yynerrs a3_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 198 of skeleton.m4 */
88 #include "tokenizer.h"
100 /* Line 198 of skeleton.m4 */
101 #line 102 "parser.tab.c"
103 /* Enabling traces. */
108 /* Enabling verbose error messages. */
109 #ifdef YYERROR_VERBOSE
110 # undef YYERROR_VERBOSE
111 # define YYERROR_VERBOSE 1
113 # define YYERROR_VERBOSE 1
116 /* Enabling the token table. */
117 #ifndef YYTOKEN_TABLE
118 # define YYTOKEN_TABLE 0
125 /* Put the tokens into the symbol table, so that GDB and other debuggers
188 KW_DEFAULT_XML = 318,
225 below_semicolon = 355,
226 below_assignment = 356,
229 minusminus_prefix = 359,
230 plusplus_prefix = 360,
233 above_identifier = 363,
241 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
243 /* Line 223 of skeleton.m4 */
248 /* Line 223 of skeleton.m4 */
251 enum yytokentype token;
253 classinfo_t*classinfo;
254 classinfo_list_t*classinfo_list;
256 slotinfo_list_t*slotinfo_list;
259 unsigned int number_uint;
263 //typedcode_list_t*value_list;
264 codeandnumber_t value_list;
270 for_start_t for_start;
271 abc_exception_t *exception;
274 namespace_decl_t* namespace_decl;
277 abc_exception_list_t *l;
283 /* Line 223 of skeleton.m4 */
284 #line 285 "parser.tab.c"
286 # define YYSTYPE_IS_TRIVIAL 1
287 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
288 # define YYSTYPE_IS_DECLARED 1
292 /* Copy the second part of user declarations. */
294 /* Line 273 of skeleton.m4 */
298 static int a3_error(char*s)
300 syntaxerror("%s", s);
301 return 0; //make gcc happy
304 static void parsererror(const char*file, int line, const char*f)
306 syntaxerror("internal error in %s, %s:%d", f, file, line);
309 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
312 static char* concat2(const char* t1, const char* t2)
316 char*text = malloc(l1+l2+1);
317 memcpy(text , t1, l1);
318 memcpy(text+l1, t2, l2);
322 static char* concat3(const char* t1, const char* t2, const char* t3)
327 char*text = malloc(l1+l2+l3+1);
328 memcpy(text , t1, l1);
329 memcpy(text+l1, t2, l2);
330 memcpy(text+l1+l2, t3, l3);
335 typedef struct _import {
338 DECLARE_LIST(import);
340 DECLARE(methodstate);
341 DECLARE_LIST(methodstate);
343 typedef struct _classstate {
349 methodstate_t*static_init;
351 //code_t*static_init;
352 parsedclass_t*dependencies;
354 char has_constructor;
357 struct _methodstate {
368 dict_t*unresolved_variables;
371 char uses_parent_function;
379 int var_index; // for inner methods
380 int slot_index; // for inner methods
381 char is_a_slot; // for inner methods
386 abc_exception_list_t*exceptions;
388 methodstate_list_t*innerfunctions;
391 typedef struct _state {
396 import_list_t*wildcard_imports;
397 dict_t*import_toplevel_packages;
400 namespace_list_t*active_namespace_urls;
402 char has_own_imports;
403 char new_vars; // e.g. transition between two functions
404 char xmlfilter; // are we inside a xmlobj..() filter?
407 methodstate_t*method;
414 dict_t*allvars; // also contains variables from sublevels
417 typedef struct _global {
420 parsedclass_list_t*classes;
421 abc_script_t*classinit;
423 abc_script_t*init; //package-level code
426 dict_t*file2token2info;
429 static global_t*global = 0;
430 static state_t* state = 0;
434 /* protected handling here is a big hack: we just assume the protectedns
435 is package:class. the correct approach would be to add the proper
436 namespace to all protected members in the registry, even though that
437 would slow down searching */
438 #define MEMBER_MULTINAME(m,f,n) \
442 m##_ns.access = ((slotinfo_t*)(f))->access; \
443 if(m##_ns.access == ACCESS_NAMESPACE) \
444 m##_ns.name = ((slotinfo_t*)(f))->package; \
445 else if(m##_ns.access == ACCESS_PROTECTED && (f)->parent) \
446 m##_ns.name = concat3((f)->parent->package,":",(f)->parent->name); \
451 m.namespace_set = 0; \
452 m.name = ((slotinfo_t*)(f))->name; \
454 m.type = MULTINAME; \
456 m.namespace_set = &nopackage_namespace_set; \
460 /* warning: list length of namespace set is undefined */
461 #define MULTINAME_LATE(m, access, package) \
462 namespace_t m##_ns = {access, package}; \
463 namespace_set_t m##_nsset; \
464 namespace_list_t m##_l;m##_l.next = 0; \
465 m##_nsset.namespaces = &m##_l; \
466 m##_nsset = m##_nsset; \
467 m##_l.namespace = &m##_ns; \
468 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
470 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
471 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
472 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
473 static namespace_t stdns = {ACCESS_PACKAGE, ""};
474 static namespace_list_t nl4 = {&stdns,0};
475 static namespace_list_t nl3 = {&ns3,&nl4};
476 static namespace_list_t nl2 = {&ns2,&nl3};
477 static namespace_list_t nl1 = {&ns1,&nl2};
478 static namespace_set_t nopackage_namespace_set = {&nl1};
480 static dict_t*definitions=0;
481 void as3_set_define(const char*c)
484 definitions = dict_new();
485 if(!dict_contains(definitions,c))
486 dict_put(definitions,c,0);
489 static void new_state()
492 state_t*oldstate = state;
494 memcpy(s, state, sizeof(state_t)); //shallow copy
496 s->imports = dict_new();
498 if(!s->import_toplevel_packages) {
499 s->import_toplevel_packages = dict_new();
503 state->has_own_imports = 0;
504 state->vars = dict_new();
505 state->old = oldstate;
508 trie_remember(active_namespaces);
511 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
514 static void state_destroy(state_t*state)
516 if(state->has_own_imports) {
517 list_free(state->wildcard_imports);
518 dict_destroy(state->imports);state->imports=0;
520 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
521 dict_destroy(state->imports);state->imports=0;
524 dict_destroy(state->vars);state->vars=0;
526 if(state->new_vars && state->allvars) {
527 parserassert(!state->old || state->old->allvars != state->allvars);
528 DICT_ITERATE_DATA(state->allvars, void*, data) {
531 dict_destroy(state->allvars);
534 list_free(state->active_namespace_urls)
535 state->active_namespace_urls = 0;
540 static void old_state()
542 trie_rollback(active_namespaces);
544 if(!state || !state->old)
545 syntaxerror("invalid nesting");
546 state_t*leaving = state;
550 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
551 free(leaving->method);
554 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
559 state_destroy(leaving);
562 static code_t* method_header(methodstate_t*m);
563 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
564 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0);
567 static char* internal_filename_package = 0;
568 void initialize_file(char*filename)
571 syntaxerror("invalid call to initialize_file during parsing of another file");
574 active_namespaces = trie_new();
577 state->package = internal_filename_package = strdup(filename);
578 state->allvars = dict_new();
580 global->token2info = dict_lookup(global->file2token2info,
581 current_filename // use long version
583 if(!global->token2info) {
584 global->token2info = dict_new2(&ptr_type);
585 dict_put(global->file2token2info, current_filename, global->token2info);
589 state->method = rfx_calloc(sizeof(methodstate_t));
590 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
591 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
593 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
595 syntaxerror("internal error: skewed tokencount");
596 function_initvars(state->method, 0, 0, 0, 1);
603 if(!state || state->level!=1) {
604 syntaxerror("unexpected end of file in pass %d", as3_pass);
608 dict_del(global->file2token2info, current_filename);
609 code_t*header = method_header(state->method);
610 //if(global->init->method->body->code || global->init->traits) {
612 code_t*c = wrap_function(header, 0, global->init->method->body->code);
613 global->init->method->body->code = abc_returnvoid(c);
614 free(state->method);state->method=0;
618 //free(state->package);state->package=0; // used in registry
619 state_destroy(state);state=0;
622 void initialize_parser()
624 global = rfx_calloc(sizeof(global_t));
625 global->file = abc_file_new();
626 global->file->flags &= ~ABCFILE_LAZY;
627 global->file2token2info = dict_new();
628 global->token2info = 0;
629 global->classinit = abc_initscript(global->file);
632 void* finish_parser()
634 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
635 global->token2info=0;
637 initcode_add_classlist(global->classinit, global->classes);
642 typedef struct _variable {
647 methodstate_t*is_inner_method;
650 static variable_t* find_variable(state_t*s, char*name)
655 v = dict_lookup(s->vars, name);
657 if(s->new_vars) break;
660 return dict_lookup(top->allvars, name);
662 static variable_t* find_slot(state_t*s, const char*name)
664 if(s->method && s->method->slots)
665 return dict_lookup(s->method->slots, name);
669 static variable_t* find_variable_safe(state_t*s, char*name)
671 variable_t* v = find_variable(s, name);
673 syntaxerror("undefined variable: %s", name);
677 static char variable_exists(char*name)
679 return dict_contains(state->vars, name);
682 static code_t*defaultvalue(code_t*c, classinfo_t*type)
684 if(TYPE_IS_INT(type)) {
685 c = abc_pushbyte(c, 0);
686 } else if(TYPE_IS_UINT(type)) {
687 c = abc_pushuint(c, 0);
688 } else if(TYPE_IS_FLOAT(type)) {
690 } else if(TYPE_IS_BOOLEAN(type)) {
691 c = abc_pushfalse(c);
692 } else if(TYPE_IS_STRING(type)) {
696 //c = abc_pushundefined(c);
697 syntaxerror("internal error: can't generate default value for * type");
701 c = abc_coerce2(c, &m);
706 static int alloc_local()
708 return state->method->variable_count++;
711 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
714 variable_t*v = find_slot(state, name);
722 v->index = alloc_local();
727 dict_put(state->vars, name, v);
728 dict_put(state->allvars, name, v);
733 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
735 return new_variable2(name, type, init, maybeslot)->index;
738 #define TEMPVARNAME "__as3_temp__"
741 variable_t*v = find_variable(state, TEMPVARNAME);
746 i = new_variable(TEMPVARNAME, 0, 0, 0);
751 static code_t* var_block(code_t*body)
757 DICT_ITERATE_DATA(state->vars, variable_t*, v) {
758 if(v->type && v->init) {
759 c = defaultvalue(c, v->type);
760 c = abc_setlocal(c, v->index);
761 k = abc_kill(k, v->index);
769 if(x->opcode== OPCODE___BREAK__ ||
770 x->opcode== OPCODE___CONTINUE__) {
771 /* link kill code before break/continue */
772 code_t*e = code_dup(k);
773 code_t*s = code_start(e);
785 c = code_append(c, body);
786 c = code_append(c, k);
790 static void unknown_variable(char*name)
792 if(!state->method->unresolved_variables)
793 state->method->unresolved_variables = dict_new();
794 if(!dict_contains(state->method->unresolved_variables, name))
795 dict_put(state->method->unresolved_variables, name, 0);
798 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
800 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
801 c = abc_getlocal_0(c);
802 c = abc_pushscope(c);
805 /* FIXME: this alloc_local() causes variable indexes to be
806 different in pass2 than in pass1 */
807 if(!m->activation_var) {
808 m->activation_var = alloc_local();
811 c = abc_newactivation(c);
813 c = abc_pushscope(c);
814 c = abc_setlocal(c, m->activation_var);
816 c = abc_getlocal(c, m->activation_var);
817 c = abc_pushscope(c);
823 static code_t* method_header(methodstate_t*m)
827 c = add_scope_code(c, m, 1);
829 methodstate_list_t*l = m->innerfunctions;
831 parserassert(l->methodstate->abc);
832 if(m->uses_slots && l->methodstate->is_a_slot) {
833 c = abc_getscopeobject(c, 1);
834 c = abc_newfunction(c, l->methodstate->abc);
836 c = abc_setlocal(c, l->methodstate->var_index);
837 c = abc_setslot(c, l->methodstate->slot_index);
839 c = abc_newfunction(c, l->methodstate->abc);
840 c = abc_setlocal(c, l->methodstate->var_index);
842 free(l->methodstate);l->methodstate=0;
846 c = code_append(c, m->header);
849 if(m->is_constructor && !m->has_super) {
850 // call default constructor
851 c = abc_getlocal_0(c);
852 c = abc_constructsuper(c, 0);
856 /* all parameters that are used by inner functions
857 need to be copied from local to slot */
858 parserassert(m->activation_var);
859 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
860 if(v->is_parameter) {
861 c = abc_getlocal(c, m->activation_var);
862 c = abc_getlocal(c, v->index);
863 c = abc_setslot(c, v->index);
867 list_free(m->innerfunctions);
868 m->innerfunctions = 0;
873 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
875 c = code_append(c, header);
876 c = code_append(c, var_block(body));
877 /* append return if necessary */
878 if(!c || (c->opcode != OPCODE_RETURNVOID &&
879 c->opcode != OPCODE_RETURNVALUE)) {
880 c = abc_returnvoid(c);
885 static void startpackage(char*name)
888 state->package = strdup(name);
890 static void endpackage()
892 //used e.g. in classinfo_register:
893 //free(state->package);state->package=0;
897 #define FLAG_PUBLIC 256
898 #define FLAG_PROTECTED 512
899 #define FLAG_PRIVATE 1024
900 #define FLAG_PACKAGEINTERNAL 2048
901 #define FLAG_NAMESPACE 4096
903 static namespace_t modifiers2access(modifiers_t*mod)
908 if(mod->flags&FLAG_NAMESPACE) {
909 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
910 syntaxerror("invalid combination of access levels and namespaces");
911 ns.access = ACCESS_NAMESPACE;
913 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
915 /* shouldn't happen- the tokenizer only reports something as a namespace
916 if it was already registered */
917 trie_dump(active_namespaces);
918 syntaxerror("unknown namespace: %s", mod->ns);
921 } else if(mod->flags&FLAG_PUBLIC) {
922 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
923 syntaxerror("invalid combination of access levels");
924 ns.access = ACCESS_PACKAGE;
925 } else if(mod->flags&FLAG_PRIVATE) {
926 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
927 syntaxerror("invalid combination of access levels");
928 ns.access = ACCESS_PRIVATE;
929 } else if(mod->flags&FLAG_PROTECTED) {
930 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
931 syntaxerror("invalid combination of access levels");
932 ns.access = ACCESS_PROTECTED;
934 ns.access = ACCESS_PACKAGEINTERNAL;
938 static slotinfo_t* find_class(const char*name);
940 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
942 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
945 static void innerfunctions2vars(methodstate_t*m)
947 methodstate_list_t*l = m->innerfunctions;
949 methodstate_t*m = l->methodstate;
951 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 0);
952 m->var_index = v->index;
954 m->slot_index = m->is_a_slot;
955 v->is_inner_method = m;
960 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
965 index = new_variable("this", 0, 0, 0);
966 else if(!m->is_global)
967 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
969 index = new_variable("globalscope", 0, 0, 0);
970 parserassert(!index);
975 for(p=params->list;p;p=p->next) {
976 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
979 if(as3_pass==2 && m->need_arguments) {
980 /* arguments can never be used by an innerfunction (the inner functions
981 have their own arguments var), so it's ok to not initialize this until
982 pass 2. (We don't know whether we need it before, anyway) */
983 variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0);
984 m->need_arguments = v->index;
988 innerfunctions2vars(m);
991 m->scope_code = add_scope_code(m->scope_code, m, 0);
993 /* exchange unresolved identifiers with the actual objects */
994 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
995 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
996 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
997 if(!type || type->kind != INFOTYPE_CLASS) {
998 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1008 char*as3_globalclass=0;
1009 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1012 syntaxerror("inner classes now allowed");
1017 classinfo_list_t*mlist=0;
1019 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1020 syntaxerror("invalid modifier(s)");
1022 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1023 syntaxerror("public and internal not supported at the same time.");
1025 if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC))
1026 syntaxerror("protected and static not supported at the same time.");
1028 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1029 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1030 // all classes extend object
1031 extends = registry_getobjectclass();
1034 /* create the class name, together with the proper attributes */
1038 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1039 access = ACCESS_PRIVATE; package = internal_filename_package;
1040 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1041 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1042 } else if(state->package!=internal_filename_package) {
1043 access = ACCESS_PACKAGE; package = state->package;
1045 syntaxerror("public classes only allowed inside a package");
1049 state->cls = rfx_calloc(sizeof(classstate_t));
1050 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1051 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1052 state->cls->static_init->is_static=FLAG_STATIC;
1053 state->cls->static_init->variable_count=1;
1054 /* notice: we make no effort to initialize the top variable (local0) here,
1055 even though it has special meaning. We just rely on the fact
1056 that pass 1 won't do anything with variables */
1058 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1060 /* set current method to constructor- all code within the class-level (except
1061 static variable initializations) will be executed during construction time */
1062 state->method = state->cls->init;
1064 if(registry_find(package, classname)) {
1065 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1067 /* build info struct */
1068 int num_interfaces = (list_length(implements));
1069 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1070 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1071 state->cls->info->superclass = extends;
1074 classinfo_list_t*l = implements;
1075 for(l=implements;l;l=l->next) {
1076 state->cls->info->interfaces[pos++] = l->classinfo;
1081 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1083 state->method = state->cls->init;
1084 parserassert(state->cls && state->cls->info);
1086 function_initvars(state->cls->init, 0, 0, 0, 1);
1087 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1089 if(extends && (extends->flags & FLAG_FINAL))
1090 syntaxerror("Can't extend final class '%s'", extends->name);
1093 while(state->cls->info->interfaces[pos]) {
1094 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1095 syntaxerror("'%s' is not an interface",
1096 state->cls->info->interfaces[pos]->name);
1100 /* generate the abc code for this class */
1101 MULTINAME(classname2,state->cls->info);
1102 multiname_t*extends2 = sig2mname(extends);
1104 /* don't add the class to the class index just yet- that will be done later
1106 state->cls->abc = abc_class_new(0, &classname2, extends2);
1107 state->cls->abc->file = global->file;
1109 multiname_destroy(extends2);
1110 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1111 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1112 if(state->cls->info->flags&FLAG_INTERFACE) {
1113 abc_class_interface(state->cls->abc);
1116 for(mlist=implements;mlist;mlist=mlist->next) {
1117 MULTINAME(m, mlist->classinfo);
1118 abc_class_add_interface(state->cls->abc, &m);
1121 state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc);
1122 list_append(global->classes, state->cls->dependencies);
1124 /* flash.display.MovieClip handling */
1125 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1126 if(state->package && state->package[0]) {
1127 as3_globalclass = concat3(state->package, ".", classname);
1129 as3_globalclass = strdup(classname);
1135 static void endclass()
1138 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1140 c = abc_getlocal_0(c);
1141 c = abc_constructsuper(c, 0);
1142 state->cls->init->header = code_append(state->cls->init->header, c);
1143 state->cls->has_constructor=1;
1145 if(state->cls->init) {
1146 if(state->cls->info->flags&FLAG_INTERFACE) {
1147 if(state->cls->init->header)
1148 syntaxerror("interface can not have class-level code");
1150 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1151 code_t*c = method_header(state->cls->init);
1152 m->body->code = wrap_function(c, 0, m->body->code);
1155 if(state->cls->static_init) {
1156 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1157 code_t*c = method_header(state->cls->static_init);
1158 m->body->code = wrap_function(c, 0, m->body->code);
1161 trait_list_t*trait = state->cls->abc->traits;
1162 /* switch all protected members to the protected ns of this class */
1164 trait_t*t = trait->trait;
1165 if(t->name->ns->access == ACCESS_PROTECTED) {
1166 if(!state->cls->abc->protectedNS) {
1167 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1168 state->cls->abc->protectedNS = namespace_new_protected(n);
1169 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1171 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1173 trait = trait->next;
1180 void check_code_for_break(code_t*c)
1183 if(c->opcode == OPCODE___BREAK__) {
1184 char*name = string_cstr(c->data[0]);
1185 syntaxerror("Unresolved \"break %s\"", name);
1187 if(c->opcode == OPCODE___CONTINUE__) {
1188 char*name = string_cstr(c->data[0]);
1189 syntaxerror("Unresolved \"continue %s\"", name);
1191 if(c->opcode == OPCODE___RETHROW__) {
1192 syntaxerror("Unresolved \"rethrow\"");
1194 if(c->opcode == OPCODE___FALLTHROUGH__) {
1195 syntaxerror("Unresolved \"fallthrough\"");
1197 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1198 char*name = string_cstr(c->data[0]);
1199 syntaxerror("Can't reference a package (%s) as such", name);
1205 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1207 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1208 if(TYPE_IS_NUMBER(t)) {
1209 xassert(c->type == CONSTANT_FLOAT
1210 || c->type == CONSTANT_INT
1211 || c->type == CONSTANT_UINT);
1212 } else if(TYPE_IS_UINT(t)) {
1213 xassert(c->type == CONSTANT_UINT ||
1214 (c->type == CONSTANT_INT && c->i>=0));
1215 } else if(TYPE_IS_INT(t)) {
1216 xassert(c->type == CONSTANT_INT);
1217 } else if(TYPE_IS_BOOLEAN(t)) {
1218 xassert(c->type == CONSTANT_TRUE
1219 || c->type == CONSTANT_FALSE);
1223 static void check_override(memberinfo_t*m, int flags)
1227 if(m->parent == state->cls->info)
1228 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1230 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1231 if(m->access==ACCESS_PRIVATE)
1233 if(m->flags & FLAG_FINAL)
1234 syntaxerror("can't override final member %s", m->name);
1236 /* allow this. it's no issue.
1237 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1238 syntaxerror("can't override static member %s", m->name);*/
1240 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1241 syntaxerror("can't override non-static member %s with static declaration", m->name);
1243 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1244 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1245 if(m->kind == INFOTYPE_METHOD)
1246 syntaxerror("can't override without explicit 'override' declaration");
1248 syntaxerror("can't override '%s'", m->name);
1253 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1255 methodinfo_t*minfo = 0;
1256 namespace_t ns = modifiers2access(mod);
1259 minfo = methodinfo_register_global(ns.access, state->package, name);
1260 minfo->return_type = return_type;
1261 } else if(getset != KW_GET && getset != KW_SET) {
1263 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1265 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1267 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1268 minfo->return_type = return_type;
1269 // getslot on a member slot only returns "undefined", so no need
1270 // to actually store these
1271 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1273 //class getter/setter
1274 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1276 if(getset == KW_GET) {
1278 } else if(params->list && params->list->param && !params->list->next) {
1279 type = params->list->param->type;
1281 syntaxerror("setter function needs to take exactly one argument");
1282 // not sure wether to look into superclasses here, too
1283 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1285 if(minfo->kind!=INFOTYPE_VAR)
1286 syntaxerror("class already contains a method called '%s'", name);
1287 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1288 syntaxerror("class already contains a field called '%s'", name);
1289 if(minfo->subtype & gs)
1290 syntaxerror("getter/setter for '%s' already defined", name);
1291 /* make a setter or getter into a getset */
1292 minfo->subtype |= gs;
1295 FIXME: this check needs to be done in pass 2
1297 if((!minfo->return_type != !type) ||
1298 (minfo->return_type && type &&
1299 !strcmp(minfo->return_type->name, type->name))) {
1300 syntaxerror("different type in getter and setter: %s and %s",
1301 minfo->return_type?minfo->return_type->name:"*",
1302 type?type->name:"*");
1305 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1306 minfo->kind = INFOTYPE_VAR; //hack
1307 minfo->subtype = gs;
1308 minfo->return_type = type;
1311 /* can't assign a slot as getter and setter might have different slots */
1312 //minfo->slot = slot;
1314 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1315 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1316 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1321 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1323 //parserassert(state->method && state->method->info);
1325 methodstate_t*parent_method = state->method;
1328 return_type = 0; // not valid in pass 1
1332 state->new_vars = 1;
1333 state->allvars = dict_new();
1336 state->method = rfx_calloc(sizeof(methodstate_t));
1337 state->method->inner = 1;
1338 state->method->is_static = parent_method->is_static;
1339 state->method->variable_count = 0;
1340 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1342 NEW(methodinfo_t,minfo);
1343 minfo->kind = INFOTYPE_METHOD;
1344 minfo->access = ACCESS_PACKAGEINTERNAL;
1346 state->method->info = minfo;
1349 list_append(parent_method->innerfunctions, state->method);
1351 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1353 function_initvars(state->method, 1, params, 0, 1);
1357 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1358 state->method->variable_count = 0;
1359 parserassert(state->method);
1361 state->method->info->return_type = return_type;
1362 function_initvars(state->method, 1, params, 0, 1);
1366 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1367 params_t*params, classinfo_t*return_type)
1369 if(state->method && state->method->info) {
1370 syntaxerror("not able to start another method scope");
1373 state->new_vars = 1;
1374 state->allvars = dict_new();
1377 state->method = rfx_calloc(sizeof(methodstate_t));
1378 state->method->has_super = 0;
1379 state->method->is_static = mod->flags&FLAG_STATIC;
1382 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1384 state->method->is_global = 1;
1385 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1387 if(state->method->is_constructor)
1388 name = "__as3_constructor__";
1390 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1392 function_initvars(state->method, 1, params, mod->flags, 1);
1394 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1398 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1399 state->method->variable_count = 0;
1400 parserassert(state->method);
1403 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1404 check_override(m, mod->flags);
1408 state->cls->has_constructor |= state->method->is_constructor;
1411 function_initvars(state->method, 1, params, mod->flags, 1);
1415 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1416 params_t*params, classinfo_t*return_type, code_t*body)
1419 innerfunctions2vars(state->method);
1421 methodstate_list_t*ml = state->method->innerfunctions;
1423 dict_t*xvars = dict_new();
1426 methodstate_t*m = ml->methodstate;
1427 parserassert(m->inner);
1428 if(m->unresolved_variables) {
1429 dict_t*d = m->unresolved_variables;
1431 DICT_ITERATE_KEY(d, char*, id) {
1432 /* check parent method's variables */
1434 if((v=find_variable(state, id))) {
1435 m->uses_parent_function = 1;
1436 state->method->uses_slots = 1;
1437 dict_put(xvars, id, 0);
1440 dict_destroy(m->unresolved_variables);m->unresolved_variables = 0;
1445 if(state->method->uses_slots) {
1446 state->method->slots = dict_new();
1448 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1449 if(!name) syntaxerror("internal error");
1450 if(v->index && dict_contains(xvars, name)) {
1453 if(v->is_inner_method) {
1454 v->is_inner_method->is_a_slot = i;
1457 dict_put(state->method->slots, name, v);
1460 state->method->uses_slots = i;
1461 dict_destroy(state->vars);state->vars = 0;
1462 parserassert(state->new_vars);
1463 dict_destroy(state->allvars);state->allvars = 0;
1470 /*if(state->method->uses_parent_function){
1471 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1476 multiname_t*type2 = sig2mname(return_type);
1478 if(state->method->inner) {
1479 f = state->method->abc;
1480 abc_method_init(f, global->file, type2, 1);
1481 } else if(state->method->is_constructor) {
1482 f = abc_class_getconstructor(state->cls->abc, type2);
1483 } else if(!state->method->is_global) {
1484 namespace_t ns = modifiers2access(mod);
1485 multiname_t mname = {QNAME, &ns, 0, name};
1486 if(mod->flags&FLAG_STATIC)
1487 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1489 f = abc_class_method(state->cls->abc, type2, &mname);
1490 slot = f->trait->slot_id;
1492 namespace_t mname_ns = {state->method->info->access, state->package};
1493 multiname_t mname = {QNAME, &mname_ns, 0, name};
1495 f = abc_method_new(global->file, type2, 1);
1496 if(!global->init) global->init = abc_initscript(global->file);
1497 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1498 //abc_code_t*c = global->init->method->body->code;
1500 //flash doesn't seem to allow us to access function slots
1501 //state->method->info->slot = slot;
1503 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1504 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1505 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1506 if(params->varargs) f->flags |= METHOD_NEED_REST;
1507 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1511 for(p=params->list;p;p=p->next) {
1512 if(params->varargs && !p->next) {
1513 break; //varargs: omit last parameter in function signature
1515 multiname_t*m = sig2mname(p->param->type);
1516 list_append(f->parameters, m);
1517 if(p->param->value) {
1518 check_constant_against_type(p->param->type, p->param->value);
1519 opt=1;list_append(f->optional_parameters, p->param->value);
1521 syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name);
1524 if(state->method->slots) {
1525 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1527 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1528 multiname_t*type = sig2mname(v->type);
1529 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1530 t->slot_id = v->index;
1535 check_code_for_break(body);
1537 /* Seems this works now.
1538 if(state->method->exceptions && state->method->uses_slots) {
1539 as3_warning("try/catch and activation not supported yet within the same method");
1543 f->body->code = body;
1544 f->body->exceptions = state->method->exceptions;
1545 } else { //interface
1547 syntaxerror("interface methods can't have a method body");
1557 void breakjumpsto(code_t*c, char*name, code_t*jump)
1560 if(c->opcode == OPCODE___BREAK__) {
1561 string_t*name2 = c->data[0];
1562 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1563 c->opcode = OPCODE_JUMP;
1570 void continuejumpsto(code_t*c, char*name, code_t*jump)
1573 if(c->opcode == OPCODE___CONTINUE__) {
1574 string_t*name2 = c->data[0];
1575 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1576 c->opcode = OPCODE_JUMP;
1584 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1589 return abc_coerce_a(c);
1593 // cast an "any" type to a specific type. subject to
1594 // runtime exceptions
1595 return abc_coerce2(c, &m);
1598 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1599 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1600 // allow conversion between number types
1601 if(TYPE_IS_UINT(to))
1602 return abc_convert_u(c);
1603 else if(TYPE_IS_INT(to))
1604 return abc_convert_i(c);
1605 else if(TYPE_IS_NUMBER(to))
1606 return abc_convert_d(c);
1607 return abc_coerce2(c, &m);
1610 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1613 if(TYPE_IS_BOOLEAN(to))
1614 return abc_convert_b(c);
1615 if(TYPE_IS_STRING(to))
1616 return abc_convert_s(c);
1617 if(TYPE_IS_OBJECT(to))
1618 return abc_coerce2(c, &m);
1619 if(TYPE_IS_OBJECT(from) && TYPE_IS_XMLLIST(to))
1620 return abc_coerce2(c, &m);
1621 if(TYPE_IS_OBJECT(from) && TYPE_IS_ARRAY(to))
1622 return abc_coerce2(c, &m);
1624 classinfo_t*supertype = from;
1626 if(supertype == to) {
1627 /* target type is one of from's superclasses.
1628 (not sure we need this coerce - as far as the verifier
1629 is concerned, object==object (i think) */
1630 return abc_coerce2(c, &m);
1633 while(supertype->interfaces[t]) {
1634 if(supertype->interfaces[t]==to) {
1635 // target type is one of from's interfaces
1636 return abc_coerce2(c, &m);
1640 supertype = supertype->superclass;
1642 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1644 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1646 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1649 as3_error("can't convert type %s%s%s to %s%s%s",
1650 from->package, from->package[0]?".":"", from->name,
1651 to->package, to->package[0]?".":"", to->name);
1655 code_t* coerce_to_type(code_t*c, classinfo_t*t)
1658 return abc_coerce_a(c);
1659 } else if(TYPE_IS_STRING(t)) {
1660 return abc_coerce_s(c);
1663 return abc_coerce2(c, &m);
1667 char is_pushundefined(code_t*c)
1669 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1672 static const char* get_package_from_name(const char*name)
1674 /* try explicit imports */
1675 dictentry_t* e = dict_get_slot(state->imports, name);
1677 if(!strcmp(e->key, name)) {
1678 slotinfo_t*c = (slotinfo_t*)e->data;
1679 if(c) return c->package;
1685 static namespace_list_t*get_current_imports()
1687 namespace_list_t*searchlist = 0;
1689 list_append(searchlist, namespace_new_package(state->package));
1691 import_list_t*l = state->wildcard_imports;
1693 namespace_t*ns = namespace_new_package(l->import->package);
1694 list_append(searchlist, ns);
1697 list_append(searchlist, namespace_new_package(""));
1698 list_append(searchlist, namespace_new_package(internal_filename_package));
1702 static slotinfo_t* find_class(const char*name)
1706 c = registry_find(state->package, name);
1709 /* try explicit imports */
1710 dictentry_t* e = dict_get_slot(state->imports, name);
1713 if(!strcmp(e->key, name)) {
1714 c = (slotinfo_t*)e->data;
1720 /* try package.* imports */
1721 import_list_t*l = state->wildcard_imports;
1723 //printf("does package %s contain a class %s?\n", l->import->package, name);
1724 c = registry_find(l->import->package, name);
1729 /* try global package */
1730 c = registry_find("", name);
1733 /* try local "filename" package */
1734 c = registry_find(internal_filename_package, name);
1739 typedcode_t push_class(slotinfo_t*a)
1744 if(a->access == ACCESS_PACKAGEINTERNAL &&
1745 strcmp(a->package, state->package) &&
1746 strcmp(a->package, internal_filename_package)
1748 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1749 infotypename(a), a->name, a->package, state->package);
1753 if(a->kind != INFOTYPE_CLASS) {
1755 x.c = abc_findpropstrict2(x.c, &m);
1756 x.c = abc_getproperty2(x.c, &m);
1757 if(a->kind == INFOTYPE_METHOD) {
1758 methodinfo_t*f = (methodinfo_t*)a;
1759 x.t = TYPE_FUNCTION(f);
1761 varinfo_t*v = (varinfo_t*)a;
1766 if(state->cls && state->method == state->cls->static_init) {
1767 /* we're in the static initializer.
1768 record the fact that we're using this class here */
1769 parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a);
1771 classinfo_t*c = (classinfo_t*)a;
1773 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1774 x.c = abc_getglobalscope(x.c);
1775 x.c = abc_getslot(x.c, c->slot);
1778 x.c = abc_getlex2(x.c, &m);
1780 x.t = TYPE_CLASS(c);
1786 char is_break_or_jump(code_t*c)
1790 if(c->opcode == OPCODE_JUMP ||
1791 c->opcode == OPCODE___BREAK__ ||
1792 c->opcode == OPCODE___CONTINUE__ ||
1793 c->opcode == OPCODE_THROW ||
1794 c->opcode == OPCODE_RETURNVOID ||
1795 c->opcode == OPCODE_RETURNVALUE) {
1801 #define IS_FINALLY_TARGET(op) \
1802 ((op) == OPCODE___CONTINUE__ || \
1803 (op) == OPCODE___BREAK__ || \
1804 (op) == OPCODE_RETURNVOID || \
1805 (op) == OPCODE_RETURNVALUE || \
1806 (op) == OPCODE___RETHROW__)
1808 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1810 #define NEED_EXTRA_STACK_ARG
1811 code_t*finally_label = abc_nop(0);
1812 NEW(lookupswitch_t, l);
1818 code_t*prev = i->prev;
1819 if(IS_FINALLY_TARGET(i->opcode)) {
1822 if(i->opcode == OPCODE___RETHROW__ ||
1823 i->opcode == OPCODE_RETURNVALUE) {
1824 if(i->opcode == OPCODE___RETHROW__)
1825 i->opcode = OPCODE_THROW;
1827 p = abc_coerce_a(p);
1828 p = abc_setlocal(p, tempvar);
1830 p = abc_pushbyte(p, count++);
1831 p = abc_jump(p, finally_label);
1832 code_t*target = p = abc_label(p);
1833 #ifdef NEED_EXTRA_STACK_ARG
1837 p = abc_getlocal(p, tempvar);
1840 p->next = i;i->prev = p;
1841 list_append(l->targets, target);
1847 c = abc_pushbyte(c, -1);
1848 c = code_append(c, finally_label);
1849 c = code_append(c, finally);
1851 #ifdef NEED_EXTRA_STACK_ARG
1854 c = abc_lookupswitch(c, l);
1855 c = l->def = abc_label(c);
1856 #ifdef NEED_EXTRA_STACK_ARG
1863 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1867 code_t*prev = i->prev;
1868 if(IS_FINALLY_TARGET(i->opcode)) {
1869 if(i->opcode == OPCODE___RETHROW__)
1870 i->opcode = OPCODE_THROW;
1871 code_t*end = code_dup(finally);
1872 code_t*start = code_start(end);
1873 if(prev) prev->next = start;
1880 return code_append(c, finally);
1883 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1889 int num_insertion_points=0;
1891 if(IS_FINALLY_TARGET(i->opcode))
1892 num_insertion_points++;
1899 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1904 int simple_version_cost = (1+num_insertion_points)*code_size;
1905 int lookup_version_cost = 4*num_insertion_points + 5;
1907 if(cantdup || simple_version_cost > lookup_version_cost) {
1908 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1909 return insert_finally_lookup(c, finally, tempvar);
1911 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1912 return insert_finally_simple(c, finally, tempvar);
1916 #define PASS1 }} if(as3_pass == 1) {{
1917 #define PASS1END }} if(as3_pass == 2) {{
1918 #define PASS2 }} if(as3_pass == 2) {{
1919 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1920 #define PASS12END }} if(as3_pass == 2) {{
1921 #define PASS_ALWAYS }} {{
1925 /* Line 273 of skeleton.m4 */
1926 #line 1927 "parser.tab.c"
1927 /* Unqualified %code blocks. */
1929 /* Line 274 of skeleton.m4 */
1930 #line 2008 "parser.y"
1932 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1938 /* Line 274 of skeleton.m4 */
1939 #line 2458 "parser.y"
1941 static void state_has_imports()
1943 state->wildcard_imports = list_clone(state->wildcard_imports);
1944 state->imports = dict_clone(state->imports);
1945 state->has_own_imports = 1;
1947 static void import_toplevel(const char*package)
1949 char* s = strdup(package);
1951 dict_put(state->import_toplevel_packages, s, 0);
1952 char*x = strrchr(s, '.');
1961 /* Line 274 of skeleton.m4 */
1962 #line 2591 "parser.y"
1964 static int slotstate_varconst = 0;
1965 static modifiers_t*slotstate_flags = 0;
1966 static void setslotstate(modifiers_t* flags, int varconst)
1968 slotstate_varconst = varconst;
1969 slotstate_flags = flags;
1972 if(flags->flags&FLAG_STATIC) {
1973 state->method = state->cls->static_init;
1975 state->method = state->cls->init;
1978 // reset to "default" state (all in class code is static by default) */
1979 state->method = state->cls->static_init;
1982 parserassert(state->method);
1985 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
1987 int flags = modifiers->flags;
1988 namespace_t ns = modifiers2access(modifiers);
1991 multiname_t mname = {QNAME, &ns, 0, name};
1993 trait_list_t**traits;
1997 if(!global->init) global->init = abc_initscript(global->file);
1998 ns.name = state->package;
1999 traits = &global->init->traits;
2000 code = &global->init->method->body->code;
2001 } else if(flags&FLAG_STATIC) {
2003 traits = &state->cls->abc->static_traits;
2004 code = &state->cls->static_init->header;
2006 // instance variable
2007 traits = &state->cls->abc->traits;
2008 code = &state->cls->init->header;
2010 if(ns.access == ACCESS_PROTECTED) {
2011 ns.name = concat3(state->cls->info->package,":",state->cls->info->name);
2017 *m = *multiname_clone(&mname);
2019 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
2023 /* Line 274 of skeleton.m4 */
2024 #line 2776 "parser.y"
2026 static int xml_level = 0;
2029 /* Line 274 of skeleton.m4 */
2030 #line 3555 "parser.y"
2032 node_t* resolve_identifier(char*name)
2042 /* look at variables */
2043 if((v = find_variable(state, name))) {
2044 // name is a local variable
2045 o.c = abc_getlocal(o.c, v->index);
2047 return mkcodenode(o);
2049 if((v = find_slot(state, name))) {
2050 o.c = abc_getscopeobject(o.c, 1);
2051 o.c = abc_getslot(o.c, v->index);
2053 return mkcodenode(o);
2056 int i_am_static = state->method->is_static;
2058 /* look at current class' members */
2059 if(!state->method->inner &&
2060 !state->xmlfilter &&
2062 (f = findmember_nsset(state->cls->info, name, 1)))
2064 // name is a member or attribute in this class
2065 int var_is_static = (f->flags&FLAG_STATIC);
2067 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2068 /* if the variable is a constant (and we know what is evaluates to), we
2069 can just use the value itself */
2070 varinfo_t*v = (varinfo_t*)f;
2072 return mkconstnode(v->value);
2076 if(var_is_static >= i_am_static) {
2077 if(f->kind == INFOTYPE_METHOD) {
2078 o.t = TYPE_FUNCTION(f);
2083 if(var_is_static && !i_am_static) {
2084 /* access to a static member from a non-static location.
2085 do this via findpropstrict:
2086 there doesn't seem to be any non-lookup way to access
2087 static properties of a class */
2088 state->method->late_binding = 1;
2090 namespace_t ns = {f->access, f->package};
2091 multiname_t m = {QNAME, &ns, 0, name};
2092 o.c = abc_findpropstrict2(o.c, &m);
2093 o.c = abc_getproperty2(o.c, &m);
2094 return mkcodenode(o);
2095 } else if(f->slot>0) {
2096 o.c = abc_getlocal_0(o.c);
2097 o.c = abc_getslot(o.c, f->slot);
2098 return mkcodenode(o);
2100 MEMBER_MULTINAME(m, f, name);
2101 o.c = abc_getlocal_0(o.c);
2102 o.c = abc_getproperty2(o.c, &m);
2103 return mkcodenode(o);
2108 /* look at actual classes, in the current package and imported */
2109 if(!state->xmlfilter && (a = find_class(name))) {
2110 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2111 o.c = abc_getlocal_0(0);
2112 o.t = TYPE_CLASS((classinfo_t*)a);
2116 return mkcodenode(o);
2119 /* look through package prefixes */
2120 if(!state->xmlfilter &&
2121 (dict_contains(state->import_toplevel_packages, name) ||
2122 registry_ispackage(name))) {
2123 o.c = abc___pushpackage__(o.c, name);
2125 return mkcodenode(o); //?
2128 /* unknown object, let the avm2 resolve it */
2130 if(!state->method->inner && !state->xmlfilter) {
2131 /* we really should make inner functions aware of the class context */
2132 as3_warning("Couldn't resolve '%s', doing late binding", name);
2134 state->method->late_binding = 1;
2136 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2139 o.c = abc_findpropstrict2(o.c, &m);
2140 o.c = abc_getproperty2(o.c, &m);
2141 return mkcodenode(o);
2146 /* Line 274 of skeleton.m4 */
2147 #line 3697 "parser.y"
2149 void add_active_url(const char*url)
2153 list_append(state->active_namespace_urls, n);
2158 /* Line 274 of skeleton.m4 */
2159 #line 2160 "parser.tab.c"
2166 typedef YYTYPE_UINT8 yytype_uint8;
2168 typedef unsigned char yytype_uint8;
2172 typedef YYTYPE_INT8 yytype_int8;
2173 #elif (defined __STDC__ || defined __C99__FUNC__ \
2174 || defined __cplusplus || defined _MSC_VER)
2175 typedef signed char yytype_int8;
2177 typedef short int yytype_int8;
2180 #ifdef YYTYPE_UINT16
2181 typedef YYTYPE_UINT16 yytype_uint16;
2183 typedef unsigned short int yytype_uint16;
2187 typedef YYTYPE_INT16 yytype_int16;
2189 typedef short int yytype_int16;
2193 # ifdef __SIZE_TYPE__
2194 # define YYSIZE_T __SIZE_TYPE__
2195 # elif defined size_t
2196 # define YYSIZE_T size_t
2197 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2198 || defined __cplusplus || defined _MSC_VER)
2199 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2200 # define YYSIZE_T size_t
2202 # define YYSIZE_T unsigned int
2206 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2211 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2212 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2216 # define YY_(msgid) msgid
2220 /* Suppress unused-variable warnings by "using" E. */
2221 #if ! defined lint || defined __GNUC__
2222 # define YYUSE(e) ((void) (e))
2224 # define YYUSE(e) /* empty */
2227 /* Identity function, used to suppress warnings about constant conditions. */
2229 # define YYID(n) (n)
2231 #if (defined __STDC__ || defined __C99__FUNC__ \
2232 || defined __cplusplus || defined _MSC_VER)
2245 #if ! defined yyoverflow || YYERROR_VERBOSE
2247 /* The parser invokes alloca or malloc; define the necessary symbols. */
2249 # ifdef YYSTACK_USE_ALLOCA
2250 # if YYSTACK_USE_ALLOCA
2252 # define YYSTACK_ALLOC __builtin_alloca
2253 # elif defined __BUILTIN_VA_ARG_INCR
2254 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2256 # define YYSTACK_ALLOC __alloca
2257 # elif defined _MSC_VER
2258 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2259 # define alloca _alloca
2261 # define YYSTACK_ALLOC alloca
2262 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2263 || defined __cplusplus || defined _MSC_VER)
2264 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2266 # define _STDLIB_H 1
2273 # ifdef YYSTACK_ALLOC
2274 /* Pacify GCC's `empty if-body' warning. */
2275 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2276 # ifndef YYSTACK_ALLOC_MAXIMUM
2277 /* The OS might guarantee only one guard page at the bottom of the stack,
2278 and a page size can be as small as 4096 bytes. So we cannot safely
2279 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2280 to allow for a few compiler-allocated temporary stack slots. */
2281 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2284 # define YYSTACK_ALLOC YYMALLOC
2285 # define YYSTACK_FREE YYFREE
2286 # ifndef YYSTACK_ALLOC_MAXIMUM
2287 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2289 # if (defined __cplusplus && ! defined _STDLIB_H \
2290 && ! ((defined YYMALLOC || defined malloc) \
2291 && (defined YYFREE || defined free)))
2292 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2294 # define _STDLIB_H 1
2298 # define YYMALLOC malloc
2299 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2300 || defined __cplusplus || defined _MSC_VER)
2301 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2305 # define YYFREE free
2306 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2307 || defined __cplusplus || defined _MSC_VER)
2308 void free (void *); /* INFRINGES ON USER NAME SPACE */
2312 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2315 #if (! defined yyoverflow \
2316 && (! defined __cplusplus \
2317 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2319 /* A type that is properly aligned for any stack member. */
2322 yytype_int16 yyss_alloc;
2326 /* The size of the maximum gap between one aligned stack and the next. */
2327 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2329 /* The size of an array large to enough to hold all stacks, each with
2331 # define YYSTACK_BYTES(N) \
2332 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2333 + YYSTACK_GAP_MAXIMUM)
2335 /* Copy COUNT objects from FROM to TO. The source and destination do
2338 # if defined __GNUC__ && 1 < __GNUC__
2339 # define YYCOPY(To, From, Count) \
2340 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2342 # define YYCOPY(To, From, Count) \
2346 for (yyi = 0; yyi < (Count); yyi++) \
2347 (To)[yyi] = (From)[yyi]; \
2353 /* Relocate STACK from its old location to the new one. The
2354 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2355 elements in the stack, and YYPTR gives the new location of the
2356 stack. Advance YYPTR to a properly aligned location for the next
2358 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2361 YYSIZE_T yynewbytes; \
2362 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2363 Stack = &yyptr->Stack_alloc; \
2364 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2365 yyptr += yynewbytes / sizeof (*yyptr); \
2371 /* YYFINAL -- State number of the termination state. */
2373 /* YYLAST -- Last index in YYTABLE. */
2376 /* YYNTOKENS -- Number of terminals. */
2377 #define YYNTOKENS 136
2378 /* YYNNTS -- Number of nonterminals. */
2380 /* YYNRULES -- Number of rules. */
2381 #define YYNRULES 351
2382 /* YYNRULES -- Number of states. */
2383 #define YYNSTATES 598
2385 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2386 #define YYUNDEFTOK 2
2387 #define YYMAXUTOK 365
2389 #define YYTRANSLATE(YYX) \
2390 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2392 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2393 static const yytype_uint8 yytranslate[] =
2395 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2398 2, 2, 2, 120, 2, 2, 2, 118, 109, 2,
2399 124, 135, 117, 115, 102, 114, 129, 116, 2, 2,
2400 2, 2, 2, 2, 2, 2, 2, 2, 106, 101,
2401 111, 104, 112, 105, 130, 2, 2, 2, 2, 2,
2402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2404 2, 126, 2, 127, 108, 2, 2, 2, 2, 2,
2405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2407 2, 2, 2, 128, 107, 134, 119, 2, 2, 2,
2408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2415 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
2421 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2422 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2423 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2424 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2425 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2426 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2427 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2428 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2429 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2430 95, 96, 97, 98, 99, 100, 103, 110, 113, 121,
2431 122, 123, 125, 131, 132, 133
2435 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2437 static const yytype_uint16 yyprhs[] =
2439 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2440 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2441 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2442 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2443 85, 87, 89, 91, 95, 98, 100, 102, 104, 106,
2444 108, 110, 112, 117, 120, 122, 124, 128, 131, 132,
2445 135, 138, 140, 144, 148, 149, 152, 153, 161, 162,
2446 164, 166, 170, 172, 175, 179, 188, 195, 196, 203,
2447 204, 212, 214, 217, 219, 222, 223, 225, 227, 230,
2448 232, 235, 240, 244, 245, 254, 255, 265, 266, 272,
2449 274, 277, 279, 282, 284, 285, 292, 295, 297, 302,
2450 305, 307, 309, 311, 313, 317, 319, 320, 327, 328,
2451 334, 337, 342, 343, 345, 347, 350, 352, 354, 356,
2452 358, 360, 362, 364, 366, 368, 370, 371, 374, 375,
2453 378, 379, 382, 383, 393, 394, 403, 404, 406, 408,
2454 411, 413, 418, 420, 422, 424, 425, 427, 429, 432,
2455 434, 437, 446, 448, 450, 451, 456, 458, 462, 466,
2456 467, 470, 472, 474, 476, 478, 480, 482, 484, 486,
2457 488, 490, 492, 494, 495, 496, 501, 502, 507, 508,
2458 511, 514, 517, 520, 524, 526, 528, 539, 546, 558,
2459 559, 561, 563, 566, 568, 572, 576, 580, 584, 585,
2460 587, 590, 595, 599, 601, 606, 609, 611, 613, 614,
2461 615, 628, 630, 631, 632, 643, 645, 649, 651, 653,
2462 655, 659, 661, 663, 665, 668, 669, 670, 674, 675,
2463 677, 679, 681, 684, 687, 688, 693, 698, 703, 706,
2464 708, 711, 713, 715, 717, 721, 723, 727, 728, 730,
2465 732, 734, 736, 738, 740, 744, 750, 752, 754, 756,
2466 758, 760, 762, 764, 766, 768, 770, 774, 778, 782,
2467 786, 790, 794, 798, 802, 806, 810, 814, 818, 821,
2468 824, 828, 832, 836, 840, 844, 848, 852, 856, 860,
2469 864, 868, 872, 876, 880, 884, 889, 892, 894, 898,
2470 901, 906, 910, 914, 918, 922, 926, 930, 934, 938,
2471 942, 946, 950, 954, 960, 963, 966, 969, 972, 976,
2472 979, 980, 987, 989, 991, 993, 995, 997, 1003, 1007,
2473 1013, 1018, 1023, 1030, 1037, 1041, 1043, 1046, 1051, 1056,
2477 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2478 static const yytype_int16 yyrhs[] =
2480 137, 0, -1, 138, -1, -1, 139, -1, 140, -1,
2481 139, 140, -1, 188, -1, 200, -1, 198, -1, 234,
2482 -1, 209, -1, 149, -1, 150, 128, 138, 134, -1,
2483 101, -1, -1, 142, -1, 143, -1, 142, 143, -1,
2484 200, -1, 198, -1, 234, -1, 209, -1, 149, -1,
2485 150, 128, 141, 134, -1, 101, -1, 145, -1, -1,
2486 145, 147, -1, 147, -1, 269, -1, 191, -1, 161,
2487 -1, 162, -1, 163, -1, 165, -1, 173, -1, 156,
2488 -1, 185, -1, 181, -1, 257, -1, 270, -1, 268,
2489 -1, 128, 145, 134, -1, 128, 134, -1, 101, -1,
2490 146, -1, 152, -1, 167, -1, 168, -1, 253, -1,
2491 183, -1, 150, 128, 145, 134, -1, 147, 101, -1,
2492 147, -1, 146, -1, 3, 91, 3, -1, 104, 261,
2493 -1, -1, 46, 153, -1, 32, 153, -1, 154, -1,
2494 153, 102, 154, -1, 3, 244, 151, -1, -1, 66,
2495 148, -1, -1, 65, 124, 157, 255, 135, 148, 155,
2496 -1, -1, 152, -1, 257, -1, 46, 3, 244, -1,
2497 3, -1, 11, 124, -1, 11, 50, 124, -1, 160,
2498 158, 101, 255, 101, 257, 135, 148, -1, 160, 159,
2499 69, 255, 135, 148, -1, -1, 12, 124, 164, 255,
2500 135, 148, -1, -1, 13, 166, 148, 12, 124, 255,
2501 135, -1, 67, -1, 67, 3, -1, 30, -1, 30,
2502 3, -1, -1, 170, -1, 172, -1, 170, 172, -1,
2503 171, -1, 170, 171, -1, 34, 261, 106, 144, -1,
2504 62, 106, 144, -1, -1, 14, 124, 174, 261, 135,
2505 128, 169, 134, -1, -1, 33, 124, 3, 244, 135,
2506 176, 128, 144, 134, -1, -1, 27, 128, 178, 144,
2507 134, -1, 175, -1, 179, 175, -1, 179, -1, 179,
2508 177, -1, 177, -1, -1, 52, 128, 182, 144, 134,
2509 180, -1, 37, 255, -1, 37, -1, 39, 124, 255,
2510 135, -1, 184, 148, -1, 3, -1, 17, -1, 16,
2511 -1, 4, -1, 187, 129, 186, -1, 186, -1, -1,
2512 17, 187, 128, 189, 141, 134, -1, -1, 17, 128,
2513 190, 141, 134, -1, 41, 240, -1, 41, 187, 129,
2514 117, -1, -1, 193, -1, 194, -1, 193, 194, -1,
2515 20, -1, 21, -1, 18, -1, 38, -1, 47, -1,
2516 49, -1, 48, -1, 25, -1, 23, -1, 4, -1,
2517 -1, 54, 241, -1, -1, 54, 242, -1, -1, 15,
2518 242, -1, -1, 192, 31, 3, 195, 197, 128, 199,
2519 202, 134, -1, -1, 192, 44, 3, 196, 128, 201,
2520 205, 134, -1, -1, 203, -1, 204, -1, 203, 204,
2521 -1, 101, -1, 150, 128, 202, 134, -1, 209, -1,
2522 234, -1, 146, -1, -1, 206, -1, 207, -1, 206,
2523 207, -1, 101, -1, 46, 3, -1, 192, 26, 233,
2524 3, 124, 230, 135, 244, -1, 46, -1, 32, -1,
2525 -1, 192, 208, 210, 211, -1, 212, -1, 211, 102,
2526 212, -1, 3, 244, 151, -1, -1, 104, 261, -1,
2527 8, -1, 9, -1, 10, -1, 5, -1, 56, -1,
2528 55, -1, 45, -1, 28, -1, 29, -1, 226, -1,
2529 111, -1, 112, -1, -1, -1, 128, 261, 220, 134,
2530 -1, -1, 128, 261, 222, 134, -1, -1, 223, 219,
2531 -1, 223, 5, -1, 223, 112, -1, 226, 223, -1,
2532 224, 226, 223, -1, 3, -1, 221, -1, 216, 225,
2533 227, 217, 223, 111, 116, 225, 218, 112, -1, 216,
2534 225, 227, 116, 218, 112, -1, 216, 225, 227, 217,
2535 223, 224, 111, 116, 225, 218, 112, -1, -1, 228,
2536 -1, 229, -1, 228, 229, -1, 221, -1, 221, 104,
2537 5, -1, 221, 104, 221, -1, 3, 104, 221, -1,
2538 3, 104, 5, -1, -1, 231, -1, 95, 232, -1,
2539 231, 102, 95, 232, -1, 231, 102, 232, -1, 232,
2540 -1, 3, 106, 243, 213, -1, 3, 213, -1, 51,
2541 -1, 35, -1, -1, -1, 192, 26, 233, 3, 124,
2542 230, 135, 244, 128, 235, 144, 134, -1, 3, -1,
2543 -1, -1, 26, 236, 124, 230, 135, 244, 128, 238,
2544 144, 134, -1, 186, -1, 187, 129, 186, -1, 240,
2545 -1, 239, -1, 241, -1, 242, 102, 241, -1, 241,
2546 -1, 117, -1, 36, -1, 106, 243, -1, -1, -1,
2547 124, 246, 135, -1, -1, 247, -1, 248, -1, 254,
2548 -1, 247, 102, -1, 248, 254, -1, -1, 24, 261,
2549 249, 245, -1, 261, 124, 246, 135, -1, 53, 124,
2550 246, 135, -1, 64, 261, -1, 42, -1, 42, 255,
2551 -1, 261, -1, 256, -1, 261, -1, 256, 102, 261,
2552 -1, 261, -1, 257, 102, 261, -1, -1, 260, -1,
2553 3, -1, 5, -1, 8, -1, 9, -1, 10, -1,
2554 259, 106, 254, -1, 260, 102, 259, 106, 254, -1,
2555 237, -1, 265, -1, 250, -1, 252, -1, 251, -1,
2556 266, -1, 214, -1, 215, -1, 6, -1, 19, -1,
2557 126, 246, 127, -1, 71, 258, 134, -1, 261, 111,
2558 261, -1, 261, 112, 261, -1, 261, 76, 261, -1,
2559 261, 77, 261, -1, 261, 72, 261, -1, 261, 73,
2560 261, -1, 261, 75, 261, -1, 261, 74, 261, -1,
2561 261, 89, 261, -1, 261, 90, 261, -1, 120, 261,
2562 -1, 119, 261, -1, 261, 109, 261, -1, 261, 108,
2563 261, -1, 261, 107, 261, -1, 261, 98, 261, -1,
2564 261, 97, 261, -1, 261, 96, 261, -1, 261, 116,
2565 261, -1, 261, 118, 261, -1, 261, 115, 261, -1,
2566 261, 114, 261, -1, 261, 117, 261, -1, 261, 69,
2567 261, -1, 261, 70, 261, -1, 261, 40, 261, -1,
2568 261, 68, 261, -1, 43, 124, 261, 135, -1, 36,
2569 261, -1, 36, -1, 124, 256, 135, -1, 114, 261,
2570 -1, 261, 126, 261, 127, -1, 261, 81, 261, -1,
2571 261, 80, 261, -1, 261, 87, 261, -1, 261, 86,
2572 261, -1, 261, 88, 261, -1, 261, 79, 261, -1,
2573 261, 78, 261, -1, 261, 85, 261, -1, 261, 82,
2574 261, -1, 261, 83, 261, -1, 261, 84, 261, -1,
2575 261, 104, 261, -1, 261, 105, 261, 106, 261, -1,
2576 261, 93, -1, 261, 92, -1, 93, 261, -1, 92,
2577 261, -1, 53, 129, 3, -1, 130, 3, -1, -1,
2578 261, 129, 124, 262, 261, 135, -1, 3, -1, 117,
2579 -1, 4, -1, 186, -1, 117, -1, 261, 129, 263,
2580 91, 264, -1, 261, 94, 264, -1, 261, 129, 126,
2581 261, 127, -1, 261, 129, 130, 264, -1, 261, 94,
2582 130, 264, -1, 261, 129, 130, 126, 261, 127, -1,
2583 261, 94, 130, 126, 261, 127, -1, 261, 129, 264,
2584 -1, 3, -1, 16, 3, -1, 16, 3, 104, 3,
2585 -1, 16, 3, 104, 5, -1, 192, 267, -1, 63,
2586 16, 104, 261, -1, 22, 16, 241, -1
2589 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2590 static const yytype_uint16 yyrline[] =
2592 0, 1908, 1908, 1910, 1910, 1911, 1912, 1914, 1915, 1916,
2593 1917, 1918, 1919, 1920, 1921, 1923, 1923, 1924, 1925, 1927,
2594 1928, 1929, 1930, 1931, 1932, 1933, 1935, 1936, 1938, 1941,
2595 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953,
2596 1954, 1955, 1956, 1957, 1958, 1961, 1962, 1963, 1964, 1965,
2597 1966, 1967, 1968, 1980, 1981, 1985, 1996, 2015, 2016, 2018,
2598 2019, 2021, 2022, 2024, 2084, 2085, 2088, 2088, 2107, 2108,
2599 2109, 2114, 2118, 2123, 2124, 2126, 2146, 2194, 2194, 2213,
2600 2213, 2228, 2231, 2234, 2237, 2241, 2242, 2243, 2244, 2245,
2601 2246, 2248, 2259, 2262, 2262, 2293, 2293, 2318, 2318, 2334,
2602 2335, 2336, 2337, 2345, 2354, 2354, 2403, 2407, 2418, 2428,
2603 2445, 2446, 2447, 2448, 2450, 2451, 2453, 2453, 2455, 2455,
2604 2478, 2492, 2508, 2509, 2510, 2511, 2518, 2519, 2520, 2521,
2605 2522, 2523, 2524, 2525, 2526, 2527, 2531, 2532, 2534, 2535,
2606 2537, 2538, 2542, 2540, 2548, 2546, 2555, 2556, 2557, 2558,
2607 2559, 2560, 2561, 2562, 2564, 2570, 2571, 2572, 2573, 2574,
2608 2575, 2578, 2651, 2651, 2653, 2653, 2655, 2656, 2658, 2742,
2609 2743, 2752, 2753, 2756, 2757, 2758, 2759, 2760, 2761, 2762,
2610 2780, 2782, 2783, 2784, 2786, 2786, 2790, 2790, 2794, 2795,
2611 2798, 2799, 2801, 2802, 2804, 2805, 2807, 2811, 2814, 2819,
2612 2820, 2821, 2822, 2824, 2827, 2831, 2834, 2837, 2847, 2851,
2613 2857, 2863, 2871, 2876, 2882, 2890, 2898, 2899, 2900, 2903,
2614 2902, 2919, 2920, 2922, 2921, 2945, 2964, 2978, 2979, 2981,
2615 2982, 2984, 2985, 2986, 2995, 2996, 3000, 3001, 3003, 3004,
2616 3005, 3007, 3011, 3012, 3017, 3018, 3062, 3112, 3133, 3155,
2617 3158, 3165, 3168, 3171, 3174, 3177, 3180, 3185, 3186, 3188,
2618 3189, 3190, 3191, 3192, 3194, 3200, 3209, 3210, 3211, 3212,
2619 3213, 3214, 3216, 3220, 3232, 3250, 3261, 3271, 3280, 3281,
2620 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291,
2621 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301,
2622 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311,
2623 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321,
2624 3322, 3323, 3324, 3325, 3327, 3328, 3329, 3330, 3332, 3347,
2625 3355, 3355, 3409, 3410, 3411, 3412, 3413, 3421, 3439, 3446,
2626 3457, 3464, 3471, 3481, 3492, 3670, 3706, 3713, 3720, 3727,
2631 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2632 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2633 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2634 static const char *const yytname[] =
2636 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2637 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2638 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2639 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2640 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2641 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2642 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2643 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2644 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2645 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2646 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2647 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2648 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"",
2649 "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"",
2650 "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"",
2651 "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"",
2652 "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"",
2653 "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"",
2654 "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2655 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2656 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2657 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2658 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2659 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2660 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2661 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2662 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2663 "PACKAGE_INITCODE", "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION",
2664 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2665 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2666 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2667 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2668 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2669 "TRY", "$@7", "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE",
2670 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2671 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2672 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2673 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2674 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2675 "SLOT_DECLARATION", "$@12", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT",
2676 "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@13",
2677 "XMLEXPR2", "$@14", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", "XMLNODE",
2678 "MAYBE_XMLATTRIBUTES", "XMLATTRIBUTES", "XMLATTRIBUTE",
2679 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2680 "FUNCTION_DECLARATION", "$@15", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2681 "$@16", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2682 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2683 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2684 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2685 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2686 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@17", "ID_OR_NS", "SUBNODE",
2687 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2688 "DEFAULT_NAMESPACE", "USE_NAMESPACE", 0
2693 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2695 static const yytype_uint16 yytoknum[] =
2697 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2698 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2699 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2700 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2701 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2702 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2703 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2704 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2705 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2706 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2707 355, 59, 44, 356, 61, 63, 58, 124, 94, 38,
2708 357, 60, 62, 358, 45, 43, 47, 42, 37, 126,
2709 33, 359, 360, 361, 40, 362, 91, 93, 123, 46,
2710 64, 363, 364, 365, 125, 41
2714 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2715 static const yytype_uint16 yyr1[] =
2717 0, 136, 137, 138, 138, 139, 139, 140, 140, 140,
2718 140, 140, 140, 140, 140, 141, 141, 142, 142, 143,
2719 143, 143, 143, 143, 143, 143, 144, 144, 145, 145,
2720 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
2721 146, 146, 146, 146, 146, 147, 147, 147, 147, 147,
2722 147, 147, 147, 148, 148, 149, 150, 151, 151, 152,
2723 152, 153, 153, 154, 155, 155, 157, 156, 158, 158,
2724 158, 159, 159, 160, 160, 161, 162, 164, 163, 166,
2725 165, 167, 167, 168, 168, 169, 169, 169, 169, 170,
2726 170, 171, 172, 174, 173, 176, 175, 178, 177, 179,
2727 179, 180, 180, 180, 182, 181, 183, 183, 184, 185,
2728 186, 186, 186, 186, 187, 187, 189, 188, 190, 188,
2729 191, 191, 192, 192, 193, 193, 194, 194, 194, 194,
2730 194, 194, 194, 194, 194, 194, 195, 195, 196, 196,
2731 197, 197, 199, 198, 201, 200, 202, 202, 203, 203,
2732 204, 204, 204, 204, 204, 205, 205, 206, 206, 207,
2733 207, 207, 208, 208, 210, 209, 211, 211, 212, 213,
2734 213, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2735 215, 216, 217, 218, 220, 219, 222, 221, 223, 223,
2736 223, 223, 224, 224, 225, 225, 226, 226, 226, 227,
2737 227, 228, 228, 229, 229, 229, 229, 229, 230, 230,
2738 230, 230, 231, 231, 232, 232, 233, 233, 233, 235,
2739 234, 236, 236, 238, 237, 239, 240, 241, 241, 242,
2740 242, 243, 243, 243, 244, 244, 245, 245, 246, 246,
2741 246, 247, 248, 247, 249, 250, 251, 251, 252, 253,
2742 253, 254, 255, 256, 256, 257, 257, 258, 258, 259,
2743 259, 259, 259, 259, 260, 260, 261, 261, 261, 261,
2744 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2745 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2746 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2747 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2748 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2749 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2750 262, 261, 263, 263, 263, 264, 264, 261, 261, 261,
2751 261, 261, 261, 261, 265, 266, 267, 267, 267, 268,
2755 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2756 static const yytype_uint8 yyr2[] =
2758 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2759 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2760 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2761 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2762 1, 1, 1, 3, 2, 1, 1, 1, 1, 1,
2763 1, 1, 4, 2, 1, 1, 3, 2, 0, 2,
2764 2, 1, 3, 3, 0, 2, 0, 7, 0, 1,
2765 1, 3, 1, 2, 3, 8, 6, 0, 6, 0,
2766 7, 1, 2, 1, 2, 0, 1, 1, 2, 1,
2767 2, 4, 3, 0, 8, 0, 9, 0, 5, 1,
2768 2, 1, 2, 1, 0, 6, 2, 1, 4, 2,
2769 1, 1, 1, 1, 3, 1, 0, 6, 0, 5,
2770 2, 4, 0, 1, 1, 2, 1, 1, 1, 1,
2771 1, 1, 1, 1, 1, 1, 0, 2, 0, 2,
2772 0, 2, 0, 9, 0, 8, 0, 1, 1, 2,
2773 1, 4, 1, 1, 1, 0, 1, 1, 2, 1,
2774 2, 8, 1, 1, 0, 4, 1, 3, 3, 0,
2775 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2776 1, 1, 1, 0, 0, 4, 0, 4, 0, 2,
2777 2, 2, 2, 3, 1, 1, 10, 6, 11, 0,
2778 1, 1, 2, 1, 3, 3, 3, 3, 0, 1,
2779 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2780 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2781 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2782 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2783 2, 1, 1, 1, 3, 1, 3, 0, 1, 1,
2784 1, 1, 1, 1, 3, 5, 1, 1, 1, 1,
2785 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
2786 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2787 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2788 3, 3, 3, 3, 3, 4, 2, 1, 3, 2,
2789 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2790 3, 3, 3, 5, 2, 2, 2, 2, 3, 2,
2791 0, 6, 1, 1, 1, 1, 1, 5, 3, 5,
2792 4, 4, 6, 6, 3, 1, 2, 4, 4, 2,
2796 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2797 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2798 means the default is an error. */
2799 static const yytype_uint16 yydefact[] =
2801 122, 345, 135, 174, 274, 171, 172, 173, 0, 0,
2802 79, 0, 0, 128, 275, 126, 127, 0, 134, 0,
2803 133, 222, 178, 179, 307, 129, 0, 0, 0, 177,
2804 130, 132, 131, 0, 0, 176, 175, 0, 0, 0,
2805 257, 0, 0, 14, 181, 0, 0, 0, 0, 238,
2806 122, 0, 0, 2, 122, 5, 55, 12, 0, 37,
2807 68, 32, 33, 34, 35, 36, 39, 122, 38, 7,
2808 31, 0, 123, 124, 9, 8, 11, 272, 273, 0,
2809 180, 10, 266, 268, 270, 269, 40, 255, 267, 271,
2810 42, 30, 41, 0, 0, 73, 77, 122, 93, 110,
2811 113, 112, 111, 118, 115, 0, 0, 345, 244, 221,
2812 0, 306, 0, 0, 120, 0, 104, 238, 0, 0,
2813 248, 66, 259, 260, 261, 262, 263, 0, 0, 258,
2814 327, 326, 309, 289, 288, 0, 253, 0, 239, 240,
2815 241, 251, 83, 0, 107, 249, 0, 81, 45, 44,
2816 122, 46, 29, 0, 47, 48, 49, 51, 0, 50,
2817 329, 1, 6, 122, 345, 0, 69, 0, 0, 70,
2818 54, 109, 0, 218, 0, 163, 0, 162, 164, 349,
2819 125, 194, 0, 195, 199, 0, 0, 0, 0, 0,
2820 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2821 0, 0, 0, 0, 0, 0, 0, 0, 0, 325,
2822 324, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2823 0, 0, 0, 0, 0, 0, 0, 238, 0, 0,
2824 56, 74, 0, 0, 0, 122, 116, 0, 225, 0,
2825 228, 227, 351, 236, 208, 0, 252, 0, 0, 27,
2826 0, 328, 0, 0, 277, 0, 0, 0, 308, 276,
2827 242, 243, 84, 235, 60, 61, 106, 250, 59, 82,
2828 43, 28, 122, 0, 235, 0, 0, 53, 346, 217,
2829 216, 0, 136, 138, 0, 186, 0, 203, 0, 200,
2830 201, 256, 303, 304, 301, 302, 282, 283, 285, 284,
2831 280, 281, 317, 316, 312, 311, 319, 320, 321, 318,
2832 314, 313, 315, 286, 287, 336, 0, 335, 338, 295,
2833 294, 293, 322, 0, 292, 291, 290, 278, 279, 299,
2834 298, 296, 300, 297, 0, 0, 110, 113, 336, 330,
2835 0, 0, 0, 344, 0, 0, 0, 25, 0, 122,
2836 17, 23, 0, 20, 19, 22, 21, 122, 114, 0,
2837 238, 245, 169, 0, 0, 209, 213, 108, 121, 226,
2838 305, 0, 26, 247, 350, 0, 264, 0, 254, 0,
2839 58, 0, 122, 13, 58, 0, 0, 0, 0, 0,
2840 140, 0, 0, 235, 165, 166, 0, 0, 0, 182,
2841 183, 188, 202, 0, 341, 0, 246, 310, 0, 0,
2842 0, 340, 0, 122, 0, 0, 119, 18, 122, 0,
2843 0, 0, 0, 215, 210, 235, 0, 0, 122, 0,
2844 233, 232, 231, 234, 0, 63, 62, 52, 0, 122,
2845 347, 348, 208, 137, 0, 0, 229, 139, 144, 58,
2846 0, 187, 207, 206, 204, 205, 0, 0, 0, 323,
2847 0, 339, 0, 337, 78, 0, 85, 0, 117, 237,
2848 170, 169, 0, 0, 212, 0, 0, 99, 103, 101,
2849 105, 64, 265, 57, 0, 76, 0, 141, 142, 0,
2850 122, 168, 167, 197, 190, 181, 191, 0, 189, 0,
2851 188, 343, 331, 342, 80, 0, 0, 0, 86, 89,
2852 87, 24, 214, 223, 211, 97, 0, 100, 102, 122,
2853 67, 122, 235, 122, 230, 0, 159, 0, 0, 122,
2854 157, 0, 184, 181, 188, 192, 0, 27, 94, 90,
2855 88, 27, 27, 235, 65, 75, 0, 150, 154, 0,
2856 0, 0, 122, 148, 152, 153, 160, 218, 145, 158,
2857 183, 0, 0, 193, 27, 92, 0, 0, 0, 219,
2858 122, 143, 149, 0, 0, 185, 183, 91, 224, 98,
2859 95, 27, 0, 0, 196, 0, 0, 0, 151, 208,
2860 198, 27, 220, 0, 0, 235, 96, 161
2863 /* YYDEFGOTO[NTERM-NUM]. */
2864 static const yytype_int16 yydefgoto[] =
2866 -1, 52, 53, 54, 55, 348, 349, 350, 371, 372,
2867 151, 152, 171, 351, 153, 435, 154, 268, 265, 520,
2868 59, 253, 167, 168, 60, 61, 62, 63, 232, 64,
2869 97, 155, 156, 507, 508, 509, 510, 65, 234, 477,
2870 586, 478, 542, 479, 480, 66, 249, 157, 67, 68,
2871 238, 239, 69, 357, 235, 70, 158, 72, 73, 390,
2872 392, 445, 353, 523, 354, 490, 551, 552, 553, 528,
2873 529, 530, 178, 355, 284, 394, 395, 423, 77, 78,
2874 79, 401, 456, 498, 561, 183, 396, 457, 499, 184,
2875 80, 288, 289, 290, 364, 365, 366, 281, 356, 581,
2876 110, 82, 541, 240, 241, 432, 447, 433, 380, 361,
2877 137, 138, 139, 243, 83, 84, 85, 159, 140, 245,
2878 246, 86, 127, 128, 129, 87, 408, 342, 318, 88,
2882 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2884 #define YYPACT_NINF -494
2885 static const yytype_int16 yypact[] =
2887 1763, -21, -494, -494, -494, -494, -494, -494, -29, -45,
2888 -494, -36, 68, -494, -494, -494, -494, 75, -494, 2217,
2889 -494, 91, -494, -494, 438, -494, -15, 316, -5, -494,
2890 -494, -494, -494, 7, -37, -494, -494, 107, 2217, 24,
2891 367, 2217, 2217, -494, -494, 2217, 2217, 2217, 2217, 2217,
2892 707, 127, 139, -494, 575, -494, -494, -494, 23, -494,
2893 2145, -494, -494, -494, -494, -494, -494, 2019, -494, -494,
2894 -494, 488, 431, -494, -494, -494, -494, -494, -494, 17,
2895 -494, -494, -494, -494, -494, -494, 57, 2920, -494, -494,
2896 -494, -494, -494, 155, 36, -494, -494, 2019, -494, -494,
2897 -494, -494, -494, -494, -494, 28, 316, -494, -48, -494,
2898 47, 213, 2217, 69, -494, 2217, -494, 2217, 194, 116,
2899 213, -494, -494, -494, -494, -494, -494, 92, 121, 132,
2900 213, 213, 379, 213, 213, -42, 2858, 114, 146, 2217,
2901 -494, 2858, 246, 247, 2217, 2217, 247, 249, -494, -494,
2902 839, -494, -494, 125, -494, -494, -494, -494, 248, -494,
2903 -494, -494, -494, 1103, 197, 264, -494, 168, 203, 57,
2904 173, -494, 274, 66, 276, -494, 278, -494, -494, -494,
2905 -494, -494, 2217, -494, 21, 2217, 2217, 2217, 2217, 2217,
2906 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2907 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, -494,
2908 -494, 138, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217,
2909 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 2217, 130,
2910 -494, -494, 2217, 273, 2217, 1235, -494, 316, 158, 160,
2911 -494, -494, -494, 167, 15, 157, 192, 229, 2276, 1891,
2912 165, -494, 2217, 2217, -494, 2217, 367, 2217, -494, -494,
2913 -494, -494, -494, 207, 212, -494, -494, -494, 212, -494,
2914 -494, -494, 2019, 181, 207, 2217, 2217, -494, 217, -494,
2915 -494, 314, 262, 269, 315, 2858, 220, 221, 6, 21,
2916 -494, 2858, 1095, 567, 567, 567, 3292, 3292, 3292, 3292,
2917 1095, 1095, 2858, 2858, 2858, 2858, 2858, 2858, 2858, 2858,
2918 2858, 2858, 2858, 2982, 3044, -494, 214, -494, -494, 313,
2919 313, 313, 2858, 2486, 3106, 3168, 3230, 1095, 1095, 379,
2920 379, 213, 213, 213, 199, 2548, 238, 244, 245, -494,
2921 2217, 267, 254, -494, 226, 224, 2346, -494, 228, 1367,
2922 -494, -494, 235, -494, -494, -494, -494, 1235, -494, 316,
2923 2217, -494, -55, 363, 232, 280, -494, -494, -494, 240,
2924 -494, 237, 1891, -494, 2858, 243, -494, 277, 2858, 292,
2925 281, 247, 971, -494, -6, 279, 252, 135, 270, 316,
2926 376, 316, 268, 207, 296, -494, 265, 22, 34, -494,
2927 -494, -494, -494, 2217, -494, 2217, -494, -494, 2217, 2610,
2928 2217, -494, 294, 2019, 2217, 272, -494, -494, 1235, 283,
2929 275, 2217, 292, -494, -494, 207, 19, 78, 2019, 2217,
2930 -494, -494, -494, -494, 2217, -494, -494, -494, 2217, 2019,
2931 -494, -494, 15, -494, 316, 284, -494, 300, -494, 281,
2932 315, -494, -494, -494, -494, -494, 291, 253, 2672, 2858,
2933 2416, -494, 2734, -494, -494, 287, 46, 289, -494, -494,
2934 2858, 309, 286, 363, -494, 297, 312, -494, -494, 78,
2935 -494, 338, -494, 2858, -38, -494, 298, 300, -494, 316,
2936 27, -494, -494, -494, -494, 299, -494, 2217, -494, 327,
2937 -494, -494, -494, -494, -494, 2217, 318, 306, 46, -494,
2938 -494, -494, -494, -494, -494, -494, 442, -494, -494, 2019,
2939 -494, 2019, 207, 1499, -494, 447, -494, 427, 321, 255,
2940 -494, 17, 2858, 342, -494, 25, 2796, 1891, -494, -494,
2941 -494, 1891, 1891, 207, -494, -494, 332, -494, -494, 335,
2942 328, 331, 1631, -494, -494, -494, -494, 66, -494, -494,
2943 -494, 334, 17, 25, 1891, -494, 336, 340, 341, -494,
2944 1499, -494, -494, 472, 365, -494, -494, -494, -494, -494,
2945 -494, 1891, 347, 358, -494, 373, 359, 352, -494, 15,
2946 -494, 1891, -494, 353, 355, 207, -494, -494
2949 /* YYPGOTO[NTERM-NUM]. */
2950 static const yytype_int16 yypgoto[] =
2952 -494, -494, 337, -494, 444, -315, -494, 150, -475, -34,
2953 1, -60, -87, 53, 2, 52, 446, 364, 129, -494,
2954 -494, -494, -494, -494, -494, -494, -494, -494, -494, -494,
2955 -494, -494, -494, -494, -494, 5, 8, -494, -494, 32,
2956 -494, 33, -494, -494, -494, -494, -494, -494, -494, -494,
2957 14, 56, -494, -494, -494, -494, 0, -494, 430, -494,
2958 -494, -494, 59, -494, 61, -494, -53, -494, -31, -494,
2959 -494, -14, -494, 3, -494, -494, 72, 62, -494, -494,
2960 -494, -494, -464, -494, -494, -169, -494, -457, -494, -493,
2961 -413, -494, -494, 239, -419, -494, -344, -39, 4, -494,
2962 -494, -494, -494, -494, 508, -101, 93, 117, -257, -494,
2963 -103, -494, -494, -494, -494, -494, -494, -494, -130, -132,
2964 490, -52, -494, 285, -494, -13, -494, -494, -189, -494,
2965 -494, -494, -494, -494, -494
2968 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2969 positive, shift that token. If negative, reduce the rule which
2970 number is the opposite. If zero, do what YYDEFACT says.
2971 If YYTABLE_NINF, syntax error. */
2972 #define YYTABLE_NINF -335
2973 static const yytype_int16 yytable[] =
2975 71, 56, 58, 76, 81, 242, 108, 170, 169, 261,
2976 233, 111, 266, 267, 250, 287, 150, 384, 362, 424,
2977 181, 94, 362, 486, 286, 120, 104, 452, 130, 131,
2978 494, 2, 132, 133, 134, 136, 141, 170, 560, 454,
2979 343, 104, 419, 535, 500, 13, 211, 15, 16, 421,
2980 18, 422, 20, 57, 71, 56, 58, 76, 81, 74,
2981 257, 75, 565, -71, 185, 25, 566, 567, 105, 576,
2982 93, 99, 100, 525, 30, 31, 32, 563, 228, 96,
2983 505, 229, 474, 113, 101, 102, 534, 117, 98, 577,
2984 271, 106, 118, 258, 109, 95, 574, 521, 434, 136,
2985 344, 279, 248, 467, 141, 475, 587, 57, 506, 112,
2986 363, 476, 585, 74, 473, 75, 594, 280, 399, 115,
2987 287, 375, 400, 119, 334, 376, 141, 404, 526, 514,
2988 160, 136, 136, 336, 337, 116, 449, 496, 440, 161,
2989 441, 99, 100, 385, 386, 182, 101, 102, 121, 182,
2990 182, 163, 411, 497, 101, 102, 236, 237, 230, 185,
2991 231, -155, 182, 71, 56, 58, 76, 81, 472, 285,
2992 593, 244, 291, 292, 293, 294, 295, 296, 297, 298,
2993 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
2994 309, 310, 311, 312, 313, 314, 103, 251, 247, 319,
2995 320, 321, 322, 323, 324, 325, 326, 327, 328, 329,
2996 330, 331, 332, 333, 141, 335, 57, 99, 100, 136,
2997 252, 346, 74, 463, 75, 317, 254, 255, 453, 455,
2998 101, 102, 99, 100, 256, 71, 56, 352, 382, 374,
2999 136, 259, 141, 317, 378, 101, 102, 338, 260, 262,
3000 263, 358, 269, 272, 339, 315, 340, 420, 494, 2,
3001 341, 369, 136, 136, 172, 546, -72, 274, 316, 275,
3002 99, 100, 276, 13, 277, 15, 16, 278, 18, 282,
3003 20, 283, 465, 101, 102, 345, 568, -115, 443, 359,
3004 446, 360, 367, 25, 257, 99, 100, 99, 100, 482,
3005 373, 525, 30, 31, 32, 209, 210, 211, 101, 102,
3006 101, 102, 271, 379, 381, 383, 389, 388, 393, 99,
3007 100, 387, 271, 391, 397, 398, 464, 409, 430, -332,
3008 317, 315, 101, 102, 406, -334, -333, 227, 597, 228,
3009 403, 481, 229, 446, 172, 412, 368, 141, 414, 71,
3010 56, 352, 485, 170, 173, 317, 526, 71, 56, 352,
3011 175, 413, 416, 418, 495, 496, 362, 425, 170, -114,
3012 122, 427, 123, 369, 177, 124, 125, 126, 428, 170,
3013 438, 497, 426, 429, 315, 434, 484, 439, 524, -156,
3014 458, 444, 459, 410, 442, 460, 448, 462, 450, 451,
3015 466, 136, 489, 493, 519, 209, 210, 211, 470, 431,
3016 469, 315, 488, 421, 513, 531, 141, 468, 71, 56,
3017 352, 483, 504, 511, 537, 515, 317, 222, 223, 224,
3018 225, 226, 544, 522, 545, 2, 516, 227, 533, 228,
3019 538, 107, 229, 3, 4, 543, 5, 6, 7, 13,
3020 556, 15, 16, 557, 18, 558, 20, 14, 562, 170,
3021 569, 170, 19, 570, 21, 571, 22, 23, 575, 25,
3022 578, 209, 210, 211, 579, 583, 580, 584, 30, 31,
3023 32, 588, 589, 29, 532, 590, 592, 591, 595, 596,
3024 527, 34, 536, 35, 36, 224, 225, 226, 162, 417,
3025 273, 491, 180, 227, 172, 228, 166, 264, 229, 40,
3026 436, 517, 518, 539, 173, 559, 540, 582, 573, 174,
3027 175, 572, 492, 550, 548, 549, 554, 555, 402, 527,
3028 41, 42, 176, 512, 177, 114, 0, 487, 135, 471,
3029 0, 377, 0, 0, 0, 0, 0, 0, 0, 0,
3030 0, 0, 550, 548, 549, 554, 555, 0, 0, 0,
3031 0, 0, 48, 0, 49, 0, 0, 0, 51, 0,
3032 550, 548, 549, 554, 555, -4, 0, 0, 1, 2,
3033 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3034 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
3035 20, 0, 0, 22, 23, 0, 0, 186, 0, 0,
3036 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3037 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3038 35, 36, 0, 0, 0, -335, -335, -335, 37, 38,
3039 39, 0, 0, 194, 195, 0, 40, 0, 0, 0,
3040 0, 0, 0, 0, 0, 0, 0, 0, 0, 209,
3041 210, 211, 0, 212, 213, 214, 0, 41, 42, 0,
3042 0, 0, 0, 0, 0, 0, 43, 0, 220, 221,
3043 0, 222, 223, 224, 225, 226, 44, 0, 0, 45,
3044 0, 227, 0, 228, 46, 47, 229, 0, 0, 48,
3045 0, 49, 0, 50, 0, 51, 0, 0, 0, -4,
3046 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3047 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3048 18, 19, 20, 21, 0, 22, 23, 142, 0, 143,
3049 0, 0, 0, 24, 144, 25, 26, 0, 27, 145,
3050 28, 0, 29, 146, 30, 31, 32, 0, 0, 33,
3051 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3052 37, 38, 39, 0, 147, 0, 0, 0, 40, 0,
3053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3054 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3055 42, 0, 0, 0, 0, 0, 0, 0, 148, 0,
3056 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3057 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3058 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3059 0, 149, 1, 2, 3, 4, 0, 5, 6, 7,
3060 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3061 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3062 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3063 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3064 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3065 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3066 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3067 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3068 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3069 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3070 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3071 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3072 0, 0, 0, 270, 1, 2, 3, 4, 0, 5,
3073 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3074 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3075 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3076 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3077 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3078 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3079 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3080 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3081 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3082 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3083 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3084 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3085 0, 51, 0, 0, 0, 437, 1, 2, 3, 4,
3086 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3087 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3088 0, 22, 23, 0, 0, -335, 0, 0, 0, 24,
3089 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3090 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3091 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3092 0, -335, -335, 0, 40, 0, 0, 0, 0, 0,
3093 0, 0, 0, 0, 0, 0, 0, 209, 210, 211,
3094 0, 212, 213, 214, 0, 41, 42, 0, 0, 0,
3095 0, 0, 0, 0, 43, 0, -335, -335, 0, 222,
3096 223, 224, 225, 226, 44, 0, 0, 45, 0, 227,
3097 0, 228, 46, 47, 229, 0, 0, 48, 0, 49,
3098 0, 50, 0, 51, 0, 0, 0, -3, 1, 2,
3099 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3100 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3101 20, 0, 0, 22, 23, 0, 0, 0, 0, 0,
3102 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3103 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3104 35, 36, 0, 0, 0, 0, 0, 0, 37, 38,
3105 39, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3107 0, 0, 0, 0, 0, 0, 0, 41, 42, 0,
3108 0, 0, 0, 0, 0, 0, 347, 0, 0, 0,
3109 0, 0, 0, 0, 0, 0, 44, 0, 0, 45,
3110 0, 0, 0, 0, 46, 47, 0, 0, 0, 48,
3111 0, 49, 0, 50, 0, 51, 0, 0, 0, -15,
3112 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3113 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3114 18, 19, 20, 0, 0, 22, 23, 0, 0, 0,
3115 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
3116 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
3117 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3118 37, 38, 39, 0, 0, 0, 0, 0, 40, 0,
3119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3120 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3121 42, 0, 0, 0, 0, 0, 0, 0, 347, 0,
3122 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3123 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3124 0, 48, 0, 49, 0, 50, 0, 51, 0, 0,
3125 0, -16, 1, 2, 3, 4, 0, 5, 6, 7,
3126 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3127 16, 17, 18, 19, 20, 0, 0, 22, 23, 0,
3128 0, 0, 0, 0, 0, 24, 0, 25, 26, 0,
3129 27, 0, 28, 0, 29, 0, 30, 31, 32, 0,
3130 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3131 0, 0, 37, 38, 39, 0, 0, 0, 0, 0,
3132 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3133 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3134 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3135 547, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3136 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3137 0, 0, 0, 48, 0, 49, 0, 50, 0, 51,
3138 0, 0, 0, -146, 1, 2, 3, 4, 0, 5,
3139 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3140 14, 15, 16, 17, 18, 19, 20, 0, 0, 22,
3141 23, 0, 0, 0, 0, 0, 0, 24, 0, 25,
3142 26, 0, 27, 0, 28, 0, 29, 0, 30, 31,
3143 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3144 0, 0, 0, 0, 37, 38, 39, 0, 0, 0,
3145 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3147 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3148 0, 0, 547, 0, 0, 0, 0, 0, 0, 0,
3149 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3150 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3151 0, 51, 0, -3, 0, -147, 1, 2, 3, 4,
3152 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3153 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3154 0, 22, 23, 0, 0, 0, 0, 0, 0, 24,
3155 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3156 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3157 0, 0, 0, 0, 0, 0, 37, 38, 39, 0,
3158 0, 0, 0, 0, 40, 0, 0, 0, 0, 0,
3159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3160 0, 0, 0, 0, 0, 41, 42, 0, 0, 0,
3161 0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
3162 0, 0, 0, 0, 44, 0, 0, 45, 0, 0,
3163 0, 0, 46, 47, 0, 0, 0, 48, 0, 49,
3164 0, 50, 0, 51, 1, 2, 3, 4, 0, 5,
3165 6, 7, 8, 9, 10, 11, 0, -122, 0, 13,
3166 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3167 23, 142, 0, 143, 0, 0, 0, 24, 144, 25,
3168 26, 0, 27, 145, 28, 0, 29, 146, 30, 31,
3169 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3170 0, 0, 0, 0, 37, 38, 39, 0, 147, 0,
3171 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
3172 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3173 0, 0, 0, 41, 42, 0, 0, 0, 0, 0,
3174 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
3175 0, 0, 44, 0, 0, 45, 0, 0, 0, 0,
3176 46, 47, 0, 0, 0, 48, 0, 49, 0, 50,
3177 0, 51, 1, 2, 3, 4, 0, 5, 6, 7,
3178 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3179 16, 17, 18, 19, 20, 21, 0, 22, 23, 142,
3180 0, 143, 0, 0, 0, 24, 144, 25, 26, 0,
3181 27, 145, 28, 0, 29, 146, 30, 31, 32, 0,
3182 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3183 0, 0, 37, 38, 39, 0, 147, 0, 0, 0,
3184 40, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3185 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3186 0, 41, 42, 0, 0, 0, 0, 0, 0, 0,
3187 148, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3188 44, 0, 0, 45, 0, 0, 0, 0, 46, 47,
3189 0, 0, 0, 48, 0, 49, 0, 50, 164, 51,
3190 3, 4, 0, 5, 6, 7, 0, 0, 0, 0,
3191 0, 0, 0, 0, 14, 0, 0, 0, 0, 19,
3192 0, 21, 0, 22, 23, 0, 0, 143, 0, 0,
3193 0, 24, 0, 0, 0, 0, 0, 0, 28, 0,
3194 29, 165, 0, 0, 0, 0, 0, 0, 34, 0,
3195 35, 36, 0, 0, 0, 0, 0, 0, 0, 38,
3196 0, 0, 0, 0, 0, 0, 40, 0, 0, 0,
3197 107, 0, 3, 4, 0, 5, 6, 7, 0, 0,
3198 0, 0, 0, 0, 0, 0, 14, 41, 42, 0,
3199 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3200 0, 0, 0, 24, 0, 0, 44, 0, 0, 45,
3201 28, 0, 29, 0, 46, 47, 0, 0, 0, 48,
3202 34, 49, 35, 36, 0, 51, 0, 0, 0, 0,
3203 0, 38, 0, 0, 0, 0, 0, 0, 40, 0,
3204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3205 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3206 42, 0, 0, 0, 0, 0, 186, 0, 0, 0,
3207 0, 0, 0, 0, 0, 0, 0, 0, 44, 0,
3208 0, 45, 0, 0, 0, 0, 46, 47, 0, 0,
3209 0, 48, 0, 49, 187, 188, 189, 51, 190, 191,
3210 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3211 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3212 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3213 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3214 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3215 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3216 0, 370, 0, 0, 187, 188, 189, 0, 190, 191,
3217 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3218 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3219 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3220 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3221 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3222 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3223 0, 415, 0, 0, 187, 188, 189, 0, 190, 191,
3224 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3225 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3226 211, 0, 212, 213, 214, 0, 0, 0, 0, 0,
3227 215, 216, 0, 217, 218, 219, 186, 220, 221, 0,
3228 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3229 227, 0, 228, 0, 0, 229, 0, 0, 0, 0,
3230 0, 502, 0, 0, 187, 188, 189, 0, 190, 191,
3231 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3232 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3233 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3234 215, 216, 405, 217, 218, 219, 0, 220, 221, 0,
3235 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3236 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3237 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3238 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3239 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3240 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3241 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3242 0, 0, 227, 0, 228, 407, 0, 229, 187, 188,
3243 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3244 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3245 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3246 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3247 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3248 0, 0, 0, 0, 227, 0, 228, 461, 0, 229,
3249 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3250 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
3251 206, 207, 208, 0, 209, 210, 211, 0, 212, 213,
3252 214, 0, 0, 0, 186, 0, 215, 216, 0, 217,
3253 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3254 226, 0, 0, 0, 0, 0, 227, 0, 228, 501,
3255 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3256 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3257 204, 205, 206, 207, 208, 0, 209, 210, 211, 0,
3258 212, 213, 214, 0, 0, 0, 186, 0, 215, 216,
3259 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3260 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3261 228, 503, 0, 229, 187, 188, 189, 0, 190, 191,
3262 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3263 202, 203, 204, 205, 206, 207, 208, 0, 209, 210,
3264 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3265 215, 216, 564, 217, 218, 219, 0, 220, 221, 0,
3266 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3267 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3268 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3269 200, 201, 202, 203, 204, 205, 206, 207, 208, 0,
3270 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3271 186, 0, 215, 216, 0, 217, 218, 219, 0, 220,
3272 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3273 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3274 189, 0, 190, 191, 192, 193, 194, 195, 196, 197,
3275 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
3276 208, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3277 0, 0, 186, 0, 215, 216, 0, 217, 218, 219,
3278 0, 0, 221, 0, 222, 223, 224, 225, 226, 0,
3279 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3280 187, 188, 189, 0, 190, 191, 192, 193, 194, 195,
3281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3282 0, 0, 208, 0, 209, 210, 211, 0, 212, 213,
3283 214, 0, 0, 0, 186, 0, 0, 0, 0, 217,
3284 218, 219, 0, 220, 221, 0, 222, 223, 224, 225,
3285 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3286 0, 229, 187, 188, 189, 0, 190, 191, 192, 193,
3287 194, 195, 0, 0, 0, 0, 0, 0, 0, 0,
3288 0, 0, 0, 0, 0, 0, 209, 210, 211, 0,
3289 212, 213, 214, 0, 0, 0, 186, 0, 0, 0,
3290 0, 217, 218, 219, 0, 220, 221, 0, 222, 223,
3291 224, 225, 226, 0, 0, 0, 0, 0, 227, 0,
3292 228, 0, 0, 229, 187, 188, 189, 0, 190, 191,
3293 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
3294 0, 0, 0, 0, 0, 0, 0, 0, 209, 210,
3295 211, 0, 212, 213, 214, 0, 0, 0, 186, 0,
3296 0, 0, 0, 0, 218, 219, 0, 220, 221, 0,
3297 222, 223, 224, 225, 226, 0, 0, 0, 0, 0,
3298 227, 0, 228, 0, 0, 229, 187, 188, 189, 0,
3299 190, 191, 192, 193, 194, 195, 0, 0, 0, 0,
3300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3301 209, 210, 211, 0, 212, 213, 214, 0, 0, 0,
3302 186, 0, 0, 0, 0, 0, 0, 219, 0, 220,
3303 221, 0, 222, 223, 224, 225, 226, 0, 0, 0,
3304 0, 0, 227, 0, 228, 0, 0, 229, 187, 188,
3305 189, 0, 190, 191, 192, 193, 194, 195, 0, 0,
3306 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3307 0, 0, 209, 210, 211, 0, 212, 213, 214, 0,
3308 0, 0, 186, 0, 0, 0, 0, 0, 0, -335,
3309 0, 220, 221, 0, 222, 223, 224, 225, 226, 0,
3310 0, 0, 0, 0, 227, 0, 228, 0, 0, 229,
3311 187, 188, 189, 0, -335, -335, -335, -335, 194, 195,
3312 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3313 0, 0, 0, 0, 209, 210, 211, 0, 212, 213,
3314 214, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3315 0, 0, 0, 220, 221, 0, 222, 223, 224, 225,
3316 226, 0, 0, 0, 0, 0, 227, 0, 228, 0,
3320 static const yytype_int16 yycheck[] =
3322 0, 0, 0, 0, 0, 106, 19, 67, 60, 139,
3323 97, 24, 144, 145, 117, 184, 50, 274, 3, 363,
3324 3, 50, 3, 442, 3, 38, 12, 5, 41, 42,
3325 5, 4, 45, 46, 47, 48, 49, 97, 531, 5,
3326 229, 27, 357, 500, 457, 18, 94, 20, 21, 104,
3327 23, 106, 25, 0, 54, 54, 54, 54, 54, 0,
3328 102, 0, 537, 69, 102, 38, 541, 542, 12, 562,
3329 91, 3, 4, 46, 47, 48, 49, 534, 126, 124,
3330 34, 129, 426, 27, 16, 17, 499, 124, 124, 564,
3331 150, 16, 129, 135, 3, 124, 560, 135, 104, 112,
3332 232, 35, 115, 418, 117, 27, 581, 54, 62, 124,
3333 95, 33, 576, 54, 95, 54, 591, 51, 112, 124,
3334 289, 253, 116, 16, 227, 255, 139, 316, 101, 473,
3335 3, 144, 145, 3, 4, 128, 393, 112, 3, 0,
3336 5, 3, 4, 275, 276, 128, 16, 17, 124, 128,
3337 128, 128, 341, 128, 16, 17, 128, 129, 3, 102,
3338 124, 134, 128, 163, 163, 163, 163, 163, 425, 182,
3339 589, 124, 185, 186, 187, 188, 189, 190, 191, 192,
3340 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3341 203, 204, 205, 206, 207, 208, 128, 3, 129, 212,
3342 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
3343 223, 224, 225, 226, 227, 228, 163, 3, 4, 232,
3344 104, 234, 163, 412, 163, 211, 134, 106, 397, 398,
3345 16, 17, 3, 4, 102, 235, 235, 235, 272, 252,
3346 253, 127, 255, 229, 257, 16, 17, 117, 102, 3,
3347 3, 237, 3, 128, 124, 117, 126, 360, 5, 4,
3348 130, 247, 275, 276, 16, 522, 69, 3, 130, 101,
3349 3, 4, 69, 18, 101, 20, 21, 3, 23, 3,
3350 25, 3, 414, 16, 17, 12, 543, 129, 389, 129,
3351 391, 124, 135, 38, 102, 3, 4, 3, 4, 429,
3352 135, 46, 47, 48, 49, 92, 93, 94, 16, 17,
3353 16, 17, 372, 106, 102, 134, 54, 3, 3, 3,
3354 4, 104, 382, 54, 104, 104, 413, 340, 36, 91,
3355 316, 117, 16, 17, 135, 91, 91, 124, 595, 126,
3356 126, 428, 129, 444, 16, 91, 117, 360, 124, 349,
3357 349, 349, 439, 413, 26, 341, 101, 357, 357, 357,
3358 32, 135, 134, 128, 111, 112, 3, 135, 428, 129,
3359 3, 134, 5, 359, 46, 8, 9, 10, 135, 439,
3360 101, 128, 102, 106, 117, 104, 438, 135, 489, 134,
3361 403, 15, 405, 126, 124, 408, 128, 410, 102, 134,
3362 128, 414, 102, 112, 66, 92, 93, 94, 421, 117,
3363 135, 117, 128, 104, 128, 116, 429, 134, 418, 418,
3364 418, 434, 135, 134, 106, 128, 412, 114, 115, 116,
3365 117, 118, 519, 135, 521, 4, 124, 124, 111, 126,
3366 134, 3, 129, 5, 6, 3, 8, 9, 10, 18,
3367 3, 20, 21, 26, 23, 134, 25, 19, 116, 519,
3368 128, 521, 24, 128, 26, 134, 28, 29, 134, 38,
3369 134, 92, 93, 94, 134, 3, 135, 112, 47, 48,
3370 49, 134, 124, 45, 497, 112, 134, 128, 135, 134,
3371 490, 53, 505, 55, 56, 116, 117, 118, 54, 349,
3372 163, 449, 72, 124, 16, 126, 60, 143, 129, 71,
3373 381, 479, 479, 508, 26, 529, 508, 570, 557, 31,
3374 32, 552, 450, 523, 523, 523, 523, 523, 289, 529,
3375 92, 93, 44, 471, 46, 27, -1, 444, 48, 422,
3376 -1, 256, -1, -1, -1, -1, -1, -1, -1, -1,
3377 -1, -1, 552, 552, 552, 552, 552, -1, -1, -1,
3378 -1, -1, 124, -1, 126, -1, -1, -1, 130, -1,
3379 570, 570, 570, 570, 570, 0, -1, -1, 3, 4,
3380 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3381 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
3382 25, -1, -1, 28, 29, -1, -1, 40, -1, -1,
3383 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3384 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3385 55, 56, -1, -1, -1, 68, 69, 70, 63, 64,
3386 65, -1, -1, 76, 77, -1, 71, -1, -1, -1,
3387 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3388 93, 94, -1, 96, 97, 98, -1, 92, 93, -1,
3389 -1, -1, -1, -1, -1, -1, 101, -1, 111, 112,
3390 -1, 114, 115, 116, 117, 118, 111, -1, -1, 114,
3391 -1, 124, -1, 126, 119, 120, 129, -1, -1, 124,
3392 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3393 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3394 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3395 23, 24, 25, 26, -1, 28, 29, 30, -1, 32,
3396 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
3397 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
3398 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3399 63, 64, 65, -1, 67, -1, -1, -1, 71, -1,
3400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3401 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3402 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3403 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3404 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3405 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3406 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3407 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3408 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3409 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3410 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3411 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3412 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3413 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3415 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3416 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3417 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3418 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3419 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3420 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3421 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3422 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3423 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3424 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3425 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3426 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3427 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3428 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3429 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3430 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3431 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3432 -1, 130, -1, -1, -1, 134, 3, 4, 5, 6,
3433 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3434 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3435 -1, 28, 29, -1, -1, 40, -1, -1, -1, 36,
3436 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3437 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3438 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3439 -1, 76, 77, -1, 71, -1, -1, -1, -1, -1,
3440 -1, -1, -1, -1, -1, -1, -1, 92, 93, 94,
3441 -1, 96, 97, 98, -1, 92, 93, -1, -1, -1,
3442 -1, -1, -1, -1, 101, -1, 111, 112, -1, 114,
3443 115, 116, 117, 118, 111, -1, -1, 114, -1, 124,
3444 -1, 126, 119, 120, 129, -1, -1, 124, -1, 126,
3445 -1, 128, -1, 130, -1, -1, -1, 134, 3, 4,
3446 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3447 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3448 25, -1, -1, 28, 29, -1, -1, -1, -1, -1,
3449 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3450 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3451 55, 56, -1, -1, -1, -1, -1, -1, 63, 64,
3452 65, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3453 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3454 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
3455 -1, -1, -1, -1, -1, -1, 101, -1, -1, -1,
3456 -1, -1, -1, -1, -1, -1, 111, -1, -1, 114,
3457 -1, -1, -1, -1, 119, 120, -1, -1, -1, 124,
3458 -1, 126, -1, 128, -1, 130, -1, -1, -1, 134,
3459 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3460 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3461 23, 24, 25, -1, -1, 28, 29, -1, -1, -1,
3462 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3463 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3464 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3465 63, 64, 65, -1, -1, -1, -1, -1, 71, -1,
3466 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3467 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3468 93, -1, -1, -1, -1, -1, -1, -1, 101, -1,
3469 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3470 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3471 -1, 124, -1, 126, -1, 128, -1, 130, -1, -1,
3472 -1, 134, 3, 4, 5, 6, -1, 8, 9, 10,
3473 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3474 21, 22, 23, 24, 25, -1, -1, 28, 29, -1,
3475 -1, -1, -1, -1, -1, 36, -1, 38, 39, -1,
3476 41, -1, 43, -1, 45, -1, 47, 48, 49, -1,
3477 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3478 -1, -1, 63, 64, 65, -1, -1, -1, -1, -1,
3479 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3480 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3481 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3482 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3483 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3484 -1, -1, -1, 124, -1, 126, -1, 128, -1, 130,
3485 -1, -1, -1, 134, 3, 4, 5, 6, -1, 8,
3486 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3487 19, 20, 21, 22, 23, 24, 25, -1, -1, 28,
3488 29, -1, -1, -1, -1, -1, -1, 36, -1, 38,
3489 39, -1, 41, -1, 43, -1, 45, -1, 47, 48,
3490 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3491 -1, -1, -1, -1, 63, 64, 65, -1, -1, -1,
3492 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3493 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3494 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3495 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3496 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3497 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3498 -1, 130, -1, 0, -1, 134, 3, 4, 5, 6,
3499 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3500 17, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3501 -1, 28, 29, -1, -1, -1, -1, -1, -1, 36,
3502 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3503 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3504 -1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
3505 -1, -1, -1, -1, 71, -1, -1, -1, -1, -1,
3506 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3507 -1, -1, -1, -1, -1, 92, 93, -1, -1, -1,
3508 -1, -1, -1, -1, 101, -1, -1, -1, -1, -1,
3509 -1, -1, -1, -1, 111, -1, -1, 114, -1, -1,
3510 -1, -1, 119, 120, -1, -1, -1, 124, -1, 126,
3511 -1, 128, -1, 130, 3, 4, 5, 6, -1, 8,
3512 9, 10, 11, 12, 13, 14, -1, 16, -1, 18,
3513 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3514 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3515 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3516 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3517 -1, -1, -1, -1, 63, 64, 65, -1, 67, -1,
3518 -1, -1, 71, -1, -1, -1, -1, -1, -1, -1,
3519 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3520 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
3521 -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
3522 -1, -1, 111, -1, -1, 114, -1, -1, -1, -1,
3523 119, 120, -1, -1, -1, 124, -1, 126, -1, 128,
3524 -1, 130, 3, 4, 5, 6, -1, 8, 9, 10,
3525 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3526 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3527 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3528 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3529 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3530 -1, -1, 63, 64, 65, -1, 67, -1, -1, -1,
3531 71, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3532 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3533 -1, 92, 93, -1, -1, -1, -1, -1, -1, -1,
3534 101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3535 111, -1, -1, 114, -1, -1, -1, -1, 119, 120,
3536 -1, -1, -1, 124, -1, 126, -1, 128, 3, 130,
3537 5, 6, -1, 8, 9, 10, -1, -1, -1, -1,
3538 -1, -1, -1, -1, 19, -1, -1, -1, -1, 24,
3539 -1, 26, -1, 28, 29, -1, -1, 32, -1, -1,
3540 -1, 36, -1, -1, -1, -1, -1, -1, 43, -1,
3541 45, 46, -1, -1, -1, -1, -1, -1, 53, -1,
3542 55, 56, -1, -1, -1, -1, -1, -1, -1, 64,
3543 -1, -1, -1, -1, -1, -1, 71, -1, -1, -1,
3544 3, -1, 5, 6, -1, 8, 9, 10, -1, -1,
3545 -1, -1, -1, -1, -1, -1, 19, 92, 93, -1,
3546 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3547 -1, -1, -1, 36, -1, -1, 111, -1, -1, 114,
3548 43, -1, 45, -1, 119, 120, -1, -1, -1, 124,
3549 53, 126, 55, 56, -1, 130, -1, -1, -1, -1,
3550 -1, 64, -1, -1, -1, -1, -1, -1, 71, -1,
3551 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3552 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3553 93, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3554 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3555 -1, 114, -1, -1, -1, -1, 119, 120, -1, -1,
3556 -1, 124, -1, 126, 68, 69, 70, 130, 72, 73,
3557 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3558 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3559 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3560 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3561 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3562 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3563 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3564 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3565 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3566 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3567 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3568 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3569 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3570 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3571 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3572 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3573 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3574 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3575 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3576 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3577 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3578 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3579 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3580 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3581 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3582 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3583 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3584 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3585 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3586 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3587 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3588 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3589 -1, -1, 124, -1, 126, 127, -1, 129, 68, 69,
3590 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3591 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3592 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3593 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3594 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3595 -1, -1, -1, -1, 124, -1, 126, 127, -1, 129,
3596 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3597 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3598 88, 89, 90, -1, 92, 93, 94, -1, 96, 97,
3599 98, -1, -1, -1, 40, -1, 104, 105, -1, 107,
3600 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3601 118, -1, -1, -1, -1, -1, 124, -1, 126, 127,
3602 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3603 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3604 86, 87, 88, 89, 90, -1, 92, 93, 94, -1,
3605 96, 97, 98, -1, -1, -1, 40, -1, 104, 105,
3606 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3607 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3608 126, 127, -1, 129, 68, 69, 70, -1, 72, 73,
3609 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3610 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3611 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3612 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3613 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3614 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3615 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3616 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3617 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3618 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3619 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3620 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3621 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3622 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3623 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3624 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3625 -1, -1, 112, -1, 114, 115, 116, 117, 118, -1,
3626 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3627 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3628 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3629 -1, -1, 90, -1, 92, 93, 94, -1, 96, 97,
3630 98, -1, -1, -1, 40, -1, -1, -1, -1, 107,
3631 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3632 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3633 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3634 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
3635 -1, -1, -1, -1, -1, -1, 92, 93, 94, -1,
3636 96, 97, 98, -1, -1, -1, 40, -1, -1, -1,
3637 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3638 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3639 126, -1, -1, 129, 68, 69, 70, -1, 72, 73,
3640 74, 75, 76, 77, -1, -1, -1, -1, -1, -1,
3641 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3642 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3643 -1, -1, -1, -1, 108, 109, -1, 111, 112, -1,
3644 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3645 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3646 72, 73, 74, 75, 76, 77, -1, -1, -1, -1,
3647 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3648 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3649 40, -1, -1, -1, -1, -1, -1, 109, -1, 111,
3650 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3651 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3652 70, -1, 72, 73, 74, 75, 76, 77, -1, -1,
3653 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3654 -1, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3655 -1, -1, 40, -1, -1, -1, -1, -1, -1, 109,
3656 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3657 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3658 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3659 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3660 -1, -1, -1, -1, 92, 93, 94, -1, 96, 97,
3661 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3662 -1, -1, -1, 111, 112, -1, 114, 115, 116, 117,
3663 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3667 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3668 symbol of state STATE-NUM. */
3669 static const yytype_uint16 yystos[] =
3671 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3672 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3673 25, 26, 28, 29, 36, 38, 39, 41, 43, 45,
3674 47, 48, 49, 52, 53, 55, 56, 63, 64, 65,
3675 71, 92, 93, 101, 111, 114, 119, 120, 124, 126,
3676 128, 130, 137, 138, 139, 140, 146, 149, 150, 156,
3677 160, 161, 162, 163, 165, 173, 181, 184, 185, 188,
3678 191, 192, 193, 194, 198, 200, 209, 214, 215, 216,
3679 226, 234, 237, 250, 251, 252, 257, 261, 265, 266,
3680 268, 269, 270, 91, 50, 124, 124, 166, 124, 3,
3681 4, 16, 17, 128, 186, 187, 16, 3, 261, 3,
3682 236, 261, 124, 187, 240, 124, 128, 124, 129, 16,
3683 261, 124, 3, 5, 8, 9, 10, 258, 259, 260,
3684 261, 261, 261, 261, 261, 256, 261, 246, 247, 248,
3685 254, 261, 30, 32, 37, 42, 46, 67, 101, 134,
3686 145, 146, 147, 150, 152, 167, 168, 183, 192, 253,
3687 3, 0, 140, 128, 3, 46, 152, 158, 159, 257,
3688 147, 148, 16, 26, 31, 32, 44, 46, 208, 267,
3689 194, 3, 128, 221, 225, 102, 40, 68, 69, 70,
3690 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3691 82, 83, 84, 85, 86, 87, 88, 89, 90, 92,
3692 93, 94, 96, 97, 98, 104, 105, 107, 108, 109,
3693 111, 112, 114, 115, 116, 117, 118, 124, 126, 129,
3694 3, 124, 164, 148, 174, 190, 128, 129, 186, 187,
3695 239, 240, 241, 249, 124, 255, 256, 129, 261, 182,
3696 246, 3, 104, 157, 134, 106, 102, 102, 135, 127,
3697 102, 254, 3, 3, 153, 154, 255, 255, 153, 3,
3698 134, 147, 128, 138, 3, 101, 69, 101, 3, 35,
3699 51, 233, 3, 3, 210, 261, 3, 221, 227, 228,
3700 229, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3701 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3702 261, 261, 261, 261, 261, 117, 130, 186, 264, 261,
3703 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3704 261, 261, 261, 261, 246, 261, 3, 4, 117, 124,
3705 126, 130, 263, 264, 255, 12, 261, 101, 141, 142,
3706 143, 149, 150, 198, 200, 209, 234, 189, 186, 129,
3707 124, 245, 3, 95, 230, 231, 232, 135, 117, 186,
3708 135, 144, 145, 135, 261, 255, 254, 259, 261, 106,
3709 244, 102, 145, 134, 244, 255, 255, 104, 3, 54,
3710 195, 54, 196, 3, 211, 212, 222, 104, 104, 112,
3711 116, 217, 229, 126, 264, 106, 135, 127, 262, 261,
3712 126, 264, 91, 135, 124, 135, 134, 143, 128, 141,
3713 246, 104, 106, 213, 232, 135, 102, 134, 135, 106,
3714 36, 117, 241, 243, 104, 151, 154, 134, 101, 135,
3715 3, 5, 124, 241, 15, 197, 241, 242, 128, 244,
3716 102, 134, 5, 221, 5, 221, 218, 223, 261, 261,
3717 261, 127, 261, 264, 148, 255, 128, 141, 134, 135,
3718 261, 243, 244, 95, 232, 27, 33, 175, 177, 179,
3719 180, 148, 254, 261, 257, 148, 230, 242, 128, 102,
3720 201, 151, 212, 112, 5, 111, 112, 128, 219, 224,
3721 226, 127, 135, 127, 135, 34, 62, 169, 170, 171,
3722 172, 134, 213, 128, 232, 128, 124, 175, 177, 66,
3723 155, 135, 135, 199, 241, 46, 101, 192, 205, 206,
3724 207, 116, 261, 111, 226, 223, 261, 106, 134, 171,
3725 172, 238, 178, 3, 148, 148, 244, 101, 146, 150,
3726 192, 202, 203, 204, 209, 234, 3, 26, 134, 207,
3727 225, 220, 116, 223, 106, 144, 144, 144, 244, 128,
3728 128, 134, 204, 233, 218, 134, 225, 144, 134, 134,
3729 135, 235, 202, 3, 112, 218, 176, 144, 134, 124,
3730 112, 128, 134, 230, 144, 135, 134, 244
3733 #define yyerrok (yyerrstatus = 0)
3734 #define yyclearin (yychar = YYEMPTY)
3735 #define YYEMPTY (-2)
3738 #define YYACCEPT goto yyacceptlab
3739 #define YYABORT goto yyabortlab
3740 #define YYERROR goto yyerrorlab
3743 /* Like YYERROR except do call yyerror. This remains here temporarily
3744 to ease the transition to the new meaning of YYERROR, for GCC.
3745 Once GCC version 2 has supplanted version 1, this can go. */
3747 #define YYFAIL goto yyerrlab
3749 #define YYRECOVERING() (!!yyerrstatus)
3751 #define YYBACKUP(Token, Value) \
3753 if (yychar == YYEMPTY && yylen == 1) \
3757 yytoken = YYTRANSLATE (yychar); \
3763 yyerror (YY_("syntax error: cannot back up")); \
3770 #define YYERRCODE 256
3773 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3774 If N is 0, then set CURRENT to the empty location which ends
3775 the previous symbol: RHS[0] (always defined). */
3777 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3778 #ifndef YYLLOC_DEFAULT
3779 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3783 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3784 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3785 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3786 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3790 (Current).first_line = (Current).last_line = \
3791 YYRHSLOC (Rhs, 0).last_line; \
3792 (Current).first_column = (Current).last_column = \
3793 YYRHSLOC (Rhs, 0).last_column; \
3799 /* YY_LOCATION_PRINT -- Print the location on the stream.
3800 This macro was not mandated originally: define only if we know
3801 we won't break user code: when these are the locations we know. */
3803 #ifndef YY_LOCATION_PRINT
3804 # if YYLTYPE_IS_TRIVIAL
3805 # define YY_LOCATION_PRINT(File, Loc) \
3806 fprintf (File, "%d.%d-%d.%d", \
3807 (Loc).first_line, (Loc).first_column, \
3808 (Loc).last_line, (Loc).last_column)
3810 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3815 /* YYLEX -- calling `yylex' with the right arguments. */
3818 # define YYLEX yylex (YYLEX_PARAM)
3820 # define YYLEX yylex ()
3823 /* Enable debugging if requested. */
3827 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3828 # define YYFPRINTF fprintf
3831 # define YYDPRINTF(Args) \
3837 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3841 YYFPRINTF (stderr, "%s ", Title); \
3842 yy_symbol_print (stderr, \
3844 YYFPRINTF (stderr, "\n"); \
3849 /*--------------------------------.
3850 | Print this symbol on YYOUTPUT. |
3851 `--------------------------------*/
3854 #if (defined __STDC__ || defined __C99__FUNC__ \
3855 || defined __cplusplus || defined _MSC_VER)
3857 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3860 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3863 YYSTYPE const * const yyvaluep;
3869 if (yytype < YYNTOKENS)
3870 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3882 /*--------------------------------.
3883 | Print this symbol on YYOUTPUT. |
3884 `--------------------------------*/
3886 #if (defined __STDC__ || defined __C99__FUNC__ \
3887 || defined __cplusplus || defined _MSC_VER)
3889 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3892 yy_symbol_print (yyoutput, yytype, yyvaluep)
3895 YYSTYPE const * const yyvaluep;
3898 if (yytype < YYNTOKENS)
3899 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3901 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3903 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3904 YYFPRINTF (yyoutput, ")");
3907 /*------------------------------------------------------------------.
3908 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3910 `------------------------------------------------------------------*/
3912 #if (defined __STDC__ || defined __C99__FUNC__ \
3913 || defined __cplusplus || defined _MSC_VER)
3915 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3918 yy_stack_print (yybottom, yytop)
3919 yytype_int16 *yybottom;
3920 yytype_int16 *yytop;
3923 YYFPRINTF (stderr, "Stack now");
3924 for (; yybottom <= yytop; yybottom++)
3926 int yybot = *yybottom;
3927 YYFPRINTF (stderr, " %d", yybot);
3929 YYFPRINTF (stderr, "\n");
3932 # define YY_STACK_PRINT(Bottom, Top) \
3935 yy_stack_print ((Bottom), (Top)); \
3939 /*------------------------------------------------.
3940 | Report that the YYRULE is going to be reduced. |
3941 `------------------------------------------------*/
3943 #if (defined __STDC__ || defined __C99__FUNC__ \
3944 || defined __cplusplus || defined _MSC_VER)
3946 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3949 yy_reduce_print (yyvsp, yyrule)
3954 int yynrhs = yyr2[yyrule];
3956 unsigned long int yylno = yyrline[yyrule];
3957 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3959 /* The symbols being reduced. */
3960 for (yyi = 0; yyi < yynrhs; yyi++)
3962 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3963 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3964 &(yyvsp[(yyi + 1) - (yynrhs)])
3966 YYFPRINTF (stderr, "\n");
3970 # define YY_REDUCE_PRINT(Rule) \
3973 yy_reduce_print (yyvsp, Rule); \
3976 /* Nonzero means print parse trace. It is left uninitialized so that
3977 multiple parsers can coexist. */
3979 #else /* !YYDEBUG */
3980 # define YYDPRINTF(Args)
3981 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3982 # define YY_STACK_PRINT(Bottom, Top)
3983 # define YY_REDUCE_PRINT(Rule)
3984 #endif /* !YYDEBUG */
3987 /* YYINITDEPTH -- initial size of the parser's stacks. */
3989 # define YYINITDEPTH 200
3992 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3993 if the built-in stack extension method is used).
3995 Do not make this value too large; the results are undefined if
3996 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3997 evaluated with infinite-precision integer arithmetic. */
4000 # define YYMAXDEPTH 10000
4008 # if defined __GLIBC__ && defined _STRING_H
4009 # define yystrlen strlen
4011 /* Return the length of YYSTR. */
4012 #if (defined __STDC__ || defined __C99__FUNC__ \
4013 || defined __cplusplus || defined _MSC_VER)
4015 yystrlen (const char *yystr)
4023 for (yylen = 0; yystr[yylen]; yylen++)
4031 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
4032 # define yystpcpy stpcpy
4034 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
4036 #if (defined __STDC__ || defined __C99__FUNC__ \
4037 || defined __cplusplus || defined _MSC_VER)
4039 yystpcpy (char *yydest, const char *yysrc)
4042 yystpcpy (yydest, yysrc)
4048 const char *yys = yysrc;
4050 while ((*yyd++ = *yys++) != '\0')
4059 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
4060 quotes and backslashes, so that it's suitable for yyerror. The
4061 heuristic is that double-quoting is unnecessary unless the string
4062 contains an apostrophe, a comma, or backslash (other than
4063 backslash-backslash). YYSTR is taken from yytname. If YYRES is
4064 null, do not copy; instead, return the length of what the result
4067 yytnamerr (char *yyres, const char *yystr)
4072 char const *yyp = yystr;
4079 goto do_not_strip_quotes;
4083 goto do_not_strip_quotes;
4096 do_not_strip_quotes: ;
4100 return yystrlen (yystr);
4102 return yystpcpy (yyres, yystr) - yyres;
4106 /* Copy into YYRESULT an error message about the unexpected token
4107 YYCHAR while in state YYSTATE. Return the number of bytes copied,
4108 including the terminating null byte. If YYRESULT is null, do not
4109 copy anything; just return the number of bytes that would be
4110 copied. As a special case, return 0 if an ordinary "syntax error"
4111 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
4112 size calculation. */
4114 yysyntax_error (char *yyresult, int yystate, int yychar)
4116 int yyn = yypact[yystate];
4118 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
4122 int yytype = YYTRANSLATE (yychar);
4123 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4124 YYSIZE_T yysize = yysize0;
4126 int yysize_overflow = 0;
4127 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
4128 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4132 /* This is so xgettext sees the translatable formats that are
4133 constructed on the fly. */
4134 YY_("syntax error, unexpected %s");
4135 YY_("syntax error, unexpected %s, expecting %s");
4136 YY_("syntax error, unexpected %s, expecting %s or %s");
4137 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4138 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4142 static char const yyunexpected[] = "syntax error, unexpected %s";
4143 static char const yyexpecting[] = ", expecting %s";
4144 static char const yyor[] = " or %s";
4145 char yyformat[sizeof yyunexpected
4146 + sizeof yyexpecting - 1
4147 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4148 * (sizeof yyor - 1))];
4149 char const *yyprefix = yyexpecting;
4151 /* Start YYX at -YYN if negative to avoid negative indexes in
4153 int yyxbegin = yyn < 0 ? -yyn : 0;
4155 /* Stay within bounds of both yycheck and yytname. */
4156 int yychecklim = YYLAST - yyn + 1;
4157 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4160 yyarg[0] = yytname[yytype];
4161 yyfmt = yystpcpy (yyformat, yyunexpected);
4163 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4164 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4166 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4170 yyformat[sizeof yyunexpected - 1] = '\0';
4173 yyarg[yycount++] = yytname[yyx];
4174 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4175 yysize_overflow |= (yysize1 < yysize);
4177 yyfmt = yystpcpy (yyfmt, yyprefix);
4181 yyf = YY_(yyformat);
4182 yysize1 = yysize + yystrlen (yyf);
4183 yysize_overflow |= (yysize1 < yysize);
4186 if (yysize_overflow)
4187 return YYSIZE_MAXIMUM;
4191 /* Avoid sprintf, as that infringes on the user's name space.
4192 Don't have undefined behavior even if the translation
4193 produced a string with the wrong number of "%s"s. */
4194 char *yyp = yyresult;
4196 while ((*yyp = *yyf) != '\0')
4198 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4200 yyp += yytnamerr (yyp, yyarg[yyi++]);
4213 #endif /* YYERROR_VERBOSE */
4216 /*-----------------------------------------------.
4217 | Release the memory associated to this symbol. |
4218 `-----------------------------------------------*/
4221 #if (defined __STDC__ || defined __C99__FUNC__ \
4222 || defined __cplusplus || defined _MSC_VER)
4224 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4227 yydestruct (yymsg, yytype, yyvaluep)
4237 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4247 /* Prevent warnings from -Wmissing-prototypes. */
4248 #ifdef YYPARSE_PARAM
4249 #if defined __STDC__ || defined __cplusplus
4250 int yyparse (void *YYPARSE_PARAM);
4254 #else /* ! YYPARSE_PARAM */
4255 #if defined __STDC__ || defined __cplusplus
4260 #endif /* ! YYPARSE_PARAM */
4263 /* The lookahead symbol. */
4266 /* The semantic value of the lookahead symbol. */
4269 /* Number of syntax errors so far. */
4274 /*-------------------------.
4275 | yyparse or yypush_parse. |
4276 `-------------------------*/
4278 #ifdef YYPARSE_PARAM
4279 #if (defined __STDC__ || defined __C99__FUNC__ \
4280 || defined __cplusplus || defined _MSC_VER)
4282 yyparse (void *YYPARSE_PARAM)
4285 yyparse (YYPARSE_PARAM)
4286 void *YYPARSE_PARAM;
4288 #else /* ! YYPARSE_PARAM */
4289 #if (defined __STDC__ || defined __C99__FUNC__ \
4290 || defined __cplusplus || defined _MSC_VER)
4303 /* Number of tokens to shift before error messages enabled. */
4306 /* The stacks and their tools:
4307 `yyss': related to states.
4308 `yyvs': related to semantic values.
4310 Refer to the stacks thru separate pointers, to allow yyoverflow
4311 to reallocate them elsewhere. */
4313 /* The state stack. */
4314 yytype_int16 yyssa[YYINITDEPTH];
4316 yytype_int16 *yyssp;
4318 /* The semantic value stack. */
4319 YYSTYPE yyvsa[YYINITDEPTH];
4323 YYSIZE_T yystacksize;
4327 /* Lookahead token as an internal (translated) token number. */
4329 /* The variables used to return semantic value and location from the
4334 /* Buffer for error messages, and its allocated size. */
4336 char *yymsg = yymsgbuf;
4337 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4340 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4342 /* The number of symbols on the RHS of the reduced rule.
4343 Keep to zero when no symbol should be popped. */
4349 yystacksize = YYINITDEPTH;
4351 YYDPRINTF ((stderr, "Starting parse\n"));
4356 yychar = YYEMPTY; /* Cause a token to be read. */
4358 /* Initialize stack pointers.
4359 Waste one element of value and location stack
4360 so that they stay on the same level as the state stack.
4361 The wasted elements are never initialized. */
4367 /*------------------------------------------------------------.
4368 | yynewstate -- Push a new state, which is found in yystate. |
4369 `------------------------------------------------------------*/
4371 /* In all cases, when you get here, the value and location stacks
4372 have just been pushed. So pushing a state here evens the stacks. */
4378 if (yyss + yystacksize - 1 <= yyssp)
4380 /* Get the current used size of the three stacks, in elements. */
4381 YYSIZE_T yysize = yyssp - yyss + 1;
4385 /* Give user a chance to reallocate the stack. Use copies of
4386 these so that the &'s don't force the real ones into
4388 YYSTYPE *yyvs1 = yyvs;
4389 yytype_int16 *yyss1 = yyss;
4391 /* Each stack pointer address is followed by the size of the
4392 data in use in that stack, in bytes. This used to be a
4393 conditional around just the two extra args, but that might
4394 be undefined if yyoverflow is a macro. */
4395 yyoverflow (YY_("memory exhausted"),
4396 &yyss1, yysize * sizeof (*yyssp),
4397 &yyvs1, yysize * sizeof (*yyvsp),
4403 #else /* no yyoverflow */
4404 # ifndef YYSTACK_RELOCATE
4405 goto yyexhaustedlab;
4407 /* Extend the stack our own way. */
4408 if (YYMAXDEPTH <= yystacksize)
4409 goto yyexhaustedlab;
4411 if (YYMAXDEPTH < yystacksize)
4412 yystacksize = YYMAXDEPTH;
4415 yytype_int16 *yyss1 = yyss;
4416 union yyalloc *yyptr =
4417 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4419 goto yyexhaustedlab;
4420 YYSTACK_RELOCATE (yyss_alloc, yyss);
4421 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4422 # undef YYSTACK_RELOCATE
4424 YYSTACK_FREE (yyss1);
4427 #endif /* no yyoverflow */
4429 yyssp = yyss + yysize - 1;
4430 yyvsp = yyvs + yysize - 1;
4432 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4433 (unsigned long int) yystacksize));
4435 if (yyss + yystacksize - 1 <= yyssp)
4439 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4441 if (yystate == YYFINAL)
4451 /* Do appropriate processing given the current state. Read a
4452 lookahead token if we need one and don't already have one. */
4454 /* First try to decide what to do without reference to lookahead token. */
4455 yyn = yypact[yystate];
4456 if (yyn == YYPACT_NINF)
4459 /* Not known => get a lookahead token if don't already have one. */
4461 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4462 if (yychar == YYEMPTY)
4464 YYDPRINTF ((stderr, "Reading a token: "));
4468 if (yychar <= YYEOF)
4470 yychar = yytoken = YYEOF;
4471 YYDPRINTF ((stderr, "Now at end of input.\n"));
4475 yytoken = YYTRANSLATE (yychar);
4476 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4479 /* If the proper action on seeing token YYTOKEN is to reduce or to
4480 detect an error, take that action. */
4482 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4487 if (yyn == 0 || yyn == YYTABLE_NINF)
4493 /* Count tokens shifted since error; after three, turn off error
4498 /* Shift the lookahead token. */
4499 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4501 /* Discard the shifted token. */
4510 /*-----------------------------------------------------------.
4511 | yydefault -- do the default action for the current state. |
4512 `-----------------------------------------------------------*/
4514 yyn = yydefact[yystate];
4520 /*-----------------------------.
4521 | yyreduce -- Do a reduction. |
4522 `-----------------------------*/
4524 /* yyn is the number of a rule to reduce with. */
4527 /* If YYLEN is nonzero, implement the default value of the action:
4530 Otherwise, the following line sets YYVAL to garbage.
4531 This behavior is undocumented and Bison
4532 users should not rely upon it. Assigning to YYVAL
4533 unconditionally makes the parser a bit smaller, and it avoids a
4534 GCC warning that YYVAL may be used uninitialized. */
4535 yyval = yyvsp[1-yylen];
4538 YY_REDUCE_PRINT (yyn);
4545 /* Line 1464 of skeleton.m4 */
4546 #line 1920 "parser.y"
4547 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4556 /* Line 1464 of skeleton.m4 */
4557 #line 1932 "parser.y"
4558 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4567 /* Line 1464 of skeleton.m4 */
4568 #line 1935 "parser.y"
4569 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4578 /* Line 1464 of skeleton.m4 */
4579 #line 1936 "parser.y"
4580 {(yyval.code)=code_new();}
4589 /* Line 1464 of skeleton.m4 */
4590 #line 1938 "parser.y"
4592 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4602 /* Line 1464 of skeleton.m4 */
4603 #line 1941 "parser.y"
4604 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4613 /* Line 1464 of skeleton.m4 */
4614 #line 1957 "parser.y"
4615 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4624 /* Line 1464 of skeleton.m4 */
4625 #line 1958 "parser.y"
4635 /* Line 1464 of skeleton.m4 */
4636 #line 1961 "parser.y"
4646 /* Line 1464 of skeleton.m4 */
4647 #line 1968 "parser.y"
4651 (yyval.code) = (yyvsp[(3) - (4)].code);
4655 as3_pass=(yyvsp[(1) - (4)].number_int);
4665 /* Line 1464 of skeleton.m4 */
4666 #line 1980 "parser.y"
4667 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4676 /* Line 1464 of skeleton.m4 */
4677 #line 1981 "parser.y"
4678 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4687 /* Line 1464 of skeleton.m4 */
4688 #line 1985 "parser.y"
4690 if((yyvsp[(1) - (1)].code)) {
4692 global->init = abc_initscript(global->file);
4693 code_t**cc = &global->init->method->body->code;
4694 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4705 /* Line 1464 of skeleton.m4 */
4706 #line 1996 "parser.y"
4709 (yyval.number_int)=as3_pass;
4710 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4711 if(!definitions || !dict_contains(definitions, key)) {
4724 /* Line 1464 of skeleton.m4 */
4725 #line 2015 "parser.y"
4726 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4735 /* Line 1464 of skeleton.m4 */
4736 #line 2016 "parser.y"
4737 {(yyval.node)=mkdummynode();}
4746 /* Line 1464 of skeleton.m4 */
4747 #line 2018 "parser.y"
4748 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4757 /* Line 1464 of skeleton.m4 */
4758 #line 2019 "parser.y"
4759 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4768 /* Line 1464 of skeleton.m4 */
4769 #line 2021 "parser.y"
4770 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4779 /* Line 1464 of skeleton.m4 */
4780 #line 2022 "parser.y"
4781 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4790 /* Line 1464 of skeleton.m4 */
4791 #line 2025 "parser.y"
4794 if(variable_exists((yyvsp[(1) - (3)].id)))
4795 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4797 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4802 if(state->method->uses_slots) {
4803 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4805 // this variable is stored in a slot
4807 v->type = (yyvsp[(2) - (3)].classinfo);
4813 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4816 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4818 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
4819 if(!is_subtype_of(v.t, (yyvsp[(2) - (3)].classinfo))) {
4820 syntaxerror("Can't convert %s to %s", v.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4822 if((yyvsp[(2) - (3)].classinfo)) {
4823 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4824 (yyval.code) = code_append((yyval.code), v.c);
4825 (yyval.code) = converttype((yyval.code), v.t, (yyvsp[(2) - (3)].classinfo));
4828 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4831 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4832 (yyval.code) = code_append((yyval.code), v.c);
4833 (yyval.code) = abc_coerce_a((yyval.code));
4835 // don't do anything
4837 code_free((yyval.code));
4843 (yyval.code) = abc_setslot((yyval.code), index);
4845 (yyval.code) = abc_setlocal((yyval.code), index);
4856 /* Line 1464 of skeleton.m4 */
4857 #line 2084 "parser.y"
4858 {(yyval.code) = code_new();}
4867 /* Line 1464 of skeleton.m4 */
4868 #line 2085 "parser.y"
4869 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4878 /* Line 1464 of skeleton.m4 */
4879 #line 2088 "parser.y"
4880 {PASS12 new_state();}
4889 /* Line 1464 of skeleton.m4 */
4890 #line 2088 "parser.y"
4893 (yyval.code) = code_new();
4894 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4895 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4897 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4898 if((yyvsp[(7) - (7)].code)) {
4899 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4901 myif->branch = (yyval.code) = abc_nop((yyval.code));
4902 if((yyvsp[(7) - (7)].code)) {
4903 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4904 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4906 (yyval.code) = var_block((yyval.code));
4917 /* Line 1464 of skeleton.m4 */
4918 #line 2107 "parser.y"
4919 {(yyval.code)=code_new();}
4928 /* Line 1464 of skeleton.m4 */
4929 #line 2114 "parser.y"
4931 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4932 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4942 /* Line 1464 of skeleton.m4 */
4943 #line 2118 "parser.y"
4946 (yyval.id)=(yyvsp[(1) - (1)].id);
4956 /* Line 1464 of skeleton.m4 */
4957 #line 2123 "parser.y"
4958 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4967 /* Line 1464 of skeleton.m4 */
4968 #line 2124 "parser.y"
4969 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4978 /* Line 1464 of skeleton.m4 */
4979 #line 2126 "parser.y"
4981 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4982 (yyval.code) = code_new();
4983 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4984 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4985 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4986 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4987 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4988 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4989 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4990 (yyval.code) = abc_jump((yyval.code), loopstart);
4991 code_t*out = (yyval.code) = abc_nop((yyval.code));
4992 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4993 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4996 (yyval.code) = var_block((yyval.code));
5007 /* Line 1464 of skeleton.m4 */
5008 #line 2146 "parser.y"
5010 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
5012 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
5015 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
5016 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
5017 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
5018 int array = new_variable(tmp1name, 0, 0, 0);
5020 (yyval.code) = code_new();
5021 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5022 (yyval.code) = abc_coerce_a((yyval.code));
5023 (yyval.code) = abc_setlocal((yyval.code), array);
5024 (yyval.code) = abc_pushbyte((yyval.code), 0);
5025 (yyval.code) = abc_setlocal((yyval.code), it);
5027 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5029 (yyval.code) = abc_hasnext2((yyval.code), array, it);
5030 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
5031 (yyval.code) = abc_getlocal((yyval.code), array);
5032 (yyval.code) = abc_getlocal((yyval.code), it);
5033 if(!(yyvsp[(1) - (6)].for_start).each)
5034 (yyval.code) = abc_nextname((yyval.code));
5036 (yyval.code) = abc_nextvalue((yyval.code));
5037 (yyval.code) = converttype((yyval.code), 0, var->type);
5038 (yyval.code) = abc_setlocal((yyval.code), var->index);
5040 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5041 (yyval.code) = abc_jump((yyval.code), loopstart);
5043 code_t*out = (yyval.code) = abc_nop((yyval.code));
5044 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
5045 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
5049 (yyval.code) = var_block((yyval.code));
5064 /* Line 1464 of skeleton.m4 */
5065 #line 2194 "parser.y"
5066 {PASS12 new_state();}
5075 /* Line 1464 of skeleton.m4 */
5076 #line 2194 "parser.y"
5079 (yyval.code) = code_new();
5081 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
5082 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5083 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5084 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5085 myjmp->branch = cont;
5086 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5087 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5088 code_t*out = (yyval.code) = abc_nop((yyval.code));
5089 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5090 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5092 (yyval.code) = var_block((yyval.code));
5103 /* Line 1464 of skeleton.m4 */
5104 #line 2213 "parser.y"
5105 {PASS12 new_state();}
5114 /* Line 1464 of skeleton.m4 */
5115 #line 2213 "parser.y"
5117 (yyval.code) = code_new();
5118 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5119 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
5120 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5121 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
5122 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5123 code_t*out = (yyval.code) = abc_nop((yyval.code));
5124 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
5125 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
5127 (yyval.code) = var_block((yyval.code));
5138 /* Line 1464 of skeleton.m4 */
5139 #line 2228 "parser.y"
5141 (yyval.code) = abc___break__(0, "");
5151 /* Line 1464 of skeleton.m4 */
5152 #line 2231 "parser.y"
5154 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5164 /* Line 1464 of skeleton.m4 */
5165 #line 2234 "parser.y"
5167 (yyval.code) = abc___continue__(0, "");
5177 /* Line 1464 of skeleton.m4 */
5178 #line 2237 "parser.y"
5180 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5190 /* Line 1464 of skeleton.m4 */
5191 #line 2241 "parser.y"
5201 /* Line 1464 of skeleton.m4 */
5202 #line 2242 "parser.y"
5203 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5212 /* Line 1464 of skeleton.m4 */
5213 #line 2243 "parser.y"
5214 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5223 /* Line 1464 of skeleton.m4 */
5224 #line 2244 "parser.y"
5225 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5234 /* Line 1464 of skeleton.m4 */
5235 #line 2245 "parser.y"
5236 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5245 /* Line 1464 of skeleton.m4 */
5246 #line 2246 "parser.y"
5247 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5256 /* Line 1464 of skeleton.m4 */
5257 #line 2248 "parser.y"
5259 (yyval.code) = abc_getlocal(0, state->switch_var);
5260 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5261 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5262 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5263 if((yyval.code)->opcode != OPCODE___BREAK__) {
5264 (yyval.code) = abc___fallthrough__((yyval.code), "");
5266 code_t*e = (yyval.code) = abc_nop((yyval.code));
5277 /* Line 1464 of skeleton.m4 */
5278 #line 2259 "parser.y"
5280 (yyval.code) = (yyvsp[(3) - (3)].code);
5290 /* Line 1464 of skeleton.m4 */
5291 #line 2262 "parser.y"
5292 {PASS12 new_state();state->switch_var=alloc_local();}
5301 /* Line 1464 of skeleton.m4 */
5302 #line 2262 "parser.y"
5304 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5305 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5306 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5308 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5309 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5311 code_t*c = (yyval.code),*lastblock=0;
5313 if(c->opcode == OPCODE_IFNE) {
5314 if(!c->next) syntaxerror("internal error in fallthrough handling");
5316 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5318 c->opcode = OPCODE_JUMP;
5319 c->branch = lastblock;
5321 /* fall through end of switch */
5322 c->opcode = OPCODE_NOP;
5328 (yyval.code) = var_block((yyval.code));
5339 /* Line 1464 of skeleton.m4 */
5340 #line 2293 "parser.y"
5341 {PASS12 new_state();
5342 state->exception_name=(yyvsp[(3) - (5)].id);
5343 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5344 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5354 /* Line 1464 of skeleton.m4 */
5355 #line 2298 "parser.y"
5357 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5358 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5360 NEW(abc_exception_t, e)
5361 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5362 e->var_name = multiname_clone(&name);
5363 (yyval.exception) = e;
5366 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5367 e->target = c = abc_nop(0);
5368 c = abc_setlocal(c, i);
5369 c = code_append(c, code_dup(state->method->scope_code));
5370 c = code_append(c, (yyvsp[(8) - (9)].code));
5384 /* Line 1464 of skeleton.m4 */
5385 #line 2318 "parser.y"
5386 {PASS12 new_state();state->exception_name=0;}
5395 /* Line 1464 of skeleton.m4 */
5396 #line 2318 "parser.y"
5398 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5399 if(!(yyvsp[(4) - (5)].code)) {
5400 (yyval.exception)=0;
5402 NEW(abc_exception_t, e)
5403 e->exc_type = 0; //all exceptions
5404 e->var_name = 0; //no name
5407 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5408 (yyval.exception) = e;
5420 /* Line 1464 of skeleton.m4 */
5421 #line 2334 "parser.y"
5422 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5431 /* Line 1464 of skeleton.m4 */
5432 #line 2335 "parser.y"
5433 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5442 /* Line 1464 of skeleton.m4 */
5443 #line 2336 "parser.y"
5444 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5453 /* Line 1464 of skeleton.m4 */
5454 #line 2337 "parser.y"
5456 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5457 (yyval.catch_list).finally = 0;
5458 if((yyvsp[(2) - (2)].exception)) {
5459 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5460 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5471 /* Line 1464 of skeleton.m4 */
5472 #line 2345 "parser.y"
5474 (yyval.catch_list).l=list_new();
5475 (yyval.catch_list).finally = 0;
5476 if((yyvsp[(1) - (1)].exception)) {
5477 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5478 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5489 /* Line 1464 of skeleton.m4 */
5490 #line 2354 "parser.y"
5491 {PASS12 new_state();
5492 state->method->has_exceptions=1;
5493 state->method->late_binding=1;//for invariant scope_code
5503 /* Line 1464 of skeleton.m4 */
5504 #line 2357 "parser.y"
5506 code_t*out = abc_nop(0);
5508 code_t*start = abc_nop(0);
5509 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5510 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5511 (yyval.code) = abc_jump((yyval.code), out);
5513 code_t*end = (yyval.code) = abc_nop((yyval.code));
5516 if((yyvsp[(6) - (6)].catch_list).finally)
5517 tmp = new_variable("__finally__", 0, 0, 0);
5519 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5522 abc_exception_t*e = l->abc_exception;
5524 (yyval.code) = code_append((yyval.code), e->target);
5525 (yyval.code) = abc_jump((yyval.code), out);
5527 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5529 e->target = (yyval.code) = abc_nop((yyval.code));
5530 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5531 (yyval.code) = abc___rethrow__((yyval.code));
5539 (yyval.code) = code_append((yyval.code), out);
5541 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5543 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5545 (yyval.code) = var_block((yyval.code));
5556 /* Line 1464 of skeleton.m4 */
5557 #line 2403 "parser.y"
5559 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5560 (yyval.code)=abc_throw((yyval.code));
5570 /* Line 1464 of skeleton.m4 */
5571 #line 2407 "parser.y"
5573 if(!state->exception_name)
5574 syntaxerror("re-throw only possible within a catch block");
5575 variable_t*v = find_variable(state, state->exception_name);
5576 (yyval.code)=code_new();
5577 (yyval.code)=abc_getlocal((yyval.code), v->index);
5578 (yyval.code)=abc_throw((yyval.code));
5588 /* Line 1464 of skeleton.m4 */
5589 #line 2418 "parser.y"
5592 if(state->method->has_exceptions) {
5593 int v = alloc_local();
5594 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5595 state->method->scope_code = abc_pushwith(state->method->scope_code);
5596 (yyval.value_list).number = v;
5598 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5608 /* Line 1464 of skeleton.m4 */
5609 #line 2428 "parser.y"
5611 /* remove getlocal;pushwith from scope code again */
5612 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5614 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5615 if(state->method->has_exceptions) {
5616 (yyval.code) = abc_dup((yyval.code));
5617 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5619 (yyval.code) = abc_pushwith((yyval.code));
5620 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5621 (yyval.code) = abc_popscope((yyval.code));
5632 /* Line 1464 of skeleton.m4 */
5633 #line 2446 "parser.y"
5634 {PASS12 (yyval.id)="package";}
5643 /* Line 1464 of skeleton.m4 */
5644 #line 2447 "parser.y"
5645 {PASS12 (yyval.id)="namespace";}
5654 /* Line 1464 of skeleton.m4 */
5655 #line 2448 "parser.y"
5656 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5665 /* Line 1464 of skeleton.m4 */
5666 #line 2450 "parser.y"
5667 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5676 /* Line 1464 of skeleton.m4 */
5677 #line 2451 "parser.y"
5678 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5687 /* Line 1464 of skeleton.m4 */
5688 #line 2453 "parser.y"
5689 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5698 /* Line 1464 of skeleton.m4 */
5699 #line 2454 "parser.y"
5700 {PASS12 endpackage();(yyval.code)=0;}
5709 /* Line 1464 of skeleton.m4 */
5710 #line 2455 "parser.y"
5711 {PASS12 startpackage("");}
5720 /* Line 1464 of skeleton.m4 */
5721 #line 2456 "parser.y"
5722 {PASS12 endpackage();(yyval.code)=0;}
5731 /* Line 1464 of skeleton.m4 */
5732 #line 2478 "parser.y"
5735 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5736 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5737 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5739 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5741 syntaxerror("Couldn't import class\n");
5742 state_has_imports();
5743 dict_put(state->imports, c->name, c);
5744 import_toplevel(c->package);
5755 /* Line 1464 of skeleton.m4 */
5756 #line 2492 "parser.y"
5759 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5760 as3_schedule_package((yyvsp[(2) - (4)].id));
5764 i->package = (yyvsp[(2) - (4)].id);
5765 state_has_imports();
5766 list_append(state->wildcard_imports, i);
5767 import_toplevel(i->package);
5778 /* Line 1464 of skeleton.m4 */
5779 #line 2508 "parser.y"
5780 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5789 /* Line 1464 of skeleton.m4 */
5790 #line 2509 "parser.y"
5791 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5800 /* Line 1464 of skeleton.m4 */
5801 #line 2510 "parser.y"
5802 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5811 /* Line 1464 of skeleton.m4 */
5812 #line 2511 "parser.y"
5815 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5816 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5817 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5828 /* Line 1464 of skeleton.m4 */
5829 #line 2518 "parser.y"
5830 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5839 /* Line 1464 of skeleton.m4 */
5840 #line 2519 "parser.y"
5841 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5850 /* Line 1464 of skeleton.m4 */
5851 #line 2520 "parser.y"
5852 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5861 /* Line 1464 of skeleton.m4 */
5862 #line 2521 "parser.y"
5863 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5872 /* Line 1464 of skeleton.m4 */
5873 #line 2522 "parser.y"
5874 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5883 /* Line 1464 of skeleton.m4 */
5884 #line 2523 "parser.y"
5885 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5894 /* Line 1464 of skeleton.m4 */
5895 #line 2524 "parser.y"
5896 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5905 /* Line 1464 of skeleton.m4 */
5906 #line 2525 "parser.y"
5907 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5916 /* Line 1464 of skeleton.m4 */
5917 #line 2526 "parser.y"
5918 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5927 /* Line 1464 of skeleton.m4 */
5928 #line 2527 "parser.y"
5929 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5930 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5940 /* Line 1464 of skeleton.m4 */
5941 #line 2531 "parser.y"
5942 {PASS12 (yyval.classinfo)=0;}
5951 /* Line 1464 of skeleton.m4 */
5952 #line 2532 "parser.y"
5953 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5962 /* Line 1464 of skeleton.m4 */
5963 #line 2534 "parser.y"
5964 {PASS12 (yyval.classinfo_list)=list_new();}
5973 /* Line 1464 of skeleton.m4 */
5974 #line 2535 "parser.y"
5975 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5984 /* Line 1464 of skeleton.m4 */
5985 #line 2537 "parser.y"
5986 {PASS12 (yyval.classinfo_list)=list_new();}
5995 /* Line 1464 of skeleton.m4 */
5996 #line 2538 "parser.y"
5997 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
6006 /* Line 1464 of skeleton.m4 */
6007 #line 2542 "parser.y"
6008 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
6017 /* Line 1464 of skeleton.m4 */
6018 #line 2544 "parser.y"
6019 {PASS12 endclass();(yyval.code)=0;}
6028 /* Line 1464 of skeleton.m4 */
6029 #line 2548 "parser.y"
6030 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
6031 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
6040 /* Line 1464 of skeleton.m4 */
6041 #line 2551 "parser.y"
6042 {PASS12 endclass();(yyval.code)=0;}
6051 /* Line 1464 of skeleton.m4 */
6052 #line 2560 "parser.y"
6053 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
6062 /* Line 1464 of skeleton.m4 */
6063 #line 2564 "parser.y"
6065 code_t*c = state->cls->static_init->header;
6066 c = code_append(c, (yyvsp[(1) - (1)].code));
6067 state->cls->static_init->header = c;
6077 /* Line 1464 of skeleton.m4 */
6078 #line 2575 "parser.y"
6080 syntaxerror("variable declarations not allowed in interfaces");
6090 /* Line 1464 of skeleton.m4 */
6091 #line 2578 "parser.y"
6094 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
6095 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
6096 syntaxerror("invalid method modifiers: interface methods always need to be public");
6098 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
6099 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
6100 list_deep_free((yyvsp[(6) - (8)].params).list);
6110 /* Line 1464 of skeleton.m4 */
6111 #line 2653 "parser.y"
6112 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
6121 /* Line 1464 of skeleton.m4 */
6122 #line 2653 "parser.y"
6123 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
6132 /* Line 1464 of skeleton.m4 */
6133 #line 2655 "parser.y"
6134 {PASS12 (yyval.code)=0;}
6143 /* Line 1464 of skeleton.m4 */
6144 #line 2656 "parser.y"
6145 {PASS12 (yyval.code)=0;}
6154 /* Line 1464 of skeleton.m4 */
6155 #line 2659 "parser.y"
6158 int flags = slotstate_flags->flags;
6159 namespace_t ns = modifiers2access(slotstate_flags);
6163 varinfo_t* info = 0;
6165 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6167 check_override(i, flags);
6169 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6171 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6173 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6175 if(ns.name && ns.name[0]) {
6176 syntaxerror("namespaces not allowed on package-level variables");
6178 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6181 info->type = (yyvsp[(2) - (3)].classinfo);
6182 info->flags = flags;
6184 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6188 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6192 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6194 if((yyvsp[(2) - (3)].classinfo)) {
6195 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6196 t->type_name = multiname_clone(&m);
6198 info->slot = t->slot_id;
6200 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6201 FIXME: is there a way to use slots and still don't have conflicting overrides?
6203 info->slot = t->slot_id = 0;
6205 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6206 if(cval.type!=CONSTANT_UNKNOWN) {
6207 /* compile time constant */
6208 t->value = malloc(sizeof(constant_t));
6209 memcpy(t->value, &cval, sizeof(constant_t));
6210 info->value = constant_clone(t->value);
6212 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6213 /* initalization code (if needed) */
6215 if(v.c && !is_pushundefined(v.c)) {
6216 c = abc_getlocal_0(c);
6217 c = code_append(c, v.c);
6218 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6220 c = abc_initproperty2(c, &mname);
6222 c = abc_setslot(c, t->slot_id);
6225 *code = code_append(*code, c);
6228 if(slotstate_varconst==KW_CONST) {
6229 t->kind= TRAIT_CONST;
6230 info->flags |= FLAG_CONST;
6244 /* Line 1464 of skeleton.m4 */
6245 #line 2742 "parser.y"
6246 {(yyval.constant)=0;}
6255 /* Line 1464 of skeleton.m4 */
6256 #line 2743 "parser.y"
6258 (yyval.constant) = malloc(sizeof(constant_t));
6259 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6260 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6261 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6272 /* Line 1464 of skeleton.m4 */
6273 #line 2752 "parser.y"
6274 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6283 /* Line 1464 of skeleton.m4 */
6284 #line 2753 "parser.y"
6286 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6296 /* Line 1464 of skeleton.m4 */
6297 #line 2756 "parser.y"
6298 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6307 /* Line 1464 of skeleton.m4 */
6308 #line 2757 "parser.y"
6309 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6318 /* Line 1464 of skeleton.m4 */
6319 #line 2758 "parser.y"
6320 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6329 /* Line 1464 of skeleton.m4 */
6330 #line 2759 "parser.y"
6331 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6340 /* Line 1464 of skeleton.m4 */
6341 #line 2760 "parser.y"
6342 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6351 /* Line 1464 of skeleton.m4 */
6352 #line 2761 "parser.y"
6353 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6362 /* Line 1464 of skeleton.m4 */
6363 #line 2762 "parser.y"
6364 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6373 /* Line 1464 of skeleton.m4 */
6374 #line 2782 "parser.y"
6375 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6384 /* Line 1464 of skeleton.m4 */
6385 #line 2783 "parser.y"
6386 {PASS_ALWAYS tokenizer_begin_xmltext();}
6395 /* Line 1464 of skeleton.m4 */
6396 #line 2784 "parser.y"
6397 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6406 /* Line 1464 of skeleton.m4 */
6407 #line 2786 "parser.y"
6408 {PASS_ALWAYS tokenizer_begin_xmltext();}
6417 /* Line 1464 of skeleton.m4 */
6418 #line 2786 "parser.y"
6420 (yyval.id)=strdup("{...}");
6421 as3_warning("xml string substitution not yet supported");
6431 /* Line 1464 of skeleton.m4 */
6432 #line 2790 "parser.y"
6433 {PASS_ALWAYS tokenizer_begin_xml();}
6442 /* Line 1464 of skeleton.m4 */
6443 #line 2790 "parser.y"
6445 (yyval.id)=strdup("{...}");
6446 as3_warning("xml string substitution not yet supported");
6456 /* Line 1464 of skeleton.m4 */
6457 #line 2794 "parser.y"
6467 /* Line 1464 of skeleton.m4 */
6468 #line 2795 "parser.y"
6470 (yyval.id) = concat2((yyvsp[(1) - (2)].id), "{...}");
6480 /* Line 1464 of skeleton.m4 */
6481 #line 2798 "parser.y"
6482 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), string_cstr(&(yyvsp[(2) - (2)].str)));}
6491 /* Line 1464 of skeleton.m4 */
6492 #line 2799 "parser.y"
6493 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), ">");}
6502 /* Line 1464 of skeleton.m4 */
6503 #line 2801 "parser.y"
6504 {(yyval.id)=concat2((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].id));}
6513 /* Line 1464 of skeleton.m4 */
6514 #line 2802 "parser.y"
6515 {(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));}
6524 /* Line 1464 of skeleton.m4 */
6525 #line 2804 "parser.y"
6526 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6535 /* Line 1464 of skeleton.m4 */
6536 #line 2805 "parser.y"
6537 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6546 /* Line 1464 of skeleton.m4 */
6547 #line 2807 "parser.y"
6549 (yyval.id) = allocprintf("<%s%s>%s</%s>", (yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].id), (yyvsp[(5) - (10)].id), (yyvsp[(8) - (10)].id));
6550 free((yyvsp[(2) - (10)].id));free((yyvsp[(3) - (10)].id));free((yyvsp[(5) - (10)].id));free((yyvsp[(8) - (10)].id));
6560 /* Line 1464 of skeleton.m4 */
6561 #line 2811 "parser.y"
6563 (yyval.id) = allocprintf("<%s%s/>", (yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].id));
6573 /* Line 1464 of skeleton.m4 */
6574 #line 2814 "parser.y"
6576 (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));
6577 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));
6587 /* Line 1464 of skeleton.m4 */
6588 #line 2819 "parser.y"
6589 {(yyval.id)=strdup("");}
6598 /* Line 1464 of skeleton.m4 */
6599 #line 2820 "parser.y"
6600 {(yyval.id)=concat2(" ",(yyvsp[(1) - (1)].id));}
6609 /* Line 1464 of skeleton.m4 */
6610 #line 2821 "parser.y"
6611 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6620 /* Line 1464 of skeleton.m4 */
6621 #line 2822 "parser.y"
6622 {(yyval.id)=concat3((yyvsp[(1) - (2)].id)," ",(yyvsp[(2) - (2)].id));free((yyvsp[(1) - (2)].id));free((yyvsp[(2) - (2)].id));}
6631 /* Line 1464 of skeleton.m4 */
6632 #line 2824 "parser.y"
6634 (yyval.id) = strdup("{...}");
6644 /* Line 1464 of skeleton.m4 */
6645 #line 2827 "parser.y"
6647 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6648 (yyval.id) = concat2("{...}=",str);
6658 /* Line 1464 of skeleton.m4 */
6659 #line 2831 "parser.y"
6661 (yyval.id) = strdup("{...}={...}");
6671 /* Line 1464 of skeleton.m4 */
6672 #line 2834 "parser.y"
6674 (yyval.id) = concat2((yyvsp[(1) - (3)].id),"={...}");
6684 /* Line 1464 of skeleton.m4 */
6685 #line 2837 "parser.y"
6687 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6688 (yyval.id)=allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str);
6690 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6700 /* Line 1464 of skeleton.m4 */
6701 #line 2847 "parser.y"
6704 memset(&(yyval.params),0,sizeof((yyval.params)));
6714 /* Line 1464 of skeleton.m4 */
6715 #line 2851 "parser.y"
6718 (yyval.params)=(yyvsp[(1) - (1)].params);
6728 /* Line 1464 of skeleton.m4 */
6729 #line 2857 "parser.y"
6732 memset(&(yyval.params),0,sizeof((yyval.params)));
6733 (yyval.params).varargs=1;
6734 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6744 /* Line 1464 of skeleton.m4 */
6745 #line 2863 "parser.y"
6748 (yyval.params) =(yyvsp[(1) - (4)].params);
6749 (yyval.params).varargs=1;
6750 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6760 /* Line 1464 of skeleton.m4 */
6761 #line 2871 "parser.y"
6764 (yyval.params) = (yyvsp[(1) - (3)].params);
6765 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6775 /* Line 1464 of skeleton.m4 */
6776 #line 2876 "parser.y"
6779 memset(&(yyval.params),0,sizeof((yyval.params)));
6780 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6790 /* Line 1464 of skeleton.m4 */
6791 #line 2882 "parser.y"
6794 (yyval.param) = rfx_calloc(sizeof(param_t));
6795 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6796 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6798 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6808 /* Line 1464 of skeleton.m4 */
6809 #line 2890 "parser.y"
6812 (yyval.param) = rfx_calloc(sizeof(param_t));
6813 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6814 (yyval.param)->type = TYPE_ANY;
6816 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6826 /* Line 1464 of skeleton.m4 */
6827 #line 2900 "parser.y"
6828 {PASS12 (yyval.token)=0;}
6837 /* Line 1464 of skeleton.m4 */
6838 #line 2903 "parser.y"
6839 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6848 /* Line 1464 of skeleton.m4 */
6849 #line 2904 "parser.y"
6852 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6854 if(!state->method->info) syntaxerror("internal error");
6856 code_t*c = method_header(state->method);
6857 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6859 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6861 list_deep_free((yyvsp[(6) - (12)].params).list);
6872 /* Line 1464 of skeleton.m4 */
6873 #line 2920 "parser.y"
6874 {PASS12 (yyval.id)=0;}
6883 /* Line 1464 of skeleton.m4 */
6884 #line 2922 "parser.y"
6885 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6894 /* Line 1464 of skeleton.m4 */
6895 #line 2923 "parser.y"
6898 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6900 methodinfo_t*f = state->method->info;
6901 if(!f || !f->kind) syntaxerror("internal error");
6903 code_t*c = method_header(state->method);
6904 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6906 int index = state->method->var_index;
6907 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6909 (yyval.value).c = abc_getlocal(0, index);
6910 (yyval.value).t = TYPE_FUNCTION(f);
6912 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6922 /* Line 1464 of skeleton.m4 */
6923 #line 2945 "parser.y"
6925 PASS1 NEW(unresolvedinfo_t,c);
6926 memset(c, 0, sizeof(*c));
6927 c->kind = INFOTYPE_UNRESOLVED;
6928 c->name = (yyvsp[(1) - (1)].id);
6929 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6931 c->nsset = get_current_imports();
6932 /* make the compiler look for this class in the current directory,
6934 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6936 (yyval.classinfo) = (classinfo_t*)c;
6938 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6939 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6940 (yyval.classinfo) = (classinfo_t*)s;
6950 /* Line 1464 of skeleton.m4 */
6951 #line 2964 "parser.y"
6953 PASS1 NEW(unresolvedinfo_t,c);
6954 memset(c, 0, sizeof(*c));
6955 c->kind = INFOTYPE_UNRESOLVED;
6956 c->package = (yyvsp[(1) - (3)].id);
6957 c->name = (yyvsp[(3) - (3)].id);
6958 (yyval.classinfo) = (classinfo_t*)c;
6960 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6961 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6962 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6963 (yyval.classinfo) = (classinfo_t*)s;
6973 /* Line 1464 of skeleton.m4 */
6974 #line 2981 "parser.y"
6975 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6984 /* Line 1464 of skeleton.m4 */
6985 #line 2982 "parser.y"
6986 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6995 /* Line 1464 of skeleton.m4 */
6996 #line 2984 "parser.y"
6997 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
7006 /* Line 1464 of skeleton.m4 */
7007 #line 2985 "parser.y"
7008 {PASS12 (yyval.classinfo)=TYPE_ANY;}
7017 /* Line 1464 of skeleton.m4 */
7018 #line 2986 "parser.y"
7019 {PASS12 (yyval.classinfo)=TYPE_VOID;}
7028 /* Line 1464 of skeleton.m4 */
7029 #line 2995 "parser.y"
7030 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
7039 /* Line 1464 of skeleton.m4 */
7040 #line 2996 "parser.y"
7041 {PASS12 (yyval.classinfo)=0;}
7050 /* Line 1464 of skeleton.m4 */
7051 #line 3000 "parser.y"
7052 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7061 /* Line 1464 of skeleton.m4 */
7062 #line 3001 "parser.y"
7063 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
7072 /* Line 1464 of skeleton.m4 */
7073 #line 3003 "parser.y"
7074 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7083 /* Line 1464 of skeleton.m4 */
7084 #line 3007 "parser.y"
7085 {(yyval.value_list).number=1;
7086 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
7096 /* Line 1464 of skeleton.m4 */
7097 #line 3011 "parser.y"
7098 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
7107 /* Line 1464 of skeleton.m4 */
7108 #line 3012 "parser.y"
7110 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
7111 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
7121 /* Line 1464 of skeleton.m4 */
7122 #line 3018 "parser.y"
7124 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
7125 (yyval.value).c = v.c;
7126 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
7128 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
7129 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7130 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7131 (yyval.value).c = code_cutlast((yyval.value).c);
7132 (yyval.value).c = code_append((yyval.value).c, paramcode);
7133 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
7134 multiname_destroy(name);
7135 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7136 code_free((yyval.value).c);
7137 classinfo_t*c = v.t->data;
7139 (yyval.value).c = abc_findpropstrict2(0, &m);
7140 (yyval.value).c = code_append((yyval.value).c, paramcode);
7141 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
7142 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
7143 int slot = (int)(ptroff_t)$$.c->data[0];
7144 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
7145 multiname_t*name = t->name;
7146 $$.c = code_cutlast($$.c);
7147 $$.c = code_append($$.c, paramcode);
7148 $$.c = abc_constructprop2($$.c, name, $4.number);*/
7150 (yyval.value).c = code_append((yyval.value).c, paramcode);
7151 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
7154 (yyval.value).t = TYPE_ANY;
7155 if(TYPE_IS_CLASS(v.t) && v.t->data) {
7156 (yyval.value).t = v.t->data;
7158 (yyval.value).c = abc_coerce_a((yyval.value).c);
7159 (yyval.value).t = TYPE_ANY;
7170 /* Line 1464 of skeleton.m4 */
7171 #line 3062 "parser.y"
7174 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
7175 (yyval.value).c = v.c;
7176 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7177 (yyval.value).c = code_cutlast((yyval.value).c);
7179 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
7181 (yyval.value).t = TYPE_ANY;
7182 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7183 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7184 (yyval.value).c = code_cutlast((yyval.value).c);
7185 (yyval.value).c = code_append((yyval.value).c, paramcode);
7186 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7187 multiname_destroy(name);
7188 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7189 int slot = (int)(ptroff_t)$$.c->data[0];
7190 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7191 if(t->kind!=TRAIT_METHOD) {
7192 //ok: flash allows to assign closures to members.
7194 multiname_t*name = t->name;
7195 $$.c = code_cutlast($$.c);
7196 $$.c = code_append($$.c, paramcode);
7197 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7198 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7199 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7200 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7201 (yyval.value).c = code_cutlast((yyval.value).c);
7202 (yyval.value).c = code_append((yyval.value).c, paramcode);
7203 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7204 multiname_destroy(name);
7206 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7207 (yyval.value).c = code_append((yyval.value).c, paramcode);
7208 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7211 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7212 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7213 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7214 // calling a class is like a typecast
7215 (yyval.value).t = (classinfo_t*)v.t->data;
7217 (yyval.value).t = TYPE_ANY;
7218 (yyval.value).c = abc_coerce_a((yyval.value).c);
7229 /* Line 1464 of skeleton.m4 */
7230 #line 3112 "parser.y"
7232 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7233 if(!state->method) syntaxerror("super() not allowed outside of a function");
7234 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7236 (yyval.value).c = code_new();
7237 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7239 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7241 this is dependent on the control path, check this somewhere else
7242 if(state->method->has_super)
7243 syntaxerror("constructor may call super() only once");
7245 state->method->has_super = 1;
7247 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7248 (yyval.value).c = abc_pushundefined((yyval.value).c);
7249 (yyval.value).t = TYPE_ANY;
7259 /* Line 1464 of skeleton.m4 */
7260 #line 3133 "parser.y"
7262 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7263 (yyval.value).c = v.c;
7264 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7265 (yyval.value).c = code_cutlast((yyval.value).c);
7267 multiname_t*name = 0;
7268 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7269 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7270 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7271 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7272 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7273 (yyval.value).c = code_cutlast((yyval.value).c);
7274 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7276 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7277 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7278 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7280 (yyval.value).t = TYPE_BOOLEAN;
7290 /* Line 1464 of skeleton.m4 */
7291 #line 3155 "parser.y"
7293 (yyval.code) = abc_returnvoid(0);
7303 /* Line 1464 of skeleton.m4 */
7304 #line 3158 "parser.y"
7306 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7307 (yyval.code) = abc_returnvalue((yyval.code));
7317 /* Line 1464 of skeleton.m4 */
7318 #line 3165 "parser.y"
7320 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7330 /* Line 1464 of skeleton.m4 */
7331 #line 3168 "parser.y"
7333 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7343 /* Line 1464 of skeleton.m4 */
7344 #line 3171 "parser.y"
7346 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7356 /* Line 1464 of skeleton.m4 */
7357 #line 3174 "parser.y"
7359 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7369 /* Line 1464 of skeleton.m4 */
7370 #line 3177 "parser.y"
7372 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7382 /* Line 1464 of skeleton.m4 */
7383 #line 3180 "parser.y"
7385 (yyval.code) = (yyvsp[(1) - (3)].code);
7386 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7396 /* Line 1464 of skeleton.m4 */
7397 #line 3185 "parser.y"
7398 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7407 /* Line 1464 of skeleton.m4 */
7408 #line 3186 "parser.y"
7409 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7418 /* Line 1464 of skeleton.m4 */
7419 #line 3188 "parser.y"
7420 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7429 /* Line 1464 of skeleton.m4 */
7430 #line 3189 "parser.y"
7431 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7440 /* Line 1464 of skeleton.m4 */
7441 #line 3190 "parser.y"
7442 {syntaxerror("dictionary keys must be strings");}
7451 /* Line 1464 of skeleton.m4 */
7452 #line 3191 "parser.y"
7453 {syntaxerror("dictionary keys must be strings");}
7462 /* Line 1464 of skeleton.m4 */
7463 #line 3192 "parser.y"
7464 {syntaxerror("dictionary keys must be strings");}
7473 /* Line 1464 of skeleton.m4 */
7474 #line 3194 "parser.y"
7476 (yyval.value_list).cc = 0;
7477 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7478 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7479 (yyval.value_list).number = 2;
7489 /* Line 1464 of skeleton.m4 */
7490 #line 3200 "parser.y"
7492 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7493 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7494 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7495 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7505 /* Line 1464 of skeleton.m4 */
7506 #line 3209 "parser.y"
7507 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7516 /* Line 1464 of skeleton.m4 */
7517 #line 3210 "parser.y"
7518 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7527 /* Line 1464 of skeleton.m4 */
7528 #line 3211 "parser.y"
7529 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7538 /* Line 1464 of skeleton.m4 */
7539 #line 3212 "parser.y"
7540 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7549 /* Line 1464 of skeleton.m4 */
7550 #line 3213 "parser.y"
7551 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7560 /* Line 1464 of skeleton.m4 */
7561 #line 3214 "parser.y"
7562 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7571 /* Line 1464 of skeleton.m4 */
7572 #line 3216 "parser.y"
7574 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7584 /* Line 1464 of skeleton.m4 */
7585 #line 3220 "parser.y"
7589 multiname_t m = {QNAME, &stdns, 0, "XML"};
7590 v.c = abc_getlex2(v.c, &m);
7591 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].id));
7592 v.c = abc_construct(v.c, 1);
7594 (yyval.node) = mkcodenode(v);
7604 /* Line 1464 of skeleton.m4 */
7605 #line 3232 "parser.y"
7609 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7610 if(!(yyvsp[(1) - (1)].regexp).options) {
7611 v.c = abc_getlex2(v.c, &m);
7612 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7613 v.c = abc_construct(v.c, 1);
7615 v.c = abc_getlex2(v.c, &m);
7616 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7617 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7618 v.c = abc_construct(v.c, 2);
7621 (yyval.node) = mkcodenode(v);
7631 /* Line 1464 of skeleton.m4 */
7632 #line 3250 "parser.y"
7635 state->method->need_arguments = 1;
7638 v.c = abc_getlocal(0, state->method->need_arguments);
7640 (yyval.node) = mkcodenode(v);
7650 /* Line 1464 of skeleton.m4 */
7651 #line 3261 "parser.y"
7655 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7656 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7657 v.t = registry_getarrayclass();
7658 (yyval.node) = mkcodenode(v);
7668 /* Line 1464 of skeleton.m4 */
7669 #line 3271 "parser.y"
7673 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7674 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7675 v.t = registry_getobjectclass();
7676 (yyval.node) = mkcodenode(v);
7686 /* Line 1464 of skeleton.m4 */
7687 #line 3280 "parser.y"
7688 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7697 /* Line 1464 of skeleton.m4 */
7698 #line 3281 "parser.y"
7699 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7708 /* Line 1464 of skeleton.m4 */
7709 #line 3282 "parser.y"
7710 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7719 /* Line 1464 of skeleton.m4 */
7720 #line 3283 "parser.y"
7721 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7730 /* Line 1464 of skeleton.m4 */
7731 #line 3284 "parser.y"
7732 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7741 /* Line 1464 of skeleton.m4 */
7742 #line 3285 "parser.y"
7743 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7752 /* Line 1464 of skeleton.m4 */
7753 #line 3286 "parser.y"
7754 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7763 /* Line 1464 of skeleton.m4 */
7764 #line 3287 "parser.y"
7765 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7774 /* Line 1464 of skeleton.m4 */
7775 #line 3288 "parser.y"
7776 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7785 /* Line 1464 of skeleton.m4 */
7786 #line 3289 "parser.y"
7787 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7796 /* Line 1464 of skeleton.m4 */
7797 #line 3290 "parser.y"
7798 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7807 /* Line 1464 of skeleton.m4 */
7808 #line 3291 "parser.y"
7809 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7818 /* Line 1464 of skeleton.m4 */
7819 #line 3292 "parser.y"
7820 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7829 /* Line 1464 of skeleton.m4 */
7830 #line 3293 "parser.y"
7831 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7840 /* Line 1464 of skeleton.m4 */
7841 #line 3294 "parser.y"
7842 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7851 /* Line 1464 of skeleton.m4 */
7852 #line 3295 "parser.y"
7853 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7862 /* Line 1464 of skeleton.m4 */
7863 #line 3296 "parser.y"
7864 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7873 /* Line 1464 of skeleton.m4 */
7874 #line 3297 "parser.y"
7875 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7884 /* Line 1464 of skeleton.m4 */
7885 #line 3298 "parser.y"
7886 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7895 /* Line 1464 of skeleton.m4 */
7896 #line 3299 "parser.y"
7897 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7906 /* Line 1464 of skeleton.m4 */
7907 #line 3300 "parser.y"
7908 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7917 /* Line 1464 of skeleton.m4 */
7918 #line 3301 "parser.y"
7919 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7928 /* Line 1464 of skeleton.m4 */
7929 #line 3302 "parser.y"
7930 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7939 /* Line 1464 of skeleton.m4 */
7940 #line 3303 "parser.y"
7941 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7950 /* Line 1464 of skeleton.m4 */
7951 #line 3304 "parser.y"
7952 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7961 /* Line 1464 of skeleton.m4 */
7962 #line 3305 "parser.y"
7963 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7972 /* Line 1464 of skeleton.m4 */
7973 #line 3306 "parser.y"
7974 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7983 /* Line 1464 of skeleton.m4 */
7984 #line 3307 "parser.y"
7985 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(3) - (4)].node));}
7994 /* Line 1464 of skeleton.m4 */
7995 #line 3308 "parser.y"
7996 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
8005 /* Line 1464 of skeleton.m4 */
8006 #line 3309 "parser.y"
8007 { (yyval.node) = mkconstnode(constant_new_undefined());}
8016 /* Line 1464 of skeleton.m4 */
8017 #line 3310 "parser.y"
8018 { (yyval.node)=(yyvsp[(2) - (3)].node);}
8027 /* Line 1464 of skeleton.m4 */
8028 #line 3311 "parser.y"
8029 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
8038 /* Line 1464 of skeleton.m4 */
8039 #line 3312 "parser.y"
8040 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
8049 /* Line 1464 of skeleton.m4 */
8050 #line 3313 "parser.y"
8051 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8060 /* Line 1464 of skeleton.m4 */
8061 #line 3314 "parser.y"
8062 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8071 /* Line 1464 of skeleton.m4 */
8072 #line 3315 "parser.y"
8073 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8082 /* Line 1464 of skeleton.m4 */
8083 #line 3316 "parser.y"
8084 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8093 /* Line 1464 of skeleton.m4 */
8094 #line 3317 "parser.y"
8095 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8104 /* Line 1464 of skeleton.m4 */
8105 #line 3318 "parser.y"
8106 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8115 /* Line 1464 of skeleton.m4 */
8116 #line 3319 "parser.y"
8117 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8126 /* Line 1464 of skeleton.m4 */
8127 #line 3320 "parser.y"
8128 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8137 /* Line 1464 of skeleton.m4 */
8138 #line 3321 "parser.y"
8139 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8148 /* Line 1464 of skeleton.m4 */
8149 #line 3322 "parser.y"
8150 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8159 /* Line 1464 of skeleton.m4 */
8160 #line 3323 "parser.y"
8161 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8170 /* Line 1464 of skeleton.m4 */
8171 #line 3324 "parser.y"
8172 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8181 /* Line 1464 of skeleton.m4 */
8182 #line 3325 "parser.y"
8183 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
8192 /* Line 1464 of skeleton.m4 */
8193 #line 3327 "parser.y"
8194 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
8203 /* Line 1464 of skeleton.m4 */
8204 #line 3328 "parser.y"
8205 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
8214 /* Line 1464 of skeleton.m4 */
8215 #line 3329 "parser.y"
8216 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
8225 /* Line 1464 of skeleton.m4 */
8226 #line 3330 "parser.y"
8227 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
8236 /* Line 1464 of skeleton.m4 */
8237 #line 3333 "parser.y"
8238 { if(!state->cls->info)
8239 syntaxerror("super keyword not allowed outside a class");
8240 classinfo_t*t = state->cls->info->superclass;
8241 if(!t) t = TYPE_OBJECT;
8242 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8243 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8246 v.c = abc_getlocal_0(v.c);
8247 v.c = abc_getsuper2(v.c, &m);
8248 v.t = slotinfo_gettype((slotinfo_t*)f);
8249 (yyval.node) = mkcodenode(v);
8259 /* Line 1464 of skeleton.m4 */
8260 #line 3347 "parser.y"
8263 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
8264 v.c = abc_getlex2(0, &m);
8266 (yyval.node) = mkcodenode(v);
8276 /* Line 1464 of skeleton.m4 */
8277 #line 3355 "parser.y"
8278 {PASS12 new_state();state->xmlfilter=1;}
8287 /* Line 1464 of skeleton.m4 */
8288 #line 3355 "parser.y"
8292 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8293 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8295 int index = alloc_local();
8296 int result = alloc_local();
8297 int tmp = alloc_local();
8298 int xml = alloc_local();
8300 c = code_append(c, v.c);
8301 c = abc_checkfilter(c);
8302 c = abc_coerce_a(c); //hasnext2 converts to *
8303 c = abc_setlocal(c, xml);
8304 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8305 c = abc_getlex2(c, &m);
8306 c = abc_construct(c, 0);
8307 c = abc_setlocal(c, result);
8308 c = abc_pushbyte(c, 0);
8309 c = abc_setlocal(c, index);
8310 code_t*jmp = c = abc_jump(c, 0);
8311 code_t*loop = c = abc_label(c);
8312 c = abc_getlocal(c, xml);
8313 c = abc_getlocal(c, index);
8314 c = abc_nextvalue(c);
8316 c = abc_setlocal(c, tmp);
8317 c = abc_pushwith(c);
8318 c = code_append(c, w.c);
8319 c = abc_popscope(c);
8320 code_t*b = c = abc_iffalse(c, 0);
8321 c = abc_getlocal(c, result);
8322 c = abc_getlocal(c, index);
8323 c = abc_getlocal(c, tmp);
8324 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8325 c = abc_setproperty2(c, &m2);
8326 c = b->branch = jmp->branch = abc_nop(c);
8327 c = abc_kill(c, tmp);
8328 c = abc_hasnext2(c, xml, index);
8329 c = abc_iftrue(c, loop);
8330 c = abc_getlocal(c, result);
8331 c = abc_kill(c, xml);
8332 c = abc_kill(c, result);
8333 c = abc_kill(c, index);
8340 (yyval.node) = mkcodenode(r);
8350 /* Line 1464 of skeleton.m4 */
8351 #line 3409 "parser.y"
8352 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8361 /* Line 1464 of skeleton.m4 */
8362 #line 3410 "parser.y"
8372 /* Line 1464 of skeleton.m4 */
8373 #line 3411 "parser.y"
8374 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8383 /* Line 1464 of skeleton.m4 */
8384 #line 3413 "parser.y"
8394 /* Line 1464 of skeleton.m4 */
8395 #line 3421 "parser.y"
8397 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8398 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8399 v.c = code_append(v.c, w.c);
8400 if(!TYPE_IS_NAMESPACE(w.t)) {
8401 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8403 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8404 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8405 v.c = abc_getproperty2(v.c, &m);
8406 if(TYPE_IS_XML(v.t)) {
8409 v.c = abc_coerce_a(v.c);
8412 (yyval.node) = mkcodenode(v);
8422 /* Line 1464 of skeleton.m4 */
8423 #line 3439 "parser.y"
8425 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8426 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8427 v.c = abc_getdescendants2(v.c, &m);
8429 (yyval.node) = mkcodenode(v);
8439 /* Line 1464 of skeleton.m4 */
8440 #line 3446 "parser.y"
8442 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8443 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8444 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8445 v.c = code_append(v.c, w.c);
8446 v.c = converttype(w.c, w.t, TYPE_STRING);
8447 v.c = abc_getproperty2(v.c, &m);
8449 (yyval.node) = mkcodenode(v);
8459 /* Line 1464 of skeleton.m4 */
8460 #line 3457 "parser.y"
8462 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8463 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8464 v.c = abc_getproperty2(v.c, &m);
8466 (yyval.node) = mkcodenode(v);
8476 /* Line 1464 of skeleton.m4 */
8477 #line 3464 "parser.y"
8479 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8480 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8481 v.c = abc_getdescendants2(v.c, &m);
8483 (yyval.node) = mkcodenode(v);
8493 /* Line 1464 of skeleton.m4 */
8494 #line 3471 "parser.y"
8496 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8497 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8498 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8499 v.c = code_append(v.c, w.c);
8500 v.c = converttype(w.c, w.t, TYPE_STRING);
8501 v.c = abc_getproperty2(v.c, &m);
8503 (yyval.node) = mkcodenode(v);
8513 /* Line 1464 of skeleton.m4 */
8514 #line 3481 "parser.y"
8516 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8517 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8518 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8519 v.c = code_append(v.c, w.c);
8520 v.c = converttype(w.c, w.t, TYPE_STRING);
8521 v.c = abc_getdescendants2(v.c, &m);
8523 (yyval.node) = mkcodenode(v);
8533 /* Line 1464 of skeleton.m4 */
8534 #line 3492 "parser.y"
8536 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8537 (yyval.value).c = v1.c;
8538 classinfo_t*t = v1.t;
8540 if(TYPE_IS_CLASS(t) && t->data) {
8544 if(TYPE_IS_XML(t)) {
8545 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8546 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8547 (yyval.value).c = abc_coerce_a((yyval.value).c);
8548 (yyval.value).t = TYPE_XMLLIST;
8550 if(t->subtype==INFOTYPE_UNRESOLVED) {
8551 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8553 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8555 if(f && !is_static != !(f->flags&FLAG_STATIC))
8557 if(f && f->slot && !noslot) {
8558 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8561 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8563 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8564 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8566 /* determine type */
8567 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8568 if(!(yyval.value).t)
8569 (yyval.value).c = abc_coerce_a((yyval.value).c);
8571 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8572 string_t*package = v1.c->data[0];
8573 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8575 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8577 (yyval.value) = push_class(a);
8578 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8579 registry_ispackage(package2)) {
8580 (yyval.value).c = v1.c;
8581 (yyval.value).c->data[0] = string_new4(package2);
8582 (yyval.value).t = 0;
8584 syntaxerror("couldn't resolve %s", package2);
8587 /* when resolving a property on an unknown type, we do know the
8588 name of the property (and don't seem to need the package), but
8589 we need to make avm2 try out all access modes */
8590 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8591 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8592 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8593 (yyval.value).c = abc_coerce_a((yyval.value).c);
8594 (yyval.value).t = TYPE_ANY;
8605 /* Line 1464 of skeleton.m4 */
8606 #line 3670 "parser.y"
8609 /* Queue unresolved identifiers for checking against the parent
8610 function's variables.
8611 We consider everything which is not a local variable "unresolved".
8612 This encompasses class names, members of the surrounding class
8613 etc. which is *correct* because local variables of the parent function
8617 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8618 if(state->method->inner) {
8619 unknown_variable((yyvsp[(1) - (1)].id));
8621 /* let the compiler know that it might want to check the current directory/package
8622 for this identifier- maybe there's a file $1.as defining $1. */
8623 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8629 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8639 /* Line 1464 of skeleton.m4 */
8640 #line 3706 "parser.y"
8643 NEW(namespace_decl_t,n);
8644 n->name = (yyvsp[(2) - (2)].id);
8645 n->url = (yyvsp[(2) - (2)].id);
8646 (yyval.namespace_decl)=n;
8656 /* Line 1464 of skeleton.m4 */
8657 #line 3713 "parser.y"
8660 NEW(namespace_decl_t,n);
8661 n->name = (yyvsp[(2) - (4)].id);
8662 n->url = (yyvsp[(4) - (4)].id);
8663 (yyval.namespace_decl)=n;
8673 /* Line 1464 of skeleton.m4 */
8674 #line 3720 "parser.y"
8677 NEW(namespace_decl_t,n);
8678 n->name = (yyvsp[(2) - (4)].id);
8679 n->url = (yyvsp[(4) - (4)].str).str;
8680 (yyval.namespace_decl)=n;
8690 /* Line 1464 of skeleton.m4 */
8691 #line 3727 "parser.y"
8694 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8696 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8697 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8698 var->type = TYPE_NAMESPACE;
8700 ns.access = ACCESS_NAMESPACE;
8701 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8702 var->value = constant_new_namespace(&ns);
8705 MULTINAME(m, TYPE_NAMESPACE);
8706 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8707 t->value = var->value;
8708 t->type_name = multiname_clone(&m);
8721 /* Line 1464 of skeleton.m4 */
8722 #line 3750 "parser.y"
8724 as3_warning("default xml namespaces not supported yet");
8734 /* Line 1464 of skeleton.m4 */
8735 #line 3754 "parser.y"
8738 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8740 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8741 if(s->kind == INFOTYPE_UNRESOLVED) {
8742 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8744 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8747 if(!s || s->kind != INFOTYPE_VAR)
8748 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8749 if(!s->value || !NS_TYPE(s->value->type))
8750 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8751 url = s->value->ns->name;
8753 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8754 add_active_url(url);
8763 /* Line 1464 of skeleton.m4 */
8764 #line 8765 "parser.tab.c"
8767 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8771 YY_STACK_PRINT (yyss, yyssp);
8775 /* Now `shift' the result of the reduction. Determine what state
8776 that goes to, based on the state we popped back to and the rule
8777 number reduced by. */
8781 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8782 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8783 yystate = yytable[yystate];
8785 yystate = yydefgoto[yyn - YYNTOKENS];
8790 /*------------------------------------.
8791 | yyerrlab -- here on detecting error |
8792 `------------------------------------*/
8794 /* If not already recovering from an error, report this error. */
8798 #if ! YYERROR_VERBOSE
8799 yyerror (YY_("syntax error"));
8802 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8803 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8805 YYSIZE_T yyalloc = 2 * yysize;
8806 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8807 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8808 if (yymsg != yymsgbuf)
8809 YYSTACK_FREE (yymsg);
8810 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8812 yymsg_alloc = yyalloc;
8816 yymsg_alloc = sizeof yymsgbuf;
8820 if (0 < yysize && yysize <= yymsg_alloc)
8822 (void) yysyntax_error (yymsg, yystate, yychar);
8827 yyerror (YY_("syntax error"));
8829 goto yyexhaustedlab;
8837 if (yyerrstatus == 3)
8839 /* If just tried and failed to reuse lookahead token after an
8840 error, discard it. */
8842 if (yychar <= YYEOF)
8844 /* Return failure if at end of input. */
8845 if (yychar == YYEOF)
8850 yydestruct ("Error: discarding",
8856 /* Else will try to reuse lookahead token after shifting the error
8861 /*---------------------------------------------------.
8862 | yyerrorlab -- error raised explicitly by YYERROR. |
8863 `---------------------------------------------------*/
8866 /* Pacify compilers like GCC when the user code never invokes
8867 YYERROR and the label yyerrorlab therefore never appears in user
8869 if (/*CONSTCOND*/ 0)
8872 /* Do not reclaim the symbols of the rule which action triggered
8876 YY_STACK_PRINT (yyss, yyssp);
8881 /*-------------------------------------------------------------.
8882 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8883 `-------------------------------------------------------------*/
8885 yyerrstatus = 3; /* Each real token shifted decrements this. */
8889 yyn = yypact[yystate];
8890 if (yyn != YYPACT_NINF)
8893 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8901 /* Pop the current state because it cannot handle the error token. */
8906 yydestruct ("Error: popping",
8907 yystos[yystate], yyvsp);
8910 YY_STACK_PRINT (yyss, yyssp);
8916 /* Shift the error token. */
8917 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8923 /*-------------------------------------.
8924 | yyacceptlab -- YYACCEPT comes here. |
8925 `-------------------------------------*/
8930 /*-----------------------------------.
8931 | yyabortlab -- YYABORT comes here. |
8932 `-----------------------------------*/
8937 #if !defined(yyoverflow) || YYERROR_VERBOSE
8938 /*-------------------------------------------------.
8939 | yyexhaustedlab -- memory exhaustion comes here. |
8940 `-------------------------------------------------*/
8942 yyerror (YY_("memory exhausted"));
8948 if (yychar != YYEMPTY)
8949 yydestruct ("Cleanup: discarding lookahead",
8951 /* Do not reclaim the symbols of the rule which action triggered
8952 this YYABORT or YYACCEPT. */
8954 YY_STACK_PRINT (yyss, yyssp);
8955 while (yyssp != yyss)
8957 yydestruct ("Cleanup: popping",
8958 yystos[*yyssp], yyvsp);
8963 YYSTACK_FREE (yyss);
8966 if (yymsg != yymsgbuf)
8967 YYSTACK_FREE (yymsg);
8969 /* Make sure YYID is used. */
8970 return YYID (yyresult);