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
224 below_semicolon = 354,
225 below_assignment = 355,
228 minusminus_prefix = 358,
229 plusplus_prefix = 359,
232 above_identifier = 362,
240 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
242 /* Line 223 of skeleton.m4 */
247 /* Line 223 of skeleton.m4 */
250 enum yytokentype token;
252 classinfo_t*classinfo;
253 classinfo_list_t*classinfo_list;
255 slotinfo_list_t*slotinfo_list;
258 unsigned int number_uint;
262 //typedcode_list_t*value_list;
263 codeandnumber_t value_list;
269 for_start_t for_start;
270 abc_exception_t *exception;
273 namespace_decl_t* namespace_decl;
276 abc_exception_list_t *l;
282 /* Line 223 of skeleton.m4 */
283 #line 284 "parser.tab.c"
285 # define YYSTYPE_IS_TRIVIAL 1
286 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
287 # define YYSTYPE_IS_DECLARED 1
291 /* Copy the second part of user declarations. */
293 /* Line 273 of skeleton.m4 */
297 static int a3_error(char*s)
299 syntaxerror("%s", s);
300 return 0; //make gcc happy
303 static void parsererror(const char*file, int line, const char*f)
305 syntaxerror("internal error in %s, %s:%d", f, file, line);
308 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
311 static char* concat2(const char* t1, const char* t2)
315 char*text = malloc(l1+l2+1);
316 memcpy(text , t1, l1);
317 memcpy(text+l1, t2, l2);
321 static char* concat3(const char* t1, const char* t2, const char* t3)
326 char*text = malloc(l1+l2+l3+1);
327 memcpy(text , t1, l1);
328 memcpy(text+l1, t2, l2);
329 memcpy(text+l1+l2, t3, l3);
334 typedef struct _import {
337 DECLARE_LIST(import);
339 DECLARE(methodstate);
340 DECLARE_LIST(methodstate);
342 typedef struct _classstate {
348 methodstate_t*static_init;
350 //code_t*static_init;
352 char has_constructor;
355 struct _methodstate {
366 dict_t*unresolved_variables;
369 char uses_parent_function;
377 int var_index; // for inner methods
378 int slot_index; // for inner methods
379 char is_a_slot; // for inner methods
384 abc_exception_list_t*exceptions;
386 methodstate_list_t*innerfunctions;
389 typedef struct _state {
394 import_list_t*wildcard_imports;
395 dict_t*import_toplevel_packages;
398 namespace_list_t*active_namespace_urls;
400 char has_own_imports;
401 char new_vars; // e.g. transition between two functions
402 char xmlfilter; // are we inside a xmlobj..() filter?
405 methodstate_t*method;
412 dict_t*allvars; // also contains variables from sublevels
415 typedef struct _global {
418 parsedclass_list_t*classes;
419 abc_script_t*classinit;
421 abc_script_t*init; //package-level code
424 dict_t*file2token2info;
427 static global_t*global = 0;
428 static state_t* state = 0;
432 /* protected handling here is a big hack: we just assume the protectedns
433 is package:class. the correct approach would be to add the proper
434 namespace to all protected members in the registry, even though that
435 would slow down searching */
436 #define MEMBER_MULTINAME(m,f,n) \
440 m##_ns.access = ((slotinfo_t*)(f))->access; \
441 if(m##_ns.access == ACCESS_NAMESPACE) \
442 m##_ns.name = ((slotinfo_t*)(f))->package; \
443 else if(m##_ns.access == ACCESS_PROTECTED && (f)->parent) \
444 m##_ns.name = concat3((f)->parent->package,":",(f)->parent->name); \
449 m.namespace_set = 0; \
450 m.name = ((slotinfo_t*)(f))->name; \
452 m.type = MULTINAME; \
454 m.namespace_set = &nopackage_namespace_set; \
458 /* warning: list length of namespace set is undefined */
459 #define MULTINAME_LATE(m, access, package) \
460 namespace_t m##_ns = {access, package}; \
461 namespace_set_t m##_nsset; \
462 namespace_list_t m##_l;m##_l.next = 0; \
463 m##_nsset.namespaces = &m##_l; \
464 m##_nsset = m##_nsset; \
465 m##_l.namespace = &m##_ns; \
466 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
468 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
469 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
470 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
471 static namespace_t stdns = {ACCESS_PACKAGE, ""};
472 static namespace_list_t nl4 = {&stdns,0};
473 static namespace_list_t nl3 = {&ns3,&nl4};
474 static namespace_list_t nl2 = {&ns2,&nl3};
475 static namespace_list_t nl1 = {&ns1,&nl2};
476 static namespace_set_t nopackage_namespace_set = {&nl1};
478 static dict_t*definitions=0;
479 void as3_set_define(const char*c)
482 definitions = dict_new();
483 if(!dict_contains(definitions,c))
484 dict_put(definitions,c,0);
487 static void new_state()
490 state_t*oldstate = state;
492 memcpy(s, state, sizeof(state_t)); //shallow copy
494 s->imports = dict_new();
496 if(!s->import_toplevel_packages) {
497 s->import_toplevel_packages = dict_new();
501 state->has_own_imports = 0;
502 state->vars = dict_new();
503 state->old = oldstate;
506 trie_remember(active_namespaces);
509 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
512 static void state_destroy(state_t*state)
514 if(state->has_own_imports) {
515 list_free(state->wildcard_imports);
516 dict_destroy(state->imports);state->imports=0;
518 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
519 dict_destroy(state->imports);state->imports=0;
522 dict_destroy(state->vars);state->vars=0;
524 if(state->new_vars && state->allvars) {
525 parserassert(!state->old || state->old->allvars != state->allvars);
526 DICT_ITERATE_DATA(state->allvars, void*, data) {
529 dict_destroy(state->allvars);
532 list_free(state->active_namespace_urls)
533 state->active_namespace_urls = 0;
538 static void old_state()
540 trie_rollback(active_namespaces);
542 if(!state || !state->old)
543 syntaxerror("invalid nesting");
544 state_t*leaving = state;
548 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
549 free(leaving->method);
552 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
557 state_destroy(leaving);
560 static code_t* method_header(methodstate_t*m);
561 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
562 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0);
565 static char* internal_filename_package = 0;
566 void initialize_file(char*filename)
569 syntaxerror("invalid call to initialize_file during parsing of another file");
572 active_namespaces = trie_new();
575 state->package = internal_filename_package = strdup(filename);
576 state->allvars = dict_new();
578 global->token2info = dict_lookup(global->file2token2info,
579 current_filename // use long version
581 if(!global->token2info) {
582 global->token2info = dict_new2(&ptr_type);
583 dict_put(global->file2token2info, current_filename, global->token2info);
587 state->method = rfx_calloc(sizeof(methodstate_t));
588 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
589 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
591 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
593 syntaxerror("internal error: skewed tokencount");
594 function_initvars(state->method, 0, 0, 0, 1);
595 global->init = abc_initscript(global->file);
601 if(!state || state->level!=1) {
602 syntaxerror("unexpected end of file in pass %d", as3_pass);
606 dict_del(global->file2token2info, current_filename);
607 code_t*header = method_header(state->method);
608 code_t*c = wrap_function(header, 0, global->init->method->body->code);
609 global->init->method->body->code = abc_returnvoid(c);
610 free(state->method);state->method=0;
613 //free(state->package);state->package=0; // used in registry
614 state_destroy(state);state=0;
617 void initialize_parser()
619 global = rfx_calloc(sizeof(global_t));
620 global->file = abc_file_new();
621 global->file->flags &= ~ABCFILE_LAZY;
622 global->file2token2info = dict_new();
623 global->token2info = 0;
624 global->classinit = abc_initscript(global->file);
627 void* finish_parser()
629 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
630 global->token2info=0;
632 initcode_add_classlist(global->classinit, global->classes);
637 typedef struct _variable {
642 methodstate_t*is_inner_method;
645 static variable_t* find_variable(state_t*s, char*name)
650 v = dict_lookup(s->vars, name);
652 if(s->new_vars) break;
655 return dict_lookup(top->allvars, name);
657 static variable_t* find_slot(state_t*s, const char*name)
659 if(s->method && s->method->slots)
660 return dict_lookup(s->method->slots, name);
664 static variable_t* find_variable_safe(state_t*s, char*name)
666 variable_t* v = find_variable(s, name);
668 syntaxerror("undefined variable: %s", name);
672 static char variable_exists(char*name)
674 return dict_contains(state->vars, name);
677 static code_t*defaultvalue(code_t*c, classinfo_t*type)
679 if(TYPE_IS_INT(type)) {
680 c = abc_pushbyte(c, 0);
681 } else if(TYPE_IS_UINT(type)) {
682 c = abc_pushuint(c, 0);
683 } else if(TYPE_IS_FLOAT(type)) {
685 } else if(TYPE_IS_BOOLEAN(type)) {
686 c = abc_pushfalse(c);
688 //c = abc_pushundefined(c);
689 syntaxerror("internal error: can't generate default value for * type");
693 c = abc_coerce2(c, &m);
698 static int alloc_local()
700 return state->method->variable_count++;
703 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
706 variable_t*v = find_slot(state, name);
712 v->index = alloc_local();
717 dict_put(state->vars, name, v);
718 dict_put(state->allvars, name, v);
723 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
725 return new_variable2(name, type, init, maybeslot)->index;
728 #define TEMPVARNAME "__as3_temp__"
731 variable_t*v = find_variable(state, TEMPVARNAME);
736 i = new_variable(TEMPVARNAME, 0, 0, 0);
741 static code_t* var_block(code_t*body)
747 for(t=0;t<state->vars->hashsize;t++) {
748 dictentry_t*e = state->vars->slots[t];
750 variable_t*v = (variable_t*)e->data;
751 if(v->type && v->init) {
752 c = defaultvalue(c, v->type);
753 c = abc_setlocal(c, v->index);
754 k = abc_kill(k, v->index);
764 if(x->opcode== OPCODE___BREAK__ ||
765 x->opcode== OPCODE___CONTINUE__) {
766 /* link kill code before break/continue */
767 code_t*e = code_dup(k);
768 code_t*s = code_start(e);
780 c = code_append(c, body);
781 c = code_append(c, k);
785 static void unknown_variable(char*name)
787 if(!state->method->unresolved_variables)
788 state->method->unresolved_variables = dict_new();
789 if(!dict_contains(state->method->unresolved_variables, name))
790 dict_put(state->method->unresolved_variables, name, 0);
793 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
795 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
796 c = abc_getlocal_0(c);
797 c = abc_pushscope(c);
800 /* FIXME: this alloc_local() causes variable indexes to be
801 different in pass2 than in pass1 */
802 if(!m->activation_var) {
803 m->activation_var = alloc_local();
806 c = abc_newactivation(c);
808 c = abc_pushscope(c);
809 c = abc_setlocal(c, m->activation_var);
811 c = abc_getlocal(c, m->activation_var);
812 c = abc_pushscope(c);
818 static code_t* method_header(methodstate_t*m)
822 c = add_scope_code(c, m, 1);
824 methodstate_list_t*l = m->innerfunctions;
826 parserassert(l->methodstate->abc);
827 if(m->uses_slots && l->methodstate->is_a_slot) {
828 c = abc_getscopeobject(c, 1);
829 c = abc_newfunction(c, l->methodstate->abc);
831 c = abc_setlocal(c, l->methodstate->var_index);
832 c = abc_setslot(c, l->methodstate->slot_index);
834 c = abc_newfunction(c, l->methodstate->abc);
835 c = abc_setlocal(c, l->methodstate->var_index);
837 free(l->methodstate);l->methodstate=0;
841 c = code_append(c, m->header);
844 if(m->is_constructor && !m->has_super) {
845 // call default constructor
846 c = abc_getlocal_0(c);
847 c = abc_constructsuper(c, 0);
851 /* all parameters that are used by inner functions
852 need to be copied from local to slot */
853 parserassert(m->activation_var);
854 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
855 if(v->is_parameter) {
856 c = abc_getlocal(c, m->activation_var);
857 c = abc_getlocal(c, v->index);
858 c = abc_setslot(c, v->index);
862 list_free(m->innerfunctions);
863 m->innerfunctions = 0;
868 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
870 c = code_append(c, header);
871 c = code_append(c, var_block(body));
872 /* append return if necessary */
873 if(!c || (c->opcode != OPCODE_RETURNVOID &&
874 c->opcode != OPCODE_RETURNVALUE)) {
875 c = abc_returnvoid(c);
880 static void startpackage(char*name)
883 state->package = strdup(name);
885 static void endpackage()
887 //used e.g. in classinfo_register:
888 //free(state->package);state->package=0;
892 #define FLAG_PUBLIC 256
893 #define FLAG_PROTECTED 512
894 #define FLAG_PRIVATE 1024
895 #define FLAG_PACKAGEINTERNAL 2048
896 #define FLAG_NAMESPACE 4096
898 static namespace_t modifiers2access(modifiers_t*mod)
903 if(mod->flags&FLAG_NAMESPACE) {
904 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
905 syntaxerror("invalid combination of access levels and namespaces");
906 ns.access = ACCESS_NAMESPACE;
908 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
910 /* shouldn't happen- the tokenizer only reports something as a namespace
911 if it was already registered */
912 trie_dump(active_namespaces);
913 syntaxerror("unknown namespace: %s", mod->ns);
916 } else if(mod->flags&FLAG_PUBLIC) {
917 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
918 syntaxerror("invalid combination of access levels");
919 ns.access = ACCESS_PACKAGE;
920 } else if(mod->flags&FLAG_PRIVATE) {
921 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
922 syntaxerror("invalid combination of access levels");
923 ns.access = ACCESS_PRIVATE;
924 } else if(mod->flags&FLAG_PROTECTED) {
925 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
926 syntaxerror("invalid combination of access levels");
927 ns.access = ACCESS_PROTECTED;
929 ns.access = ACCESS_PACKAGEINTERNAL;
933 static slotinfo_t* find_class(const char*name);
935 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
937 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
940 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
945 index = new_variable("this", 0, 0, 0);
946 else if(!m->is_global)
947 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
949 index = new_variable("globalscope", 0, 0, 0);
950 parserassert(!index);
955 for(p=params->list;p;p=p->next) {
956 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
959 variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0);
960 if(as3_pass==2 && m->need_arguments) {
961 m->need_arguments = v->index;
966 /* as variables and slots share the same number, make sure
967 that those variable indices are reserved. It's up to the
968 optimizer to later shuffle the variables down to lower
970 m->variable_count = m->uses_slots;
974 methodstate_list_t*l = m->innerfunctions;
976 methodstate_t*m = l->methodstate;
978 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
979 m->var_index = v->index;
980 m->slot_index = v->index;
981 v->is_inner_method = m;
987 m->scope_code = add_scope_code(m->scope_code, m, 0);
990 if(as3_pass==2 && m->slots) {
991 /* exchange unresolved identifiers with the actual objects */
992 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
993 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
994 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
995 if(!type || type->kind != INFOTYPE_CLASS) {
996 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1005 char*as3_globalclass=0;
1006 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1009 syntaxerror("inner classes now allowed");
1014 classinfo_list_t*mlist=0;
1016 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1017 syntaxerror("invalid modifier(s)");
1019 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1020 syntaxerror("public and internal not supported at the same time.");
1022 if((mod->flags&(FLAG_PROTECTED)) == (FLAG_STATIC))
1023 syntaxerror("protected and static not supported at the same time.");
1025 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1026 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1027 // all classes extend object
1028 extends = registry_getobjectclass();
1031 /* create the class name, together with the proper attributes */
1035 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1036 access = ACCESS_PRIVATE; package = internal_filename_package;
1037 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1038 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1039 } else if(state->package!=internal_filename_package) {
1040 access = ACCESS_PACKAGE; package = state->package;
1042 syntaxerror("public classes only allowed inside a package");
1046 state->cls = rfx_calloc(sizeof(classstate_t));
1047 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1048 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1049 state->cls->static_init->is_static=FLAG_STATIC;
1050 state->cls->static_init->variable_count=1;
1051 /* notice: we make no effort to initialize the top variable (local0) here,
1052 even though it has special meaning. We just rely on the fact
1053 that pass 1 won't do anything with variables */
1055 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1057 /* set current method to constructor- all code within the class-level (except
1058 static variable initializations) will be executed during construction time */
1059 state->method = state->cls->init;
1061 if(registry_find(package, classname)) {
1062 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1064 /* build info struct */
1065 int num_interfaces = (list_length(implements));
1066 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1067 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1068 state->cls->info->superclass = extends;
1071 classinfo_list_t*l = implements;
1072 for(l=implements;l;l=l->next) {
1073 state->cls->info->interfaces[pos++] = l->classinfo;
1078 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1080 state->method = state->cls->init;
1081 parserassert(state->cls && state->cls->info);
1083 function_initvars(state->cls->init, 0, 0, 0, 1);
1084 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1086 if(extends && (extends->flags & FLAG_FINAL))
1087 syntaxerror("Can't extend final class '%s'", extends->name);
1090 while(state->cls->info->interfaces[pos]) {
1091 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1092 syntaxerror("'%s' is not an interface",
1093 state->cls->info->interfaces[pos]->name);
1097 /* generate the abc code for this class */
1098 MULTINAME(classname2,state->cls->info);
1099 multiname_t*extends2 = sig2mname(extends);
1101 /* don't add the class to the class index just yet- that will be done later
1103 state->cls->abc = abc_class_new(0, &classname2, extends2);
1104 state->cls->abc->file = global->file;
1106 multiname_destroy(extends2);
1107 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1108 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1109 if(state->cls->info->flags&FLAG_INTERFACE) {
1110 abc_class_interface(state->cls->abc);
1113 for(mlist=implements;mlist;mlist=mlist->next) {
1114 MULTINAME(m, mlist->classinfo);
1115 abc_class_add_interface(state->cls->abc, &m);
1118 NEW(parsedclass_t,p);
1119 p->cls = state->cls->info;
1120 p->abc = state->cls->abc;
1121 list_append(global->classes, p);
1123 /* flash.display.MovieClip handling */
1124 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1125 if(state->package && state->package[0]) {
1126 as3_globalclass = concat3(state->package, ".", classname);
1128 as3_globalclass = strdup(classname);
1134 static void endclass()
1137 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1139 c = abc_getlocal_0(c);
1140 c = abc_constructsuper(c, 0);
1141 state->cls->init->header = code_append(state->cls->init->header, c);
1142 state->cls->has_constructor=1;
1144 if(state->cls->init) {
1145 if(state->cls->info->flags&FLAG_INTERFACE) {
1146 if(state->cls->init->header)
1147 syntaxerror("interface can not have class-level code");
1149 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1150 code_t*c = method_header(state->cls->init);
1151 m->body->code = wrap_function(c, 0, m->body->code);
1154 if(state->cls->static_init) {
1155 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1156 code_t*c = method_header(state->cls->static_init);
1157 m->body->code = wrap_function(c, 0, m->body->code);
1160 trait_list_t*trait = state->cls->abc->traits;
1161 /* switch all protected members to the protected ns of this class */
1163 trait_t*t = trait->trait;
1164 if(t->name->ns->access == ACCESS_PROTECTED) {
1165 if(!state->cls->abc->protectedNS) {
1166 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1167 state->cls->abc->protectedNS = namespace_new_protected(n);
1168 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1170 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1172 trait = trait->next;
1179 void check_code_for_break(code_t*c)
1182 if(c->opcode == OPCODE___BREAK__) {
1183 char*name = string_cstr(c->data[0]);
1184 syntaxerror("Unresolved \"break %s\"", name);
1186 if(c->opcode == OPCODE___CONTINUE__) {
1187 char*name = string_cstr(c->data[0]);
1188 syntaxerror("Unresolved \"continue %s\"", name);
1190 if(c->opcode == OPCODE___RETHROW__) {
1191 syntaxerror("Unresolved \"rethrow\"");
1193 if(c->opcode == OPCODE___FALLTHROUGH__) {
1194 syntaxerror("Unresolved \"fallthrough\"");
1196 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1197 char*name = string_cstr(c->data[0]);
1198 syntaxerror("Can't reference a package (%s) as such", name);
1204 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1206 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1207 if(TYPE_IS_NUMBER(t)) {
1208 xassert(c->type == CONSTANT_FLOAT
1209 || c->type == CONSTANT_INT
1210 || c->type == CONSTANT_UINT);
1211 } else if(TYPE_IS_UINT(t)) {
1212 xassert(c->type == CONSTANT_UINT ||
1213 (c->type == CONSTANT_INT && c->i>=0));
1214 } else if(TYPE_IS_INT(t)) {
1215 xassert(c->type == CONSTANT_INT);
1216 } else if(TYPE_IS_BOOLEAN(t)) {
1217 xassert(c->type == CONSTANT_TRUE
1218 || c->type == CONSTANT_FALSE);
1222 static void check_override(memberinfo_t*m, int flags)
1226 if(m->parent == state->cls->info)
1227 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1229 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1230 if(m->access==ACCESS_PRIVATE)
1232 if(m->flags & FLAG_FINAL)
1233 syntaxerror("can't override final member %s", m->name);
1235 /* allow this. it's no issue.
1236 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1237 syntaxerror("can't override static member %s", m->name);*/
1239 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1240 syntaxerror("can't override non-static member %s with static declaration", m->name);
1242 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1243 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1244 if(m->kind == INFOTYPE_METHOD)
1245 syntaxerror("can't override without explicit 'override' declaration");
1247 syntaxerror("can't override '%s'", m->name);
1252 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1254 methodinfo_t*minfo = 0;
1255 namespace_t ns = modifiers2access(mod);
1258 minfo = methodinfo_register_global(ns.access, state->package, name);
1259 minfo->return_type = return_type;
1260 } else if(getset != KW_GET && getset != KW_SET) {
1262 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1264 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1266 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1267 minfo->return_type = return_type;
1268 // getslot on a member slot only returns "undefined", so no need
1269 // to actually store these
1270 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1272 //class getter/setter
1273 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1275 if(getset == KW_GET) {
1277 } else if(params->list && params->list->param && !params->list->next) {
1278 type = params->list->param->type;
1280 syntaxerror("setter function needs to take exactly one argument");
1281 // not sure wether to look into superclasses here, too
1282 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1284 if(minfo->kind!=INFOTYPE_VAR)
1285 syntaxerror("class already contains a method called '%s'", name);
1286 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1287 syntaxerror("class already contains a field called '%s'", name);
1288 if(minfo->subtype & gs)
1289 syntaxerror("getter/setter for '%s' already defined", name);
1290 /* make a setter or getter into a getset */
1291 minfo->subtype |= gs;
1294 FIXME: this check needs to be done in pass 2
1296 if((!minfo->return_type != !type) ||
1297 (minfo->return_type && type &&
1298 !strcmp(minfo->return_type->name, type->name))) {
1299 syntaxerror("different type in getter and setter: %s and %s",
1300 minfo->return_type?minfo->return_type->name:"*",
1301 type?type->name:"*");
1304 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1305 minfo->kind = INFOTYPE_VAR; //hack
1306 minfo->subtype = gs;
1307 minfo->return_type = type;
1310 /* can't assign a slot as getter and setter might have different slots */
1311 //minfo->slot = slot;
1313 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1314 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1315 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1320 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1322 //parserassert(state->method && state->method->info);
1324 methodstate_t*parent_method = state->method;
1327 return_type = 0; // not valid in pass 1
1331 state->new_vars = 1;
1332 state->allvars = dict_new();
1335 state->method = rfx_calloc(sizeof(methodstate_t));
1336 state->method->inner = 1;
1337 state->method->variable_count = 0;
1338 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1340 NEW(methodinfo_t,minfo);
1341 minfo->kind = INFOTYPE_METHOD;
1342 minfo->access = ACCESS_PACKAGEINTERNAL;
1344 state->method->info = minfo;
1347 list_append(parent_method->innerfunctions, state->method);
1349 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1351 function_initvars(state->method, 1, params, 0, 1);
1355 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1356 state->method->variable_count = 0;
1357 parserassert(state->method);
1359 state->method->info->return_type = return_type;
1360 function_initvars(state->method, 1, params, 0, 1);
1364 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1365 params_t*params, classinfo_t*return_type)
1367 if(state->method && state->method->info) {
1368 syntaxerror("not able to start another method scope");
1371 state->new_vars = 1;
1372 state->allvars = dict_new();
1375 state->method = rfx_calloc(sizeof(methodstate_t));
1376 state->method->has_super = 0;
1377 state->method->is_static = mod->flags&FLAG_STATIC;
1380 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1382 state->method->is_global = 1;
1383 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1385 if(state->method->is_constructor)
1386 name = "__as3_constructor__";
1388 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1390 function_initvars(state->method, 1, params, mod->flags, 1);
1392 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1396 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1397 state->method->variable_count = 0;
1398 parserassert(state->method);
1401 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1402 check_override(m, mod->flags);
1406 state->cls->has_constructor |= state->method->is_constructor;
1409 function_initvars(state->method, 1, params, mod->flags, 1);
1413 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1414 params_t*params, classinfo_t*return_type, code_t*body)
1417 // store inner methods in variables
1418 function_initvars(state->method, 0, 0, 0, 0);
1420 methodstate_list_t*ml = state->method->innerfunctions;
1422 dict_t*xvars = dict_new();
1425 methodstate_t*m = ml->methodstate;
1426 parserassert(m->inner);
1427 if(m->unresolved_variables) {
1428 dict_t*d = m->unresolved_variables;
1430 for(t=0;t<d->hashsize;t++) {
1431 dictentry_t*l = d->slots[t];
1433 /* check parent method's variables */
1435 if((v=find_variable(state, l->key))) {
1436 m->uses_parent_function = 1;
1437 state->method->uses_slots = 1;
1438 dict_put(xvars, l->key, 0);
1445 dict_destroy(m->unresolved_variables);
1446 m->unresolved_variables = 0;
1451 if(state->method->uses_slots) {
1452 state->method->slots = dict_new();
1454 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1455 if(!name) syntaxerror("internal error");
1456 if(v->index && dict_contains(xvars, name)) {
1459 if(v->is_inner_method) {
1460 v->is_inner_method->is_a_slot = 1;
1463 dict_put(state->method->slots, name, v);
1466 state->method->uses_slots = i;
1467 dict_destroy(state->vars);state->vars = 0;
1468 parserassert(state->new_vars);
1469 dict_destroy(state->allvars);state->allvars = 0;
1476 /*if(state->method->uses_parent_function){
1477 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1482 multiname_t*type2 = sig2mname(return_type);
1484 if(state->method->inner) {
1485 f = state->method->abc;
1486 abc_method_init(f, global->file, type2, 1);
1487 } else if(state->method->is_constructor) {
1488 f = abc_class_getconstructor(state->cls->abc, type2);
1489 } else if(!state->method->is_global) {
1490 namespace_t ns = modifiers2access(mod);
1491 multiname_t mname = {QNAME, &ns, 0, name};
1492 if(mod->flags&FLAG_STATIC)
1493 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1495 f = abc_class_method(state->cls->abc, type2, &mname);
1496 slot = f->trait->slot_id;
1498 namespace_t mname_ns = {state->method->info->access, state->package};
1499 multiname_t mname = {QNAME, &mname_ns, 0, name};
1501 f = abc_method_new(global->file, type2, 1);
1502 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1503 //abc_code_t*c = global->init->method->body->code;
1505 //flash doesn't seem to allow us to access function slots
1506 //state->method->info->slot = slot;
1508 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1509 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1510 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1511 if(params->varargs) f->flags |= METHOD_NEED_REST;
1512 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1516 for(p=params->list;p;p=p->next) {
1517 if(params->varargs && !p->next) {
1518 break; //varargs: omit last parameter in function signature
1520 multiname_t*m = sig2mname(p->param->type);
1521 list_append(f->parameters, m);
1522 if(p->param->value) {
1523 check_constant_against_type(p->param->type, p->param->value);
1524 opt=1;list_append(f->optional_parameters, p->param->value);
1526 syntaxerror("non-optional parameter not allowed after optional parameters");
1529 if(state->method->slots) {
1530 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1532 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1533 multiname_t*type = sig2mname(v->type);
1534 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1535 t->slot_id = v->index;
1540 check_code_for_break(body);
1542 /* Seems this works now.
1543 if(state->method->exceptions && state->method->uses_slots) {
1544 as3_warning("try/catch and activation not supported yet within the same method");
1548 f->body->code = body;
1549 f->body->exceptions = state->method->exceptions;
1550 } else { //interface
1552 syntaxerror("interface methods can't have a method body");
1562 void breakjumpsto(code_t*c, char*name, code_t*jump)
1565 if(c->opcode == OPCODE___BREAK__) {
1566 string_t*name2 = c->data[0];
1567 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1568 c->opcode = OPCODE_JUMP;
1575 void continuejumpsto(code_t*c, char*name, code_t*jump)
1578 if(c->opcode == OPCODE___CONTINUE__) {
1579 string_t*name2 = c->data[0];
1580 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1581 c->opcode = OPCODE_JUMP;
1589 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1594 return abc_coerce_a(c);
1598 // cast an "any" type to a specific type. subject to
1599 // runtime exceptions
1600 return abc_coerce2(c, &m);
1603 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1604 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1605 // allow conversion between number types
1606 if(TYPE_IS_UINT(to))
1607 return abc_convert_u(c);
1608 else if(TYPE_IS_INT(to))
1609 return abc_convert_i(c);
1610 else if(TYPE_IS_NUMBER(to))
1611 return abc_convert_d(c);
1612 return abc_coerce2(c, &m);
1615 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1618 if(TYPE_IS_BOOLEAN(to))
1619 return abc_convert_b(c);
1620 if(TYPE_IS_STRING(to))
1621 return abc_convert_s(c);
1622 if(TYPE_IS_OBJECT(to))
1623 return abc_convert_o(c);
1625 classinfo_t*supertype = from;
1627 if(supertype == to) {
1628 // target type is one of from's superclasses
1629 return abc_coerce2(c, &m);
1632 while(supertype->interfaces[t]) {
1633 if(supertype->interfaces[t]==to) {
1634 // target type is one of from's interfaces
1635 return abc_coerce2(c, &m);
1639 supertype = supertype->superclass;
1641 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1643 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1645 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1648 as3_error("can't convert type %s%s%s to %s%s%s",
1649 from->package, from->package[0]?".":"", from->name,
1650 to->package, to->package[0]?".":"", to->name);
1654 /* move to ast.c todo end */
1656 char is_pushundefined(code_t*c)
1658 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1661 static const char* get_package_from_name(const char*name)
1663 /* try explicit imports */
1664 dictentry_t* e = dict_get_slot(state->imports, name);
1666 if(!strcmp(e->key, name)) {
1667 slotinfo_t*c = (slotinfo_t*)e->data;
1668 if(c) return c->package;
1674 static namespace_list_t*get_current_imports()
1676 namespace_list_t*searchlist = 0;
1678 list_append(searchlist, namespace_new_package(state->package));
1680 import_list_t*l = state->wildcard_imports;
1682 namespace_t*ns = namespace_new_package(l->import->package);
1683 list_append(searchlist, ns);
1686 list_append(searchlist, namespace_new_package(""));
1687 list_append(searchlist, namespace_new_package(internal_filename_package));
1691 static slotinfo_t* find_class(const char*name)
1695 c = registry_find(state->package, name);
1698 /* try explicit imports */
1699 dictentry_t* e = dict_get_slot(state->imports, name);
1702 if(!strcmp(e->key, name)) {
1703 c = (slotinfo_t*)e->data;
1709 /* try package.* imports */
1710 import_list_t*l = state->wildcard_imports;
1712 //printf("does package %s contain a class %s?\n", l->import->package, name);
1713 c = registry_find(l->import->package, name);
1718 /* try global package */
1719 c = registry_find("", name);
1722 /* try local "filename" package */
1723 c = registry_find(internal_filename_package, name);
1728 typedcode_t push_class(slotinfo_t*a)
1733 if(a->access == ACCESS_PACKAGEINTERNAL &&
1734 strcmp(a->package, state->package) &&
1735 strcmp(a->package, internal_filename_package)
1737 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1738 infotypename(a), a->name, a->package, state->package);
1741 if(a->kind != INFOTYPE_CLASS) {
1743 x.c = abc_findpropstrict2(x.c, &m);
1744 x.c = abc_getproperty2(x.c, &m);
1745 if(a->kind == INFOTYPE_METHOD) {
1746 methodinfo_t*f = (methodinfo_t*)a;
1747 x.t = TYPE_FUNCTION(f);
1749 varinfo_t*v = (varinfo_t*)a;
1753 classinfo_t*c = (classinfo_t*)a;
1755 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1756 x.c = abc_getglobalscope(x.c);
1757 x.c = abc_getslot(x.c, c->slot);
1760 x.c = abc_getlex2(x.c, &m);
1762 x.t = TYPE_CLASS(c);
1768 char is_break_or_jump(code_t*c)
1772 if(c->opcode == OPCODE_JUMP ||
1773 c->opcode == OPCODE___BREAK__ ||
1774 c->opcode == OPCODE___CONTINUE__ ||
1775 c->opcode == OPCODE_THROW ||
1776 c->opcode == OPCODE_RETURNVOID ||
1777 c->opcode == OPCODE_RETURNVALUE) {
1783 #define IS_FINALLY_TARGET(op) \
1784 ((op) == OPCODE___CONTINUE__ || \
1785 (op) == OPCODE___BREAK__ || \
1786 (op) == OPCODE_RETURNVOID || \
1787 (op) == OPCODE_RETURNVALUE || \
1788 (op) == OPCODE___RETHROW__)
1790 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1792 #define NEED_EXTRA_STACK_ARG
1793 code_t*finally_label = abc_nop(0);
1794 NEW(lookupswitch_t, l);
1800 code_t*prev = i->prev;
1801 if(IS_FINALLY_TARGET(i->opcode)) {
1804 if(i->opcode == OPCODE___RETHROW__ ||
1805 i->opcode == OPCODE_RETURNVALUE) {
1806 if(i->opcode == OPCODE___RETHROW__)
1807 i->opcode = OPCODE_THROW;
1809 p = abc_coerce_a(p);
1810 p = abc_setlocal(p, tempvar);
1812 p = abc_pushbyte(p, count++);
1813 p = abc_jump(p, finally_label);
1814 code_t*target = p = abc_label(p);
1815 #ifdef NEED_EXTRA_STACK_ARG
1819 p = abc_getlocal(p, tempvar);
1822 p->next = i;i->prev = p;
1823 list_append(l->targets, target);
1829 c = abc_pushbyte(c, -1);
1830 c = code_append(c, finally_label);
1831 c = code_append(c, finally);
1833 #ifdef NEED_EXTRA_STACK_ARG
1836 c = abc_lookupswitch(c, l);
1837 c = l->def = abc_label(c);
1838 #ifdef NEED_EXTRA_STACK_ARG
1845 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1849 code_t*prev = i->prev;
1850 if(IS_FINALLY_TARGET(i->opcode)) {
1851 if(i->opcode == OPCODE___RETHROW__)
1852 i->opcode = OPCODE_THROW;
1853 code_t*end = code_dup(finally);
1854 code_t*start = code_start(end);
1855 if(prev) prev->next = start;
1862 return code_append(c, finally);
1865 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1871 int num_insertion_points=0;
1873 if(IS_FINALLY_TARGET(i->opcode))
1874 num_insertion_points++;
1881 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1886 int simple_version_cost = (1+num_insertion_points)*code_size;
1887 int lookup_version_cost = 4*num_insertion_points + 5;
1889 if(cantdup || simple_version_cost > lookup_version_cost) {
1890 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1891 return insert_finally_lookup(c, finally, tempvar);
1893 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1894 return insert_finally_simple(c, finally, tempvar);
1898 #define PASS1 }} if(as3_pass == 1) {{
1899 #define PASS1END }} if(as3_pass == 2) {{
1900 #define PASS2 }} if(as3_pass == 2) {{
1901 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1902 #define PASS12END }} if(as3_pass == 2) {{
1903 #define PASS_ALWAYS }} {{
1907 /* Line 273 of skeleton.m4 */
1908 #line 1909 "parser.tab.c"
1909 /* Unqualified %code blocks. */
1911 /* Line 274 of skeleton.m4 */
1912 #line 1985 "parser.y"
1914 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1920 /* Line 274 of skeleton.m4 */
1921 #line 2434 "parser.y"
1923 static void state_has_imports()
1925 state->wildcard_imports = list_clone(state->wildcard_imports);
1926 state->imports = dict_clone(state->imports);
1927 state->has_own_imports = 1;
1929 static void import_toplevel(const char*package)
1931 char* s = strdup(package);
1933 dict_put(state->import_toplevel_packages, s, 0);
1934 char*x = strrchr(s, '.');
1943 /* Line 274 of skeleton.m4 */
1944 #line 2567 "parser.y"
1946 static int slotstate_varconst = 0;
1947 static modifiers_t*slotstate_flags = 0;
1948 static void setslotstate(modifiers_t* flags, int varconst)
1950 slotstate_varconst = varconst;
1951 slotstate_flags = flags;
1954 if(flags->flags&FLAG_STATIC) {
1955 state->method = state->cls->static_init;
1957 state->method = state->cls->init;
1960 // reset to "default" state (all in class code is static by default) */
1961 state->method = state->cls->static_init;
1964 parserassert(state->method);
1967 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
1969 int flags = modifiers->flags;
1970 namespace_t ns = modifiers2access(modifiers);
1973 multiname_t mname = {QNAME, &ns, 0, name};
1975 trait_list_t**traits;
1979 ns.name = state->package;
1980 traits = &global->init->traits;
1981 code = &global->init->method->body->code;
1982 } else if(flags&FLAG_STATIC) {
1984 traits = &state->cls->abc->static_traits;
1985 code = &state->cls->static_init->header;
1987 // instance variable
1988 traits = &state->cls->abc->traits;
1989 code = &state->cls->init->header;
1994 *m = *multiname_clone(&mname);
1996 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
2000 /* Line 274 of skeleton.m4 */
2001 #line 2747 "parser.y"
2003 static int xml_level = 0;
2006 /* Line 274 of skeleton.m4 */
2007 #line 3519 "parser.y"
2009 node_t* resolve_identifier(char*name)
2019 /* look at variables */
2020 if((v = find_variable(state, name))) {
2021 // name is a local variable
2022 o.c = abc_getlocal(o.c, v->index);
2024 return mkcodenode(o);
2026 if((v = find_slot(state, name))) {
2027 o.c = abc_getscopeobject(o.c, 1);
2028 o.c = abc_getslot(o.c, v->index);
2030 return mkcodenode(o);
2033 int i_am_static = state->method->is_static;
2035 /* look at current class' members */
2036 if(!state->method->inner &&
2037 !state->xmlfilter &&
2039 (f = findmember_nsset(state->cls->info, name, 1)))
2041 // name is a member or attribute in this class
2042 int var_is_static = (f->flags&FLAG_STATIC);
2044 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2045 /* if the variable is a constant (and we know what is evaluates to), we
2046 can just use the value itself */
2047 varinfo_t*v = (varinfo_t*)f;
2049 return mkconstnode(v->value);
2053 if(var_is_static >= i_am_static) {
2054 if(f->kind == INFOTYPE_METHOD) {
2055 o.t = TYPE_FUNCTION(f);
2060 if(var_is_static && !i_am_static) {
2061 /* access to a static member from a non-static location.
2062 do this via findpropstrict:
2063 there doesn't seem to be any non-lookup way to access
2064 static properties of a class */
2065 state->method->late_binding = 1;
2067 namespace_t ns = {f->access, f->package};
2068 multiname_t m = {QNAME, &ns, 0, name};
2069 o.c = abc_findpropstrict2(o.c, &m);
2070 o.c = abc_getproperty2(o.c, &m);
2071 return mkcodenode(o);
2072 } else if(f->slot>0) {
2073 o.c = abc_getlocal_0(o.c);
2074 o.c = abc_getslot(o.c, f->slot);
2075 return mkcodenode(o);
2077 MEMBER_MULTINAME(m, f, name);
2078 o.c = abc_getlocal_0(o.c);
2079 o.c = abc_getproperty2(o.c, &m);
2080 return mkcodenode(o);
2085 /* look at actual classes, in the current package and imported */
2086 if(!state->xmlfilter && (a = find_class(name))) {
2087 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2088 o.c = abc_getlocal_0(0);
2089 o.t = TYPE_CLASS((classinfo_t*)a);
2093 return mkcodenode(o);
2096 /* look through package prefixes */
2097 if(!state->xmlfilter &&
2098 (dict_contains(state->import_toplevel_packages, name) ||
2099 registry_ispackage(name))) {
2100 o.c = abc___pushpackage__(o.c, name);
2102 return mkcodenode(o); //?
2105 /* unknown object, let the avm2 resolve it */
2107 if(!state->method->inner && !state->xmlfilter) {
2108 /* we really should make inner functions aware of the class context */
2109 as3_warning("Couldn't resolve '%s', doing late binding", name);
2111 state->method->late_binding = 1;
2113 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2116 o.c = abc_findpropstrict2(o.c, &m);
2117 o.c = abc_getproperty2(o.c, &m);
2118 return mkcodenode(o);
2123 /* Line 274 of skeleton.m4 */
2124 #line 3661 "parser.y"
2126 void add_active_url(const char*url)
2130 list_append(state->active_namespace_urls, n);
2135 /* Line 274 of skeleton.m4 */
2136 #line 2137 "parser.tab.c"
2143 typedef YYTYPE_UINT8 yytype_uint8;
2145 typedef unsigned char yytype_uint8;
2149 typedef YYTYPE_INT8 yytype_int8;
2150 #elif (defined __STDC__ || defined __C99__FUNC__ \
2151 || defined __cplusplus || defined _MSC_VER)
2152 typedef signed char yytype_int8;
2154 typedef short int yytype_int8;
2157 #ifdef YYTYPE_UINT16
2158 typedef YYTYPE_UINT16 yytype_uint16;
2160 typedef unsigned short int yytype_uint16;
2164 typedef YYTYPE_INT16 yytype_int16;
2166 typedef short int yytype_int16;
2170 # ifdef __SIZE_TYPE__
2171 # define YYSIZE_T __SIZE_TYPE__
2172 # elif defined size_t
2173 # define YYSIZE_T size_t
2174 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2175 || defined __cplusplus || defined _MSC_VER)
2176 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2177 # define YYSIZE_T size_t
2179 # define YYSIZE_T unsigned int
2183 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2188 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2189 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2193 # define YY_(msgid) msgid
2197 /* Suppress unused-variable warnings by "using" E. */
2198 #if ! defined lint || defined __GNUC__
2199 # define YYUSE(e) ((void) (e))
2201 # define YYUSE(e) /* empty */
2204 /* Identity function, used to suppress warnings about constant conditions. */
2206 # define YYID(n) (n)
2208 #if (defined __STDC__ || defined __C99__FUNC__ \
2209 || defined __cplusplus || defined _MSC_VER)
2222 #if ! defined yyoverflow || YYERROR_VERBOSE
2224 /* The parser invokes alloca or malloc; define the necessary symbols. */
2226 # ifdef YYSTACK_USE_ALLOCA
2227 # if YYSTACK_USE_ALLOCA
2229 # define YYSTACK_ALLOC __builtin_alloca
2230 # elif defined __BUILTIN_VA_ARG_INCR
2231 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2233 # define YYSTACK_ALLOC __alloca
2234 # elif defined _MSC_VER
2235 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2236 # define alloca _alloca
2238 # define YYSTACK_ALLOC alloca
2239 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2240 || defined __cplusplus || defined _MSC_VER)
2241 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2243 # define _STDLIB_H 1
2250 # ifdef YYSTACK_ALLOC
2251 /* Pacify GCC's `empty if-body' warning. */
2252 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2253 # ifndef YYSTACK_ALLOC_MAXIMUM
2254 /* The OS might guarantee only one guard page at the bottom of the stack,
2255 and a page size can be as small as 4096 bytes. So we cannot safely
2256 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2257 to allow for a few compiler-allocated temporary stack slots. */
2258 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2261 # define YYSTACK_ALLOC YYMALLOC
2262 # define YYSTACK_FREE YYFREE
2263 # ifndef YYSTACK_ALLOC_MAXIMUM
2264 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2266 # if (defined __cplusplus && ! defined _STDLIB_H \
2267 && ! ((defined YYMALLOC || defined malloc) \
2268 && (defined YYFREE || defined free)))
2269 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2271 # define _STDLIB_H 1
2275 # define YYMALLOC malloc
2276 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2277 || defined __cplusplus || defined _MSC_VER)
2278 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2282 # define YYFREE free
2283 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2284 || defined __cplusplus || defined _MSC_VER)
2285 void free (void *); /* INFRINGES ON USER NAME SPACE */
2289 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2292 #if (! defined yyoverflow \
2293 && (! defined __cplusplus \
2294 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2296 /* A type that is properly aligned for any stack member. */
2299 yytype_int16 yyss_alloc;
2303 /* The size of the maximum gap between one aligned stack and the next. */
2304 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2306 /* The size of an array large to enough to hold all stacks, each with
2308 # define YYSTACK_BYTES(N) \
2309 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2310 + YYSTACK_GAP_MAXIMUM)
2312 /* Copy COUNT objects from FROM to TO. The source and destination do
2315 # if defined __GNUC__ && 1 < __GNUC__
2316 # define YYCOPY(To, From, Count) \
2317 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2319 # define YYCOPY(To, From, Count) \
2323 for (yyi = 0; yyi < (Count); yyi++) \
2324 (To)[yyi] = (From)[yyi]; \
2330 /* Relocate STACK from its old location to the new one. The
2331 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2332 elements in the stack, and YYPTR gives the new location of the
2333 stack. Advance YYPTR to a properly aligned location for the next
2335 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2338 YYSIZE_T yynewbytes; \
2339 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2340 Stack = &yyptr->Stack_alloc; \
2341 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2342 yyptr += yynewbytes / sizeof (*yyptr); \
2348 /* YYFINAL -- State number of the termination state. */
2350 /* YYLAST -- Last index in YYTABLE. */
2353 /* YYNTOKENS -- Number of terminals. */
2354 #define YYNTOKENS 135
2355 /* YYNNTS -- Number of nonterminals. */
2357 /* YYNRULES -- Number of rules. */
2358 #define YYNRULES 347
2359 /* YYNRULES -- Number of states. */
2360 #define YYNSTATES 591
2362 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2363 #define YYUNDEFTOK 2
2364 #define YYMAXUTOK 364
2366 #define YYTRANSLATE(YYX) \
2367 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2369 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2370 static const yytype_uint8 yytranslate[] =
2372 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2375 2, 2, 2, 119, 2, 2, 2, 117, 108, 2,
2376 123, 134, 116, 114, 101, 113, 128, 115, 2, 2,
2377 2, 2, 2, 2, 2, 2, 2, 2, 105, 100,
2378 110, 103, 111, 104, 129, 2, 2, 2, 2, 2,
2379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2381 2, 125, 2, 126, 107, 2, 2, 2, 2, 2,
2382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2384 2, 2, 2, 127, 106, 133, 118, 2, 2, 2,
2385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2390 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2393 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2397 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2398 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2399 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2400 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2401 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2402 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2403 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2404 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2405 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2406 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2407 95, 96, 97, 98, 99, 102, 109, 112, 120, 121,
2408 122, 124, 130, 131, 132
2412 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2414 static const yytype_uint16 yyprhs[] =
2416 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2417 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2418 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2419 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2420 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2421 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2422 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2423 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2424 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2425 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2426 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2427 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2428 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2429 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2430 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2431 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2432 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2433 468, 470, 472, 474, 476, 478, 480, 482, 484, 486,
2434 488, 490, 491, 492, 497, 498, 503, 504, 507, 510,
2435 513, 516, 520, 522, 524, 535, 542, 554, 555, 557,
2436 559, 562, 564, 568, 572, 576, 580, 581, 583, 586,
2437 591, 595, 597, 602, 605, 607, 609, 610, 611, 624,
2438 626, 627, 628, 639, 641, 645, 647, 649, 651, 655,
2439 657, 659, 661, 664, 665, 666, 670, 671, 673, 675,
2440 677, 680, 683, 684, 689, 694, 699, 702, 704, 707,
2441 709, 711, 713, 717, 719, 723, 724, 726, 728, 730,
2442 732, 734, 736, 740, 746, 748, 750, 752, 754, 756,
2443 758, 760, 762, 764, 766, 770, 774, 778, 782, 786,
2444 790, 794, 798, 802, 806, 810, 814, 817, 820, 824,
2445 828, 832, 836, 840, 844, 848, 852, 856, 860, 864,
2446 868, 872, 876, 880, 885, 888, 890, 894, 897, 902,
2447 906, 910, 914, 918, 922, 926, 930, 934, 938, 942,
2448 946, 950, 956, 959, 962, 965, 968, 972, 975, 976,
2449 983, 985, 987, 989, 991, 997, 1001, 1007, 1012, 1017,
2450 1024, 1031, 1035, 1037, 1040, 1045, 1050, 1053
2453 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2454 static const yytype_int16 yyrhs[] =
2456 136, 0, -1, 137, -1, -1, 138, -1, 139, -1,
2457 138, 139, -1, 187, -1, 199, -1, 197, -1, 233,
2458 -1, 208, -1, 148, -1, 149, 127, 137, 133, -1,
2459 100, -1, -1, 141, -1, 142, -1, 141, 142, -1,
2460 199, -1, 197, -1, 233, -1, 208, -1, 148, -1,
2461 149, 127, 140, 133, -1, 100, -1, 144, -1, -1,
2462 144, 146, -1, 146, -1, 190, -1, 160, -1, 161,
2463 -1, 162, -1, 164, -1, 172, -1, 155, -1, 184,
2464 -1, 180, -1, 256, -1, 268, -1, 267, -1, 127,
2465 144, 133, -1, 127, 133, -1, 100, -1, 145, -1,
2466 151, -1, 166, -1, 167, -1, 252, -1, 182, -1,
2467 149, 127, 144, 133, -1, 146, 100, -1, 146, -1,
2468 145, -1, 3, 90, 3, -1, 103, 260, -1, -1,
2469 46, 152, -1, 32, 152, -1, 153, -1, 152, 101,
2470 153, -1, 3, 243, 150, -1, -1, 65, 147, -1,
2471 -1, 64, 123, 156, 254, 134, 147, 154, -1, -1,
2472 151, -1, 256, -1, 46, 3, 243, -1, 3, -1,
2473 11, 123, -1, 11, 50, 123, -1, 159, 157, 100,
2474 254, 100, 256, 134, 147, -1, 159, 158, 68, 254,
2475 134, 147, -1, -1, 12, 123, 163, 254, 134, 147,
2476 -1, -1, 13, 165, 147, 12, 123, 254, 134, -1,
2477 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2478 -1, 169, -1, 171, -1, 169, 171, -1, 170, -1,
2479 169, 170, -1, 34, 260, 105, 143, -1, 62, 105,
2480 143, -1, -1, 14, 123, 173, 260, 134, 127, 168,
2481 133, -1, -1, 33, 123, 3, 243, 134, 175, 127,
2482 143, 133, -1, -1, 27, 127, 177, 143, 133, -1,
2483 174, -1, 178, 174, -1, 178, -1, 178, 176, -1,
2484 176, -1, -1, 52, 127, 181, 143, 133, 179, -1,
2485 37, 254, -1, 37, -1, 39, 123, 254, 134, -1,
2486 183, 147, -1, 3, -1, 17, -1, 4, -1, 186,
2487 128, 185, -1, 185, -1, -1, 17, 186, 127, 188,
2488 140, 133, -1, -1, 17, 127, 189, 140, 133, -1,
2489 41, 239, -1, 41, 186, 128, 116, -1, -1, 192,
2490 -1, 193, -1, 192, 193, -1, 20, -1, 21, -1,
2491 18, -1, 38, -1, 47, -1, 49, -1, 48, -1,
2492 25, -1, 23, -1, 4, -1, -1, 54, 240, -1,
2493 -1, 54, 241, -1, -1, 15, 241, -1, -1, 191,
2494 31, 3, 194, 196, 127, 198, 201, 133, -1, -1,
2495 191, 44, 3, 195, 127, 200, 204, 133, -1, -1,
2496 202, -1, 203, -1, 202, 203, -1, 100, -1, 149,
2497 127, 201, 133, -1, 208, -1, 233, -1, 145, -1,
2498 -1, 205, -1, 206, -1, 205, 206, -1, 100, -1,
2499 46, 3, -1, 191, 26, 232, 3, 123, 229, 134,
2500 243, -1, 46, -1, 32, -1, -1, 191, 207, 209,
2501 210, -1, 211, -1, 210, 101, 211, -1, 3, 243,
2502 150, -1, -1, 103, 260, -1, 8, -1, 9, -1,
2503 10, -1, 5, -1, 56, -1, 55, -1, 45, -1,
2504 28, -1, 29, -1, 225, -1, 110, -1, 111, -1,
2505 -1, -1, 127, 260, 219, 133, -1, -1, 127, 260,
2506 221, 133, -1, -1, 222, 218, -1, 222, 5, -1,
2507 222, 111, -1, 225, 222, -1, 223, 225, 222, -1,
2508 3, -1, 220, -1, 215, 224, 226, 216, 222, 110,
2509 115, 224, 217, 111, -1, 215, 224, 226, 115, 217,
2510 111, -1, 215, 224, 226, 216, 222, 223, 110, 115,
2511 224, 217, 111, -1, -1, 227, -1, 228, -1, 227,
2512 228, -1, 220, -1, 220, 103, 5, -1, 220, 103,
2513 220, -1, 3, 103, 220, -1, 3, 103, 5, -1,
2514 -1, 230, -1, 94, 231, -1, 230, 101, 94, 231,
2515 -1, 230, 101, 231, -1, 231, -1, 3, 105, 242,
2516 212, -1, 3, 212, -1, 51, -1, 35, -1, -1,
2517 -1, 191, 26, 232, 3, 123, 229, 134, 243, 127,
2518 234, 143, 133, -1, 3, -1, -1, -1, 26, 235,
2519 123, 229, 134, 243, 127, 237, 143, 133, -1, 185,
2520 -1, 186, 128, 185, -1, 239, -1, 238, -1, 240,
2521 -1, 241, 101, 240, -1, 240, -1, 116, -1, 36,
2522 -1, 105, 242, -1, -1, -1, 123, 245, 134, -1,
2523 -1, 246, -1, 247, -1, 253, -1, 246, 101, -1,
2524 247, 253, -1, -1, 24, 260, 248, 244, -1, 260,
2525 123, 245, 134, -1, 53, 123, 245, 134, -1, 63,
2526 260, -1, 42, -1, 42, 254, -1, 260, -1, 255,
2527 -1, 260, -1, 255, 101, 260, -1, 260, -1, 256,
2528 101, 260, -1, -1, 259, -1, 3, -1, 5, -1,
2529 8, -1, 9, -1, 10, -1, 258, 105, 253, -1,
2530 259, 101, 258, 105, 253, -1, 236, -1, 264, -1,
2531 249, -1, 251, -1, 250, -1, 265, -1, 213, -1,
2532 214, -1, 6, -1, 19, -1, 125, 245, 126, -1,
2533 70, 257, 133, -1, 260, 110, 260, -1, 260, 111,
2534 260, -1, 260, 75, 260, -1, 260, 76, 260, -1,
2535 260, 71, 260, -1, 260, 72, 260, -1, 260, 74,
2536 260, -1, 260, 73, 260, -1, 260, 88, 260, -1,
2537 260, 89, 260, -1, 119, 260, -1, 118, 260, -1,
2538 260, 108, 260, -1, 260, 107, 260, -1, 260, 106,
2539 260, -1, 260, 97, 260, -1, 260, 96, 260, -1,
2540 260, 95, 260, -1, 260, 115, 260, -1, 260, 117,
2541 260, -1, 260, 114, 260, -1, 260, 113, 260, -1,
2542 260, 116, 260, -1, 260, 68, 260, -1, 260, 69,
2543 260, -1, 260, 40, 260, -1, 260, 67, 260, -1,
2544 43, 123, 260, 134, -1, 36, 260, -1, 36, -1,
2545 123, 255, 134, -1, 113, 260, -1, 260, 125, 260,
2546 126, -1, 260, 80, 260, -1, 260, 79, 260, -1,
2547 260, 86, 260, -1, 260, 85, 260, -1, 260, 87,
2548 260, -1, 260, 78, 260, -1, 260, 77, 260, -1,
2549 260, 84, 260, -1, 260, 81, 260, -1, 260, 82,
2550 260, -1, 260, 83, 260, -1, 260, 103, 260, -1,
2551 260, 104, 260, 105, 260, -1, 260, 92, -1, 260,
2552 91, -1, 92, 260, -1, 91, 260, -1, 53, 128,
2553 3, -1, 129, 3, -1, -1, 260, 128, 123, 261,
2554 260, 134, -1, 3, -1, 4, -1, 3, -1, 116,
2555 -1, 260, 128, 262, 90, 263, -1, 260, 93, 263,
2556 -1, 260, 128, 125, 260, 126, -1, 260, 128, 129,
2557 263, -1, 260, 93, 129, 263, -1, 260, 128, 129,
2558 125, 260, 126, -1, 260, 93, 129, 125, 260, 126,
2559 -1, 260, 128, 263, -1, 3, -1, 16, 3, -1,
2560 16, 3, 103, 3, -1, 16, 3, 103, 5, -1,
2561 191, 266, -1, 22, 16, 240, -1
2564 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2565 static const yytype_uint16 yyrline[] =
2567 0, 1890, 1890, 1892, 1892, 1893, 1894, 1896, 1897, 1898,
2568 1899, 1900, 1901, 1902, 1903, 1905, 1905, 1906, 1907, 1909,
2569 1910, 1911, 1912, 1913, 1914, 1915, 1917, 1918, 1920, 1923,
2570 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935,
2571 1936, 1937, 1938, 1939, 1942, 1943, 1944, 1945, 1946, 1947,
2572 1948, 1949, 1961, 1962, 1966, 1973, 1992, 1993, 1995, 1996,
2573 1998, 1999, 2001, 2061, 2062, 2065, 2065, 2084, 2085, 2086,
2574 2091, 2095, 2100, 2101, 2103, 2123, 2171, 2171, 2190, 2190,
2575 2205, 2208, 2211, 2214, 2218, 2219, 2220, 2221, 2222, 2223,
2576 2225, 2236, 2239, 2239, 2270, 2270, 2295, 2295, 2311, 2312,
2577 2313, 2314, 2322, 2331, 2331, 2380, 2384, 2395, 2405, 2422,
2578 2423, 2424, 2426, 2427, 2429, 2429, 2431, 2431, 2454, 2468,
2579 2484, 2485, 2486, 2487, 2494, 2495, 2496, 2497, 2498, 2499,
2580 2500, 2501, 2502, 2503, 2507, 2508, 2510, 2511, 2513, 2514,
2581 2518, 2516, 2524, 2522, 2531, 2532, 2533, 2534, 2535, 2536,
2582 2537, 2538, 2540, 2546, 2547, 2548, 2549, 2550, 2551, 2554,
2583 2622, 2622, 2624, 2624, 2626, 2627, 2629, 2713, 2714, 2723,
2584 2724, 2727, 2728, 2729, 2730, 2731, 2732, 2733, 2751, 2753,
2585 2754, 2755, 2757, 2757, 2761, 2761, 2765, 2766, 2769, 2770,
2586 2772, 2773, 2775, 2776, 2778, 2782, 2785, 2790, 2791, 2792,
2587 2793, 2795, 2798, 2802, 2805, 2808, 2818, 2822, 2828, 2834,
2588 2842, 2847, 2853, 2861, 2869, 2870, 2871, 2874, 2873, 2890,
2589 2891, 2893, 2892, 2916, 2935, 2949, 2950, 2952, 2953, 2955,
2590 2956, 2957, 2966, 2967, 2971, 2972, 2974, 2975, 2976, 2978,
2591 2982, 2983, 2988, 2989, 3033, 3083, 3104, 3126, 3129, 3136,
2592 3139, 3142, 3145, 3148, 3151, 3156, 3157, 3159, 3160, 3161,
2593 3162, 3163, 3165, 3171, 3180, 3181, 3182, 3183, 3184, 3185,
2594 3187, 3191, 3203, 3221, 3232, 3242, 3251, 3252, 3253, 3254,
2595 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264,
2596 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274,
2597 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284,
2598 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294,
2599 3295, 3296, 3298, 3299, 3300, 3301, 3303, 3318, 3326, 3326,
2600 3380, 3381, 3382, 3383, 3385, 3403, 3410, 3421, 3428, 3435,
2601 3445, 3456, 3634, 3670, 3677, 3684, 3691, 3713
2605 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2606 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2607 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2608 static const char *const yytname[] =
2610 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2611 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2612 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2613 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2614 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2615 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2616 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2617 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2618 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2619 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2620 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2621 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2622 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2623 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2624 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2625 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"", "\"+=\"",
2626 "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"",
2627 "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"",
2628 "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2629 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2630 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2631 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2632 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2633 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2634 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2635 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2636 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2637 "PACKAGE_INITCODE", "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION",
2638 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2639 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2640 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2641 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2642 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2643 "TRY", "$@7", "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE",
2644 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2645 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2646 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2647 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2648 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2649 "SLOT_DECLARATION", "$@12", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT",
2650 "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@13",
2651 "XMLEXPR2", "$@14", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", "XMLNODE",
2652 "MAYBE_XMLATTRIBUTES", "XMLATTRIBUTES", "XMLATTRIBUTE",
2653 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2654 "FUNCTION_DECLARATION", "$@15", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2655 "$@16", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2656 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2657 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2658 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2659 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2660 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@17", "ID_OR_NS", "SUBNODE",
2661 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2667 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2669 static const yytype_uint16 yytoknum[] =
2671 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2672 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2673 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2674 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2675 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2676 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2677 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2678 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2679 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2680 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2681 59, 44, 355, 61, 63, 58, 124, 94, 38, 356,
2682 60, 62, 357, 45, 43, 47, 42, 37, 126, 33,
2683 358, 359, 360, 40, 361, 91, 93, 123, 46, 64,
2684 362, 363, 364, 125, 41
2688 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2689 static const yytype_uint16 yyr1[] =
2691 0, 135, 136, 137, 137, 138, 138, 139, 139, 139,
2692 139, 139, 139, 139, 139, 140, 140, 141, 141, 142,
2693 142, 142, 142, 142, 142, 142, 143, 143, 144, 144,
2694 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
2695 145, 145, 145, 145, 146, 146, 146, 146, 146, 146,
2696 146, 146, 147, 147, 148, 149, 150, 150, 151, 151,
2697 152, 152, 153, 154, 154, 156, 155, 157, 157, 157,
2698 158, 158, 159, 159, 160, 161, 163, 162, 165, 164,
2699 166, 166, 167, 167, 168, 168, 168, 168, 169, 169,
2700 170, 171, 173, 172, 175, 174, 177, 176, 178, 178,
2701 179, 179, 179, 181, 180, 182, 182, 183, 184, 185,
2702 185, 185, 186, 186, 188, 187, 189, 187, 190, 190,
2703 191, 191, 192, 192, 193, 193, 193, 193, 193, 193,
2704 193, 193, 193, 193, 194, 194, 195, 195, 196, 196,
2705 198, 197, 200, 199, 201, 201, 202, 202, 203, 203,
2706 203, 203, 203, 204, 204, 205, 205, 206, 206, 206,
2707 207, 207, 209, 208, 210, 210, 211, 212, 212, 213,
2708 213, 213, 213, 213, 213, 213, 213, 213, 214, 215,
2709 216, 217, 219, 218, 221, 220, 222, 222, 222, 222,
2710 223, 223, 224, 224, 225, 225, 225, 226, 226, 227,
2711 227, 228, 228, 228, 228, 228, 229, 229, 229, 229,
2712 230, 230, 231, 231, 232, 232, 232, 234, 233, 235,
2713 235, 237, 236, 238, 239, 240, 240, 241, 241, 242,
2714 242, 242, 243, 243, 244, 244, 245, 245, 245, 246,
2715 247, 246, 248, 249, 250, 250, 251, 252, 252, 253,
2716 254, 255, 255, 256, 256, 257, 257, 258, 258, 258,
2717 258, 258, 259, 259, 260, 260, 260, 260, 260, 260,
2718 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
2719 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
2720 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
2721 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
2722 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
2723 260, 260, 260, 260, 260, 260, 260, 260, 261, 260,
2724 262, 262, 263, 263, 260, 260, 260, 260, 260, 260,
2725 260, 264, 265, 266, 266, 266, 267, 268
2728 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2729 static const yytype_uint8 yyr2[] =
2731 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2732 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2733 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2734 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2735 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2736 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2737 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2738 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2739 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2740 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2741 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2742 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2743 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2744 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2745 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2746 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2747 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2748 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2749 1, 0, 0, 4, 0, 4, 0, 2, 2, 2,
2750 2, 3, 1, 1, 10, 6, 11, 0, 1, 1,
2751 2, 1, 3, 3, 3, 3, 0, 1, 2, 4,
2752 3, 1, 4, 2, 1, 1, 0, 0, 12, 1,
2753 0, 0, 10, 1, 3, 1, 1, 1, 3, 1,
2754 1, 1, 2, 0, 0, 3, 0, 1, 1, 1,
2755 2, 2, 0, 4, 4, 4, 2, 1, 2, 1,
2756 1, 1, 3, 1, 3, 0, 1, 1, 1, 1,
2757 1, 1, 3, 5, 1, 1, 1, 1, 1, 1,
2758 1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
2759 3, 3, 3, 3, 3, 3, 2, 2, 3, 3,
2760 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2761 3, 3, 3, 4, 2, 1, 3, 2, 4, 3,
2762 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2763 3, 5, 2, 2, 2, 2, 3, 2, 0, 6,
2764 1, 1, 1, 1, 5, 3, 5, 4, 4, 6,
2765 6, 3, 1, 2, 4, 4, 2, 3
2768 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2769 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2770 means the default is an error. */
2771 static const yytype_uint16 yydefact[] =
2773 120, 342, 133, 172, 272, 169, 170, 171, 0, 0,
2774 78, 0, 0, 126, 273, 124, 125, 0, 132, 0,
2775 131, 220, 176, 177, 305, 127, 0, 0, 0, 175,
2776 128, 130, 129, 0, 0, 174, 173, 0, 0, 255,
2777 0, 0, 14, 179, 0, 0, 0, 0, 236, 120,
2778 0, 0, 2, 120, 5, 54, 12, 0, 36, 67,
2779 31, 32, 33, 34, 35, 38, 120, 37, 7, 30,
2780 0, 121, 122, 9, 8, 11, 270, 271, 0, 178,
2781 10, 264, 266, 268, 267, 39, 253, 265, 269, 41,
2782 40, 0, 0, 72, 76, 120, 92, 109, 111, 110,
2783 116, 113, 0, 0, 342, 242, 219, 0, 304, 0,
2784 0, 118, 0, 103, 236, 0, 246, 65, 257, 258,
2785 259, 260, 261, 0, 0, 256, 325, 324, 307, 287,
2786 286, 0, 251, 0, 237, 238, 239, 249, 82, 0,
2787 106, 247, 0, 80, 44, 43, 120, 45, 29, 0,
2788 46, 47, 48, 50, 0, 49, 327, 1, 6, 120,
2789 342, 0, 68, 0, 0, 69, 53, 108, 0, 216,
2790 0, 161, 0, 160, 162, 346, 123, 192, 0, 193,
2791 197, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2792 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2793 0, 0, 0, 0, 0, 323, 322, 0, 0, 0,
2794 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2795 0, 0, 0, 236, 0, 0, 55, 73, 0, 0,
2796 0, 120, 114, 0, 223, 0, 226, 225, 347, 234,
2797 206, 0, 250, 0, 0, 27, 0, 326, 0, 275,
2798 0, 0, 0, 306, 274, 240, 241, 83, 233, 59,
2799 60, 105, 248, 58, 81, 42, 28, 120, 0, 233,
2800 0, 0, 52, 343, 215, 214, 0, 134, 136, 0,
2801 184, 0, 201, 0, 198, 199, 254, 301, 302, 299,
2802 300, 280, 281, 283, 282, 278, 279, 315, 314, 310,
2803 309, 317, 318, 319, 316, 312, 311, 313, 284, 285,
2804 332, 333, 0, 335, 293, 292, 291, 320, 0, 290,
2805 289, 288, 276, 277, 297, 296, 294, 298, 295, 0,
2806 0, 332, 331, 328, 0, 0, 0, 341, 0, 0,
2807 0, 25, 0, 120, 17, 23, 0, 20, 19, 22,
2808 21, 120, 112, 0, 236, 243, 167, 0, 0, 207,
2809 211, 107, 119, 224, 303, 0, 26, 245, 0, 262,
2810 0, 252, 0, 57, 0, 120, 13, 57, 0, 0,
2811 0, 0, 0, 138, 0, 0, 233, 163, 164, 0,
2812 0, 0, 180, 181, 186, 200, 0, 338, 0, 244,
2813 308, 0, 0, 0, 337, 0, 120, 0, 0, 117,
2814 18, 120, 0, 0, 0, 0, 213, 208, 233, 0,
2815 0, 120, 0, 231, 230, 229, 232, 0, 62, 61,
2816 51, 0, 120, 344, 345, 206, 135, 0, 0, 227,
2817 137, 142, 57, 0, 185, 205, 204, 202, 203, 0,
2818 0, 0, 321, 0, 336, 0, 334, 77, 0, 84,
2819 0, 115, 235, 168, 167, 0, 0, 210, 0, 0,
2820 98, 102, 100, 104, 63, 263, 56, 0, 75, 0,
2821 139, 140, 0, 120, 166, 165, 195, 188, 179, 189,
2822 0, 187, 0, 186, 340, 329, 339, 79, 0, 0,
2823 0, 85, 88, 86, 24, 212, 221, 209, 96, 0,
2824 99, 101, 120, 66, 120, 233, 120, 228, 0, 157,
2825 0, 0, 120, 155, 0, 182, 179, 186, 190, 0,
2826 27, 93, 89, 87, 27, 27, 233, 64, 74, 0,
2827 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2828 216, 143, 156, 181, 0, 0, 191, 27, 91, 0,
2829 0, 0, 217, 120, 141, 147, 0, 0, 183, 181,
2830 90, 222, 97, 94, 27, 0, 0, 194, 0, 0,
2831 0, 149, 206, 196, 27, 218, 0, 0, 233, 95,
2835 /* YYDEFGOTO[NTERM-NUM]. */
2836 static const yytype_int16 yydefgoto[] =
2838 -1, 51, 52, 53, 54, 342, 343, 344, 365, 366,
2839 147, 148, 167, 345, 149, 428, 150, 263, 260, 513,
2840 58, 248, 163, 164, 59, 60, 61, 62, 228, 63,
2841 95, 151, 152, 500, 501, 502, 503, 64, 230, 470,
2842 579, 471, 535, 472, 473, 65, 245, 153, 66, 67,
2843 234, 235, 68, 351, 231, 69, 154, 71, 72, 383,
2844 385, 438, 347, 516, 348, 483, 544, 545, 546, 521,
2845 522, 523, 174, 349, 279, 387, 388, 416, 76, 77,
2846 78, 394, 449, 491, 554, 179, 389, 450, 492, 180,
2847 79, 283, 284, 285, 358, 359, 360, 276, 350, 574,
2848 107, 81, 534, 236, 237, 425, 440, 426, 373, 355,
2849 133, 134, 135, 239, 82, 83, 84, 155, 136, 241,
2850 242, 85, 123, 124, 125, 86, 401, 336, 313, 87,
2854 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2856 #define YYPACT_NINF -474
2857 static const yytype_int16 yypact[] =
2859 1747, -27, -474, -474, -474, -474, -474, -474, -10, -46,
2860 -474, -25, 26, -474, -474, -474, -474, 90, -474, 2197,
2861 -474, 106, -474, -474, 412, -474, 11, 133, 23, -474,
2862 -474, -474, -474, 13, -53, -474, -474, 2197, 32, 257,
2863 2197, 2197, -474, -474, 2197, 2197, 2197, 2197, 2197, 699,
2864 154, 224, -474, 568, -474, -474, -474, 99, -474, 2126,
2865 -474, -474, -474, -474, -474, -474, 2001, -474, -474, -474,
2866 361, 70, -474, -474, -474, -474, -474, -474, 65, -474,
2867 -474, -474, -474, -474, -474, 141, 2897, -474, -474, -474,
2868 -474, 242, 125, -474, -474, 2001, -474, -474, -474, -474,
2869 -474, -474, 143, 133, -474, -52, -474, 127, -44, 2197,
2870 124, -474, 2197, -474, 2197, 256, -44, -474, -474, -474,
2871 -474, -474, -474, 135, 176, 182, -44, -44, 202, -44,
2872 -44, -37, 2835, 159, 186, 2197, -474, 2835, 286, 288,
2873 2197, 2197, 288, 289, -474, -474, 830, -474, -474, 169,
2874 -474, -474, -474, -474, 287, -474, -474, -474, -474, 1092,
2875 236, 302, -474, 206, 241, 141, 211, -474, 311, 43,
2876 312, -474, 320, -474, -474, -474, -474, -474, 2197, -474,
2877 66, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197,
2878 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197,
2879 2197, 2197, 2197, 2197, 2197, -474, -474, 15, 2197, 2197,
2880 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197,
2881 2197, 2197, 2197, 2197, 2197, 22, -474, -474, 2197, 317,
2882 2197, 1223, -474, 133, 196, 203, -474, -474, -474, 209,
2883 35, 199, 235, 107, 2256, 1874, 204, -474, 2197, -474,
2884 2197, 257, 2197, -474, -474, -474, -474, -474, 232, 239,
2885 -474, -474, -474, 239, -474, -474, -474, 2001, 215, 232,
2886 2197, 2197, -474, 246, -474, -474, 347, 300, 303, 353,
2887 2835, 255, 258, 37, 66, -474, 2835, 383, 560, 560,
2888 560, 3269, 3269, 3269, 3269, 383, 383, 2835, 2835, 2835,
2889 2835, 2835, 2835, 2835, 2835, 2835, 2835, 2835, 2959, 3021,
2890 -474, -474, 42, -474, 185, 185, 185, 2835, 2463, 3083,
2891 3145, 3207, 383, 383, 202, 202, -44, -44, -44, 230,
2892 2525, 270, -474, -474, 2197, 100, 275, -474, 233, 243,
2893 2325, -474, 237, 1354, -474, -474, 248, -474, -474, -474,
2894 -474, 1223, -474, 133, 2197, -474, 36, 375, 245, 280,
2895 -474, -474, -474, 254, -474, 253, 1874, -474, 261, -474,
2896 291, 2835, 252, 299, 288, 961, -474, -18, 304, 269,
2897 151, 268, 133, 391, 133, 281, 232, 309, -474, 283,
2898 67, 87, -474, -474, -474, -474, 2197, -474, 2197, -474,
2899 -474, 2197, 2587, 2197, -474, 17, 2001, 2197, 292, -474,
2900 -474, 1223, 294, 290, 2197, 252, -474, -474, 232, 41,
2901 33, 2001, 2197, -474, -474, -474, -474, 2197, -474, -474,
2902 -474, 2197, 2001, -474, -474, 35, -474, 133, 298, -474,
2903 328, -474, 299, 353, -474, -474, -474, -474, -474, 319,
2904 102, 2649, 2835, 2394, -474, 2711, -474, -474, 301, 24,
2905 306, -474, -474, 2835, 329, 307, 375, -474, 310, 321,
2906 -474, -474, 33, -474, 368, -474, 2835, -30, -474, 308,
2907 328, -474, 133, 226, -474, -474, -474, -474, 330, -474,
2908 2197, -474, 333, -474, -474, -474, -474, -474, 2197, 341,
2909 314, 24, -474, -474, -474, -474, -474, -474, -474, 445,
2910 -474, -474, 2001, -474, 2001, 232, 1485, -474, 446, -474,
2911 424, 323, 351, -474, 65, 2835, 337, -474, 111, 2773,
2912 1874, -474, -474, -474, 1874, 1874, 232, -474, -474, 327,
2913 -474, -474, 334, 296, 331, 1616, -474, -474, -474, -474,
2914 43, -474, -474, -474, 336, 65, 111, 1874, -474, 338,
2915 339, 326, -474, 1485, -474, -474, 459, 352, -474, -474,
2916 -474, -474, -474, -474, 1874, 340, 343, -474, 359, 354,
2917 355, -474, 35, -474, 1874, -474, 356, 358, 232, -474,
2921 /* YYPGOTO[NTERM-NUM]. */
2922 static const yytype_int16 yypgoto[] =
2924 -474, -474, 342, -474, 433, -309, -474, 144, -294, -33,
2925 1, -59, -86, 59, 2, 47, 436, 363, 118, -474,
2926 -474, -474, -474, -474, -474, -474, -474, -474, -474, -474,
2927 -474, -474, -474, -474, -474, 6, 8, -474, -474, 38,
2928 -474, 49, -474, -474, -474, -474, -474, -474, -474, -474,
2929 10, 40, -474, -474, -474, -474, 0, -474, 434, -474,
2930 -474, -474, 61, -474, 62, -474, -50, -474, -31, -474,
2931 -474, -7, -474, 3, -474, -474, 69, 60, -474, -474,
2932 -474, -474, -464, -474, -474, -163, -474, -447, -474, -473,
2933 -427, -474, -474, 244, -416, -474, -336, -24, 4, -474,
2934 -474, -474, -474, -474, 496, -98, 88, 112, -254, -474,
2935 -100, -474, -474, -474, -474, -474, -474, -474, -125, -128,
2936 482, -51, -474, 279, -474, -13, -474, -474, -186, -474,
2937 -474, -474, -474, -474
2940 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2941 positive, shift that token. If negative, reduce the rule which
2942 number is the opposite. If zero, do what YYDEFACT says.
2943 If YYTABLE_NINF, syntax error. */
2944 #define YYTABLE_NINF -331
2945 static const yytype_int16 yytable[] =
2947 70, 55, 57, 75, 80, 238, 105, 166, 165, 229,
2948 256, 108, 261, 262, 246, 377, 146, 282, 310, 479,
2949 310, 417, 101, 493, 116, 331, 332, 126, 127, 97,
2950 98, 128, 129, 130, 132, 137, 166, 101, 356, 337,
2951 92, 207, 412, 99, 356, 310, 528, 205, 206, 207,
2952 -70, 553, 102, 70, 55, 57, 75, 80, 498, 56,
2953 468, 73, 74, 91, 252, 527, 469, 110, 177, 281,
2954 114, 181, 445, 224, 2, 115, 225, 94, 274, 223,
2955 556, 224, 569, 467, 225, 427, 499, 266, 13, 567,
2956 15, 16, 447, 18, 275, 20, 132, 253, 96, 244,
2957 338, 137, 460, 310, 514, 578, 103, 487, 25, 106,
2958 97, 98, 56, 93, 73, 74, 487, 30, 31, 32,
2959 368, 282, 137, 329, 99, 369, 397, 132, 132, 357,
2960 507, 311, 442, 311, 109, 466, 97, 98, 311, 414,
2961 113, 415, 378, 379, 312, 333, 112, 334, 392, 404,
2962 99, 335, 393, 100, 433, 117, 434, 156, 311, 70,
2963 55, 57, 75, 80, 465, 280, 586, 396, 286, 287,
2964 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
2965 298, 299, 300, 301, 302, 303, 304, 305, 306, 307,
2966 308, 309, 178, 178, 178, 314, 315, 316, 317, 318,
2967 319, 320, 321, 322, 323, 324, 325, 326, 327, 328,
2968 137, 330, 488, 489, 178, 132, 311, 340, 56, 456,
2969 73, 74, 489, 362, 157, 403, 159, 446, 448, 490,
2970 2, 70, 55, 346, 375, 132, 558, 137, 490, 371,
2971 559, 560, 181, 352, 13, 226, 15, 16, 227, 18,
2972 240, 20, 243, 363, 413, 97, 98, 132, 132, 247,
2973 118, 539, 119, 570, 25, 120, 121, 122, 249, 99,
2974 232, 233, 518, 30, 31, 32, 205, 206, 207, 458,
2975 580, 250, 561, 251, 436, 254, 439, 255, 423, 257,
2976 587, 258, 264, 205, 206, 207, 267, 475, 218, 219,
2977 220, 221, 222, 168, -71, 269, 270, 266, 223, 271,
2978 224, 272, 168, 225, 273, 277, 266, 220, 221, 222,
2979 457, 402, 169, 278, -113, 223, 519, 224, 171, 339,
2980 225, 353, 354, 361, 590, 474, 252, 372, 367, 439,
2981 374, 137, 173, 70, 55, 346, 478, 166, 376, 380,
2982 381, 70, 55, 346, 382, 2, 386, 384, 390, -153,
2983 -330, 391, 166, 363, 399, 405, 407, 406, 424, 13,
2984 409, 15, 16, 166, 18, 411, 20, 168, 356, 418,
2985 477, 419, -112, 451, 517, 452, 420, 169, 453, 25,
2986 455, 435, 170, 171, 132, 421, 422, 518, 30, 31,
2987 32, 463, 427, 432, 431, 172, 437, 173, 441, 137,
2988 443, 70, 55, 346, 476, 104, 444, 3, 4, 459,
2989 5, 6, 7, -331, 462, 481, 537, 461, 538, 482,
2990 486, 14, 414, 512, 506, 497, 19, 508, 21, 504,
2991 22, 23, 515, 526, 509, 524, 530, 531, 536, 549,
2992 550, 519, 555, 166, 562, 166, 551, 29, -331, -331,
2993 573, 563, 576, 577, 564, 34, 582, 35, 36, 568,
2994 583, 571, 572, 581, 205, 206, 207, 525, 208, 209,
2995 210, 584, 39, 520, -154, 529, 158, 410, 585, 484,
2996 588, 589, 429, -331, -331, 162, 218, 219, 220, 221,
2997 222, 268, 259, 40, 41, 176, 223, 532, 224, 533,
2998 510, 225, 485, 575, 565, 552, 543, 541, 542, 547,
2999 548, 511, 520, 111, 505, 480, 566, 464, 395, 131,
3000 370, 0, 0, 0, 0, 47, 0, 48, 0, 0,
3001 0, 50, 0, 0, 0, 543, 541, 542, 547, 548,
3002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3003 0, 0, 0, 543, 541, 542, 547, 548, -4, 0,
3004 0, 1, 2, 3, 4, 0, 5, 6, 7, 8,
3005 9, 10, 11, 0, 0, 12, 13, 14, 15, 16,
3006 17, 18, 19, 20, 0, 0, 22, 23, 0, 0,
3007 182, 0, 0, 0, 24, 0, 25, 26, 0, 27,
3008 0, 28, 0, 29, 0, 30, 31, 32, 0, 0,
3009 33, 34, 0, 35, 36, 0, 0, -331, -331, -331,
3010 0, 37, 38, 0, 0, 190, 191, 0, 39, 0,
3011 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3012 0, 205, 206, 207, 0, 208, 209, 210, 0, 40,
3013 41, 0, 0, 0, 0, 0, 0, 0, 42, 0,
3014 216, 217, 0, 218, 219, 220, 221, 222, 43, 0,
3015 0, 44, 0, 223, 0, 224, 45, 46, 225, 0,
3016 0, 47, 0, 48, 0, 49, 0, 50, 0, 0,
3017 0, -4, 1, 2, 3, 4, 0, 5, 6, 7,
3018 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3019 16, 17, 18, 19, 20, 21, 0, 22, 23, 138,
3020 0, 139, 0, 0, 0, 24, 140, 25, 26, 0,
3021 27, 141, 28, 0, 29, 142, 30, 31, 32, 0,
3022 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
3023 0, 0, 37, 38, 0, 143, 0, 0, 0, 39,
3024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3025 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3026 40, 41, 0, 0, 0, 0, 0, 0, 0, 144,
3027 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
3028 0, 0, 44, 0, 0, 0, 0, 45, 46, 0,
3029 0, 0, 47, 0, 48, 0, 49, 0, 50, 0,
3030 0, 0, 145, 1, 2, 3, 4, 0, 5, 6,
3031 7, 8, 9, 10, 11, 0, 0, 0, 13, 14,
3032 15, 16, 17, 18, 19, 20, 21, 0, 22, 23,
3033 138, 0, 139, 0, 0, 0, 24, 140, 25, 26,
3034 0, 27, 141, 28, 0, 29, 142, 30, 31, 32,
3035 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3036 0, 0, 0, 37, 38, 0, 143, 0, 0, 0,
3037 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3038 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3039 0, 40, 41, 0, 0, 0, 0, 0, 0, 0,
3040 144, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3041 43, 0, 0, 44, 0, 0, 0, 0, 45, 46,
3042 0, 0, 0, 47, 0, 48, 0, 49, 0, 50,
3043 0, 0, 0, 265, 1, 2, 3, 4, 0, 5,
3044 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3045 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3046 23, 138, 0, 139, 0, 0, 0, 24, 140, 25,
3047 26, 0, 27, 141, 28, 0, 29, 142, 30, 31,
3048 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3049 0, 0, 0, 0, 37, 38, 0, 143, 0, 0,
3050 0, 39, 0, 0, 0, 0, 0, 0, 0, 0,
3051 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3052 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
3053 0, 144, 0, 0, 0, 0, 0, 0, 0, 0,
3054 0, 43, 0, 0, 44, 0, 0, 0, 0, 45,
3055 46, 0, 0, 0, 47, 0, 48, 0, 49, 0,
3056 50, 0, 0, 0, 430, 1, 2, 3, 4, 0,
3057 5, 6, 7, 8, 9, 10, 11, 0, 0, 12,
3058 13, 14, 15, 16, 17, 18, 19, 20, 0, 0,
3059 22, 23, 0, 0, 0, 0, 0, 0, 24, 0,
3060 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
3061 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
3062 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
3063 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
3064 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3065 0, 0, 0, 40, 41, 0, 0, 0, 0, 0,
3066 0, 0, 42, 0, 0, 0, 0, 0, 0, 0,
3067 0, 0, 43, 0, 0, 44, 0, 0, 0, 0,
3068 45, 46, 0, 0, 0, 47, 0, 48, 0, 49,
3069 0, 50, 0, 0, 0, -3, 1, 2, 3, 4,
3070 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
3071 0, 13, 14, 15, 16, 17, 18, 19, 20, 0,
3072 0, 22, 23, 0, 0, 0, 0, 0, 0, 24,
3073 0, 25, 26, 0, 27, 0, 28, 0, 29, 0,
3074 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
3075 0, 0, 0, 0, 0, 0, 37, 38, 0, 0,
3076 0, 0, 0, 39, 0, 0, 0, 0, 0, 0,
3077 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3078 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3079 0, 0, 0, 341, 0, 0, 0, 0, 0, 0,
3080 0, 0, 0, 43, 0, 0, 44, 0, 0, 0,
3081 0, 45, 46, 0, 0, 0, 47, 0, 48, 0,
3082 49, 0, 50, 0, 0, 0, -15, 1, 2, 3,
3083 4, 0, 5, 6, 7, 8, 9, 10, 11, 0,
3084 0, 0, 13, 14, 15, 16, 17, 18, 19, 20,
3085 0, 0, 22, 23, 0, 0, 0, 0, 0, 0,
3086 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3087 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3088 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3089 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3090 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3091 0, 0, 0, 0, 0, 40, 41, 0, 0, 0,
3092 0, 0, 0, 0, 341, 0, 0, 0, 0, 0,
3093 0, 0, 0, 0, 43, 0, 0, 44, 0, 0,
3094 0, 0, 45, 46, 0, 0, 0, 47, 0, 48,
3095 0, 49, 0, 50, 0, 0, 0, -16, 1, 2,
3096 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3097 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3098 20, 0, 0, 22, 23, 0, 0, 0, 0, 0,
3099 0, 24, 0, 25, 26, 0, 27, 0, 28, 0,
3100 29, 0, 30, 31, 32, 0, 0, 33, 34, 0,
3101 35, 36, 0, 0, 0, 0, 0, 0, 37, 38,
3102 0, 0, 0, 0, 0, 39, 0, 0, 0, 0,
3103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3104 0, 0, 0, 0, 0, 0, 40, 41, 0, 0,
3105 0, 0, 0, 0, 0, 540, 0, 0, 0, 0,
3106 0, 0, 0, 0, 0, 43, 0, 0, 44, 0,
3107 0, 0, 0, 45, 46, 0, 0, 0, 47, 0,
3108 48, 0, 49, 0, 50, 0, 0, 0, -144, 1,
3109 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3110 11, 0, 0, 0, 13, 14, 15, 16, 17, 18,
3111 19, 20, 0, 0, 22, 23, 0, 0, 0, 0,
3112 0, 0, 24, 0, 25, 26, 0, 27, 0, 28,
3113 0, 29, 0, 30, 31, 32, 0, 0, 33, 34,
3114 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3115 38, 0, 0, 0, 0, 0, 39, 0, 0, 0,
3116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3117 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
3118 0, 0, 0, 0, 0, 0, 540, 0, 0, 0,
3119 0, 0, 0, 0, 0, 0, 43, 0, 0, 44,
3120 0, 0, 0, 0, 45, 46, 0, 0, 0, 47,
3121 0, 48, 0, 49, 0, 50, 0, -3, 0, -145,
3122 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3123 10, 11, 0, 0, 12, 13, 14, 15, 16, 17,
3124 18, 19, 20, 0, 0, 22, 23, 0, 0, 0,
3125 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
3126 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
3127 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
3128 37, 38, 0, 0, 0, 0, 0, 39, 0, 0,
3129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3130 0, 0, 0, 0, 0, 0, 0, 0, 40, 41,
3131 0, 0, 0, 0, 0, 0, 0, 42, 0, 0,
3132 0, 0, 0, 0, 0, 0, 0, 43, 0, 0,
3133 44, 0, 0, 0, 0, 45, 46, 0, 0, 0,
3134 47, 0, 48, 0, 49, 0, 50, 1, 2, 3,
3135 4, 0, 5, 6, 7, 8, 9, 10, 11, 0,
3136 -120, 0, 13, 14, 15, 16, 17, 18, 19, 20,
3137 21, 0, 22, 23, 138, 0, 139, 0, 0, 0,
3138 24, 140, 25, 26, 0, 27, 141, 28, 0, 29,
3139 142, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3140 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3141 143, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3143 0, 0, 0, 0, 0, 40, 41, 0, 0, 0,
3144 0, 0, 0, 0, 144, 0, 0, 0, 0, 0,
3145 0, 0, 0, 0, 43, 0, 0, 44, 0, 0,
3146 0, 0, 45, 46, 0, 0, 0, 47, 0, 48,
3147 0, 49, 0, 50, 1, 2, 3, 4, 0, 5,
3148 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3149 14, 15, 16, 17, 18, 19, 20, 21, 0, 22,
3150 23, 138, 0, 139, 0, 0, 0, 24, 140, 25,
3151 26, 0, 27, 141, 28, 0, 29, 142, 30, 31,
3152 32, 0, 0, 33, 34, 0, 35, 36, 0, 0,
3153 0, 0, 0, 0, 37, 38, 0, 143, 0, 0,
3154 0, 39, 0, 0, 0, 0, 0, 0, 0, 0,
3155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3156 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
3157 0, 144, 0, 0, 0, 0, 0, 0, 0, 0,
3158 0, 43, 0, 0, 44, 0, 0, 0, 0, 45,
3159 46, 0, 0, 0, 47, 0, 48, 0, 49, 160,
3160 50, 3, 4, 0, 5, 6, 7, 0, 0, 0,
3161 0, 0, 0, 0, 0, 14, 0, 0, 0, 0,
3162 19, 0, 21, 0, 22, 23, 0, 0, 139, 0,
3163 0, 0, 24, 0, 0, 0, 0, 0, 0, 28,
3164 0, 29, 161, 0, 0, 0, 0, 0, 0, 34,
3165 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3166 0, 0, 0, 0, 0, 0, 39, 0, 0, 0,
3167 104, 0, 3, 4, 0, 5, 6, 7, 0, 0,
3168 0, 0, 0, 0, 0, 0, 14, 40, 41, 0,
3169 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3170 0, 0, 0, 24, 0, 0, 43, 0, 0, 44,
3171 28, 0, 29, 0, 45, 46, 0, 0, 0, 47,
3172 34, 48, 35, 36, 0, 50, 0, 0, 0, 0,
3173 37, 0, 0, 0, 0, 0, 0, 39, 0, 0,
3174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3175 0, 0, 0, 0, 0, 0, 0, 0, 40, 41,
3176 0, 0, 0, 0, 0, 0, 182, 0, 0, 0,
3177 0, 0, 0, 0, 0, 0, 0, 43, 0, 0,
3178 44, 0, 0, 0, 0, 45, 46, 0, 0, 0,
3179 47, 0, 48, 183, 184, 185, 50, 186, 187, 188,
3180 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
3181 199, 200, 201, 202, 203, 204, 0, 205, 206, 207,
3182 0, 208, 209, 210, 0, 0, 0, 0, 0, 211,
3183 212, 0, 213, 214, 215, 182, 216, 217, 0, 218,
3184 219, 220, 221, 222, 0, 0, 0, 0, 0, 223,
3185 0, 224, 0, 0, 225, 0, 0, 0, 0, 0,
3186 364, 0, 183, 184, 185, 0, 186, 187, 188, 189,
3187 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3188 200, 201, 202, 203, 204, 0, 205, 206, 207, 0,
3189 208, 209, 210, 0, 0, 0, 0, 0, 211, 212,
3190 0, 213, 214, 215, 182, 216, 217, 0, 218, 219,
3191 220, 221, 222, 0, 0, 0, 0, 0, 223, 0,
3192 224, 0, 0, 225, 0, 0, 0, 0, 0, 408,
3193 0, 183, 184, 185, 0, 186, 187, 188, 189, 190,
3194 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
3195 201, 202, 203, 204, 0, 205, 206, 207, 0, 208,
3196 209, 210, 0, 0, 0, 0, 0, 211, 212, 0,
3197 213, 214, 215, 182, 216, 217, 0, 218, 219, 220,
3198 221, 222, 0, 0, 0, 0, 0, 223, 0, 224,
3199 0, 0, 225, 0, 0, 0, 0, 0, 495, 0,
3200 183, 184, 185, 0, 186, 187, 188, 189, 190, 191,
3201 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3202 202, 203, 204, 0, 205, 206, 207, 0, 208, 209,
3203 210, 0, 0, 0, 0, 182, 211, 212, 398, 213,
3204 214, 215, 0, 216, 217, 0, 218, 219, 220, 221,
3205 222, 0, 0, 0, 0, 0, 223, 0, 224, 0,
3206 0, 225, 183, 184, 185, 0, 186, 187, 188, 189,
3207 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3208 200, 201, 202, 203, 204, 0, 205, 206, 207, 0,
3209 208, 209, 210, 0, 0, 0, 0, 182, 211, 212,
3210 0, 213, 214, 215, 0, 216, 217, 0, 218, 219,
3211 220, 221, 222, 0, 0, 0, 0, 0, 223, 0,
3212 224, 400, 0, 225, 183, 184, 185, 0, 186, 187,
3213 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
3214 198, 199, 200, 201, 202, 203, 204, 0, 205, 206,
3215 207, 0, 208, 209, 210, 0, 0, 0, 0, 182,
3216 211, 212, 0, 213, 214, 215, 0, 216, 217, 0,
3217 218, 219, 220, 221, 222, 0, 0, 0, 0, 0,
3218 223, 0, 224, 454, 0, 225, 183, 184, 185, 0,
3219 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
3220 196, 197, 198, 199, 200, 201, 202, 203, 204, 0,
3221 205, 206, 207, 0, 208, 209, 210, 0, 0, 0,
3222 0, 182, 211, 212, 0, 213, 214, 215, 0, 216,
3223 217, 0, 218, 219, 220, 221, 222, 0, 0, 0,
3224 0, 0, 223, 0, 224, 494, 0, 225, 183, 184,
3225 185, 0, 186, 187, 188, 189, 190, 191, 192, 193,
3226 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
3227 204, 0, 205, 206, 207, 0, 208, 209, 210, 0,
3228 0, 0, 0, 182, 211, 212, 0, 213, 214, 215,
3229 0, 216, 217, 0, 218, 219, 220, 221, 222, 0,
3230 0, 0, 0, 0, 223, 0, 224, 496, 0, 225,
3231 183, 184, 185, 0, 186, 187, 188, 189, 190, 191,
3232 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3233 202, 203, 204, 0, 205, 206, 207, 0, 208, 209,
3234 210, 0, 0, 0, 0, 182, 211, 212, 557, 213,
3235 214, 215, 0, 216, 217, 0, 218, 219, 220, 221,
3236 222, 0, 0, 0, 0, 0, 223, 0, 224, 0,
3237 0, 225, 183, 184, 185, 0, 186, 187, 188, 189,
3238 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
3239 200, 201, 202, 203, 204, 0, 205, 206, 207, 0,
3240 208, 209, 210, 0, 0, 0, 0, 182, 211, 212,
3241 0, 213, 214, 215, 0, 216, 217, 0, 218, 219,
3242 220, 221, 222, 0, 0, 0, 0, 0, 223, 0,
3243 224, 0, 0, 225, 183, 184, 185, 0, 186, 187,
3244 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
3245 198, 199, 200, 201, 202, 203, 204, 0, 205, 206,
3246 207, 0, 208, 209, 210, 0, 0, 0, 0, 182,
3247 211, 212, 0, 213, 214, 215, 0, 0, 217, 0,
3248 218, 219, 220, 221, 222, 0, 0, 0, 0, 0,
3249 223, 0, 224, 0, 0, 225, 183, 184, 185, 0,
3250 186, 187, 188, 189, 190, 191, 0, 0, 0, 0,
3251 0, 0, 0, 0, 0, 0, 0, 0, 204, 0,
3252 205, 206, 207, 0, 208, 209, 210, 0, 0, 0,
3253 0, 182, 0, 0, 0, 213, 214, 215, 0, 216,
3254 217, 0, 218, 219, 220, 221, 222, 0, 0, 0,
3255 0, 0, 223, 0, 224, 0, 0, 225, 183, 184,
3256 185, 0, 186, 187, 188, 189, 190, 191, 0, 0,
3257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3258 0, 0, 205, 206, 207, 0, 208, 209, 210, 0,
3259 0, 0, 0, 182, 0, 0, 0, 213, 214, 215,
3260 0, 216, 217, 0, 218, 219, 220, 221, 222, 0,
3261 0, 0, 0, 0, 223, 0, 224, 0, 0, 225,
3262 183, 184, 185, 0, 186, 187, 188, 189, 190, 191,
3263 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3264 0, 0, 0, 0, 205, 206, 207, 0, 208, 209,
3265 210, 0, 0, 0, 0, 182, 0, 0, 0, 0,
3266 214, 215, 0, 216, 217, 0, 218, 219, 220, 221,
3267 222, 0, 0, 0, 0, 0, 223, 0, 224, 0,
3268 0, 225, 183, 184, 185, 0, 186, 187, 188, 189,
3269 190, 191, 0, 0, 0, 0, 0, 0, 0, 0,
3270 0, 0, 0, 0, 0, 0, 205, 206, 207, 0,
3271 208, 209, 210, 0, 0, 0, 0, 182, 0, 0,
3272 0, 0, 0, 215, 0, 216, 217, 0, 218, 219,
3273 220, 221, 222, 0, 0, 0, 0, 0, 223, 0,
3274 224, 0, 0, 225, 183, 184, 185, 0, 186, 187,
3275 188, 189, 190, 191, 0, 0, 0, 0, 0, 0,
3276 0, 0, 0, 0, 0, 0, 0, 0, 205, 206,
3277 207, 0, 208, 209, 210, 0, 0, 0, 0, 182,
3278 0, 0, 0, 0, 0, -331, 0, 216, 217, 0,
3279 218, 219, 220, 221, 222, 0, 0, 0, 0, 0,
3280 223, 0, 224, 0, 0, 225, 183, 184, 185, 0,
3281 -331, -331, -331, -331, 190, 191, 0, 0, 0, 0,
3282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3283 205, 206, 207, 0, 208, 209, 210, 0, 0, 0,
3284 0, 0, 0, 0, 0, 0, 0, 0, 0, 216,
3285 217, 0, 218, 219, 220, 221, 222, 0, 0, 0,
3286 0, 0, 223, 0, 224, 0, 0, 225
3289 static const yytype_int16 yycheck[] =
3291 0, 0, 0, 0, 0, 103, 19, 66, 59, 95,
3292 135, 24, 140, 141, 114, 269, 49, 180, 3, 435,
3293 3, 357, 12, 450, 37, 3, 4, 40, 41, 3,
3294 4, 44, 45, 46, 47, 48, 95, 27, 3, 225,
3295 50, 93, 351, 17, 3, 3, 493, 91, 92, 93,
3296 68, 524, 12, 53, 53, 53, 53, 53, 34, 0,
3297 27, 0, 0, 90, 101, 492, 33, 27, 3, 3,
3298 123, 101, 5, 125, 4, 128, 128, 123, 35, 123,
3299 527, 125, 555, 419, 128, 103, 62, 146, 18, 553,
3300 20, 21, 5, 23, 51, 25, 109, 134, 123, 112,
3301 228, 114, 411, 3, 134, 569, 16, 5, 38, 3,
3302 3, 4, 53, 123, 53, 53, 5, 47, 48, 49,
3303 248, 284, 135, 223, 17, 250, 312, 140, 141, 94,
3304 466, 116, 386, 116, 123, 94, 3, 4, 116, 103,
3305 127, 105, 270, 271, 129, 123, 123, 125, 111, 335,
3306 17, 129, 115, 127, 3, 123, 5, 3, 116, 159,
3307 159, 159, 159, 159, 418, 178, 582, 125, 181, 182,
3308 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
3309 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3310 203, 204, 127, 127, 127, 208, 209, 210, 211, 212,
3311 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
3312 223, 224, 110, 111, 127, 228, 116, 230, 159, 405,
3313 159, 159, 111, 116, 0, 125, 127, 390, 391, 127,
3314 4, 231, 231, 231, 267, 248, 530, 250, 127, 252,
3315 534, 535, 101, 233, 18, 3, 20, 21, 123, 23,
3316 123, 25, 128, 243, 354, 3, 4, 270, 271, 3,
3317 3, 515, 5, 557, 38, 8, 9, 10, 133, 17,
3318 127, 128, 46, 47, 48, 49, 91, 92, 93, 407,
3319 574, 105, 536, 101, 382, 126, 384, 101, 36, 3,
3320 584, 3, 3, 91, 92, 93, 127, 422, 113, 114,
3321 115, 116, 117, 16, 68, 3, 100, 366, 123, 68,
3322 125, 100, 16, 128, 3, 3, 375, 115, 116, 117,
3323 406, 334, 26, 3, 128, 123, 100, 125, 32, 12,
3324 128, 128, 123, 134, 588, 421, 101, 105, 134, 437,
3325 101, 354, 46, 343, 343, 343, 432, 406, 133, 103,
3326 3, 351, 351, 351, 54, 4, 3, 54, 103, 133,
3327 90, 103, 421, 353, 134, 90, 123, 134, 116, 18,
3328 133, 20, 21, 432, 23, 127, 25, 16, 3, 134,
3329 431, 101, 128, 396, 482, 398, 133, 26, 401, 38,
3330 403, 123, 31, 32, 407, 134, 105, 46, 47, 48,
3331 49, 414, 103, 134, 100, 44, 15, 46, 127, 422,
3332 101, 411, 411, 411, 427, 3, 133, 5, 6, 127,
3333 8, 9, 10, 40, 134, 127, 512, 133, 514, 101,
3334 111, 19, 103, 65, 127, 134, 24, 127, 26, 133,
3335 28, 29, 134, 110, 123, 115, 105, 133, 3, 3,
3336 26, 100, 115, 512, 127, 514, 133, 45, 75, 76,
3337 134, 127, 3, 111, 133, 53, 123, 55, 56, 133,
3338 111, 133, 133, 133, 91, 92, 93, 490, 95, 96,
3339 97, 127, 70, 483, 133, 498, 53, 343, 133, 442,
3340 134, 133, 374, 110, 111, 59, 113, 114, 115, 116,
3341 117, 159, 139, 91, 92, 71, 123, 501, 125, 501,
3342 472, 128, 443, 563, 545, 522, 516, 516, 516, 516,
3343 516, 472, 522, 27, 464, 437, 550, 415, 284, 47,
3344 251, -1, -1, -1, -1, 123, -1, 125, -1, -1,
3345 -1, 129, -1, -1, -1, 545, 545, 545, 545, 545,
3346 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3347 -1, -1, -1, 563, 563, 563, 563, 563, 0, -1,
3348 -1, 3, 4, 5, 6, -1, 8, 9, 10, 11,
3349 12, 13, 14, -1, -1, 17, 18, 19, 20, 21,
3350 22, 23, 24, 25, -1, -1, 28, 29, -1, -1,
3351 40, -1, -1, -1, 36, -1, 38, 39, -1, 41,
3352 -1, 43, -1, 45, -1, 47, 48, 49, -1, -1,
3353 52, 53, -1, 55, 56, -1, -1, 67, 68, 69,
3354 -1, 63, 64, -1, -1, 75, 76, -1, 70, -1,
3355 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3356 -1, 91, 92, 93, -1, 95, 96, 97, -1, 91,
3357 92, -1, -1, -1, -1, -1, -1, -1, 100, -1,
3358 110, 111, -1, 113, 114, 115, 116, 117, 110, -1,
3359 -1, 113, -1, 123, -1, 125, 118, 119, 128, -1,
3360 -1, 123, -1, 125, -1, 127, -1, 129, -1, -1,
3361 -1, 133, 3, 4, 5, 6, -1, 8, 9, 10,
3362 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3363 21, 22, 23, 24, 25, 26, -1, 28, 29, 30,
3364 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3365 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3366 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3367 -1, -1, 63, 64, -1, 66, -1, -1, -1, 70,
3368 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3369 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3370 91, 92, -1, -1, -1, -1, -1, -1, -1, 100,
3371 -1, -1, -1, -1, -1, -1, -1, -1, -1, 110,
3372 -1, -1, 113, -1, -1, -1, -1, 118, 119, -1,
3373 -1, -1, 123, -1, 125, -1, 127, -1, 129, -1,
3374 -1, -1, 133, 3, 4, 5, 6, -1, 8, 9,
3375 10, 11, 12, 13, 14, -1, -1, -1, 18, 19,
3376 20, 21, 22, 23, 24, 25, 26, -1, 28, 29,
3377 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3378 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3379 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3380 -1, -1, -1, 63, 64, -1, 66, -1, -1, -1,
3381 70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3382 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3383 -1, 91, 92, -1, -1, -1, -1, -1, -1, -1,
3384 100, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3385 110, -1, -1, 113, -1, -1, -1, -1, 118, 119,
3386 -1, -1, -1, 123, -1, 125, -1, 127, -1, 129,
3387 -1, -1, -1, 133, 3, 4, 5, 6, -1, 8,
3388 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3389 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3390 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3391 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3392 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3393 -1, -1, -1, -1, 63, 64, -1, 66, -1, -1,
3394 -1, 70, -1, -1, -1, -1, -1, -1, -1, -1,
3395 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3396 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
3397 -1, 100, -1, -1, -1, -1, -1, -1, -1, -1,
3398 -1, 110, -1, -1, 113, -1, -1, -1, -1, 118,
3399 119, -1, -1, -1, 123, -1, 125, -1, 127, -1,
3400 129, -1, -1, -1, 133, 3, 4, 5, 6, -1,
3401 8, 9, 10, 11, 12, 13, 14, -1, -1, 17,
3402 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
3403 28, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3404 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3405 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3406 -1, -1, -1, -1, -1, 63, 64, -1, -1, -1,
3407 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3408 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3409 -1, -1, -1, 91, 92, -1, -1, -1, -1, -1,
3410 -1, -1, 100, -1, -1, -1, -1, -1, -1, -1,
3411 -1, -1, 110, -1, -1, 113, -1, -1, -1, -1,
3412 118, 119, -1, -1, -1, 123, -1, 125, -1, 127,
3413 -1, 129, -1, -1, -1, 133, 3, 4, 5, 6,
3414 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3415 -1, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3416 -1, 28, 29, -1, -1, -1, -1, -1, -1, 36,
3417 -1, 38, 39, -1, 41, -1, 43, -1, 45, -1,
3418 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3419 -1, -1, -1, -1, -1, -1, 63, 64, -1, -1,
3420 -1, -1, -1, 70, -1, -1, -1, -1, -1, -1,
3421 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3422 -1, -1, -1, -1, 91, 92, -1, -1, -1, -1,
3423 -1, -1, -1, 100, -1, -1, -1, -1, -1, -1,
3424 -1, -1, -1, 110, -1, -1, 113, -1, -1, -1,
3425 -1, 118, 119, -1, -1, -1, 123, -1, 125, -1,
3426 127, -1, 129, -1, -1, -1, 133, 3, 4, 5,
3427 6, -1, 8, 9, 10, 11, 12, 13, 14, -1,
3428 -1, -1, 18, 19, 20, 21, 22, 23, 24, 25,
3429 -1, -1, 28, 29, -1, -1, -1, -1, -1, -1,
3430 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3431 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3432 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3433 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3434 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3435 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
3436 -1, -1, -1, -1, 100, -1, -1, -1, -1, -1,
3437 -1, -1, -1, -1, 110, -1, -1, 113, -1, -1,
3438 -1, -1, 118, 119, -1, -1, -1, 123, -1, 125,
3439 -1, 127, -1, 129, -1, -1, -1, 133, 3, 4,
3440 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3441 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3442 25, -1, -1, 28, 29, -1, -1, -1, -1, -1,
3443 -1, 36, -1, 38, 39, -1, 41, -1, 43, -1,
3444 45, -1, 47, 48, 49, -1, -1, 52, 53, -1,
3445 55, 56, -1, -1, -1, -1, -1, -1, 63, 64,
3446 -1, -1, -1, -1, -1, 70, -1, -1, -1, -1,
3447 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3448 -1, -1, -1, -1, -1, -1, 91, 92, -1, -1,
3449 -1, -1, -1, -1, -1, 100, -1, -1, -1, -1,
3450 -1, -1, -1, -1, -1, 110, -1, -1, 113, -1,
3451 -1, -1, -1, 118, 119, -1, -1, -1, 123, -1,
3452 125, -1, 127, -1, 129, -1, -1, -1, 133, 3,
3453 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3454 14, -1, -1, -1, 18, 19, 20, 21, 22, 23,
3455 24, 25, -1, -1, 28, 29, -1, -1, -1, -1,
3456 -1, -1, 36, -1, 38, 39, -1, 41, -1, 43,
3457 -1, 45, -1, 47, 48, 49, -1, -1, 52, 53,
3458 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3459 64, -1, -1, -1, -1, -1, 70, -1, -1, -1,
3460 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3461 -1, -1, -1, -1, -1, -1, -1, 91, 92, -1,
3462 -1, -1, -1, -1, -1, -1, 100, -1, -1, -1,
3463 -1, -1, -1, -1, -1, -1, 110, -1, -1, 113,
3464 -1, -1, -1, -1, 118, 119, -1, -1, -1, 123,
3465 -1, 125, -1, 127, -1, 129, -1, 0, -1, 133,
3466 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3467 13, 14, -1, -1, 17, 18, 19, 20, 21, 22,
3468 23, 24, 25, -1, -1, 28, 29, -1, -1, -1,
3469 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3470 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3471 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3472 63, 64, -1, -1, -1, -1, -1, 70, -1, -1,
3473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3474 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
3475 -1, -1, -1, -1, -1, -1, -1, 100, -1, -1,
3476 -1, -1, -1, -1, -1, -1, -1, 110, -1, -1,
3477 113, -1, -1, -1, -1, 118, 119, -1, -1, -1,
3478 123, -1, 125, -1, 127, -1, 129, 3, 4, 5,
3479 6, -1, 8, 9, 10, 11, 12, 13, 14, -1,
3480 16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
3481 26, -1, 28, 29, 30, -1, 32, -1, -1, -1,
3482 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3483 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3484 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3485 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3486 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3487 -1, -1, -1, -1, -1, 91, 92, -1, -1, -1,
3488 -1, -1, -1, -1, 100, -1, -1, -1, -1, -1,
3489 -1, -1, -1, -1, 110, -1, -1, 113, -1, -1,
3490 -1, -1, 118, 119, -1, -1, -1, 123, -1, 125,
3491 -1, 127, -1, 129, 3, 4, 5, 6, -1, 8,
3492 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3493 19, 20, 21, 22, 23, 24, 25, 26, -1, 28,
3494 29, 30, -1, 32, -1, -1, -1, 36, 37, 38,
3495 39, -1, 41, 42, 43, -1, 45, 46, 47, 48,
3496 49, -1, -1, 52, 53, -1, 55, 56, -1, -1,
3497 -1, -1, -1, -1, 63, 64, -1, 66, -1, -1,
3498 -1, 70, -1, -1, -1, -1, -1, -1, -1, -1,
3499 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3500 -1, -1, 91, 92, -1, -1, -1, -1, -1, -1,
3501 -1, 100, -1, -1, -1, -1, -1, -1, -1, -1,
3502 -1, 110, -1, -1, 113, -1, -1, -1, -1, 118,
3503 119, -1, -1, -1, 123, -1, 125, -1, 127, 3,
3504 129, 5, 6, -1, 8, 9, 10, -1, -1, -1,
3505 -1, -1, -1, -1, -1, 19, -1, -1, -1, -1,
3506 24, -1, 26, -1, 28, 29, -1, -1, 32, -1,
3507 -1, -1, 36, -1, -1, -1, -1, -1, -1, 43,
3508 -1, 45, 46, -1, -1, -1, -1, -1, -1, 53,
3509 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3510 -1, -1, -1, -1, -1, -1, 70, -1, -1, -1,
3511 3, -1, 5, 6, -1, 8, 9, 10, -1, -1,
3512 -1, -1, -1, -1, -1, -1, 19, 91, 92, -1,
3513 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3514 -1, -1, -1, 36, -1, -1, 110, -1, -1, 113,
3515 43, -1, 45, -1, 118, 119, -1, -1, -1, 123,
3516 53, 125, 55, 56, -1, 129, -1, -1, -1, -1,
3517 63, -1, -1, -1, -1, -1, -1, 70, -1, -1,
3518 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3519 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
3520 -1, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3521 -1, -1, -1, -1, -1, -1, -1, 110, -1, -1,
3522 113, -1, -1, -1, -1, 118, 119, -1, -1, -1,
3523 123, -1, 125, 67, 68, 69, 129, 71, 72, 73,
3524 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3525 84, 85, 86, 87, 88, 89, -1, 91, 92, 93,
3526 -1, 95, 96, 97, -1, -1, -1, -1, -1, 103,
3527 104, -1, 106, 107, 108, 40, 110, 111, -1, 113,
3528 114, 115, 116, 117, -1, -1, -1, -1, -1, 123,
3529 -1, 125, -1, -1, 128, -1, -1, -1, -1, -1,
3530 134, -1, 67, 68, 69, -1, 71, 72, 73, 74,
3531 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3532 85, 86, 87, 88, 89, -1, 91, 92, 93, -1,
3533 95, 96, 97, -1, -1, -1, -1, -1, 103, 104,
3534 -1, 106, 107, 108, 40, 110, 111, -1, 113, 114,
3535 115, 116, 117, -1, -1, -1, -1, -1, 123, -1,
3536 125, -1, -1, 128, -1, -1, -1, -1, -1, 134,
3537 -1, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3538 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3539 86, 87, 88, 89, -1, 91, 92, 93, -1, 95,
3540 96, 97, -1, -1, -1, -1, -1, 103, 104, -1,
3541 106, 107, 108, 40, 110, 111, -1, 113, 114, 115,
3542 116, 117, -1, -1, -1, -1, -1, 123, -1, 125,
3543 -1, -1, 128, -1, -1, -1, -1, -1, 134, -1,
3544 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3545 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3546 87, 88, 89, -1, 91, 92, 93, -1, 95, 96,
3547 97, -1, -1, -1, -1, 40, 103, 104, 105, 106,
3548 107, 108, -1, 110, 111, -1, 113, 114, 115, 116,
3549 117, -1, -1, -1, -1, -1, 123, -1, 125, -1,
3550 -1, 128, 67, 68, 69, -1, 71, 72, 73, 74,
3551 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3552 85, 86, 87, 88, 89, -1, 91, 92, 93, -1,
3553 95, 96, 97, -1, -1, -1, -1, 40, 103, 104,
3554 -1, 106, 107, 108, -1, 110, 111, -1, 113, 114,
3555 115, 116, 117, -1, -1, -1, -1, -1, 123, -1,
3556 125, 126, -1, 128, 67, 68, 69, -1, 71, 72,
3557 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3558 83, 84, 85, 86, 87, 88, 89, -1, 91, 92,
3559 93, -1, 95, 96, 97, -1, -1, -1, -1, 40,
3560 103, 104, -1, 106, 107, 108, -1, 110, 111, -1,
3561 113, 114, 115, 116, 117, -1, -1, -1, -1, -1,
3562 123, -1, 125, 126, -1, 128, 67, 68, 69, -1,
3563 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3564 81, 82, 83, 84, 85, 86, 87, 88, 89, -1,
3565 91, 92, 93, -1, 95, 96, 97, -1, -1, -1,
3566 -1, 40, 103, 104, -1, 106, 107, 108, -1, 110,
3567 111, -1, 113, 114, 115, 116, 117, -1, -1, -1,
3568 -1, -1, 123, -1, 125, 126, -1, 128, 67, 68,
3569 69, -1, 71, 72, 73, 74, 75, 76, 77, 78,
3570 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3571 89, -1, 91, 92, 93, -1, 95, 96, 97, -1,
3572 -1, -1, -1, 40, 103, 104, -1, 106, 107, 108,
3573 -1, 110, 111, -1, 113, 114, 115, 116, 117, -1,
3574 -1, -1, -1, -1, 123, -1, 125, 126, -1, 128,
3575 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3576 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3577 87, 88, 89, -1, 91, 92, 93, -1, 95, 96,
3578 97, -1, -1, -1, -1, 40, 103, 104, 105, 106,
3579 107, 108, -1, 110, 111, -1, 113, 114, 115, 116,
3580 117, -1, -1, -1, -1, -1, 123, -1, 125, -1,
3581 -1, 128, 67, 68, 69, -1, 71, 72, 73, 74,
3582 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3583 85, 86, 87, 88, 89, -1, 91, 92, 93, -1,
3584 95, 96, 97, -1, -1, -1, -1, 40, 103, 104,
3585 -1, 106, 107, 108, -1, 110, 111, -1, 113, 114,
3586 115, 116, 117, -1, -1, -1, -1, -1, 123, -1,
3587 125, -1, -1, 128, 67, 68, 69, -1, 71, 72,
3588 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3589 83, 84, 85, 86, 87, 88, 89, -1, 91, 92,
3590 93, -1, 95, 96, 97, -1, -1, -1, -1, 40,
3591 103, 104, -1, 106, 107, 108, -1, -1, 111, -1,
3592 113, 114, 115, 116, 117, -1, -1, -1, -1, -1,
3593 123, -1, 125, -1, -1, 128, 67, 68, 69, -1,
3594 71, 72, 73, 74, 75, 76, -1, -1, -1, -1,
3595 -1, -1, -1, -1, -1, -1, -1, -1, 89, -1,
3596 91, 92, 93, -1, 95, 96, 97, -1, -1, -1,
3597 -1, 40, -1, -1, -1, 106, 107, 108, -1, 110,
3598 111, -1, 113, 114, 115, 116, 117, -1, -1, -1,
3599 -1, -1, 123, -1, 125, -1, -1, 128, 67, 68,
3600 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3601 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3602 -1, -1, 91, 92, 93, -1, 95, 96, 97, -1,
3603 -1, -1, -1, 40, -1, -1, -1, 106, 107, 108,
3604 -1, 110, 111, -1, 113, 114, 115, 116, 117, -1,
3605 -1, -1, -1, -1, 123, -1, 125, -1, -1, 128,
3606 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3607 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3608 -1, -1, -1, -1, 91, 92, 93, -1, 95, 96,
3609 97, -1, -1, -1, -1, 40, -1, -1, -1, -1,
3610 107, 108, -1, 110, 111, -1, 113, 114, 115, 116,
3611 117, -1, -1, -1, -1, -1, 123, -1, 125, -1,
3612 -1, 128, 67, 68, 69, -1, 71, 72, 73, 74,
3613 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
3614 -1, -1, -1, -1, -1, -1, 91, 92, 93, -1,
3615 95, 96, 97, -1, -1, -1, -1, 40, -1, -1,
3616 -1, -1, -1, 108, -1, 110, 111, -1, 113, 114,
3617 115, 116, 117, -1, -1, -1, -1, -1, 123, -1,
3618 125, -1, -1, 128, 67, 68, 69, -1, 71, 72,
3619 73, 74, 75, 76, -1, -1, -1, -1, -1, -1,
3620 -1, -1, -1, -1, -1, -1, -1, -1, 91, 92,
3621 93, -1, 95, 96, 97, -1, -1, -1, -1, 40,
3622 -1, -1, -1, -1, -1, 108, -1, 110, 111, -1,
3623 113, 114, 115, 116, 117, -1, -1, -1, -1, -1,
3624 123, -1, 125, -1, -1, 128, 67, 68, 69, -1,
3625 71, 72, 73, 74, 75, 76, -1, -1, -1, -1,
3626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3627 91, 92, 93, -1, 95, 96, 97, -1, -1, -1,
3628 -1, -1, -1, -1, -1, -1, -1, -1, -1, 110,
3629 111, -1, 113, 114, 115, 116, 117, -1, -1, -1,
3630 -1, -1, 123, -1, 125, -1, -1, 128
3633 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3634 symbol of state STATE-NUM. */
3635 static const yytype_uint16 yystos[] =
3637 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3638 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3639 25, 26, 28, 29, 36, 38, 39, 41, 43, 45,
3640 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3641 91, 92, 100, 110, 113, 118, 119, 123, 125, 127,
3642 129, 136, 137, 138, 139, 145, 148, 149, 155, 159,
3643 160, 161, 162, 164, 172, 180, 183, 184, 187, 190,
3644 191, 192, 193, 197, 199, 208, 213, 214, 215, 225,
3645 233, 236, 249, 250, 251, 256, 260, 264, 265, 267,
3646 268, 90, 50, 123, 123, 165, 123, 3, 4, 17,
3647 127, 185, 186, 16, 3, 260, 3, 235, 260, 123,
3648 186, 239, 123, 127, 123, 128, 260, 123, 3, 5,
3649 8, 9, 10, 257, 258, 259, 260, 260, 260, 260,
3650 260, 255, 260, 245, 246, 247, 253, 260, 30, 32,
3651 37, 42, 46, 66, 100, 133, 144, 145, 146, 149,
3652 151, 166, 167, 182, 191, 252, 3, 0, 139, 127,
3653 3, 46, 151, 157, 158, 256, 146, 147, 16, 26,
3654 31, 32, 44, 46, 207, 266, 193, 3, 127, 220,
3655 224, 101, 40, 67, 68, 69, 71, 72, 73, 74,
3656 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3657 85, 86, 87, 88, 89, 91, 92, 93, 95, 96,
3658 97, 103, 104, 106, 107, 108, 110, 111, 113, 114,
3659 115, 116, 117, 123, 125, 128, 3, 123, 163, 147,
3660 173, 189, 127, 128, 185, 186, 238, 239, 240, 248,
3661 123, 254, 255, 128, 260, 181, 245, 3, 156, 133,
3662 105, 101, 101, 134, 126, 101, 253, 3, 3, 152,
3663 153, 254, 254, 152, 3, 133, 146, 127, 137, 3,
3664 100, 68, 100, 3, 35, 51, 232, 3, 3, 209,
3665 260, 3, 220, 226, 227, 228, 260, 260, 260, 260,
3666 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
3667 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
3668 3, 116, 129, 263, 260, 260, 260, 260, 260, 260,
3669 260, 260, 260, 260, 260, 260, 260, 260, 260, 245,
3670 260, 3, 4, 123, 125, 129, 262, 263, 254, 12,
3671 260, 100, 140, 141, 142, 148, 149, 197, 199, 208,
3672 233, 188, 185, 128, 123, 244, 3, 94, 229, 230,
3673 231, 134, 116, 185, 134, 143, 144, 134, 254, 253,
3674 258, 260, 105, 243, 101, 144, 133, 243, 254, 254,
3675 103, 3, 54, 194, 54, 195, 3, 210, 211, 221,
3676 103, 103, 111, 115, 216, 228, 125, 263, 105, 134,
3677 126, 261, 260, 125, 263, 90, 134, 123, 134, 133,
3678 142, 127, 140, 245, 103, 105, 212, 231, 134, 101,
3679 133, 134, 105, 36, 116, 240, 242, 103, 150, 153,
3680 133, 100, 134, 3, 5, 123, 240, 15, 196, 240,
3681 241, 127, 243, 101, 133, 5, 220, 5, 220, 217,
3682 222, 260, 260, 260, 126, 260, 263, 147, 254, 127,
3683 140, 133, 134, 260, 242, 243, 94, 231, 27, 33,
3684 174, 176, 178, 179, 147, 253, 260, 256, 147, 229,
3685 241, 127, 101, 200, 150, 211, 111, 5, 110, 111,
3686 127, 218, 223, 225, 126, 134, 126, 134, 34, 62,
3687 168, 169, 170, 171, 133, 212, 127, 231, 127, 123,
3688 174, 176, 65, 154, 134, 134, 198, 240, 46, 100,
3689 191, 204, 205, 206, 115, 260, 110, 225, 222, 260,
3690 105, 133, 170, 171, 237, 177, 3, 147, 147, 243,
3691 100, 145, 149, 191, 201, 202, 203, 208, 233, 3,
3692 26, 133, 206, 224, 219, 115, 222, 105, 143, 143,
3693 143, 243, 127, 127, 133, 203, 232, 217, 133, 224,
3694 143, 133, 133, 134, 234, 201, 3, 111, 217, 175,
3695 143, 133, 123, 111, 127, 133, 229, 143, 134, 133,
3699 #define yyerrok (yyerrstatus = 0)
3700 #define yyclearin (yychar = YYEMPTY)
3701 #define YYEMPTY (-2)
3704 #define YYACCEPT goto yyacceptlab
3705 #define YYABORT goto yyabortlab
3706 #define YYERROR goto yyerrorlab
3709 /* Like YYERROR except do call yyerror. This remains here temporarily
3710 to ease the transition to the new meaning of YYERROR, for GCC.
3711 Once GCC version 2 has supplanted version 1, this can go. */
3713 #define YYFAIL goto yyerrlab
3715 #define YYRECOVERING() (!!yyerrstatus)
3717 #define YYBACKUP(Token, Value) \
3719 if (yychar == YYEMPTY && yylen == 1) \
3723 yytoken = YYTRANSLATE (yychar); \
3729 yyerror (YY_("syntax error: cannot back up")); \
3736 #define YYERRCODE 256
3739 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3740 If N is 0, then set CURRENT to the empty location which ends
3741 the previous symbol: RHS[0] (always defined). */
3743 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3744 #ifndef YYLLOC_DEFAULT
3745 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3749 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3750 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3751 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3752 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3756 (Current).first_line = (Current).last_line = \
3757 YYRHSLOC (Rhs, 0).last_line; \
3758 (Current).first_column = (Current).last_column = \
3759 YYRHSLOC (Rhs, 0).last_column; \
3765 /* YY_LOCATION_PRINT -- Print the location on the stream.
3766 This macro was not mandated originally: define only if we know
3767 we won't break user code: when these are the locations we know. */
3769 #ifndef YY_LOCATION_PRINT
3770 # if YYLTYPE_IS_TRIVIAL
3771 # define YY_LOCATION_PRINT(File, Loc) \
3772 fprintf (File, "%d.%d-%d.%d", \
3773 (Loc).first_line, (Loc).first_column, \
3774 (Loc).last_line, (Loc).last_column)
3776 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3781 /* YYLEX -- calling `yylex' with the right arguments. */
3784 # define YYLEX yylex (YYLEX_PARAM)
3786 # define YYLEX yylex ()
3789 /* Enable debugging if requested. */
3793 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3794 # define YYFPRINTF fprintf
3797 # define YYDPRINTF(Args) \
3803 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3807 YYFPRINTF (stderr, "%s ", Title); \
3808 yy_symbol_print (stderr, \
3810 YYFPRINTF (stderr, "\n"); \
3815 /*--------------------------------.
3816 | Print this symbol on YYOUTPUT. |
3817 `--------------------------------*/
3820 #if (defined __STDC__ || defined __C99__FUNC__ \
3821 || defined __cplusplus || defined _MSC_VER)
3823 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3826 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3829 YYSTYPE const * const yyvaluep;
3835 if (yytype < YYNTOKENS)
3836 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3848 /*--------------------------------.
3849 | Print this symbol on YYOUTPUT. |
3850 `--------------------------------*/
3852 #if (defined __STDC__ || defined __C99__FUNC__ \
3853 || defined __cplusplus || defined _MSC_VER)
3855 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3858 yy_symbol_print (yyoutput, yytype, yyvaluep)
3861 YYSTYPE const * const yyvaluep;
3864 if (yytype < YYNTOKENS)
3865 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3867 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3869 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3870 YYFPRINTF (yyoutput, ")");
3873 /*------------------------------------------------------------------.
3874 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3876 `------------------------------------------------------------------*/
3878 #if (defined __STDC__ || defined __C99__FUNC__ \
3879 || defined __cplusplus || defined _MSC_VER)
3881 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3884 yy_stack_print (yybottom, yytop)
3885 yytype_int16 *yybottom;
3886 yytype_int16 *yytop;
3889 YYFPRINTF (stderr, "Stack now");
3890 for (; yybottom <= yytop; yybottom++)
3892 int yybot = *yybottom;
3893 YYFPRINTF (stderr, " %d", yybot);
3895 YYFPRINTF (stderr, "\n");
3898 # define YY_STACK_PRINT(Bottom, Top) \
3901 yy_stack_print ((Bottom), (Top)); \
3905 /*------------------------------------------------.
3906 | Report that the YYRULE is going to be reduced. |
3907 `------------------------------------------------*/
3909 #if (defined __STDC__ || defined __C99__FUNC__ \
3910 || defined __cplusplus || defined _MSC_VER)
3912 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3915 yy_reduce_print (yyvsp, yyrule)
3920 int yynrhs = yyr2[yyrule];
3922 unsigned long int yylno = yyrline[yyrule];
3923 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3925 /* The symbols being reduced. */
3926 for (yyi = 0; yyi < yynrhs; yyi++)
3928 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3929 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3930 &(yyvsp[(yyi + 1) - (yynrhs)])
3932 YYFPRINTF (stderr, "\n");
3936 # define YY_REDUCE_PRINT(Rule) \
3939 yy_reduce_print (yyvsp, Rule); \
3942 /* Nonzero means print parse trace. It is left uninitialized so that
3943 multiple parsers can coexist. */
3945 #else /* !YYDEBUG */
3946 # define YYDPRINTF(Args)
3947 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3948 # define YY_STACK_PRINT(Bottom, Top)
3949 # define YY_REDUCE_PRINT(Rule)
3950 #endif /* !YYDEBUG */
3953 /* YYINITDEPTH -- initial size of the parser's stacks. */
3955 # define YYINITDEPTH 200
3958 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3959 if the built-in stack extension method is used).
3961 Do not make this value too large; the results are undefined if
3962 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3963 evaluated with infinite-precision integer arithmetic. */
3966 # define YYMAXDEPTH 10000
3974 # if defined __GLIBC__ && defined _STRING_H
3975 # define yystrlen strlen
3977 /* Return the length of YYSTR. */
3978 #if (defined __STDC__ || defined __C99__FUNC__ \
3979 || defined __cplusplus || defined _MSC_VER)
3981 yystrlen (const char *yystr)
3989 for (yylen = 0; yystr[yylen]; yylen++)
3997 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3998 # define yystpcpy stpcpy
4000 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
4002 #if (defined __STDC__ || defined __C99__FUNC__ \
4003 || defined __cplusplus || defined _MSC_VER)
4005 yystpcpy (char *yydest, const char *yysrc)
4008 yystpcpy (yydest, yysrc)
4014 const char *yys = yysrc;
4016 while ((*yyd++ = *yys++) != '\0')
4025 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
4026 quotes and backslashes, so that it's suitable for yyerror. The
4027 heuristic is that double-quoting is unnecessary unless the string
4028 contains an apostrophe, a comma, or backslash (other than
4029 backslash-backslash). YYSTR is taken from yytname. If YYRES is
4030 null, do not copy; instead, return the length of what the result
4033 yytnamerr (char *yyres, const char *yystr)
4038 char const *yyp = yystr;
4045 goto do_not_strip_quotes;
4049 goto do_not_strip_quotes;
4062 do_not_strip_quotes: ;
4066 return yystrlen (yystr);
4068 return yystpcpy (yyres, yystr) - yyres;
4072 /* Copy into YYRESULT an error message about the unexpected token
4073 YYCHAR while in state YYSTATE. Return the number of bytes copied,
4074 including the terminating null byte. If YYRESULT is null, do not
4075 copy anything; just return the number of bytes that would be
4076 copied. As a special case, return 0 if an ordinary "syntax error"
4077 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
4078 size calculation. */
4080 yysyntax_error (char *yyresult, int yystate, int yychar)
4082 int yyn = yypact[yystate];
4084 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
4088 int yytype = YYTRANSLATE (yychar);
4089 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4090 YYSIZE_T yysize = yysize0;
4092 int yysize_overflow = 0;
4093 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
4094 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4098 /* This is so xgettext sees the translatable formats that are
4099 constructed on the fly. */
4100 YY_("syntax error, unexpected %s");
4101 YY_("syntax error, unexpected %s, expecting %s");
4102 YY_("syntax error, unexpected %s, expecting %s or %s");
4103 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4104 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4108 static char const yyunexpected[] = "syntax error, unexpected %s";
4109 static char const yyexpecting[] = ", expecting %s";
4110 static char const yyor[] = " or %s";
4111 char yyformat[sizeof yyunexpected
4112 + sizeof yyexpecting - 1
4113 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4114 * (sizeof yyor - 1))];
4115 char const *yyprefix = yyexpecting;
4117 /* Start YYX at -YYN if negative to avoid negative indexes in
4119 int yyxbegin = yyn < 0 ? -yyn : 0;
4121 /* Stay within bounds of both yycheck and yytname. */
4122 int yychecklim = YYLAST - yyn + 1;
4123 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4126 yyarg[0] = yytname[yytype];
4127 yyfmt = yystpcpy (yyformat, yyunexpected);
4129 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4130 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4132 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4136 yyformat[sizeof yyunexpected - 1] = '\0';
4139 yyarg[yycount++] = yytname[yyx];
4140 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4141 yysize_overflow |= (yysize1 < yysize);
4143 yyfmt = yystpcpy (yyfmt, yyprefix);
4147 yyf = YY_(yyformat);
4148 yysize1 = yysize + yystrlen (yyf);
4149 yysize_overflow |= (yysize1 < yysize);
4152 if (yysize_overflow)
4153 return YYSIZE_MAXIMUM;
4157 /* Avoid sprintf, as that infringes on the user's name space.
4158 Don't have undefined behavior even if the translation
4159 produced a string with the wrong number of "%s"s. */
4160 char *yyp = yyresult;
4162 while ((*yyp = *yyf) != '\0')
4164 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4166 yyp += yytnamerr (yyp, yyarg[yyi++]);
4179 #endif /* YYERROR_VERBOSE */
4182 /*-----------------------------------------------.
4183 | Release the memory associated to this symbol. |
4184 `-----------------------------------------------*/
4187 #if (defined __STDC__ || defined __C99__FUNC__ \
4188 || defined __cplusplus || defined _MSC_VER)
4190 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4193 yydestruct (yymsg, yytype, yyvaluep)
4203 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4213 /* Prevent warnings from -Wmissing-prototypes. */
4214 #ifdef YYPARSE_PARAM
4215 #if defined __STDC__ || defined __cplusplus
4216 int yyparse (void *YYPARSE_PARAM);
4220 #else /* ! YYPARSE_PARAM */
4221 #if defined __STDC__ || defined __cplusplus
4226 #endif /* ! YYPARSE_PARAM */
4229 /* The lookahead symbol. */
4232 /* The semantic value of the lookahead symbol. */
4235 /* Number of syntax errors so far. */
4240 /*-------------------------.
4241 | yyparse or yypush_parse. |
4242 `-------------------------*/
4244 #ifdef YYPARSE_PARAM
4245 #if (defined __STDC__ || defined __C99__FUNC__ \
4246 || defined __cplusplus || defined _MSC_VER)
4248 yyparse (void *YYPARSE_PARAM)
4251 yyparse (YYPARSE_PARAM)
4252 void *YYPARSE_PARAM;
4254 #else /* ! YYPARSE_PARAM */
4255 #if (defined __STDC__ || defined __C99__FUNC__ \
4256 || defined __cplusplus || defined _MSC_VER)
4269 /* Number of tokens to shift before error messages enabled. */
4272 /* The stacks and their tools:
4273 `yyss': related to states.
4274 `yyvs': related to semantic values.
4276 Refer to the stacks thru separate pointers, to allow yyoverflow
4277 to reallocate them elsewhere. */
4279 /* The state stack. */
4280 yytype_int16 yyssa[YYINITDEPTH];
4282 yytype_int16 *yyssp;
4284 /* The semantic value stack. */
4285 YYSTYPE yyvsa[YYINITDEPTH];
4289 YYSIZE_T yystacksize;
4293 /* Lookahead token as an internal (translated) token number. */
4295 /* The variables used to return semantic value and location from the
4300 /* Buffer for error messages, and its allocated size. */
4302 char *yymsg = yymsgbuf;
4303 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4306 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4308 /* The number of symbols on the RHS of the reduced rule.
4309 Keep to zero when no symbol should be popped. */
4315 yystacksize = YYINITDEPTH;
4317 YYDPRINTF ((stderr, "Starting parse\n"));
4322 yychar = YYEMPTY; /* Cause a token to be read. */
4324 /* Initialize stack pointers.
4325 Waste one element of value and location stack
4326 so that they stay on the same level as the state stack.
4327 The wasted elements are never initialized. */
4333 /*------------------------------------------------------------.
4334 | yynewstate -- Push a new state, which is found in yystate. |
4335 `------------------------------------------------------------*/
4337 /* In all cases, when you get here, the value and location stacks
4338 have just been pushed. So pushing a state here evens the stacks. */
4344 if (yyss + yystacksize - 1 <= yyssp)
4346 /* Get the current used size of the three stacks, in elements. */
4347 YYSIZE_T yysize = yyssp - yyss + 1;
4351 /* Give user a chance to reallocate the stack. Use copies of
4352 these so that the &'s don't force the real ones into
4354 YYSTYPE *yyvs1 = yyvs;
4355 yytype_int16 *yyss1 = yyss;
4357 /* Each stack pointer address is followed by the size of the
4358 data in use in that stack, in bytes. This used to be a
4359 conditional around just the two extra args, but that might
4360 be undefined if yyoverflow is a macro. */
4361 yyoverflow (YY_("memory exhausted"),
4362 &yyss1, yysize * sizeof (*yyssp),
4363 &yyvs1, yysize * sizeof (*yyvsp),
4369 #else /* no yyoverflow */
4370 # ifndef YYSTACK_RELOCATE
4371 goto yyexhaustedlab;
4373 /* Extend the stack our own way. */
4374 if (YYMAXDEPTH <= yystacksize)
4375 goto yyexhaustedlab;
4377 if (YYMAXDEPTH < yystacksize)
4378 yystacksize = YYMAXDEPTH;
4381 yytype_int16 *yyss1 = yyss;
4382 union yyalloc *yyptr =
4383 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4385 goto yyexhaustedlab;
4386 YYSTACK_RELOCATE (yyss_alloc, yyss);
4387 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4388 # undef YYSTACK_RELOCATE
4390 YYSTACK_FREE (yyss1);
4393 #endif /* no yyoverflow */
4395 yyssp = yyss + yysize - 1;
4396 yyvsp = yyvs + yysize - 1;
4398 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4399 (unsigned long int) yystacksize));
4401 if (yyss + yystacksize - 1 <= yyssp)
4405 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4407 if (yystate == YYFINAL)
4417 /* Do appropriate processing given the current state. Read a
4418 lookahead token if we need one and don't already have one. */
4420 /* First try to decide what to do without reference to lookahead token. */
4421 yyn = yypact[yystate];
4422 if (yyn == YYPACT_NINF)
4425 /* Not known => get a lookahead token if don't already have one. */
4427 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4428 if (yychar == YYEMPTY)
4430 YYDPRINTF ((stderr, "Reading a token: "));
4434 if (yychar <= YYEOF)
4436 yychar = yytoken = YYEOF;
4437 YYDPRINTF ((stderr, "Now at end of input.\n"));
4441 yytoken = YYTRANSLATE (yychar);
4442 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4445 /* If the proper action on seeing token YYTOKEN is to reduce or to
4446 detect an error, take that action. */
4448 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4453 if (yyn == 0 || yyn == YYTABLE_NINF)
4459 /* Count tokens shifted since error; after three, turn off error
4464 /* Shift the lookahead token. */
4465 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4467 /* Discard the shifted token. */
4476 /*-----------------------------------------------------------.
4477 | yydefault -- do the default action for the current state. |
4478 `-----------------------------------------------------------*/
4480 yyn = yydefact[yystate];
4486 /*-----------------------------.
4487 | yyreduce -- Do a reduction. |
4488 `-----------------------------*/
4490 /* yyn is the number of a rule to reduce with. */
4493 /* If YYLEN is nonzero, implement the default value of the action:
4496 Otherwise, the following line sets YYVAL to garbage.
4497 This behavior is undocumented and Bison
4498 users should not rely upon it. Assigning to YYVAL
4499 unconditionally makes the parser a bit smaller, and it avoids a
4500 GCC warning that YYVAL may be used uninitialized. */
4501 yyval = yyvsp[1-yylen];
4504 YY_REDUCE_PRINT (yyn);
4511 /* Line 1464 of skeleton.m4 */
4512 #line 1902 "parser.y"
4513 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4522 /* Line 1464 of skeleton.m4 */
4523 #line 1914 "parser.y"
4524 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4533 /* Line 1464 of skeleton.m4 */
4534 #line 1917 "parser.y"
4535 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4544 /* Line 1464 of skeleton.m4 */
4545 #line 1918 "parser.y"
4546 {(yyval.code)=code_new();}
4555 /* Line 1464 of skeleton.m4 */
4556 #line 1920 "parser.y"
4558 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4568 /* Line 1464 of skeleton.m4 */
4569 #line 1923 "parser.y"
4570 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4579 /* Line 1464 of skeleton.m4 */
4580 #line 1938 "parser.y"
4581 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4590 /* Line 1464 of skeleton.m4 */
4591 #line 1939 "parser.y"
4601 /* Line 1464 of skeleton.m4 */
4602 #line 1942 "parser.y"
4612 /* Line 1464 of skeleton.m4 */
4613 #line 1949 "parser.y"
4617 (yyval.code) = (yyvsp[(3) - (4)].code);
4621 as3_pass=(yyvsp[(1) - (4)].number_int);
4631 /* Line 1464 of skeleton.m4 */
4632 #line 1961 "parser.y"
4633 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4642 /* Line 1464 of skeleton.m4 */
4643 #line 1962 "parser.y"
4644 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4653 /* Line 1464 of skeleton.m4 */
4654 #line 1966 "parser.y"
4656 code_t**cc = &global->init->method->body->code;
4657 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4667 /* Line 1464 of skeleton.m4 */
4668 #line 1973 "parser.y"
4671 (yyval.number_int)=as3_pass;
4672 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4673 if(!definitions || !dict_contains(definitions, key)) {
4686 /* Line 1464 of skeleton.m4 */
4687 #line 1992 "parser.y"
4688 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4697 /* Line 1464 of skeleton.m4 */
4698 #line 1993 "parser.y"
4699 {(yyval.node)=mkdummynode();}
4708 /* Line 1464 of skeleton.m4 */
4709 #line 1995 "parser.y"
4710 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4719 /* Line 1464 of skeleton.m4 */
4720 #line 1996 "parser.y"
4721 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4730 /* Line 1464 of skeleton.m4 */
4731 #line 1998 "parser.y"
4732 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4741 /* Line 1464 of skeleton.m4 */
4742 #line 1999 "parser.y"
4743 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4752 /* Line 1464 of skeleton.m4 */
4753 #line 2002 "parser.y"
4756 if(variable_exists((yyvsp[(1) - (3)].id)))
4757 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4759 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4764 if(state->method->uses_slots) {
4765 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4767 // this variable is stored in a slot
4769 v->type = (yyvsp[(2) - (3)].classinfo);
4775 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4778 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4780 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
4781 if(!is_subtype_of(v.t, (yyvsp[(2) - (3)].classinfo))) {
4782 syntaxerror("Can't convert %s to %s", v.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4784 if((yyvsp[(2) - (3)].classinfo)) {
4785 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4786 (yyval.code) = code_append((yyval.code), v.c);
4787 (yyval.code) = converttype((yyval.code), v.t, (yyvsp[(2) - (3)].classinfo));
4790 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4793 if(v.c->prev || v.c->opcode != OPCODE_PUSHUNDEFINED) {
4794 (yyval.code) = code_append((yyval.code), v.c);
4795 (yyval.code) = abc_coerce_a((yyval.code));
4797 // don't do anything
4799 code_free((yyval.code));
4805 (yyval.code) = abc_setslot((yyval.code), index);
4807 (yyval.code) = abc_setlocal((yyval.code), index);
4818 /* Line 1464 of skeleton.m4 */
4819 #line 2061 "parser.y"
4820 {(yyval.code) = code_new();}
4829 /* Line 1464 of skeleton.m4 */
4830 #line 2062 "parser.y"
4831 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4840 /* Line 1464 of skeleton.m4 */
4841 #line 2065 "parser.y"
4842 {PASS12 new_state();}
4851 /* Line 1464 of skeleton.m4 */
4852 #line 2065 "parser.y"
4855 (yyval.code) = code_new();
4856 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4857 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4859 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4860 if((yyvsp[(7) - (7)].code)) {
4861 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4863 myif->branch = (yyval.code) = abc_nop((yyval.code));
4864 if((yyvsp[(7) - (7)].code)) {
4865 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4866 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4868 (yyval.code) = var_block((yyval.code));
4879 /* Line 1464 of skeleton.m4 */
4880 #line 2084 "parser.y"
4881 {(yyval.code)=code_new();}
4890 /* Line 1464 of skeleton.m4 */
4891 #line 2091 "parser.y"
4893 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4894 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4904 /* Line 1464 of skeleton.m4 */
4905 #line 2095 "parser.y"
4908 (yyval.id)=(yyvsp[(1) - (1)].id);
4918 /* Line 1464 of skeleton.m4 */
4919 #line 2100 "parser.y"
4920 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4929 /* Line 1464 of skeleton.m4 */
4930 #line 2101 "parser.y"
4931 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4940 /* Line 1464 of skeleton.m4 */
4941 #line 2103 "parser.y"
4943 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4944 (yyval.code) = code_new();
4945 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4946 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4947 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4948 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4949 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4950 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4951 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4952 (yyval.code) = abc_jump((yyval.code), loopstart);
4953 code_t*out = (yyval.code) = abc_nop((yyval.code));
4954 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4955 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4958 (yyval.code) = var_block((yyval.code));
4969 /* Line 1464 of skeleton.m4 */
4970 #line 2123 "parser.y"
4972 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4974 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4977 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4978 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4979 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4980 int array = new_variable(tmp1name, 0, 0, 0);
4982 (yyval.code) = code_new();
4983 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4984 (yyval.code) = abc_coerce_a((yyval.code));
4985 (yyval.code) = abc_setlocal((yyval.code), array);
4986 (yyval.code) = abc_pushbyte((yyval.code), 0);
4987 (yyval.code) = abc_setlocal((yyval.code), it);
4989 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4991 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4992 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4993 (yyval.code) = abc_getlocal((yyval.code), array);
4994 (yyval.code) = abc_getlocal((yyval.code), it);
4995 if(!(yyvsp[(1) - (6)].for_start).each)
4996 (yyval.code) = abc_nextname((yyval.code));
4998 (yyval.code) = abc_nextvalue((yyval.code));
4999 (yyval.code) = converttype((yyval.code), 0, var->type);
5000 (yyval.code) = abc_setlocal((yyval.code), var->index);
5002 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5003 (yyval.code) = abc_jump((yyval.code), loopstart);
5005 code_t*out = (yyval.code) = abc_nop((yyval.code));
5006 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
5007 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
5011 (yyval.code) = var_block((yyval.code));
5026 /* Line 1464 of skeleton.m4 */
5027 #line 2171 "parser.y"
5028 {PASS12 new_state();}
5037 /* Line 1464 of skeleton.m4 */
5038 #line 2171 "parser.y"
5041 (yyval.code) = code_new();
5043 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
5044 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5045 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
5046 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5047 myjmp->branch = cont;
5048 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
5049 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5050 code_t*out = (yyval.code) = abc_nop((yyval.code));
5051 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5052 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5054 (yyval.code) = var_block((yyval.code));
5065 /* Line 1464 of skeleton.m4 */
5066 #line 2190 "parser.y"
5067 {PASS12 new_state();}
5076 /* Line 1464 of skeleton.m4 */
5077 #line 2190 "parser.y"
5079 (yyval.code) = code_new();
5080 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5081 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
5082 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5083 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
5084 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5085 code_t*out = (yyval.code) = abc_nop((yyval.code));
5086 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
5087 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
5089 (yyval.code) = var_block((yyval.code));
5100 /* Line 1464 of skeleton.m4 */
5101 #line 2205 "parser.y"
5103 (yyval.code) = abc___break__(0, "");
5113 /* Line 1464 of skeleton.m4 */
5114 #line 2208 "parser.y"
5116 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5126 /* Line 1464 of skeleton.m4 */
5127 #line 2211 "parser.y"
5129 (yyval.code) = abc___continue__(0, "");
5139 /* Line 1464 of skeleton.m4 */
5140 #line 2214 "parser.y"
5142 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5152 /* Line 1464 of skeleton.m4 */
5153 #line 2218 "parser.y"
5163 /* Line 1464 of skeleton.m4 */
5164 #line 2219 "parser.y"
5165 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5174 /* Line 1464 of skeleton.m4 */
5175 #line 2220 "parser.y"
5176 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5185 /* Line 1464 of skeleton.m4 */
5186 #line 2221 "parser.y"
5187 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5196 /* Line 1464 of skeleton.m4 */
5197 #line 2222 "parser.y"
5198 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5207 /* Line 1464 of skeleton.m4 */
5208 #line 2223 "parser.y"
5209 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5218 /* Line 1464 of skeleton.m4 */
5219 #line 2225 "parser.y"
5221 (yyval.code) = abc_getlocal(0, state->switch_var);
5222 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5223 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5224 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5225 if((yyval.code)->opcode != OPCODE___BREAK__) {
5226 (yyval.code) = abc___fallthrough__((yyval.code), "");
5228 code_t*e = (yyval.code) = abc_nop((yyval.code));
5239 /* Line 1464 of skeleton.m4 */
5240 #line 2236 "parser.y"
5242 (yyval.code) = (yyvsp[(3) - (3)].code);
5252 /* Line 1464 of skeleton.m4 */
5253 #line 2239 "parser.y"
5254 {PASS12 new_state();state->switch_var=alloc_local();}
5263 /* Line 1464 of skeleton.m4 */
5264 #line 2239 "parser.y"
5266 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5267 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5268 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5270 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5271 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5273 code_t*c = (yyval.code),*lastblock=0;
5275 if(c->opcode == OPCODE_IFNE) {
5276 if(!c->next) syntaxerror("internal error in fallthrough handling");
5278 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5280 c->opcode = OPCODE_JUMP;
5281 c->branch = lastblock;
5283 /* fall through end of switch */
5284 c->opcode = OPCODE_NOP;
5290 (yyval.code) = var_block((yyval.code));
5301 /* Line 1464 of skeleton.m4 */
5302 #line 2270 "parser.y"
5303 {PASS12 new_state();
5304 state->exception_name=(yyvsp[(3) - (5)].id);
5305 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5306 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5316 /* Line 1464 of skeleton.m4 */
5317 #line 2275 "parser.y"
5319 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5320 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5322 NEW(abc_exception_t, e)
5323 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5324 e->var_name = multiname_clone(&name);
5325 (yyval.exception) = e;
5328 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5329 e->target = c = abc_nop(0);
5330 c = abc_setlocal(c, i);
5331 c = code_append(c, code_dup(state->method->scope_code));
5332 c = code_append(c, (yyvsp[(8) - (9)].code));
5346 /* Line 1464 of skeleton.m4 */
5347 #line 2295 "parser.y"
5348 {PASS12 new_state();state->exception_name=0;}
5357 /* Line 1464 of skeleton.m4 */
5358 #line 2295 "parser.y"
5360 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5361 if(!(yyvsp[(4) - (5)].code)) {
5362 (yyval.exception)=0;
5364 NEW(abc_exception_t, e)
5365 e->exc_type = 0; //all exceptions
5366 e->var_name = 0; //no name
5369 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5370 (yyval.exception) = e;
5382 /* Line 1464 of skeleton.m4 */
5383 #line 2311 "parser.y"
5384 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5393 /* Line 1464 of skeleton.m4 */
5394 #line 2312 "parser.y"
5395 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5404 /* Line 1464 of skeleton.m4 */
5405 #line 2313 "parser.y"
5406 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5415 /* Line 1464 of skeleton.m4 */
5416 #line 2314 "parser.y"
5418 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5419 (yyval.catch_list).finally = 0;
5420 if((yyvsp[(2) - (2)].exception)) {
5421 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5422 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5433 /* Line 1464 of skeleton.m4 */
5434 #line 2322 "parser.y"
5436 (yyval.catch_list).l=list_new();
5437 (yyval.catch_list).finally = 0;
5438 if((yyvsp[(1) - (1)].exception)) {
5439 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5440 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5451 /* Line 1464 of skeleton.m4 */
5452 #line 2331 "parser.y"
5453 {PASS12 new_state();
5454 state->method->has_exceptions=1;
5455 state->method->late_binding=1;//for invariant scope_code
5465 /* Line 1464 of skeleton.m4 */
5466 #line 2334 "parser.y"
5468 code_t*out = abc_nop(0);
5470 code_t*start = abc_nop(0);
5471 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5472 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5473 (yyval.code) = abc_jump((yyval.code), out);
5475 code_t*end = (yyval.code) = abc_nop((yyval.code));
5478 if((yyvsp[(6) - (6)].catch_list).finally)
5479 tmp = new_variable("__finally__", 0, 0, 0);
5481 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5484 abc_exception_t*e = l->abc_exception;
5486 (yyval.code) = code_append((yyval.code), e->target);
5487 (yyval.code) = abc_jump((yyval.code), out);
5489 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5491 e->target = (yyval.code) = abc_nop((yyval.code));
5492 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5493 (yyval.code) = abc___rethrow__((yyval.code));
5501 (yyval.code) = code_append((yyval.code), out);
5503 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5505 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5507 (yyval.code) = var_block((yyval.code));
5518 /* Line 1464 of skeleton.m4 */
5519 #line 2380 "parser.y"
5521 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5522 (yyval.code)=abc_throw((yyval.code));
5532 /* Line 1464 of skeleton.m4 */
5533 #line 2384 "parser.y"
5535 if(!state->exception_name)
5536 syntaxerror("re-throw only possible within a catch block");
5537 variable_t*v = find_variable(state, state->exception_name);
5538 (yyval.code)=code_new();
5539 (yyval.code)=abc_getlocal((yyval.code), v->index);
5540 (yyval.code)=abc_throw((yyval.code));
5550 /* Line 1464 of skeleton.m4 */
5551 #line 2395 "parser.y"
5554 if(state->method->has_exceptions) {
5555 int v = alloc_local();
5556 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5557 state->method->scope_code = abc_pushwith(state->method->scope_code);
5558 (yyval.value_list).number = v;
5560 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5570 /* Line 1464 of skeleton.m4 */
5571 #line 2405 "parser.y"
5573 /* remove getlocal;pushwith from scope code again */
5574 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5576 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5577 if(state->method->has_exceptions) {
5578 (yyval.code) = abc_dup((yyval.code));
5579 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5581 (yyval.code) = abc_pushwith((yyval.code));
5582 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5583 (yyval.code) = abc_popscope((yyval.code));
5594 /* Line 1464 of skeleton.m4 */
5595 #line 2423 "parser.y"
5596 {PASS12 (yyval.id)="package";}
5605 /* Line 1464 of skeleton.m4 */
5606 #line 2424 "parser.y"
5607 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5616 /* Line 1464 of skeleton.m4 */
5617 #line 2426 "parser.y"
5618 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5627 /* Line 1464 of skeleton.m4 */
5628 #line 2427 "parser.y"
5629 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5638 /* Line 1464 of skeleton.m4 */
5639 #line 2429 "parser.y"
5640 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5649 /* Line 1464 of skeleton.m4 */
5650 #line 2430 "parser.y"
5651 {PASS12 endpackage();(yyval.code)=0;}
5660 /* Line 1464 of skeleton.m4 */
5661 #line 2431 "parser.y"
5662 {PASS12 startpackage("");}
5671 /* Line 1464 of skeleton.m4 */
5672 #line 2432 "parser.y"
5673 {PASS12 endpackage();(yyval.code)=0;}
5682 /* Line 1464 of skeleton.m4 */
5683 #line 2454 "parser.y"
5686 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5687 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5688 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5690 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5692 syntaxerror("Couldn't import class\n");
5693 state_has_imports();
5694 dict_put(state->imports, c->name, c);
5695 import_toplevel(c->package);
5706 /* Line 1464 of skeleton.m4 */
5707 #line 2468 "parser.y"
5710 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5711 as3_schedule_package((yyvsp[(2) - (4)].id));
5715 i->package = (yyvsp[(2) - (4)].id);
5716 state_has_imports();
5717 list_append(state->wildcard_imports, i);
5718 import_toplevel(i->package);
5729 /* Line 1464 of skeleton.m4 */
5730 #line 2484 "parser.y"
5731 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5740 /* Line 1464 of skeleton.m4 */
5741 #line 2485 "parser.y"
5742 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5751 /* Line 1464 of skeleton.m4 */
5752 #line 2486 "parser.y"
5753 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5762 /* Line 1464 of skeleton.m4 */
5763 #line 2487 "parser.y"
5766 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5767 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5768 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5779 /* Line 1464 of skeleton.m4 */
5780 #line 2494 "parser.y"
5781 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5790 /* Line 1464 of skeleton.m4 */
5791 #line 2495 "parser.y"
5792 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5801 /* Line 1464 of skeleton.m4 */
5802 #line 2496 "parser.y"
5803 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5812 /* Line 1464 of skeleton.m4 */
5813 #line 2497 "parser.y"
5814 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5823 /* Line 1464 of skeleton.m4 */
5824 #line 2498 "parser.y"
5825 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5834 /* Line 1464 of skeleton.m4 */
5835 #line 2499 "parser.y"
5836 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5845 /* Line 1464 of skeleton.m4 */
5846 #line 2500 "parser.y"
5847 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5856 /* Line 1464 of skeleton.m4 */
5857 #line 2501 "parser.y"
5858 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5867 /* Line 1464 of skeleton.m4 */
5868 #line 2502 "parser.y"
5869 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5878 /* Line 1464 of skeleton.m4 */
5879 #line 2503 "parser.y"
5880 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5881 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5891 /* Line 1464 of skeleton.m4 */
5892 #line 2507 "parser.y"
5893 {PASS12 (yyval.classinfo)=0;}
5902 /* Line 1464 of skeleton.m4 */
5903 #line 2508 "parser.y"
5904 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5913 /* Line 1464 of skeleton.m4 */
5914 #line 2510 "parser.y"
5915 {PASS12 (yyval.classinfo_list)=list_new();}
5924 /* Line 1464 of skeleton.m4 */
5925 #line 2511 "parser.y"
5926 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5935 /* Line 1464 of skeleton.m4 */
5936 #line 2513 "parser.y"
5937 {PASS12 (yyval.classinfo_list)=list_new();}
5946 /* Line 1464 of skeleton.m4 */
5947 #line 2514 "parser.y"
5948 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5957 /* Line 1464 of skeleton.m4 */
5958 #line 2518 "parser.y"
5959 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5968 /* Line 1464 of skeleton.m4 */
5969 #line 2520 "parser.y"
5970 {PASS12 endclass();(yyval.code)=0;}
5979 /* Line 1464 of skeleton.m4 */
5980 #line 2524 "parser.y"
5981 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5982 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5991 /* Line 1464 of skeleton.m4 */
5992 #line 2527 "parser.y"
5993 {PASS12 endclass();(yyval.code)=0;}
6002 /* Line 1464 of skeleton.m4 */
6003 #line 2536 "parser.y"
6004 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
6013 /* Line 1464 of skeleton.m4 */
6014 #line 2540 "parser.y"
6016 code_t*c = state->cls->static_init->header;
6017 c = code_append(c, (yyvsp[(1) - (1)].code));
6018 state->cls->static_init->header = c;
6028 /* Line 1464 of skeleton.m4 */
6029 #line 2551 "parser.y"
6031 syntaxerror("variable declarations not allowed in interfaces");
6041 /* Line 1464 of skeleton.m4 */
6042 #line 2554 "parser.y"
6045 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
6046 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
6047 syntaxerror("invalid method modifiers: interface methods always need to be public");
6049 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
6050 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
6051 list_deep_free((yyvsp[(6) - (8)].params).list);
6061 /* Line 1464 of skeleton.m4 */
6062 #line 2624 "parser.y"
6063 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
6072 /* Line 1464 of skeleton.m4 */
6073 #line 2624 "parser.y"
6074 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
6083 /* Line 1464 of skeleton.m4 */
6084 #line 2626 "parser.y"
6085 {PASS12 (yyval.code)=0;}
6094 /* Line 1464 of skeleton.m4 */
6095 #line 2627 "parser.y"
6096 {PASS12 (yyval.code)=0;}
6105 /* Line 1464 of skeleton.m4 */
6106 #line 2630 "parser.y"
6109 int flags = slotstate_flags->flags;
6110 namespace_t ns = modifiers2access(slotstate_flags);
6114 varinfo_t* info = 0;
6116 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6118 check_override(i, flags);
6120 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6122 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6124 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6126 if(ns.name && ns.name[0]) {
6127 syntaxerror("namespaces not allowed on package-level variables");
6129 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6132 info->type = (yyvsp[(2) - (3)].classinfo);
6133 info->flags = flags;
6135 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6139 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6143 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6145 if((yyvsp[(2) - (3)].classinfo)) {
6146 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6147 t->type_name = multiname_clone(&m);
6149 info->slot = t->slot_id;
6151 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6152 FIXME: is there a way to use slots and still don't have conflicting overrides?
6154 info->slot = t->slot_id = 0;
6156 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6157 if(cval.type!=CONSTANT_UNKNOWN) {
6158 /* compile time constant */
6159 t->value = malloc(sizeof(constant_t));
6160 memcpy(t->value, &cval, sizeof(constant_t));
6161 info->value = constant_clone(t->value);
6163 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6164 /* initalization code (if needed) */
6166 if(v.c && !is_pushundefined(v.c)) {
6167 c = abc_getlocal_0(c);
6168 c = code_append(c, v.c);
6169 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6171 c = abc_initproperty2(c, &mname);
6173 c = abc_setslot(c, t->slot_id);
6176 *code = code_append(*code, c);
6179 if(slotstate_varconst==KW_CONST) {
6180 t->kind= TRAIT_CONST;
6181 info->flags |= FLAG_CONST;
6195 /* Line 1464 of skeleton.m4 */
6196 #line 2713 "parser.y"
6197 {(yyval.constant)=0;}
6206 /* Line 1464 of skeleton.m4 */
6207 #line 2714 "parser.y"
6209 (yyval.constant) = malloc(sizeof(constant_t));
6210 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6211 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6212 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6223 /* Line 1464 of skeleton.m4 */
6224 #line 2723 "parser.y"
6225 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6234 /* Line 1464 of skeleton.m4 */
6235 #line 2724 "parser.y"
6237 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6247 /* Line 1464 of skeleton.m4 */
6248 #line 2727 "parser.y"
6249 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6258 /* Line 1464 of skeleton.m4 */
6259 #line 2728 "parser.y"
6260 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6269 /* Line 1464 of skeleton.m4 */
6270 #line 2729 "parser.y"
6271 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6280 /* Line 1464 of skeleton.m4 */
6281 #line 2730 "parser.y"
6282 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6291 /* Line 1464 of skeleton.m4 */
6292 #line 2731 "parser.y"
6293 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6302 /* Line 1464 of skeleton.m4 */
6303 #line 2732 "parser.y"
6304 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6313 /* Line 1464 of skeleton.m4 */
6314 #line 2733 "parser.y"
6315 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6324 /* Line 1464 of skeleton.m4 */
6325 #line 2753 "parser.y"
6326 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6335 /* Line 1464 of skeleton.m4 */
6336 #line 2754 "parser.y"
6337 {PASS_ALWAYS tokenizer_begin_xmltext();}
6346 /* Line 1464 of skeleton.m4 */
6347 #line 2755 "parser.y"
6348 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6357 /* Line 1464 of skeleton.m4 */
6358 #line 2757 "parser.y"
6359 {PASS_ALWAYS tokenizer_begin_xmltext();}
6368 /* Line 1464 of skeleton.m4 */
6369 #line 2757 "parser.y"
6371 (yyval.id)=strdup("{...}");
6372 as3_warning("xml string substitution not yet supported");
6382 /* Line 1464 of skeleton.m4 */
6383 #line 2761 "parser.y"
6384 {PASS_ALWAYS tokenizer_begin_xml();}
6393 /* Line 1464 of skeleton.m4 */
6394 #line 2761 "parser.y"
6396 (yyval.id)=strdup("{...}");
6397 as3_warning("xml string substitution not yet supported");
6407 /* Line 1464 of skeleton.m4 */
6408 #line 2765 "parser.y"
6418 /* Line 1464 of skeleton.m4 */
6419 #line 2766 "parser.y"
6421 (yyval.id) = concat2((yyvsp[(1) - (2)].id), "{...}");
6431 /* Line 1464 of skeleton.m4 */
6432 #line 2769 "parser.y"
6433 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), string_cstr(&(yyvsp[(2) - (2)].str)));}
6442 /* Line 1464 of skeleton.m4 */
6443 #line 2770 "parser.y"
6444 {(yyval.id)=concat2((yyvsp[(1) - (2)].id), ">");}
6453 /* Line 1464 of skeleton.m4 */
6454 #line 2772 "parser.y"
6455 {(yyval.id)=concat2((yyvsp[(1) - (2)].id),(yyvsp[(2) - (2)].id));}
6464 /* Line 1464 of skeleton.m4 */
6465 #line 2773 "parser.y"
6466 {(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));}
6475 /* Line 1464 of skeleton.m4 */
6476 #line 2775 "parser.y"
6477 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6486 /* Line 1464 of skeleton.m4 */
6487 #line 2776 "parser.y"
6488 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6497 /* Line 1464 of skeleton.m4 */
6498 #line 2778 "parser.y"
6500 (yyval.id) = allocprintf("<%s%s>%s</%s>", (yyvsp[(2) - (10)].id), (yyvsp[(3) - (10)].id), (yyvsp[(5) - (10)].id), (yyvsp[(8) - (10)].id));
6501 free((yyvsp[(2) - (10)].id));free((yyvsp[(3) - (10)].id));free((yyvsp[(5) - (10)].id));free((yyvsp[(8) - (10)].id));
6511 /* Line 1464 of skeleton.m4 */
6512 #line 2782 "parser.y"
6514 (yyval.id) = allocprintf("<%s%s/>", (yyvsp[(2) - (6)].id), (yyvsp[(3) - (6)].id));
6524 /* Line 1464 of skeleton.m4 */
6525 #line 2785 "parser.y"
6527 (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));
6528 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));
6538 /* Line 1464 of skeleton.m4 */
6539 #line 2790 "parser.y"
6540 {(yyval.id)=strdup("");}
6549 /* Line 1464 of skeleton.m4 */
6550 #line 2791 "parser.y"
6551 {(yyval.id)=concat2(" ",(yyvsp[(1) - (1)].id));}
6560 /* Line 1464 of skeleton.m4 */
6561 #line 2792 "parser.y"
6562 {(yyval.id)=(yyvsp[(1) - (1)].id);}
6571 /* Line 1464 of skeleton.m4 */
6572 #line 2793 "parser.y"
6573 {(yyval.id)=concat3((yyvsp[(1) - (2)].id)," ",(yyvsp[(2) - (2)].id));free((yyvsp[(1) - (2)].id));free((yyvsp[(2) - (2)].id));}
6582 /* Line 1464 of skeleton.m4 */
6583 #line 2795 "parser.y"
6585 (yyval.id) = strdup("{...}");
6595 /* Line 1464 of skeleton.m4 */
6596 #line 2798 "parser.y"
6598 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6599 (yyval.id) = concat2("{...}=",str);
6609 /* Line 1464 of skeleton.m4 */
6610 #line 2802 "parser.y"
6612 (yyval.id) = strdup("{...}={...}");
6622 /* Line 1464 of skeleton.m4 */
6623 #line 2805 "parser.y"
6625 (yyval.id) = concat2((yyvsp[(1) - (3)].id),"={...}");
6635 /* Line 1464 of skeleton.m4 */
6636 #line 2808 "parser.y"
6638 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6639 (yyval.id)=allocprintf("%s=\"%s\"", (yyvsp[(1) - (3)].id),str);
6641 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6651 /* Line 1464 of skeleton.m4 */
6652 #line 2818 "parser.y"
6655 memset(&(yyval.params),0,sizeof((yyval.params)));
6665 /* Line 1464 of skeleton.m4 */
6666 #line 2822 "parser.y"
6669 (yyval.params)=(yyvsp[(1) - (1)].params);
6679 /* Line 1464 of skeleton.m4 */
6680 #line 2828 "parser.y"
6683 memset(&(yyval.params),0,sizeof((yyval.params)));
6684 (yyval.params).varargs=1;
6685 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6695 /* Line 1464 of skeleton.m4 */
6696 #line 2834 "parser.y"
6699 (yyval.params) =(yyvsp[(1) - (4)].params);
6700 (yyval.params).varargs=1;
6701 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6711 /* Line 1464 of skeleton.m4 */
6712 #line 2842 "parser.y"
6715 (yyval.params) = (yyvsp[(1) - (3)].params);
6716 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6726 /* Line 1464 of skeleton.m4 */
6727 #line 2847 "parser.y"
6730 memset(&(yyval.params),0,sizeof((yyval.params)));
6731 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6741 /* Line 1464 of skeleton.m4 */
6742 #line 2853 "parser.y"
6745 (yyval.param) = rfx_calloc(sizeof(param_t));
6746 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6747 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6749 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6759 /* Line 1464 of skeleton.m4 */
6760 #line 2861 "parser.y"
6763 (yyval.param) = rfx_calloc(sizeof(param_t));
6764 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6765 (yyval.param)->type = TYPE_ANY;
6767 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6777 /* Line 1464 of skeleton.m4 */
6778 #line 2871 "parser.y"
6779 {PASS12 (yyval.token)=0;}
6788 /* Line 1464 of skeleton.m4 */
6789 #line 2874 "parser.y"
6790 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6799 /* Line 1464 of skeleton.m4 */
6800 #line 2875 "parser.y"
6803 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6805 if(!state->method->info) syntaxerror("internal error");
6807 code_t*c = method_header(state->method);
6808 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6810 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6812 list_deep_free((yyvsp[(6) - (12)].params).list);
6823 /* Line 1464 of skeleton.m4 */
6824 #line 2891 "parser.y"
6825 {PASS12 (yyval.id)=0;}
6834 /* Line 1464 of skeleton.m4 */
6835 #line 2893 "parser.y"
6836 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6845 /* Line 1464 of skeleton.m4 */
6846 #line 2894 "parser.y"
6849 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6851 methodinfo_t*f = state->method->info;
6852 if(!f || !f->kind) syntaxerror("internal error");
6854 code_t*c = method_header(state->method);
6855 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6857 int index = state->method->var_index;
6858 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6860 (yyval.value).c = abc_getlocal(0, index);
6861 (yyval.value).t = TYPE_FUNCTION(f);
6863 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6873 /* Line 1464 of skeleton.m4 */
6874 #line 2916 "parser.y"
6876 PASS1 NEW(unresolvedinfo_t,c);
6877 memset(c, 0, sizeof(*c));
6878 c->kind = INFOTYPE_UNRESOLVED;
6879 c->name = (yyvsp[(1) - (1)].id);
6880 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6882 c->nsset = get_current_imports();
6883 /* make the compiler look for this class in the current directory,
6885 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6887 (yyval.classinfo) = (classinfo_t*)c;
6889 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6890 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6891 (yyval.classinfo) = (classinfo_t*)s;
6901 /* Line 1464 of skeleton.m4 */
6902 #line 2935 "parser.y"
6904 PASS1 NEW(unresolvedinfo_t,c);
6905 memset(c, 0, sizeof(*c));
6906 c->kind = INFOTYPE_UNRESOLVED;
6907 c->package = (yyvsp[(1) - (3)].id);
6908 c->name = (yyvsp[(3) - (3)].id);
6909 (yyval.classinfo) = (classinfo_t*)c;
6911 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6912 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6913 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6914 (yyval.classinfo) = (classinfo_t*)s;
6924 /* Line 1464 of skeleton.m4 */
6925 #line 2952 "parser.y"
6926 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6935 /* Line 1464 of skeleton.m4 */
6936 #line 2953 "parser.y"
6937 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6946 /* Line 1464 of skeleton.m4 */
6947 #line 2955 "parser.y"
6948 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6957 /* Line 1464 of skeleton.m4 */
6958 #line 2956 "parser.y"
6959 {PASS12 (yyval.classinfo)=TYPE_ANY;}
6968 /* Line 1464 of skeleton.m4 */
6969 #line 2957 "parser.y"
6970 {PASS12 (yyval.classinfo)=TYPE_VOID;}
6979 /* Line 1464 of skeleton.m4 */
6980 #line 2966 "parser.y"
6981 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6990 /* Line 1464 of skeleton.m4 */
6991 #line 2967 "parser.y"
6992 {PASS12 (yyval.classinfo)=0;}
7001 /* Line 1464 of skeleton.m4 */
7002 #line 2971 "parser.y"
7003 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7012 /* Line 1464 of skeleton.m4 */
7013 #line 2972 "parser.y"
7014 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
7023 /* Line 1464 of skeleton.m4 */
7024 #line 2974 "parser.y"
7025 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7034 /* Line 1464 of skeleton.m4 */
7035 #line 2978 "parser.y"
7036 {(yyval.value_list).number=1;
7037 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
7047 /* Line 1464 of skeleton.m4 */
7048 #line 2982 "parser.y"
7049 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
7058 /* Line 1464 of skeleton.m4 */
7059 #line 2983 "parser.y"
7061 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
7062 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
7072 /* Line 1464 of skeleton.m4 */
7073 #line 2989 "parser.y"
7075 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
7076 (yyval.value).c = v.c;
7077 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
7079 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
7080 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7081 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7082 (yyval.value).c = code_cutlast((yyval.value).c);
7083 (yyval.value).c = code_append((yyval.value).c, paramcode);
7084 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
7085 multiname_destroy(name);
7086 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7087 code_free((yyval.value).c);
7088 classinfo_t*c = v.t->data;
7090 (yyval.value).c = abc_findpropstrict2(0, &m);
7091 (yyval.value).c = code_append((yyval.value).c, paramcode);
7092 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
7093 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
7094 int slot = (int)(ptroff_t)$$.c->data[0];
7095 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
7096 multiname_t*name = t->name;
7097 $$.c = code_cutlast($$.c);
7098 $$.c = code_append($$.c, paramcode);
7099 $$.c = abc_constructprop2($$.c, name, $4.number);*/
7101 (yyval.value).c = code_append((yyval.value).c, paramcode);
7102 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
7105 (yyval.value).t = TYPE_ANY;
7106 if(TYPE_IS_CLASS(v.t) && v.t->data) {
7107 (yyval.value).t = v.t->data;
7109 (yyval.value).c = abc_coerce_a((yyval.value).c);
7110 (yyval.value).t = TYPE_ANY;
7121 /* Line 1464 of skeleton.m4 */
7122 #line 3033 "parser.y"
7125 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
7126 (yyval.value).c = v.c;
7127 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7128 (yyval.value).c = code_cutlast((yyval.value).c);
7130 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
7132 (yyval.value).t = TYPE_ANY;
7133 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7134 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7135 (yyval.value).c = code_cutlast((yyval.value).c);
7136 (yyval.value).c = code_append((yyval.value).c, paramcode);
7137 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7138 multiname_destroy(name);
7139 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7140 int slot = (int)(ptroff_t)$$.c->data[0];
7141 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7142 if(t->kind!=TRAIT_METHOD) {
7143 //ok: flash allows to assign closures to members.
7145 multiname_t*name = t->name;
7146 $$.c = code_cutlast($$.c);
7147 $$.c = code_append($$.c, paramcode);
7148 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7149 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7150 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7151 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7152 (yyval.value).c = code_cutlast((yyval.value).c);
7153 (yyval.value).c = code_append((yyval.value).c, paramcode);
7154 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7155 multiname_destroy(name);
7157 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7158 (yyval.value).c = code_append((yyval.value).c, paramcode);
7159 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7162 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7163 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7164 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7165 // calling a class is like a typecast
7166 (yyval.value).t = (classinfo_t*)v.t->data;
7168 (yyval.value).c = abc_coerce_a((yyval.value).c);
7169 (yyval.value).t = TYPE_ANY;
7180 /* Line 1464 of skeleton.m4 */
7181 #line 3083 "parser.y"
7183 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7184 if(!state->method) syntaxerror("super() not allowed outside of a function");
7185 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7187 (yyval.value).c = code_new();
7188 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7190 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7192 this is dependent on the control path, check this somewhere else
7193 if(state->method->has_super)
7194 syntaxerror("constructor may call super() only once");
7196 state->method->has_super = 1;
7198 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7199 (yyval.value).c = abc_pushundefined((yyval.value).c);
7200 (yyval.value).t = TYPE_ANY;
7210 /* Line 1464 of skeleton.m4 */
7211 #line 3104 "parser.y"
7213 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7214 (yyval.value).c = v.c;
7215 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7216 (yyval.value).c = code_cutlast((yyval.value).c);
7218 multiname_t*name = 0;
7219 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7220 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7221 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7222 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7223 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7224 (yyval.value).c = code_cutlast((yyval.value).c);
7225 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7227 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7228 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7229 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7231 (yyval.value).t = TYPE_BOOLEAN;
7241 /* Line 1464 of skeleton.m4 */
7242 #line 3126 "parser.y"
7244 (yyval.code) = abc_returnvoid(0);
7254 /* Line 1464 of skeleton.m4 */
7255 #line 3129 "parser.y"
7257 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7258 (yyval.code) = abc_returnvalue((yyval.code));
7268 /* Line 1464 of skeleton.m4 */
7269 #line 3136 "parser.y"
7271 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7281 /* Line 1464 of skeleton.m4 */
7282 #line 3139 "parser.y"
7284 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7294 /* Line 1464 of skeleton.m4 */
7295 #line 3142 "parser.y"
7297 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7307 /* Line 1464 of skeleton.m4 */
7308 #line 3145 "parser.y"
7310 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7320 /* Line 1464 of skeleton.m4 */
7321 #line 3148 "parser.y"
7323 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7333 /* Line 1464 of skeleton.m4 */
7334 #line 3151 "parser.y"
7336 (yyval.code) = (yyvsp[(1) - (3)].code);
7337 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7347 /* Line 1464 of skeleton.m4 */
7348 #line 3156 "parser.y"
7349 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7358 /* Line 1464 of skeleton.m4 */
7359 #line 3157 "parser.y"
7360 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7369 /* Line 1464 of skeleton.m4 */
7370 #line 3159 "parser.y"
7371 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7380 /* Line 1464 of skeleton.m4 */
7381 #line 3160 "parser.y"
7382 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7391 /* Line 1464 of skeleton.m4 */
7392 #line 3161 "parser.y"
7393 {syntaxerror("dictionary keys must be strings");}
7402 /* Line 1464 of skeleton.m4 */
7403 #line 3162 "parser.y"
7404 {syntaxerror("dictionary keys must be strings");}
7413 /* Line 1464 of skeleton.m4 */
7414 #line 3163 "parser.y"
7415 {syntaxerror("dictionary keys must be strings");}
7424 /* Line 1464 of skeleton.m4 */
7425 #line 3165 "parser.y"
7427 (yyval.value_list).cc = 0;
7428 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7429 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7430 (yyval.value_list).number = 2;
7440 /* Line 1464 of skeleton.m4 */
7441 #line 3171 "parser.y"
7443 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7444 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7445 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7446 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7456 /* Line 1464 of skeleton.m4 */
7457 #line 3180 "parser.y"
7458 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7467 /* Line 1464 of skeleton.m4 */
7468 #line 3181 "parser.y"
7469 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7478 /* Line 1464 of skeleton.m4 */
7479 #line 3182 "parser.y"
7480 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7489 /* Line 1464 of skeleton.m4 */
7490 #line 3183 "parser.y"
7491 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7500 /* Line 1464 of skeleton.m4 */
7501 #line 3184 "parser.y"
7502 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7511 /* Line 1464 of skeleton.m4 */
7512 #line 3185 "parser.y"
7513 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7522 /* Line 1464 of skeleton.m4 */
7523 #line 3187 "parser.y"
7525 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7535 /* Line 1464 of skeleton.m4 */
7536 #line 3191 "parser.y"
7540 multiname_t m = {QNAME, &stdns, 0, "XML"};
7541 v.c = abc_getlex2(v.c, &m);
7542 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].id));
7543 v.c = abc_construct(v.c, 1);
7545 (yyval.node) = mkcodenode(v);
7555 /* Line 1464 of skeleton.m4 */
7556 #line 3203 "parser.y"
7560 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7561 if(!(yyvsp[(1) - (1)].regexp).options) {
7562 v.c = abc_getlex2(v.c, &m);
7563 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7564 v.c = abc_construct(v.c, 1);
7566 v.c = abc_getlex2(v.c, &m);
7567 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7568 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7569 v.c = abc_construct(v.c, 2);
7572 (yyval.node) = mkcodenode(v);
7582 /* Line 1464 of skeleton.m4 */
7583 #line 3221 "parser.y"
7586 state->method->need_arguments = 1;
7589 v.c = abc_getlocal(0, state->method->need_arguments);
7591 (yyval.node) = mkcodenode(v);
7601 /* Line 1464 of skeleton.m4 */
7602 #line 3232 "parser.y"
7606 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7607 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7608 v.t = registry_getarrayclass();
7609 (yyval.node) = mkcodenode(v);
7619 /* Line 1464 of skeleton.m4 */
7620 #line 3242 "parser.y"
7624 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7625 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7626 v.t = registry_getobjectclass();
7627 (yyval.node) = mkcodenode(v);
7637 /* Line 1464 of skeleton.m4 */
7638 #line 3251 "parser.y"
7639 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7648 /* Line 1464 of skeleton.m4 */
7649 #line 3252 "parser.y"
7650 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7659 /* Line 1464 of skeleton.m4 */
7660 #line 3253 "parser.y"
7661 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7670 /* Line 1464 of skeleton.m4 */
7671 #line 3254 "parser.y"
7672 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7681 /* Line 1464 of skeleton.m4 */
7682 #line 3255 "parser.y"
7683 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7692 /* Line 1464 of skeleton.m4 */
7693 #line 3256 "parser.y"
7694 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7703 /* Line 1464 of skeleton.m4 */
7704 #line 3257 "parser.y"
7705 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7714 /* Line 1464 of skeleton.m4 */
7715 #line 3258 "parser.y"
7716 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7725 /* Line 1464 of skeleton.m4 */
7726 #line 3259 "parser.y"
7727 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7736 /* Line 1464 of skeleton.m4 */
7737 #line 3260 "parser.y"
7738 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7747 /* Line 1464 of skeleton.m4 */
7748 #line 3261 "parser.y"
7749 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7758 /* Line 1464 of skeleton.m4 */
7759 #line 3262 "parser.y"
7760 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7769 /* Line 1464 of skeleton.m4 */
7770 #line 3263 "parser.y"
7771 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7780 /* Line 1464 of skeleton.m4 */
7781 #line 3264 "parser.y"
7782 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7791 /* Line 1464 of skeleton.m4 */
7792 #line 3265 "parser.y"
7793 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7802 /* Line 1464 of skeleton.m4 */
7803 #line 3266 "parser.y"
7804 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7813 /* Line 1464 of skeleton.m4 */
7814 #line 3267 "parser.y"
7815 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7824 /* Line 1464 of skeleton.m4 */
7825 #line 3268 "parser.y"
7826 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7835 /* Line 1464 of skeleton.m4 */
7836 #line 3269 "parser.y"
7837 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7846 /* Line 1464 of skeleton.m4 */
7847 #line 3270 "parser.y"
7848 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7857 /* Line 1464 of skeleton.m4 */
7858 #line 3271 "parser.y"
7859 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7868 /* Line 1464 of skeleton.m4 */
7869 #line 3272 "parser.y"
7870 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7879 /* Line 1464 of skeleton.m4 */
7880 #line 3273 "parser.y"
7881 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7890 /* Line 1464 of skeleton.m4 */
7891 #line 3274 "parser.y"
7892 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7901 /* Line 1464 of skeleton.m4 */
7902 #line 3275 "parser.y"
7903 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7912 /* Line 1464 of skeleton.m4 */
7913 #line 3276 "parser.y"
7914 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7923 /* Line 1464 of skeleton.m4 */
7924 #line 3277 "parser.y"
7925 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7934 /* Line 1464 of skeleton.m4 */
7935 #line 3278 "parser.y"
7936 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(3) - (4)].node));}
7945 /* Line 1464 of skeleton.m4 */
7946 #line 3279 "parser.y"
7947 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
7956 /* Line 1464 of skeleton.m4 */
7957 #line 3280 "parser.y"
7958 { (yyval.node) = mkconstnode(constant_new_undefined());}
7967 /* Line 1464 of skeleton.m4 */
7968 #line 3281 "parser.y"
7969 { (yyval.node)=(yyvsp[(2) - (3)].node);}
7978 /* Line 1464 of skeleton.m4 */
7979 #line 3282 "parser.y"
7980 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
7989 /* Line 1464 of skeleton.m4 */
7990 #line 3283 "parser.y"
7991 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
8000 /* Line 1464 of skeleton.m4 */
8001 #line 3284 "parser.y"
8002 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8011 /* Line 1464 of skeleton.m4 */
8012 #line 3285 "parser.y"
8013 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8022 /* Line 1464 of skeleton.m4 */
8023 #line 3286 "parser.y"
8024 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8033 /* Line 1464 of skeleton.m4 */
8034 #line 3287 "parser.y"
8035 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8044 /* Line 1464 of skeleton.m4 */
8045 #line 3288 "parser.y"
8046 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8055 /* Line 1464 of skeleton.m4 */
8056 #line 3289 "parser.y"
8057 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8066 /* Line 1464 of skeleton.m4 */
8067 #line 3290 "parser.y"
8068 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8077 /* Line 1464 of skeleton.m4 */
8078 #line 3291 "parser.y"
8079 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8088 /* Line 1464 of skeleton.m4 */
8089 #line 3292 "parser.y"
8090 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8099 /* Line 1464 of skeleton.m4 */
8100 #line 3293 "parser.y"
8101 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8110 /* Line 1464 of skeleton.m4 */
8111 #line 3294 "parser.y"
8112 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8121 /* Line 1464 of skeleton.m4 */
8122 #line 3295 "parser.y"
8123 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
8132 /* Line 1464 of skeleton.m4 */
8133 #line 3296 "parser.y"
8134 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
8143 /* Line 1464 of skeleton.m4 */
8144 #line 3298 "parser.y"
8145 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
8154 /* Line 1464 of skeleton.m4 */
8155 #line 3299 "parser.y"
8156 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
8165 /* Line 1464 of skeleton.m4 */
8166 #line 3300 "parser.y"
8167 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
8176 /* Line 1464 of skeleton.m4 */
8177 #line 3301 "parser.y"
8178 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
8187 /* Line 1464 of skeleton.m4 */
8188 #line 3304 "parser.y"
8189 { if(!state->cls->info)
8190 syntaxerror("super keyword not allowed outside a class");
8191 classinfo_t*t = state->cls->info->superclass;
8192 if(!t) t = TYPE_OBJECT;
8193 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8194 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8197 v.c = abc_getlocal_0(v.c);
8198 v.c = abc_getsuper2(v.c, &m);
8199 v.t = slotinfo_gettype((slotinfo_t*)f);
8200 (yyval.node) = mkcodenode(v);
8210 /* Line 1464 of skeleton.m4 */
8211 #line 3318 "parser.y"
8214 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
8215 v.c = abc_getlex2(0, &m);
8217 (yyval.node) = mkcodenode(v);
8227 /* Line 1464 of skeleton.m4 */
8228 #line 3326 "parser.y"
8229 {PASS12 new_state();state->xmlfilter=1;}
8238 /* Line 1464 of skeleton.m4 */
8239 #line 3326 "parser.y"
8243 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8244 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8246 int index = alloc_local();
8247 int result = alloc_local();
8248 int tmp = alloc_local();
8249 int xml = alloc_local();
8251 c = code_append(c, v.c);
8252 c = abc_checkfilter(c);
8253 c = abc_coerce_a(c); //hasnext2 converts to *
8254 c = abc_setlocal(c, xml);
8255 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8256 c = abc_getlex2(c, &m);
8257 c = abc_construct(c, 0);
8258 c = abc_setlocal(c, result);
8259 c = abc_pushbyte(c, 0);
8260 c = abc_setlocal(c, index);
8261 code_t*jmp = c = abc_jump(c, 0);
8262 code_t*loop = c = abc_label(c);
8263 c = abc_getlocal(c, xml);
8264 c = abc_getlocal(c, index);
8265 c = abc_nextvalue(c);
8267 c = abc_setlocal(c, tmp);
8268 c = abc_pushwith(c);
8269 c = code_append(c, w.c);
8270 c = abc_popscope(c);
8271 code_t*b = c = abc_iffalse(c, 0);
8272 c = abc_getlocal(c, result);
8273 c = abc_getlocal(c, index);
8274 c = abc_getlocal(c, tmp);
8275 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8276 c = abc_setproperty2(c, &m2);
8277 c = b->branch = jmp->branch = abc_nop(c);
8278 c = abc_kill(c, tmp);
8279 c = abc_hasnext2(c, xml, index);
8280 c = abc_iftrue(c, loop);
8281 c = abc_getlocal(c, result);
8282 c = abc_kill(c, xml);
8283 c = abc_kill(c, result);
8284 c = abc_kill(c, index);
8291 (yyval.node) = mkcodenode(r);
8301 /* Line 1464 of skeleton.m4 */
8302 #line 3380 "parser.y"
8303 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8312 /* Line 1464 of skeleton.m4 */
8313 #line 3381 "parser.y"
8314 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8323 /* Line 1464 of skeleton.m4 */
8324 #line 3383 "parser.y"
8334 /* Line 1464 of skeleton.m4 */
8335 #line 3385 "parser.y"
8337 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8338 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8339 v.c = code_append(v.c, w.c);
8340 if(!TYPE_IS_NAMESPACE(w.t)) {
8341 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8343 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8344 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8345 v.c = abc_getproperty2(v.c, &m);
8346 if(TYPE_IS_XML(v.t)) {
8349 v.c = abc_coerce_a(v.c);
8352 (yyval.node) = mkcodenode(v);
8362 /* Line 1464 of skeleton.m4 */
8363 #line 3403 "parser.y"
8365 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8366 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8367 v.c = abc_getdescendants2(v.c, &m);
8369 (yyval.node) = mkcodenode(v);
8379 /* Line 1464 of skeleton.m4 */
8380 #line 3410 "parser.y"
8382 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8383 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8384 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8385 v.c = code_append(v.c, w.c);
8386 v.c = converttype(w.c, w.t, TYPE_STRING);
8387 v.c = abc_getproperty2(v.c, &m);
8389 (yyval.node) = mkcodenode(v);
8399 /* Line 1464 of skeleton.m4 */
8400 #line 3421 "parser.y"
8402 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8403 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8404 v.c = abc_getproperty2(v.c, &m);
8406 (yyval.node) = mkcodenode(v);
8416 /* Line 1464 of skeleton.m4 */
8417 #line 3428 "parser.y"
8419 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8420 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8421 v.c = abc_getdescendants2(v.c, &m);
8423 (yyval.node) = mkcodenode(v);
8433 /* Line 1464 of skeleton.m4 */
8434 #line 3435 "parser.y"
8436 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8437 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8438 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8439 v.c = code_append(v.c, w.c);
8440 v.c = converttype(w.c, w.t, TYPE_STRING);
8441 v.c = abc_getproperty2(v.c, &m);
8443 (yyval.node) = mkcodenode(v);
8453 /* Line 1464 of skeleton.m4 */
8454 #line 3445 "parser.y"
8456 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8457 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8458 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8459 v.c = code_append(v.c, w.c);
8460 v.c = converttype(w.c, w.t, TYPE_STRING);
8461 v.c = abc_getdescendants2(v.c, &m);
8463 (yyval.node) = mkcodenode(v);
8473 /* Line 1464 of skeleton.m4 */
8474 #line 3456 "parser.y"
8476 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8477 (yyval.value).c = v1.c;
8478 classinfo_t*t = v1.t;
8480 if(TYPE_IS_CLASS(t) && t->data) {
8484 if(TYPE_IS_XML(t)) {
8485 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8486 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8487 (yyval.value).c = abc_coerce_a((yyval.value).c);
8488 (yyval.value).t = TYPE_XMLLIST;
8490 if(t->subtype==INFOTYPE_UNRESOLVED) {
8491 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8493 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8495 if(f && !is_static != !(f->flags&FLAG_STATIC))
8497 if(f && f->slot && !noslot) {
8498 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8501 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8503 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8504 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8506 /* determine type */
8507 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8508 if(!(yyval.value).t)
8509 (yyval.value).c = abc_coerce_a((yyval.value).c);
8511 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8512 string_t*package = v1.c->data[0];
8513 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8515 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8517 (yyval.value) = push_class(a);
8518 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8519 registry_ispackage(package2)) {
8520 (yyval.value).c = v1.c;
8521 (yyval.value).c->data[0] = string_new4(package2);
8522 (yyval.value).t = 0;
8524 syntaxerror("couldn't resolve %s", package2);
8527 /* when resolving a property on an unknown type, we do know the
8528 name of the property (and don't seem to need the package), but
8529 we need to make avm2 try out all access modes */
8530 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8531 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8532 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8533 (yyval.value).c = abc_coerce_a((yyval.value).c);
8534 (yyval.value).t = TYPE_ANY;
8545 /* Line 1464 of skeleton.m4 */
8546 #line 3634 "parser.y"
8549 /* Queue unresolved identifiers for checking against the parent
8550 function's variables.
8551 We consider everything which is not a local variable "unresolved".
8552 This encompasses class names, members of the surrounding class
8553 etc. which is *correct* because local variables of the parent function
8557 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8558 if(state->method->inner) {
8559 unknown_variable((yyvsp[(1) - (1)].id));
8561 /* let the compiler know that it might want to check the current directory/package
8562 for this identifier- maybe there's a file $1.as defining $1. */
8563 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8569 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8579 /* Line 1464 of skeleton.m4 */
8580 #line 3670 "parser.y"
8583 NEW(namespace_decl_t,n);
8584 n->name = (yyvsp[(2) - (2)].id);
8585 n->url = (yyvsp[(2) - (2)].id);
8586 (yyval.namespace_decl)=n;
8596 /* Line 1464 of skeleton.m4 */
8597 #line 3677 "parser.y"
8600 NEW(namespace_decl_t,n);
8601 n->name = (yyvsp[(2) - (4)].id);
8602 n->url = (yyvsp[(4) - (4)].id);
8603 (yyval.namespace_decl)=n;
8613 /* Line 1464 of skeleton.m4 */
8614 #line 3684 "parser.y"
8617 NEW(namespace_decl_t,n);
8618 n->name = (yyvsp[(2) - (4)].id);
8619 n->url = (yyvsp[(4) - (4)].str).str;
8620 (yyval.namespace_decl)=n;
8630 /* Line 1464 of skeleton.m4 */
8631 #line 3691 "parser.y"
8634 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8636 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8637 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8638 var->type = TYPE_NAMESPACE;
8640 ns.access = ACCESS_NAMESPACE;
8641 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8642 var->value = constant_new_namespace(&ns);
8645 MULTINAME(m, TYPE_NAMESPACE);
8646 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8647 t->value = var->value;
8648 t->type_name = multiname_clone(&m);
8661 /* Line 1464 of skeleton.m4 */
8662 #line 3713 "parser.y"
8665 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8667 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8668 if(s->kind == INFOTYPE_UNRESOLVED) {
8669 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8671 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8674 if(!s || s->kind != INFOTYPE_VAR)
8675 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8676 if(!s->value || !NS_TYPE(s->value->type))
8677 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8678 url = s->value->ns->name;
8680 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8681 add_active_url(url);
8690 /* Line 1464 of skeleton.m4 */
8691 #line 8692 "parser.tab.c"
8694 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8698 YY_STACK_PRINT (yyss, yyssp);
8702 /* Now `shift' the result of the reduction. Determine what state
8703 that goes to, based on the state we popped back to and the rule
8704 number reduced by. */
8708 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8709 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8710 yystate = yytable[yystate];
8712 yystate = yydefgoto[yyn - YYNTOKENS];
8717 /*------------------------------------.
8718 | yyerrlab -- here on detecting error |
8719 `------------------------------------*/
8721 /* If not already recovering from an error, report this error. */
8725 #if ! YYERROR_VERBOSE
8726 yyerror (YY_("syntax error"));
8729 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8730 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8732 YYSIZE_T yyalloc = 2 * yysize;
8733 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8734 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8735 if (yymsg != yymsgbuf)
8736 YYSTACK_FREE (yymsg);
8737 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8739 yymsg_alloc = yyalloc;
8743 yymsg_alloc = sizeof yymsgbuf;
8747 if (0 < yysize && yysize <= yymsg_alloc)
8749 (void) yysyntax_error (yymsg, yystate, yychar);
8754 yyerror (YY_("syntax error"));
8756 goto yyexhaustedlab;
8764 if (yyerrstatus == 3)
8766 /* If just tried and failed to reuse lookahead token after an
8767 error, discard it. */
8769 if (yychar <= YYEOF)
8771 /* Return failure if at end of input. */
8772 if (yychar == YYEOF)
8777 yydestruct ("Error: discarding",
8783 /* Else will try to reuse lookahead token after shifting the error
8788 /*---------------------------------------------------.
8789 | yyerrorlab -- error raised explicitly by YYERROR. |
8790 `---------------------------------------------------*/
8793 /* Pacify compilers like GCC when the user code never invokes
8794 YYERROR and the label yyerrorlab therefore never appears in user
8796 if (/*CONSTCOND*/ 0)
8799 /* Do not reclaim the symbols of the rule which action triggered
8803 YY_STACK_PRINT (yyss, yyssp);
8808 /*-------------------------------------------------------------.
8809 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8810 `-------------------------------------------------------------*/
8812 yyerrstatus = 3; /* Each real token shifted decrements this. */
8816 yyn = yypact[yystate];
8817 if (yyn != YYPACT_NINF)
8820 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8828 /* Pop the current state because it cannot handle the error token. */
8833 yydestruct ("Error: popping",
8834 yystos[yystate], yyvsp);
8837 YY_STACK_PRINT (yyss, yyssp);
8843 /* Shift the error token. */
8844 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8850 /*-------------------------------------.
8851 | yyacceptlab -- YYACCEPT comes here. |
8852 `-------------------------------------*/
8857 /*-----------------------------------.
8858 | yyabortlab -- YYABORT comes here. |
8859 `-----------------------------------*/
8864 #if !defined(yyoverflow) || YYERROR_VERBOSE
8865 /*-------------------------------------------------.
8866 | yyexhaustedlab -- memory exhaustion comes here. |
8867 `-------------------------------------------------*/
8869 yyerror (YY_("memory exhausted"));
8875 if (yychar != YYEMPTY)
8876 yydestruct ("Cleanup: discarding lookahead",
8878 /* Do not reclaim the symbols of the rule which action triggered
8879 this YYABORT or YYACCEPT. */
8881 YY_STACK_PRINT (yyss, yyssp);
8882 while (yyssp != yyss)
8884 yydestruct ("Cleanup: popping",
8885 yystos[*yyssp], yyvsp);
8890 YYSTACK_FREE (yyss);
8893 if (yymsg != yymsgbuf)
8894 YYSTACK_FREE (yymsg);
8896 /* Make sure YYID is used. */
8897 return YYID (yyresult);