2 /* A Bison parser, made by GNU Bison 2.4.277-62c99-dirty. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
7 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.277-62c99-dirty"
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. */
77 /* Line 198 of skeleton.m4 */
87 #include "tokenizer.h"
98 /* Line 198 of skeleton.m4 */
99 #line 100 "parser.tab.c"
101 /* Enabling traces. */
103 # define YYDEBUG b4_debug_flag
106 /* Enabling verbose error messages. */
107 #ifdef YYERROR_VERBOSE
108 # undef YYERROR_VERBOSE
109 # define YYERROR_VERBOSE 1
111 # define YYERROR_VERBOSE b4_error_verbose_flag
114 /* Enabling the token table. */
115 #ifndef YYTOKEN_TABLE
116 # define YYTOKEN_TABLE 0
123 /* Put the tokens into the symbol table, so that GDB and other debuggers
186 KW_DEFAULT_XML = 318,
223 below_semicolon = 355,
224 below_assignment = 356,
227 minusminus_prefix = 359,
228 plusplus_prefix = 360,
231 above_identifier = 363,
239 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
240 typedef union /* Line 223 of skeleton.m4 */
244 /* Line 223 of skeleton.m4 */
247 enum yytokentype token;
249 classinfo_t*classinfo;
250 classinfo_list_t*classinfo_list;
252 slotinfo_list_t*slotinfo_list;
255 unsigned int number_uint;
259 //typedcode_list_t*value_list;
260 codeandnumber_t value_list;
266 for_start_t for_start;
267 abc_exception_t *exception;
270 namespace_decl_t* namespace_decl;
273 abc_exception_list_t *l;
278 /* Line 223 of skeleton.m4 */
279 #line 280 "parser.tab.c"
281 # define YYSTYPE_IS_TRIVIAL 1
282 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
283 # define YYSTYPE_IS_DECLARED 1
287 /* Copy the second part of user declarations. */
288 /* Line 273 of skeleton.m4 */
292 static int a3_error(char*s)
294 syntaxerror("%s", s);
295 return 0; //make gcc happy
298 static void parsererror(const char*file, int line, const char*f)
300 syntaxerror("internal error in %s, %s:%d", f, file, line);
303 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
306 static char* concat2(const char* t1, const char* t2)
310 char*text = malloc(l1+l2+1);
311 memcpy(text , t1, l1);
312 memcpy(text+l1, t2, l2);
316 static char* concat3(const char* t1, const char* t2, const char* t3)
321 char*text = malloc(l1+l2+l3+1);
322 memcpy(text , t1, l1);
323 memcpy(text+l1, t2, l2);
324 memcpy(text+l1+l2, t3, l3);
329 typedef struct _import {
332 DECLARE_LIST(import);
334 DECLARE(methodstate);
335 DECLARE_LIST(methodstate);
337 typedef struct _classstate {
343 methodstate_t*static_init;
345 //code_t*static_init;
346 parsedclass_t*dependencies;
348 char has_constructor;
351 struct _methodstate {
362 dict_t*unresolved_variables;
365 char uses_parent_function;
366 char no_variable_scoping;
374 int var_index; // for inner methods
375 int slot_index; // for inner methods
376 char is_a_slot; // for inner methods
381 abc_exception_list_t*exceptions;
383 methodstate_list_t*innerfunctions;
386 void methodstate_destroy(methodstate_t*m)
388 dict_destroy(m->unresolved_variables);
389 m->unresolved_variables = 0;
390 list_free(m->innerfunctions);m->innerfunctions=0;
393 typedef struct _state {
398 import_list_t*wildcard_imports;
399 dict_t*import_toplevel_packages;
402 namespace_list_t*active_namespace_urls;
404 char has_own_imports;
405 char new_vars; // e.g. transition between two functions
406 char xmlfilter; // are we inside a xmlobj..() filter?
409 methodstate_t*method;
416 dict_t*allvars; // also contains variables from sublevels
419 typedef struct _global {
422 parsedclass_list_t*classes;
423 abc_script_t*classinit;
425 abc_script_t*init; //package-level code
428 dict_t*file2token2info;
431 static global_t*global = 0;
432 static state_t* state = 0;
436 /* protected handling here is a big hack: we just assume the protectedns
437 is package:class. the correct approach would be to add the proper
438 namespace to all protected members in the registry, even though that
439 would slow down searching */
440 #define MEMBER_MULTINAME(m,f,n) \
444 m##_ns.access = ((slotinfo_t*)(f))->access; \
445 if(m##_ns.access == ACCESS_NAMESPACE) \
446 m##_ns.name = ((slotinfo_t*)(f))->package; \
447 else if(m##_ns.access == ACCESS_PROTECTED && (f)->parent) \
448 m##_ns.name = concat3((f)->parent->package,":",(f)->parent->name); \
453 m.namespace_set = 0; \
454 m.name = ((slotinfo_t*)(f))->name; \
456 m.type = MULTINAME; \
458 m.namespace_set = &nopackage_namespace_set; \
462 /* warning: list length of namespace set is undefined */
463 #define MULTINAME_LATE(m, access, package) \
464 namespace_t m##_ns = {access, package}; \
465 namespace_set_t m##_nsset; \
466 namespace_list_t m##_l;m##_l.next = 0; \
467 m##_nsset.namespaces = &m##_l; \
468 m##_nsset = m##_nsset; \
469 m##_l.namespace = &m##_ns; \
470 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
472 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
473 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
474 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
475 static namespace_t stdns = {ACCESS_PACKAGE, ""};
476 static namespace_list_t nl4 = {&stdns,0};
477 static namespace_list_t nl3 = {&ns3,&nl4};
478 static namespace_list_t nl2 = {&ns2,&nl3};
479 static namespace_list_t nl1 = {&ns1,&nl2};
480 static namespace_set_t nopackage_namespace_set = {&nl1};
482 static dict_t*definitions=0;
483 void as3_set_define(const char*c)
486 definitions = dict_new();
487 if(!dict_contains(definitions,c))
488 dict_put(definitions,c,0);
491 static void new_state()
494 state_t*oldstate = state;
496 memcpy(s, state, sizeof(state_t)); //shallow copy
498 s->imports = dict_new();
500 if(!s->import_toplevel_packages) {
501 s->import_toplevel_packages = dict_new();
505 state->has_own_imports = 0;
506 state->vars = dict_new();
507 state->old = oldstate;
510 trie_remember(active_namespaces);
513 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
516 static void state_destroy(state_t*state)
518 if(state->has_own_imports) {
519 list_free(state->wildcard_imports);
520 dict_destroy(state->imports);state->imports=0;
522 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
523 dict_destroy(state->imports);state->imports=0;
526 dict_destroy(state->vars);state->vars=0;
528 if(state->new_vars && state->allvars) {
529 parserassert(!state->old || state->old->allvars != state->allvars);
530 DICT_ITERATE_DATA(state->allvars, void*, data) {
533 dict_destroy(state->allvars);
536 list_free(state->active_namespace_urls)
537 state->active_namespace_urls = 0;
542 static void old_state()
544 trie_rollback(active_namespaces);
546 if(!state || !state->old)
547 syntaxerror("invalid nesting");
548 state_t*leaving = state;
552 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
553 methodstate_destroy(leaving->method);leaving->method=0;
555 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
560 state_destroy(leaving);
563 static code_t* method_header(methodstate_t*m);
564 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
565 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0);
568 static char* internal_filename_package = 0;
569 void initialize_file(char*filename)
572 syntaxerror("invalid call to initialize_file during parsing of another file");
575 active_namespaces = trie_new();
578 state->package = internal_filename_package = strdup(filename);
579 state->allvars = dict_new();
581 global->token2info = dict_lookup(global->file2token2info,
582 current_filename // use long version
584 if(!global->token2info) {
585 global->token2info = dict_new2(&ptr_type);
586 dict_put(global->file2token2info, current_filename, global->token2info);
590 state->method = rfx_calloc(sizeof(methodstate_t));
591 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
592 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
594 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
595 state->method->variable_count = 0;
597 syntaxerror("internal error: skewed tokencount");
598 function_initvars(state->method, 0, 0, 0, 1);
605 if(!state || state->level!=1) {
606 syntaxerror("unexpected end of file in pass %d", as3_pass);
610 dict_del(global->file2token2info, current_filename);
611 code_t*header = method_header(state->method);
612 //if(global->init->method->body->code || global->init->traits) {
614 code_t*c = wrap_function(header, 0, global->init->method->body->code);
615 global->init->method->body->code = abc_returnvoid(c);
616 free(state->method);state->method=0;
620 //free(state->package);state->package=0; // used in registry
621 state_destroy(state);state=0;
624 void initialize_parser()
626 global = rfx_calloc(sizeof(global_t));
627 global->file = abc_file_new();
628 global->file->flags &= ~ABCFILE_LAZY;
629 global->file2token2info = dict_new();
630 global->token2info = 0;
631 global->classinit = abc_initscript(global->file);
634 void* finish_parser()
636 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
637 global->token2info=0;
639 initcode_add_classlist(global->classinit, global->classes);
644 typedef struct _variable {
650 methodstate_t*is_inner_method;
653 static variable_t* find_variable(state_t*s, char*name)
655 if(s->method->no_variable_scoping) {
656 return dict_lookup(s->allvars, name);
661 v = dict_lookup(s->vars, name);
663 if(s->new_vars) break;
669 static variable_t* find_slot(methodstate_t*m, const char*name)
672 return dict_lookup(m->slots, name);
676 static variable_t* find_variable_safe(state_t*s, char*name)
678 variable_t* v = find_variable(s, name);
680 syntaxerror("undefined variable: %s", name);
684 static char variable_exists(char*name)
686 return dict_contains(state->vars, name);
689 static code_t*defaultvalue(code_t*c, classinfo_t*type)
691 if(TYPE_IS_INT(type)) {
692 c = abc_pushbyte(c, 0);
693 } else if(TYPE_IS_UINT(type)) {
694 c = abc_pushuint(c, 0);
695 } else if(TYPE_IS_FLOAT(type)) {
697 } else if(TYPE_IS_BOOLEAN(type)) {
698 c = abc_pushfalse(c);
699 } else if(TYPE_IS_STRING(type)) {
703 //c = abc_pushundefined(c);
704 syntaxerror("internal error: can't generate default value for * type");
708 c = abc_coerce2(c, &m);
713 static int alloc_local()
715 return state->method->variable_count++;
718 static variable_t* new_variable2(methodstate_t*method, const char*name, classinfo_t*type, char init, char maybeslot)
721 variable_t*v = find_slot(method, name);
729 v->index = alloc_local();
731 v->init = v->kill = init;
734 if(!method->no_variable_scoping)
736 if(dict_contains(state->vars, name)) {
738 syntaxerror("variable %s already defined", name);
740 dict_put(state->vars, name, v);
742 if(method->no_variable_scoping &&
744 dict_contains(state->allvars, name))
746 variable_t*v = dict_lookup(state->allvars, name);
748 syntaxerror("variable %s already defined.", name);
751 dict_put(state->allvars, name, v);
756 static int new_variable(methodstate_t*method, const char*name, classinfo_t*type, char init, char maybeslot)
758 return new_variable2(method, name, type, init, maybeslot)->index;
761 #define TEMPVARNAME "__as3_temp__"
764 variable_t*v = find_variable(state, TEMPVARNAME);
769 i = new_variable(state->method, TEMPVARNAME, 0, 0, 0);
774 static code_t* var_block(code_t*body, dict_t*vars)
779 DICT_ITERATE_DATA(vars, variable_t*, v) {
780 if(v->type && v->init) {
781 c = defaultvalue(c, v->type);
782 c = abc_setlocal(c, v->index);
784 if(v->type && v->kill) {
785 k = abc_kill(k, v->index);
792 if(x->opcode== OPCODE___BREAK__ ||
793 x->opcode== OPCODE___CONTINUE__) {
794 /* link kill code before break/continue */
795 code_t*e = code_dup(k);
796 code_t*s = code_start(e);
808 c = code_append(c, body);
809 c = code_append(c, k);
813 static void unknown_variable(char*name)
815 if(!state->method->unresolved_variables)
816 state->method->unresolved_variables = dict_new();
817 if(!dict_contains(state->method->unresolved_variables, name))
818 dict_put(state->method->unresolved_variables, name, 0);
821 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
823 if(m->uses_slots || m->innerfunctions || (m->late_binding && !m->inner)) {
824 c = abc_getlocal_0(c);
825 c = abc_pushscope(c);
828 /* FIXME: this alloc_local() causes variable indexes to be
829 different in pass2 than in pass1 */
830 if(!m->activation_var) {
831 m->activation_var = alloc_local();
834 c = abc_newactivation(c);
836 c = abc_pushscope(c);
837 c = abc_setlocal(c, m->activation_var);
839 c = abc_getlocal(c, m->activation_var);
840 c = abc_pushscope(c);
846 static code_t* method_header(methodstate_t*m)
850 c = add_scope_code(c, m, 1);
852 methodstate_list_t*l = m->innerfunctions;
854 parserassert(l->methodstate->abc);
855 if(m->uses_slots && l->methodstate->is_a_slot) {
856 c = abc_getscopeobject(c, 1);
857 c = abc_newfunction(c, l->methodstate->abc);
859 c = abc_setlocal(c, l->methodstate->var_index);
860 c = abc_setslot(c, l->methodstate->slot_index);
862 c = abc_newfunction(c, l->methodstate->abc);
863 c = abc_setlocal(c, l->methodstate->var_index);
865 free(l->methodstate);l->methodstate=0;
869 c = code_append(c, m->header);
872 if(m->is_constructor && !m->has_super) {
873 // call default constructor
874 c = abc_getlocal_0(c);
875 c = abc_constructsuper(c, 0);
879 /* all parameters that are used by inner functions
880 need to be copied from local to slot */
881 parserassert(m->activation_var);
882 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
883 if(v->is_parameter) {
884 c = abc_getlocal(c, m->activation_var);
885 c = abc_getlocal(c, v->index);
886 c = abc_setslot(c, v->index);
890 list_free(m->innerfunctions);
891 m->innerfunctions = 0;
896 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
898 c = code_append(c, header);
899 c = code_append(c, var_block(body, state->method->no_variable_scoping?state->allvars:state->vars));
900 /* append return if necessary */
901 if(!c || (c->opcode != OPCODE_RETURNVOID &&
902 c->opcode != OPCODE_RETURNVALUE)) {
903 c = abc_returnvoid(c);
908 static void startpackage(char*name)
911 state->package = strdup(name);
913 static void endpackage()
915 //used e.g. in classinfo_register:
916 //free(state->package);state->package=0;
920 #define FLAG_PUBLIC 256
921 #define FLAG_PROTECTED 512
922 #define FLAG_PRIVATE 1024
923 #define FLAG_PACKAGEINTERNAL 2048
924 #define FLAG_NAMESPACE 4096
926 static namespace_t modifiers2access(modifiers_t*mod)
931 if(mod->flags&FLAG_NAMESPACE) {
932 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
933 syntaxerror("invalid combination of access levels and namespaces");
934 ns.access = ACCESS_NAMESPACE;
936 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
938 /* shouldn't happen- the tokenizer only reports something as a namespace
939 if it was already registered */
940 trie_dump(active_namespaces);
941 syntaxerror("unknown namespace: %s", mod->ns);
944 } else if(mod->flags&FLAG_PUBLIC) {
945 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
946 syntaxerror("invalid combination of access levels");
947 ns.access = ACCESS_PACKAGE;
948 } else if(mod->flags&FLAG_PRIVATE) {
949 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
950 syntaxerror("invalid combination of access levels");
951 ns.access = ACCESS_PRIVATE;
952 } else if(mod->flags&FLAG_PROTECTED) {
953 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
954 syntaxerror("invalid combination of access levels");
955 ns.access = ACCESS_PROTECTED;
957 ns.access = ACCESS_PACKAGEINTERNAL;
961 static slotinfo_t* find_class(const char*name);
963 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
965 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
968 static void innerfunctions2vars(methodstate_t*m)
970 methodstate_list_t*l = m->innerfunctions;
972 methodstate_t*m = l->methodstate;
974 variable_t* v = new_variable2(state->method, m->info->name, TYPE_FUNCTION(m->info), 0, 0);
975 m->var_index = v->index;
977 m->slot_index = m->is_a_slot;
978 v->is_inner_method = m;
983 static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0)
988 index = new_variable(m, "this", 0, 0, 0);
989 else if(!m->is_global)
990 index = new_variable(m, (flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
992 index = new_variable(m, "globalscope", 0, 0, 0);
994 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
995 printf("%s %d\n", name, v->index);
998 parserassert(!index);
1003 for(p=params->list;p;p=p->next) {
1004 variable_t*v = new_variable2(m, p->param->name, p->param->type, 0, 1);
1005 v->is_parameter = 1;
1007 if(as3_pass==2 && m->need_arguments) {
1008 /* arguments can never be used by an innerfunction (the inner functions
1009 have their own arguments var), so it's ok to not initialize this until
1010 pass 2. (We don't know whether we need it before, anyway) */
1011 variable_t*v = new_variable2(m, "arguments", TYPE_ARRAY, 0, 0);
1012 m->need_arguments = v->index;
1016 innerfunctions2vars(m);
1019 m->scope_code = add_scope_code(m->scope_code, m, 0);
1021 /* exchange unresolved identifiers with the actual objects */
1022 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
1023 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
1024 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
1025 if(!type || type->kind != INFOTYPE_CLASS) {
1026 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1036 char*as3_globalclass=0;
1037 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1040 syntaxerror("inner classes now allowed");
1045 classinfo_list_t*mlist=0;
1047 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1048 syntaxerror("invalid modifier(s)");
1050 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1051 syntaxerror("public and internal not supported at the same time.");
1053 if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC))
1054 syntaxerror("protected and static not supported at the same time.");
1056 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1057 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1058 // all classes extend object
1059 extends = registry_getobjectclass();
1062 /* create the class name, together with the proper attributes */
1066 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1067 access = ACCESS_PRIVATE; package = internal_filename_package;
1068 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1069 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1070 } else if(state->package!=internal_filename_package) {
1071 access = ACCESS_PACKAGE; package = state->package;
1073 syntaxerror("public classes only allowed inside a package");
1077 state->cls = rfx_calloc(sizeof(classstate_t));
1078 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1079 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1080 state->cls->static_init->is_static=FLAG_STATIC;
1081 /* notice: we make no effort to initialize the top variable (local0) here,
1082 even though it has special meaning. We just rely on the fact
1083 that pass 1 won't do anything with variables */
1085 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1087 /* set current method to constructor- all code within the class-level (except
1088 static variable initializations) will be executed during construction time */
1089 state->method = state->cls->init;
1091 if(registry_find(package, classname)) {
1092 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1094 /* build info struct */
1095 int num_interfaces = (list_length(implements));
1096 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1097 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1098 state->cls->info->superclass = extends;
1101 classinfo_list_t*l = implements;
1102 for(l=implements;l;l=l->next) {
1103 state->cls->info->interfaces[pos++] = l->classinfo;
1108 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1110 parserassert(state->cls && state->cls->info);
1112 state->method = state->cls->static_init;
1114 function_initvars(state->cls->init, 0, 0, 0, 1);
1115 state->cls->static_init->variable_count=1;
1116 function_initvars(state->cls->static_init, 0, 0, 0, 0);
1118 if(extends && (extends->flags & FLAG_FINAL))
1119 syntaxerror("Can't extend final class '%s'", extends->name);
1122 while(state->cls->info->interfaces[pos]) {
1123 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1124 syntaxerror("'%s' is not an interface",
1125 state->cls->info->interfaces[pos]->name);
1129 /* generate the abc code for this class */
1130 MULTINAME(classname2,state->cls->info);
1131 multiname_t*extends2 = sig2mname(extends);
1133 /* don't add the class to the class index just yet- that will be done later
1135 state->cls->abc = abc_class_new(0, &classname2, extends2);
1136 state->cls->abc->file = global->file;
1138 multiname_destroy(extends2);
1139 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1140 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1141 if(state->cls->info->flags&FLAG_INTERFACE) {
1142 abc_class_interface(state->cls->abc);
1145 for(mlist=implements;mlist;mlist=mlist->next) {
1146 MULTINAME(m, mlist->classinfo);
1147 abc_class_add_interface(state->cls->abc, &m);
1150 state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc);
1151 list_append(global->classes, state->cls->dependencies);
1153 /* flash.display.MovieClip handling */
1154 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1155 if(state->package && state->package[0]) {
1156 as3_globalclass = concat3(state->package, ".", classname);
1158 as3_globalclass = strdup(classname);
1164 static void endclass()
1167 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1169 c = abc_getlocal_0(c);
1170 c = abc_constructsuper(c, 0);
1171 state->cls->init->header = code_append(state->cls->init->header, c);
1172 state->cls->has_constructor=1;
1174 if(state->cls->init) {
1175 if(state->cls->info->flags&FLAG_INTERFACE) {
1176 if(state->cls->init->header)
1177 syntaxerror("interface can not have class-level code");
1179 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1180 code_t*c = method_header(state->cls->init);
1181 m->body->code = wrap_function(c, 0, m->body->code);
1184 if(state->cls->static_init) {
1185 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1186 code_t*c = method_header(state->cls->static_init);
1187 m->body->code = wrap_function(c, 0, m->body->code);
1190 trait_list_t*trait = state->cls->abc->traits;
1191 /* switch all protected members to the protected ns of this class */
1193 trait_t*t = trait->trait;
1194 if(t->name->ns->access == ACCESS_PROTECTED) {
1195 if(!state->cls->abc->protectedNS) {
1196 char*n = concat3(state->cls->info->package, ":", state->cls->info->name);
1197 state->cls->abc->protectedNS = namespace_new_protected(n);
1198 state->cls->abc->flags |= CLASS_PROTECTED_NS;
1200 t->name->ns->name = strdup(state->cls->abc->protectedNS->name);
1202 trait = trait->next;
1209 void check_code_for_break(code_t*c)
1212 if(c->opcode == OPCODE___BREAK__) {
1213 char*name = string_cstr(c->data[0]);
1214 syntaxerror("Unresolved \"break %s\"", name);
1216 if(c->opcode == OPCODE___CONTINUE__) {
1217 char*name = string_cstr(c->data[0]);
1218 syntaxerror("Unresolved \"continue %s\"", name);
1220 if(c->opcode == OPCODE___RETHROW__) {
1221 syntaxerror("Unresolved \"rethrow\"");
1223 if(c->opcode == OPCODE___FALLTHROUGH__) {
1224 syntaxerror("Unresolved \"fallthrough\"");
1226 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1227 char*name = string_cstr(c->data[0]);
1228 syntaxerror("Can't reference a package (%s) as such", name);
1234 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1236 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1237 if(TYPE_IS_NUMBER(t)) {
1238 xassert(c->type == CONSTANT_FLOAT
1239 || c->type == CONSTANT_INT
1240 || c->type == CONSTANT_UINT);
1241 } else if(TYPE_IS_UINT(t)) {
1242 xassert(c->type == CONSTANT_UINT ||
1243 (c->type == CONSTANT_INT && c->i>=0));
1244 } else if(TYPE_IS_INT(t)) {
1245 xassert(c->type == CONSTANT_INT);
1246 } else if(TYPE_IS_BOOLEAN(t)) {
1247 xassert(c->type == CONSTANT_TRUE
1248 || c->type == CONSTANT_FALSE);
1252 static void check_override(memberinfo_t*m, int flags)
1256 if(m->parent == state->cls->info)
1257 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1259 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1260 if(m->access==ACCESS_PRIVATE)
1262 if(m->flags & FLAG_FINAL)
1263 syntaxerror("can't override final member %s", m->name);
1265 /* allow this. it's no issue.
1266 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1267 syntaxerror("can't override static member %s", m->name);*/
1269 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1270 syntaxerror("can't override non-static member %s with static declaration", m->name);
1272 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1273 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1274 if(m->kind == INFOTYPE_METHOD)
1275 syntaxerror("can't override without explicit 'override' declaration");
1277 syntaxerror("can't override '%s'", m->name);
1282 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1284 methodinfo_t*minfo = 0;
1285 namespace_t ns = modifiers2access(mod);
1288 minfo = methodinfo_register_global(ns.access, state->package, name);
1289 minfo->return_type = return_type;
1290 } else if(getset != KW_GET && getset != KW_SET) {
1292 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1294 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1296 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1297 minfo->return_type = return_type;
1298 // getslot on a member slot only returns "undefined", so no need
1299 // to actually store these
1300 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1302 //class getter/setter
1303 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1305 if(getset == KW_GET) {
1307 } else if(params->list && params->list->param && !params->list->next) {
1308 type = params->list->param->type;
1310 syntaxerror("setter function needs to take exactly one argument");
1311 // not sure wether to look into superclasses here, too
1312 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1314 if(minfo->kind!=INFOTYPE_VAR)
1315 syntaxerror("class already contains a method called '%s'", name);
1316 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1317 syntaxerror("class already contains a field called '%s'", name);
1318 if(minfo->subtype & gs)
1319 syntaxerror("getter/setter for '%s' already defined", name);
1320 /* make a setter or getter into a getset */
1321 minfo->subtype |= gs;
1324 FIXME: this check needs to be done in pass 2
1326 if((!minfo->return_type != !type) ||
1327 (minfo->return_type && type &&
1328 !strcmp(minfo->return_type->name, type->name))) {
1329 syntaxerror("different type in getter and setter: %s and %s",
1330 minfo->return_type?minfo->return_type->name:"*",
1331 type?type->name:"*");
1334 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1335 minfo->kind = INFOTYPE_VAR; //hack
1336 minfo->subtype = gs;
1337 minfo->return_type = type;
1340 /* can't assign a slot as getter and setter might have different slots */
1341 //minfo->slot = slot;
1343 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1344 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1345 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1350 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1352 //parserassert(state->method && state->method->info);
1354 methodstate_t*parent_method = state->method;
1358 return_type = 0; // not valid in pass 1
1360 v = new_variable2(parent_method, name, 0, 0, 0);
1365 state->new_vars = 1;
1366 state->allvars = dict_new();
1369 state->method = rfx_calloc(sizeof(methodstate_t));
1370 state->method->inner = 1;
1371 state->method->is_static = parent_method->is_static;
1372 state->method->variable_count = 0;
1373 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1375 v->is_inner_method = state->method;
1378 NEW(methodinfo_t,minfo);
1379 minfo->kind = INFOTYPE_METHOD;
1380 minfo->access = ACCESS_PACKAGEINTERNAL;
1382 state->method->info = minfo;
1385 list_append(parent_method->innerfunctions, state->method);
1387 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1389 function_initvars(state->method, 1, params, 0, 1);
1393 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1394 state->method->variable_count = 0;
1395 parserassert(state->method);
1397 state->method->info->return_type = return_type;
1398 function_initvars(state->method, 1, params, 0, 1);
1402 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1403 params_t*params, classinfo_t*return_type)
1405 if(state->method && state->method->info) {
1406 syntaxerror("not able to start another method scope");
1409 state->new_vars = 1;
1410 state->allvars = dict_new();
1413 state->method = rfx_calloc(sizeof(methodstate_t));
1414 state->method->has_super = 0;
1415 state->method->is_static = mod->flags&FLAG_STATIC;
1418 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1420 state->method->is_global = 1;
1421 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1423 if(state->method->is_constructor)
1424 name = "__as3_constructor__";
1426 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1428 function_initvars(state->method, 1, params, mod->flags, 1);
1430 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1434 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1435 state->method->variable_count = 0;
1436 parserassert(state->method);
1439 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1440 check_override(m, mod->flags);
1444 state->cls->has_constructor |= state->method->is_constructor;
1447 function_initvars(state->method, 1, params, mod->flags, 1);
1451 static void insert_unresolved(methodstate_t*m, dict_t*xvars, dict_t*allvars)
1453 parserassert(m->inner);
1454 if(m->unresolved_variables) {
1455 dict_t*d = m->unresolved_variables;
1457 DICT_ITERATE_KEY(d, char*, id) {
1458 /* check parent method's variables */
1460 if(dict_contains(allvars, id)) {
1461 m->uses_parent_function = 1;
1462 state->method->uses_slots = 1;
1463 dict_put(xvars, id, 0);
1467 methodstate_list_t*ml = m->innerfunctions;
1469 insert_unresolved(ml->methodstate, xvars, allvars);
1474 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1475 params_t*params, classinfo_t*return_type, code_t*body)
1478 dict_t*xvars = dict_new();
1480 if(state->method->unresolved_variables) {
1481 DICT_ITERATE_KEY(state->method->unresolved_variables, char*, vname) {
1482 if(!state->method->no_variable_scoping && dict_contains(state->allvars, vname)) {
1483 variable_t*v = dict_lookup(state->allvars, vname);
1484 if(!v->is_inner_method) {
1485 state->method->no_variable_scoping = 1;
1486 as3_warning("function %s uses forward or outer block variable references (%s): switching into compatiblity mode", name, vname);
1492 methodstate_list_t*ml = state->method->innerfunctions;
1494 insert_unresolved(ml->methodstate, xvars, state->allvars);
1498 if(state->method->uses_slots) {
1499 state->method->slots = dict_new();
1501 DICT_ITERATE_ITEMS(state->allvars, char*, name, variable_t*, v) {
1502 if(!name) syntaxerror("internal error");
1503 if(v->index && dict_contains(xvars, name)) {
1504 v->init = v->kill = 0;
1506 if(v->is_inner_method) {
1507 v->is_inner_method->is_a_slot = i;
1510 dict_put(state->method->slots, name, v);
1513 state->method->uses_slots = i;
1514 dict_destroy(state->vars);state->vars = 0;
1515 parserassert(state->new_vars);
1516 dict_destroy(state->allvars);state->allvars = 0;
1523 /*if(state->method->uses_parent_function){
1524 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1529 multiname_t*type2 = sig2mname(return_type);
1531 if(state->method->inner) {
1532 f = state->method->abc;
1533 abc_method_init(f, global->file, type2, 1);
1534 } else if(state->method->is_constructor) {
1535 f = abc_class_getconstructor(state->cls->abc, type2);
1536 } else if(!state->method->is_global) {
1537 namespace_t ns = modifiers2access(mod);
1538 multiname_t mname = {QNAME, &ns, 0, name};
1539 if(mod->flags&FLAG_STATIC)
1540 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1542 f = abc_class_method(state->cls->abc, type2, &mname);
1543 slot = f->trait->slot_id;
1545 namespace_t mname_ns = {state->method->info->access, state->package};
1546 multiname_t mname = {QNAME, &mname_ns, 0, name};
1548 f = abc_method_new(global->file, type2, 1);
1549 if(!global->init) global->init = abc_initscript(global->file);
1550 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1551 //abc_code_t*c = global->init->method->body->code;
1553 //flash doesn't seem to allow us to access function slots
1554 //state->method->info->slot = slot;
1556 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1557 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1558 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1559 if(params->varargs) f->flags |= METHOD_NEED_REST;
1560 if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS;
1564 for(p=params->list;p;p=p->next) {
1565 if(params->varargs && !p->next) {
1566 break; //varargs: omit last parameter in function signature
1568 multiname_t*m = sig2mname(p->param->type);
1569 list_append(f->parameters, m);
1570 if(p->param->value) {
1571 check_constant_against_type(p->param->type, p->param->value);
1572 opt=1;list_append(f->optional_parameters, p->param->value);
1574 syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name);
1577 if(state->method->slots) {
1578 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1580 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1581 multiname_t*type = sig2mname(v->type);
1582 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1583 t->slot_id = v->index;
1588 check_code_for_break(body);
1590 /* Seems this works now.
1591 if(state->method->exceptions && state->method->uses_slots) {
1592 as3_warning("try/catch and activation not supported yet within the same method");
1596 f->body->code = body;
1597 f->body->exceptions = state->method->exceptions;
1598 } else { //interface
1600 syntaxerror("interface methods can't have a method body");
1610 void breakjumpsto(code_t*c, char*name, code_t*jump)
1613 if(c->opcode == OPCODE___BREAK__) {
1614 string_t*name2 = c->data[0];
1615 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1616 c->opcode = OPCODE_JUMP;
1623 void continuejumpsto(code_t*c, char*name, code_t*jump)
1626 if(c->opcode == OPCODE___CONTINUE__) {
1627 string_t*name2 = c->data[0];
1628 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1629 c->opcode = OPCODE_JUMP;
1637 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1642 return abc_coerce_a(c);
1646 // cast an "any" type to a specific type. subject to
1647 // runtime exceptions
1648 return abc_coerce2(c, &m);
1651 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1652 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1653 // allow conversion between number types
1654 if(TYPE_IS_UINT(to))
1655 return abc_convert_u(c);
1656 else if(TYPE_IS_INT(to))
1657 return abc_convert_i(c);
1658 else if(TYPE_IS_NUMBER(to))
1659 return abc_convert_d(c);
1660 return abc_coerce2(c, &m);
1663 if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from))
1666 if(TYPE_IS_BOOLEAN(to))
1667 return abc_convert_b(c);
1668 if(TYPE_IS_STRING(to))
1669 return abc_convert_s(c);
1670 if(TYPE_IS_OBJECT(to))
1671 return abc_coerce2(c, &m);
1672 if(TYPE_IS_OBJECT(from) && TYPE_IS_XMLLIST(to))
1673 return abc_coerce2(c, &m);
1674 if(TYPE_IS_OBJECT(from) && TYPE_IS_ARRAY(to))
1675 return abc_coerce2(c, &m);
1677 classinfo_t*supertype = from;
1679 if(supertype == to) {
1680 /* target type is one of from's superclasses.
1681 (not sure we need this coerce - as far as the verifier
1682 is concerned, object==object (i think) */
1683 return abc_coerce2(c, &m);
1686 while(supertype->interfaces[t]) {
1687 if(supertype->interfaces[t]==to) {
1688 // target type is one of from's interfaces
1689 return abc_coerce2(c, &m);
1693 supertype = supertype->superclass;
1695 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1697 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1699 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1702 as3_error("can't convert type %s%s%s to %s%s%s",
1703 from->package, from->package[0]?".":"", from->name,
1704 to->package, to->package[0]?".":"", to->name);
1708 code_t* coerce_to_type(code_t*c, classinfo_t*t)
1711 return abc_coerce_a(c);
1712 } else if(TYPE_IS_STRING(t)) {
1713 return abc_coerce_s(c);
1716 return abc_coerce2(c, &m);
1720 char is_pushundefined(code_t*c)
1722 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1725 static const char* get_package_from_name(const char*name)
1727 /* try explicit imports */
1728 dictentry_t* e = dict_get_slot(state->imports, name);
1730 if(!strcmp(e->key, name)) {
1731 slotinfo_t*c = (slotinfo_t*)e->data;
1732 if(c) return c->package;
1738 static namespace_list_t*get_current_imports()
1740 namespace_list_t*searchlist = 0;
1742 list_append(searchlist, namespace_new_package(state->package));
1744 import_list_t*l = state->wildcard_imports;
1746 namespace_t*ns = namespace_new_package(l->import->package);
1747 list_append(searchlist, ns);
1750 list_append(searchlist, namespace_new_package(""));
1751 list_append(searchlist, namespace_new_package(internal_filename_package));
1755 static slotinfo_t* find_class(const char*name)
1759 c = registry_find(state->package, name);
1762 /* try explicit imports */
1763 dictentry_t* e = dict_get_slot(state->imports, name);
1766 if(!strcmp(e->key, name)) {
1767 c = (slotinfo_t*)e->data;
1773 /* try package.* imports */
1774 import_list_t*l = state->wildcard_imports;
1776 //printf("does package %s contain a class %s?\n", l->import->package, name);
1777 c = registry_find(l->import->package, name);
1782 /* try global package */
1783 c = registry_find("", name);
1786 /* try local "filename" package */
1787 c = registry_find(internal_filename_package, name);
1792 typedcode_t push_class(slotinfo_t*a)
1797 if(a->access == ACCESS_PACKAGEINTERNAL &&
1798 strcmp(a->package, state->package) &&
1799 strcmp(a->package, internal_filename_package)
1801 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1802 infotypename(a), a->name, a->package, state->package);
1806 if(a->kind != INFOTYPE_CLASS) {
1808 x.c = abc_findpropstrict2(x.c, &m);
1809 x.c = abc_getproperty2(x.c, &m);
1810 if(a->kind == INFOTYPE_METHOD) {
1811 methodinfo_t*f = (methodinfo_t*)a;
1812 x.t = TYPE_FUNCTION(f);
1814 varinfo_t*v = (varinfo_t*)a;
1819 if(state->cls && state->method == state->cls->static_init) {
1820 /* we're in the static initializer.
1821 record the fact that we're using this class here */
1822 parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a);
1824 classinfo_t*c = (classinfo_t*)a;
1826 if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global
1827 x.c = abc_getglobalscope(x.c);
1828 x.c = abc_getslot(x.c, c->slot);
1831 x.c = abc_getlex2(x.c, &m);
1833 x.t = TYPE_CLASS(c);
1839 char is_break_or_jump(code_t*c)
1843 if(c->opcode == OPCODE_JUMP ||
1844 c->opcode == OPCODE___BREAK__ ||
1845 c->opcode == OPCODE___CONTINUE__ ||
1846 c->opcode == OPCODE_THROW ||
1847 c->opcode == OPCODE_RETURNVOID ||
1848 c->opcode == OPCODE_RETURNVALUE) {
1854 #define IS_FINALLY_TARGET(op) \
1855 ((op) == OPCODE___CONTINUE__ || \
1856 (op) == OPCODE___BREAK__ || \
1857 (op) == OPCODE_RETURNVOID || \
1858 (op) == OPCODE_RETURNVALUE || \
1859 (op) == OPCODE___RETHROW__)
1861 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1863 #define NEED_EXTRA_STACK_ARG
1864 code_t*finally_label = abc_nop(0);
1865 NEW(lookupswitch_t, l);
1871 code_t*prev = i->prev;
1872 if(IS_FINALLY_TARGET(i->opcode)) {
1875 if(i->opcode == OPCODE___RETHROW__ ||
1876 i->opcode == OPCODE_RETURNVALUE) {
1877 if(i->opcode == OPCODE___RETHROW__)
1878 i->opcode = OPCODE_THROW;
1880 p = abc_coerce_a(p);
1881 p = abc_setlocal(p, tempvar);
1883 p = abc_pushbyte(p, count++);
1884 p = abc_jump(p, finally_label);
1885 code_t*target = p = abc_label(p);
1886 #ifdef NEED_EXTRA_STACK_ARG
1890 p = abc_getlocal(p, tempvar);
1893 p->next = i;i->prev = p;
1894 list_append(l->targets, target);
1900 c = abc_pushbyte(c, -1);
1901 c = code_append(c, finally_label);
1902 c = code_append(c, finally);
1904 #ifdef NEED_EXTRA_STACK_ARG
1907 c = abc_lookupswitch(c, l);
1908 c = l->def = abc_label(c);
1909 #ifdef NEED_EXTRA_STACK_ARG
1916 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1920 code_t*prev = i->prev;
1921 if(IS_FINALLY_TARGET(i->opcode)) {
1922 if(i->opcode == OPCODE___RETHROW__)
1923 i->opcode = OPCODE_THROW;
1924 code_t*end = code_dup(finally);
1925 code_t*start = code_start(end);
1926 if(prev) prev->next = start;
1933 return code_append(c, finally);
1936 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1942 int num_insertion_points=0;
1944 if(IS_FINALLY_TARGET(i->opcode))
1945 num_insertion_points++;
1952 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1957 int simple_version_cost = (1+num_insertion_points)*code_size;
1958 int lookup_version_cost = 4*num_insertion_points + 5;
1960 if(cantdup || simple_version_cost > lookup_version_cost) {
1961 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
1962 return insert_finally_lookup(c, finally, tempvar);
1964 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
1965 return insert_finally_simple(c, finally, tempvar);
1969 #define PASS1 }} if(as3_pass == 1) {{
1970 #define PASS1END }} if(as3_pass == 2) {{
1971 #define PASS2 }} if(as3_pass == 2) {{
1972 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
1973 #define PASS12END }} if(as3_pass == 2) {{
1974 #define PASS_ALWAYS }} {{
1977 /* Line 273 of skeleton.m4 */
1978 #line 1979 "parser.tab.c"
1979 /* Unqualified %code blocks. */
1980 /* Line 274 of skeleton.m4 */
1981 #line 2077 "parser.y"
1983 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1987 char do_init_variable(char*name)
1989 if(!state->method->no_variable_scoping)
1991 if(!state->new_vars)
1996 /* Line 274 of skeleton.m4 */
1997 #line 2528 "parser.y"
1999 static void state_has_imports()
2001 state->wildcard_imports = list_clone(state->wildcard_imports);
2002 state->imports = dict_clone(state->imports);
2003 state->has_own_imports = 1;
2005 static void import_toplevel(const char*package)
2007 char* s = strdup(package);
2009 dict_put(state->import_toplevel_packages, s, 0);
2010 char*x = strrchr(s, '.');
2018 /* Line 274 of skeleton.m4 */
2019 #line 2667 "parser.y"
2021 static int slotstate_varconst = 0;
2022 static modifiers_t*slotstate_flags = 0;
2023 static void setslotstate(modifiers_t* flags, int varconst)
2025 slotstate_varconst = varconst;
2026 slotstate_flags = flags;
2029 if(flags->flags&FLAG_STATIC) {
2030 state->method = state->cls->static_init;
2032 state->method = state->cls->init;
2035 // reset to "default" state (all in class code is static by default) */
2036 state->method = state->cls->static_init;
2039 parserassert(state->method);
2042 static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c)
2044 int flags = modifiers->flags;
2045 namespace_t ns = modifiers2access(modifiers);
2048 multiname_t mname = {QNAME, &ns, 0, name};
2050 trait_list_t**traits;
2054 if(!global->init) global->init = abc_initscript(global->file);
2055 ns.name = state->package;
2056 traits = &global->init->traits;
2057 code = &global->init->method->body->code;
2058 } else if(flags&FLAG_STATIC) {
2060 traits = &state->cls->abc->static_traits;
2061 code = &state->cls->static_init->header;
2063 // instance variable
2064 traits = &state->cls->abc->traits;
2065 code = &state->cls->init->header;
2067 if(ns.access == ACCESS_PROTECTED) {
2068 ns.name = concat3(state->cls->info->package,":",state->cls->info->name);
2074 *m = *multiname_clone(&mname);
2076 return trait_new_member(traits, 0, multiname_clone(&mname), 0);
2079 /* Line 274 of skeleton.m4 */
2080 #line 2847 "parser.y"
2082 static int xml_level = 0;
2084 /* Line 274 of skeleton.m4 */
2085 #line 3655 "parser.y"
2087 node_t* resolve_identifier(char*name)
2097 /* look at variables */
2098 if((v = find_variable(state, name))) {
2099 // name is a local variable
2100 o.c = abc_getlocal(o.c, v->index);
2102 return mkcodenode(o);
2104 if((v = find_slot(state->method, name))) {
2105 o.c = abc_getscopeobject(o.c, 1);
2106 o.c = abc_getslot(o.c, v->index);
2108 return mkcodenode(o);
2111 int i_am_static = state->method->is_static;
2113 /* look at current class' members */
2114 if(!state->method->inner &&
2115 !state->xmlfilter &&
2117 (f = findmember_nsset(state->cls->info, name, 1)))
2119 // name is a member or attribute in this class
2120 int var_is_static = (f->flags&FLAG_STATIC);
2122 if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) {
2123 /* if the variable is a constant (and we know what is evaluates to), we
2124 can just use the value itself */
2125 varinfo_t*v = (varinfo_t*)f;
2127 return mkconstnode(v->value);
2131 if(var_is_static >= i_am_static) {
2132 if(f->kind == INFOTYPE_METHOD) {
2133 o.t = TYPE_FUNCTION(f);
2138 if(var_is_static && !i_am_static) {
2139 /* access to a static member from a non-static location.
2140 do this via findpropstrict:
2141 there doesn't seem to be any non-lookup way to access
2142 static properties of a class */
2143 state->method->late_binding = 1;
2145 namespace_t ns = {f->access, f->package};
2146 multiname_t m = {QNAME, &ns, 0, name};
2147 o.c = abc_findpropstrict2(o.c, &m);
2148 o.c = abc_getproperty2(o.c, &m);
2149 return mkcodenode(o);
2150 } else if(f->slot>0) {
2151 o.c = abc_getlocal_0(o.c);
2152 o.c = abc_getslot(o.c, f->slot);
2153 return mkcodenode(o);
2155 MEMBER_MULTINAME(m, f, name);
2156 o.c = abc_getlocal_0(o.c);
2157 o.c = abc_getproperty2(o.c, &m);
2158 return mkcodenode(o);
2163 /* look at actual classes, in the current package and imported */
2164 if(!state->xmlfilter && (a = find_class(name))) {
2165 if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) {
2166 o.c = abc_getlocal_0(0);
2167 o.t = TYPE_CLASS((classinfo_t*)a);
2171 return mkcodenode(o);
2174 /* look through package prefixes */
2175 if(!state->xmlfilter &&
2176 (dict_contains(state->import_toplevel_packages, name) ||
2177 registry_ispackage(name))) {
2178 o.c = abc___pushpackage__(o.c, name);
2180 return mkcodenode(o); //?
2183 /* unknown object, let the avm2 resolve it */
2185 if(!state->method->inner && !state->xmlfilter) {
2186 /* we really should make inner functions aware of the class context */
2187 as3_warning("Couldn't resolve '%s', doing late binding", name);
2189 state->method->late_binding = 1;
2191 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, name};
2194 o.c = abc_findpropstrict2(o.c, &m);
2195 o.c = abc_getproperty2(o.c, &m);
2196 return mkcodenode(o);
2200 /* Line 274 of skeleton.m4 */
2201 #line 3795 "parser.y"
2203 void add_active_url(const char*url)
2207 list_append(state->active_namespace_urls, n);
2211 /* Line 274 of skeleton.m4 */
2212 #line 2213 "parser.tab.c"
2219 typedef YYTYPE_UINT8 yytype_uint8;
2221 typedef unsigned char yytype_uint8;
2225 typedef YYTYPE_INT8 yytype_int8;
2226 #elif (defined __STDC__ || defined __C99__FUNC__ \
2227 || defined __cplusplus || defined _MSC_VER)
2228 typedef signed char yytype_int8;
2230 typedef short int yytype_int8;
2233 #ifdef YYTYPE_UINT16
2234 typedef YYTYPE_UINT16 yytype_uint16;
2236 typedef unsigned short int yytype_uint16;
2240 typedef YYTYPE_INT16 yytype_int16;
2242 typedef short int yytype_int16;
2246 # ifdef __SIZE_TYPE__
2247 # define YYSIZE_T __SIZE_TYPE__
2248 # elif defined size_t
2249 # define YYSIZE_T size_t
2250 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2251 || defined __cplusplus || defined _MSC_VER)
2252 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2253 # define YYSIZE_T size_t
2255 # define YYSIZE_T unsigned int
2259 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2264 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2265 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2269 # define YY_(msgid) msgid
2273 /* Suppress unused-variable warnings by "using" E. */
2274 #if ! defined lint || defined __GNUC__
2275 # define YYUSE(e) ((void) (e))
2277 # define YYUSE(e) /* empty */
2280 /* Identity function, used to suppress warnings about constant conditions. */
2282 # define YYID(n) (n)
2284 #if (defined __STDC__ || defined __C99__FUNC__ \
2285 || defined __cplusplus || defined _MSC_VER)
2298 #if ! defined yyoverflow || YYERROR_VERBOSE
2300 /* The parser invokes alloca or malloc; define the necessary symbols. */
2302 # ifdef YYSTACK_USE_ALLOCA
2303 # if YYSTACK_USE_ALLOCA
2305 # define YYSTACK_ALLOC __builtin_alloca
2306 # elif defined __BUILTIN_VA_ARG_INCR
2307 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2309 # define YYSTACK_ALLOC __alloca
2310 # elif defined _MSC_VER
2311 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2312 # define alloca _alloca
2314 # define YYSTACK_ALLOC alloca
2315 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2316 || defined __cplusplus || defined _MSC_VER)
2317 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2319 # define _STDLIB_H 1
2326 # ifdef YYSTACK_ALLOC
2327 /* Pacify GCC's `empty if-body' warning. */
2328 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2329 # ifndef YYSTACK_ALLOC_MAXIMUM
2330 /* The OS might guarantee only one guard page at the bottom of the stack,
2331 and a page size can be as small as 4096 bytes. So we cannot safely
2332 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2333 to allow for a few compiler-allocated temporary stack slots. */
2334 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2337 # define YYSTACK_ALLOC YYMALLOC
2338 # define YYSTACK_FREE YYFREE
2339 # ifndef YYSTACK_ALLOC_MAXIMUM
2340 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2342 # if (defined __cplusplus && ! defined _STDLIB_H \
2343 && ! ((defined YYMALLOC || defined malloc) \
2344 && (defined YYFREE || defined free)))
2345 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2347 # define _STDLIB_H 1
2351 # define YYMALLOC malloc
2352 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2353 || defined __cplusplus || defined _MSC_VER)
2354 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2358 # define YYFREE free
2359 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2360 || defined __cplusplus || defined _MSC_VER)
2361 void free (void *); /* INFRINGES ON USER NAME SPACE */
2365 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2368 #if (! defined yyoverflow \
2369 && (! defined __cplusplus \
2370 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2372 /* A type that is properly aligned for any stack member. */
2375 yytype_int16 yyss_alloc;
2379 /* The size of the maximum gap between one aligned stack and the next. */
2380 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2382 /* The size of an array large to enough to hold all stacks, each with
2384 # define YYSTACK_BYTES(N) \
2385 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2386 + YYSTACK_GAP_MAXIMUM)
2388 /* Copy COUNT objects from FROM to TO. The source and destination do
2391 # if defined __GNUC__ && 1 < __GNUC__
2392 # define YYCOPY(To, From, Count) \
2393 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2395 # define YYCOPY(To, From, Count) \
2399 for (yyi = 0; yyi < (Count); yyi++) \
2400 (To)[yyi] = (From)[yyi]; \
2406 /* Relocate STACK from its old location to the new one. The
2407 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2408 elements in the stack, and YYPTR gives the new location of the
2409 stack. Advance YYPTR to a properly aligned location for the next
2411 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2414 YYSIZE_T yynewbytes; \
2415 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2416 Stack = &yyptr->Stack_alloc; \
2417 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2418 yyptr += yynewbytes / sizeof (*yyptr); \
2424 /* YYFINAL -- State number of the termination state. */
2426 /* YYLAST -- Last index in YYTABLE. */
2429 /* YYNTOKENS -- Number of terminals. */
2430 #define YYNTOKENS 136
2431 /* YYNNTS -- Number of nonterminals. */
2433 /* YYNRULES -- Number of rules. */
2434 #define YYNRULES 354
2435 /* YYNRULES -- Number of states. */
2436 #define YYNSTATES 601
2438 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2439 #define YYUNDEFTOK 2
2440 #define YYMAXUTOK 365
2442 #define YYTRANSLATE(YYX) \
2443 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2445 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2446 static const yytype_uint8 yytranslate[] =
2448 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2451 2, 2, 2, 120, 2, 2, 2, 118, 109, 2,
2452 124, 135, 117, 115, 102, 114, 129, 116, 2, 2,
2453 2, 2, 2, 2, 2, 2, 2, 2, 106, 101,
2454 111, 104, 112, 105, 130, 2, 2, 2, 2, 2,
2455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2457 2, 126, 2, 127, 108, 2, 2, 2, 2, 2,
2458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2460 2, 2, 2, 128, 107, 134, 119, 2, 2, 2,
2461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2473 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2474 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2475 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2476 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2477 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2478 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2479 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2480 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2481 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2482 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2483 95, 96, 97, 98, 99, 100, 103, 110, 113, 121,
2484 122, 123, 125, 131, 132, 133
2488 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2490 static const int yyprhs[] =
2495 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2496 static const int yyrhs[] =
2501 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2502 static const yytype_uint16 yyrline[] =
2504 0, 1968, 1968, 1970, 1970, 1971, 1972, 1974, 1975, 1976,
2505 1977, 1978, 1979, 1980, 1981, 1983, 1983, 1984, 1985, 1987,
2506 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1999,
2507 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2508 2014, 2015, 2016, 2017, 2018, 2019, 2022, 2023, 2024, 2025,
2509 2026, 2027, 2028, 2029, 2041, 2042, 2046, 2057, 2065, 2092,
2510 2093, 2095, 2096, 2098, 2099, 2101, 2162, 2162, 2166, 2167,
2511 2170, 2186, 2187, 2188, 2193, 2197, 2202, 2203, 2205, 2225,
2512 2269, 2285, 2297, 2300, 2303, 2306, 2310, 2311, 2312, 2313,
2513 2314, 2315, 2317, 2328, 2331, 2331, 2362, 2362, 2387, 2387,
2514 2403, 2404, 2405, 2406, 2414, 2423, 2423, 2472, 2476, 2487,
2515 2497, 2514, 2515, 2516, 2517, 2518, 2520, 2521, 2523, 2523,
2516 2525, 2525, 2549, 2557, 2568, 2584, 2585, 2586, 2587, 2594,
2517 2595, 2596, 2597, 2598, 2599, 2600, 2601, 2602, 2603, 2607,
2518 2608, 2610, 2611, 2613, 2614, 2618, 2616, 2624, 2622, 2631,
2519 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2640, 2646, 2647,
2520 2648, 2649, 2650, 2651, 2654, 2727, 2727, 2729, 2729, 2731,
2521 2732, 2734, 2818, 2819, 2828, 2829, 2832, 2833, 2834, 2835,
2522 2836, 2837, 2838, 2851, 2862, 2863, 2864, 2866, 2866, 2869,
2523 2869, 2872, 2873, 2876, 2881, 2884, 2887, 2890, 2893, 2897,
2524 2900, 2904, 2908, 2913, 2919, 2922, 2925, 2928, 2933, 2936,
2525 2939, 2949, 2953, 2959, 2965, 2973, 2978, 2984, 2992, 3000,
2526 3001, 3002, 3005, 3004, 3021, 3022, 3024, 3023, 3047, 3066,
2527 3080, 3081, 3083, 3084, 3086, 3087, 3088, 3097, 3098, 3102,
2528 3103, 3105, 3106, 3107, 3109, 3113, 3114, 3119, 3120, 3167,
2529 3217, 3238, 3260, 3263, 3270, 3273, 3276, 3279, 3282, 3285,
2530 3290, 3291, 3293, 3294, 3295, 3296, 3297, 3299, 3305, 3314,
2531 3315, 3316, 3317, 3318, 3319, 3321, 3325, 3330, 3348, 3359,
2532 3369, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386,
2533 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396,
2534 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406,
2535 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416,
2536 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3425, 3426, 3427,
2537 3428, 3430, 3445, 3453, 3453, 3507, 3508, 3509, 3510, 3511,
2538 3519, 3537, 3544, 3555, 3562, 3569, 3579, 3590, 3770, 3804,
2539 3811, 3818, 3825, 3847, 3853
2543 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2544 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2545 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2546 static const char *const yytname[] =
2548 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2549 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2550 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2551 "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"",
2552 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2553 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2554 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2555 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2556 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2557 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2558 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2559 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2560 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"",
2561 "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"",
2562 "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"",
2563 "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"",
2564 "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"",
2565 "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"",
2566 "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','",
2567 "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt",
2568 "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'",
2569 "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('",
2570 "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier",
2571 "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM",
2572 "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE",
2573 "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE",
2574 "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK",
2575 "PACKAGE_INITCODE", "EMBED_START", "CONDITIONAL_COMPILATION",
2576 "MAYBEEXPRESSION", "VARIABLE_DECLARATION", "VARIABLE_LIST",
2577 "ONE_VARIABLE", "IF_CODEBLOCK", "$@1", "MAYBEELSE", "IF", "FOR_INIT",
2578 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "DO_WHILE",
2579 "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT",
2580 "SWITCH", "$@2", "CATCH", "$@3", "FINALLY", "$@4", "CATCH_LIST",
2581 "CATCH_FINALLY_LIST", "TRY", "$@5", "THROW", "WITH_HEAD", "WITH",
2582 "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@6", "$@7", "IMPORT",
2583 "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2584 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@8",
2585 "INTERFACE_DECLARATION", "$@9", "MAYBE_CLASS_BODY", "CLASS_BODY",
2586 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2587 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@10", "SLOT_LIST",
2588 "ONE_SLOT", "MAYBECONSTANT", "CONSTANT", "XML", "OPEN", "CLOSE",
2589 "CLOSE2", "XMLEXPR1", "$@11", "XMLEXPR2", "$@12", "XMLTEXT", "XML2",
2590 "XML_ID_OR_EXPR", "MAYBE_XMLATTRIBUTES", "XMLNODE", "XMLATTRIBUTES",
2591 "XMLATTRIBUTE", "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2592 "FUNCTION_DECLARATION", "$@13", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2593 "$@14", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST",
2594 "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2595 "EXPRESSION_LIST", "EXPRESSION_LIST_AND_COMMA", "XX", "NEW",
2596 "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
2597 "COMMA_EXPRESSION", "VOIDEXPRESSION", "MAYBE_DICT_EXPRPAIR_LIST",
2598 "DICTLH", "DICT_EXPRPAIR_LIST", "E", "$@15", "ID_OR_NS", "SUBNODE",
2599 "MEMBER", "VAR_READ", "NAMESPACE_ID", "NAMESPACE_DECLARATION",
2600 "DEFAULT_NAMESPACE", "USE_NAMESPACE", 0
2605 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2607 static const yytype_uint16 yytoknum[] =
2609 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2610 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2611 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2612 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2613 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2614 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2615 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2616 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2617 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2618 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2619 355, 59, 44, 356, 61, 63, 58, 124, 94, 38,
2620 357, 60, 62, 358, 45, 43, 47, 42, 37, 126,
2621 33, 359, 360, 361, 40, 362, 91, 93, 123, 46,
2622 64, 363, 364, 365, 125, 41
2626 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2627 static const yytype_uint16 yyr1[] =
2629 0, 136, 137, 138, 138, 139, 139, 140, 140, 140,
2630 140, 140, 140, 140, 140, 141, 141, 142, 142, 143,
2631 143, 143, 143, 143, 143, 143, 143, 144, 144, 145,
2632 145, 146, 146, 146, 146, 146, 146, 146, 146, 146,
2633 146, 146, 146, 146, 146, 146, 147, 147, 147, 147,
2634 147, 147, 147, 147, 148, 148, 149, 150, 151, 152,
2635 152, 153, 153, 154, 154, 155, 157, 156, 158, 158,
2636 159, 160, 160, 160, 161, 161, 162, 162, 163, 164,
2637 165, 166, 167, 167, 168, 168, 169, 169, 169, 169,
2638 170, 170, 171, 172, 174, 173, 176, 175, 178, 177,
2639 179, 179, 180, 180, 180, 182, 181, 183, 183, 184,
2640 185, 186, 186, 186, 186, 186, 187, 187, 189, 188,
2641 190, 188, 191, 191, 191, 192, 192, 193, 193, 194,
2642 194, 194, 194, 194, 194, 194, 194, 194, 194, 195,
2643 195, 196, 196, 197, 197, 199, 198, 201, 200, 202,
2644 202, 203, 203, 204, 204, 204, 204, 204, 205, 205,
2645 206, 206, 207, 207, 207, 208, 208, 210, 209, 211,
2646 211, 212, 213, 213, 214, 214, 214, 214, 214, 214,
2647 214, 214, 214, 215, 216, 217, 218, 220, 219, 222,
2648 221, 223, 223, 223, 223, 224, 224, 225, 225, 226,
2649 226, 227, 227, 227, 228, 228, 229, 229, 229, 229,
2650 229, 230, 230, 230, 230, 231, 231, 232, 232, 233,
2651 233, 233, 235, 234, 236, 236, 238, 237, 239, 240,
2652 241, 241, 242, 242, 243, 243, 243, 244, 244, 245,
2653 245, 246, 246, 246, 247, 248, 247, 249, 250, 251,
2654 251, 252, 253, 253, 254, 255, 256, 256, 257, 257,
2655 258, 258, 259, 259, 259, 259, 259, 260, 260, 261,
2656 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2657 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2658 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2659 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2660 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2661 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2662 261, 261, 261, 262, 261, 263, 263, 263, 264, 264,
2663 261, 261, 261, 261, 261, 261, 261, 265, 266, 267,
2664 267, 267, 268, 269, 270
2667 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2668 static const yytype_uint8 yyr2[] =
2670 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2671 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2672 1, 1, 1, 1, 4, 4, 1, 1, 0, 2,
2673 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2674 1, 1, 1, 1, 3, 2, 1, 1, 1, 1,
2675 1, 1, 1, 4, 2, 1, 1, 0, 3, 2,
2676 0, 2, 2, 1, 3, 3, 0, 2, 0, 2,
2677 6, 0, 1, 1, 3, 1, 2, 3, 8, 6,
2678 5, 6, 1, 2, 1, 2, 0, 1, 1, 2,
2679 1, 2, 4, 3, 0, 8, 0, 9, 0, 5,
2680 1, 2, 1, 2, 1, 0, 6, 2, 1, 4,
2681 2, 1, 1, 1, 1, 1, 3, 1, 0, 6,
2682 0, 5, 2, 2, 4, 0, 1, 1, 2, 1,
2683 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2684 2, 0, 2, 0, 2, 0, 9, 0, 8, 0,
2685 1, 1, 2, 1, 4, 1, 1, 1, 0, 1,
2686 1, 2, 1, 2, 8, 1, 1, 0, 4, 1,
2687 3, 3, 0, 2, 1, 1, 1, 1, 1, 1,
2688 1, 1, 1, 1, 1, 1, 0, 0, 4, 0,
2689 4, 0, 2, 2, 2, 2, 3, 1, 1, 0,
2690 1, 6, 10, 11, 1, 2, 1, 3, 3, 3,
2691 3, 0, 1, 2, 4, 3, 1, 4, 2, 1,
2692 1, 0, 0, 12, 1, 0, 0, 10, 1, 3,
2693 1, 1, 1, 3, 1, 1, 1, 2, 0, 0,
2694 3, 0, 1, 1, 1, 2, 2, 0, 4, 4,
2695 4, 2, 1, 2, 1, 1, 1, 3, 1, 3,
2696 0, 1, 1, 1, 1, 1, 1, 3, 5, 1,
2697 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2698 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2699 3, 2, 2, 3, 3, 3, 3, 3, 3, 3,
2700 3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2701 1, 3, 2, 4, 3, 3, 3, 3, 3, 3,
2702 3, 3, 3, 3, 3, 3, 5, 2, 2, 2,
2703 2, 3, 2, 0, 6, 1, 1, 1, 1, 1,
2704 5, 3, 5, 4, 4, 6, 6, 3, 1, 2,
2708 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2709 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2710 means the default is an error. */
2711 static const yytype_uint16 yydefact[] =
2713 125, 348, 138, 177, 277, 174, 175, 176, 0, 0,
2714 66, 0, 0, 131, 278, 129, 130, 0, 137, 0,
2715 136, 225, 181, 182, 310, 132, 0, 0, 0, 180,
2716 133, 135, 134, 0, 0, 179, 178, 0, 0, 0,
2717 260, 0, 0, 14, 184, 0, 0, 0, 0, 241,
2718 125, 0, 0, 2, 125, 5, 56, 12, 0, 38,
2719 71, 33, 34, 35, 36, 37, 40, 125, 39, 7,
2720 32, 0, 126, 127, 9, 8, 11, 275, 276, 0,
2721 183, 10, 269, 271, 273, 272, 41, 258, 270, 274,
2722 43, 31, 42, 0, 0, 76, 0, 0, 125, 94,
2723 111, 115, 113, 112, 114, 120, 117, 0, 0, 348,
2724 247, 224, 0, 309, 0, 122, 0, 123, 308, 105,
2725 241, 0, 0, 251, 0, 262, 263, 264, 265, 266,
2726 0, 0, 261, 330, 329, 312, 292, 291, 0, 256,
2727 0, 242, 243, 244, 254, 84, 0, 108, 252, 0,
2728 82, 46, 45, 125, 47, 30, 0, 48, 49, 50,
2729 52, 0, 51, 332, 1, 6, 125, 348, 0, 72,
2730 0, 0, 73, 55, 110, 0, 221, 0, 166, 0,
2731 165, 167, 352, 128, 197, 0, 198, 199, 0, 0,
2732 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2733 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2734 0, 0, 328, 327, 0, 0, 0, 0, 0, 0,
2735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2736 241, 0, 0, 58, 77, 0, 255, 0, 67, 0,
2737 125, 118, 0, 228, 0, 231, 230, 354, 239, 211,
2738 0, 0, 28, 0, 331, 0, 0, 280, 0, 0,
2739 0, 311, 279, 245, 246, 85, 238, 62, 63, 107,
2740 253, 61, 83, 44, 29, 125, 0, 238, 0, 0,
2741 54, 349, 220, 219, 0, 139, 141, 0, 189, 0,
2742 206, 0, 200, 204, 259, 306, 307, 304, 305, 285,
2743 286, 288, 287, 283, 284, 320, 319, 315, 314, 322,
2744 323, 324, 321, 317, 316, 318, 289, 290, 339, 0,
2745 338, 341, 298, 297, 296, 325, 0, 295, 294, 293,
2746 281, 282, 302, 301, 299, 303, 300, 0, 0, 111,
2747 115, 339, 333, 0, 0, 0, 347, 66, 0, 0,
2748 26, 57, 0, 125, 17, 23, 0, 20, 19, 22,
2749 21, 125, 116, 0, 241, 248, 172, 0, 0, 212,
2750 216, 109, 124, 229, 0, 27, 250, 353, 66, 267,
2751 0, 257, 0, 60, 0, 125, 13, 60, 0, 0,
2752 0, 0, 0, 143, 0, 0, 238, 168, 169, 0,
2753 0, 0, 185, 186, 191, 205, 0, 344, 0, 249,
2754 313, 0, 0, 0, 343, 0, 80, 0, 0, 0,
2755 121, 18, 125, 0, 0, 0, 0, 218, 213, 238,
2756 0, 0, 68, 0, 236, 235, 234, 237, 0, 65,
2757 64, 53, 0, 66, 350, 351, 211, 140, 0, 0,
2758 232, 142, 147, 60, 0, 190, 210, 209, 207, 208,
2759 0, 0, 0, 326, 0, 342, 0, 340, 81, 86,
2760 0, 0, 119, 240, 173, 172, 0, 0, 215, 0,
2761 0, 100, 104, 102, 106, 66, 70, 268, 59, 0,
2762 79, 0, 144, 145, 0, 125, 171, 170, 201, 193,
2763 184, 194, 0, 192, 0, 191, 346, 334, 345, 0,
2764 0, 0, 87, 90, 88, 25, 24, 217, 226, 214,
2765 98, 0, 101, 103, 69, 66, 238, 125, 233, 0,
2766 162, 0, 0, 125, 160, 0, 187, 184, 191, 195,
2767 0, 28, 95, 91, 89, 28, 28, 238, 78, 0,
2768 153, 157, 0, 0, 0, 125, 151, 155, 156, 163,
2769 221, 148, 161, 186, 0, 0, 196, 28, 93, 0,
2770 0, 0, 222, 125, 146, 152, 0, 0, 188, 186,
2771 92, 227, 99, 96, 28, 0, 0, 202, 0, 0,
2772 0, 154, 211, 203, 28, 223, 0, 0, 238, 97,
2776 /* YYDEFGOTO[NTERM-NUM]. */
2777 static const yytype_int16 yydefgoto[] =
2779 -1, 52, 53, 54, 55, 352, 353, 354, 374, 375,
2780 154, 155, 174, 355, 419, 156, 439, 157, 271, 268,
2781 97, 98, 486, 59, 170, 171, 60, 61, 62, 63,
2782 64, 158, 159, 511, 512, 513, 514, 65, 239, 481,
2783 589, 482, 546, 483, 484, 66, 252, 160, 67, 68,
2784 243, 244, 69, 361, 240, 70, 161, 72, 73, 393,
2785 395, 449, 357, 527, 358, 495, 554, 555, 556, 532,
2786 533, 534, 181, 359, 287, 397, 398, 427, 77, 78,
2787 79, 404, 460, 503, 564, 186, 399, 461, 504, 187,
2788 291, 80, 292, 293, 368, 369, 370, 284, 360, 584,
2789 112, 82, 545, 245, 246, 436, 451, 437, 383, 365,
2790 140, 141, 142, 248, 83, 84, 85, 162, 143, 235,
2791 236, 86, 130, 131, 132, 87, 411, 345, 321, 88,
2795 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2797 #define YYPACT_NINF -515
2798 static const yytype_int16 yypact[] =
2800 1766, 12, -515, -515, -515, -515, -515, -515, -28, -6,
2801 -515, 16, 94, -515, -515, -515, -515, 108, -515, 2220,
2802 -515, 122, -515, -515, 2277, -515, 17, 363, 2220, -515,
2803 -515, -515, -515, 24, 27, -515, -515, 112, 2220, 29,
2804 332, 2220, 2220, -515, -515, 2220, 2220, 2220, 2220, 2220,
2805 710, 158, 165, -515, 578, -515, -515, -515, 44, -515,
2806 2148, -515, -515, -515, -515, -515, -515, 2022, -515, -515,
2807 -515, 288, 766, -515, -515, -515, -515, -515, -515, 11,
2808 -515, -515, -515, -515, -515, -515, 118, 2972, -515, -515,
2809 -515, -515, -515, 218, 101, -515, 2220, 221, 2022, -515,
2810 -515, -515, -515, -515, -515, -515, -515, -83, 373, -515,
2811 -50, -515, 111, -51, 2220, 110, 124, -515, -51, -515,
2812 2220, 253, 155, -51, 2220, -515, -515, -515, -515, -515,
2813 127, 159, 162, -51, -51, 702, -51, -51, -52, 2910,
2814 141, 168, 2220, -515, 2910, 268, 272, 2220, 2220, 272,
2815 273, -515, -515, 842, -515, -515, 149, -515, -515, -515,
2816 -515, 266, -515, -515, -515, -515, 1106, 214, 282, -515,
2817 191, 225, 118, 202, -515, 302, 54, 304, -515, 305,
2818 -515, -515, -515, -515, -515, 2220, -515, 20, 2220, 2220,
2819 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220,
2820 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220,
2821 2220, 2220, -515, -515, 130, 2220, 2220, 2220, 2220, 2220,
2822 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220,
2823 2220, 2220, 128, -515, -515, 174, 209, 188, -515, 2220,
2824 1238, -515, 373, 184, 187, -515, -515, -515, 194, 21,
2825 186, 84, 1894, 193, -515, 2220, 198, -515, 2220, 332,
2826 2220, -515, -515, -515, -515, -515, 216, 236, -515, -515,
2827 -515, 236, -515, -515, -515, 2022, 226, 216, 2220, 2220,
2828 -515, 239, -515, -515, 345, 311, 314, 366, 2910, 278,
2829 280, -49, 20, -515, 2910, 408, 570, 570, 570, 3282,
2830 3282, 3282, 3282, 408, 408, 2910, 2910, 2910, 2910, 2910,
2831 2910, 2910, 2910, 2910, 2910, 2910, 365, 3034, -515, 146,
2832 -515, -515, 424, 424, 424, 2910, 2476, 3096, 3158, 3220,
2833 408, 408, 702, 702, -51, -51, -51, 250, 2538, 295,
2834 306, 307, -515, 2220, 233, 312, -515, -515, 2220, 2336,
2835 -515, 279, 259, 1370, -515, -515, 267, -515, -515, -515,
2836 -515, 1238, -515, 373, 2220, -515, 126, 401, 274, 308,
2837 -515, -515, -515, 283, 281, 1894, -515, 2910, -515, -515,
2838 310, 2910, 270, 313, 272, 974, -515, -30, 317, 284,
2839 104, 290, 373, 393, 373, 292, 216, 323, -515, 294,
2840 14, 15, -515, -515, -515, -515, 2220, -515, 2220, -515,
2841 -515, 2220, 2600, 2220, -515, 354, -515, 296, 301, 2220,
2842 -515, -515, 1238, 298, 309, 2220, 270, -515, -515, 216,
2843 22, 39, 364, 2220, -515, -515, -515, -515, 2220, -515,
2844 -515, -515, 2220, -515, -515, -515, 21, -515, 373, 315,
2845 -515, 334, -515, 313, 366, -515, -515, -515, -515, -515,
2846 333, 43, 2662, 2910, 2406, -515, 2724, -515, -515, 28,
2847 2786, 316, -515, -515, 2910, 342, 319, 401, -515, 321,
2848 327, -515, -515, 39, -515, -515, -515, -515, 2910, -41,
2849 -515, 318, 334, -515, 373, 277, -515, -515, -515, -515,
2850 338, -515, 2220, -515, 353, -515, -515, -515, -515, 2220,
2851 350, 331, 28, -515, -515, -515, -515, -515, -515, -515,
2852 -515, 463, -515, -515, -515, -515, 216, 1502, -515, 464,
2853 -515, 442, 335, 326, -515, 11, 2910, 359, -515, 46,
2854 2848, 1894, -515, -515, -515, 1894, 1894, 216, -515, 358,
2855 -515, -515, 360, 264, 336, 1634, -515, -515, -515, -515,
2856 54, -515, -515, -515, 344, 11, 46, 1894, -515, 362,
2857 369, 352, -515, 1502, -515, -515, 489, 381, -515, -515,
2858 -515, -515, -515, -515, 1894, 374, 375, -515, 386, 379,
2859 376, -515, 21, -515, 1894, -515, 377, 380, 216, -515,
2863 /* YYPGOTO[NTERM-NUM]. */
2864 static const yytype_int16 yypgoto[] =
2866 -515, -515, 343, -515, 457, -340, -515, 160, -514, -37,
2867 1, -58, 417, 60, -515, 2, 82, 461, 390, 161,
2868 -241, -515, -515, -515, -515, -515, -515, -515, -515, -515,
2869 -515, -515, -515, -515, -515, 31, 32, -515, -515, 63,
2870 -515, 64, -515, -515, -515, -515, -515, -515, -515, -515,
2871 37, 59, -515, -515, -515, -515, 0, -515, 477, -515,
2872 -515, -515, 65, -515, 68, -515, -22, -515, -3, -515,
2873 -515, 30, -515, 3, -515, -515, 100, 85, -515, -515,
2874 -515, -515, -464, -515, -515, -172, -515, -453, -515, -488,
2875 -515, -423, -515, 269, -428, -515, -339, 5, 4, -515,
2876 -515, -515, -515, -515, 535, -103, 116, 140, -269, -515,
2877 -109, -515, -515, -515, -515, -515, -515, -515, -132, -55,
2878 519, -54, -515, 320, -515, -12, -515, -515, -215, -515,
2879 -515, -515, -515, -515, -515
2882 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2883 positive, shift that token. If negative, reduce the rule which
2884 number is the opposite. If zero, do what YYDEFACT says.
2885 If YYTABLE_NINF, syntax error. */
2886 #define YYTABLE_NINF -338
2887 static const yytype_int16 yytable[] =
2889 71, 56, 58, 76, 81, 247, 172, 110, 387, 173,
2890 264, 253, 113, 153, 184, 290, 118, 346, 491, 456,
2891 458, 423, 94, 289, 366, 366, 123, 568, 428, 133,
2892 134, 569, 570, 135, 136, 137, 139, 144, 505, -74,
2893 173, 212, 213, 214, 214, 241, 242, 563, 499, 106,
2894 260, 499, 539, 580, 71, 56, 58, 76, 81, 250,
2895 57, 188, 509, 402, 106, 74, 479, 403, 75, 256,
2896 590, 107, 480, 230, 438, 231, 231, 579, 232, 232,
2897 597, 538, 471, 261, 139, 566, 116, 100, 101, 282,
2898 510, 478, 269, 270, 525, 274, 95, 100, 101, 577,
2899 102, 103, 139, 93, 407, 283, 416, 444, 144, 445,
2900 102, 103, 139, 104, 57, 588, 367, 477, 96, 74,
2901 290, 337, 75, 104, 108, 111, 379, 453, 122, 414,
2902 144, 339, 340, 100, 101, 139, 139, 432, 519, 185,
2903 99, 114, 185, 185, 102, 103, 102, 103, 185, 100,
2904 101, 120, 119, 124, 500, 501, 121, 104, 501, 104,
2905 476, 163, 102, 103, 596, 164, 71, 56, 58, 76,
2906 81, 502, 166, 288, 502, 104, 294, 295, 296, 297,
2907 298, 299, 300, 301, 302, 303, 304, 305, 306, 307,
2908 308, 309, 310, 311, 312, 313, 314, 315, 316, 317,
2909 467, 372, 490, 322, 323, 324, 325, 326, 327, 328,
2910 329, 330, 331, 332, 333, 334, 335, 336, 144, 338,
2911 188, 233, 105, 388, 389, 234, 57, 349, 457, 459,
2912 425, 74, 426, 237, 75, 249, 100, 101, 385, -111,
2913 71, 56, 356, 377, 524, 341, 144, 318, 381, 102,
2914 103, 320, 342, 251, 343, 424, 254, 549, 344, 255,
2915 319, 257, 104, 318, 259, 258, 139, 139, 262, 320,
2916 263, 265, 406, 100, 101, 266, 272, 275, 571, 362,
2917 175, 2, 175, -75, 548, 277, 102, 103, 373, 447,
2918 176, 450, 278, 417, 279, 13, 178, 15, 16, 104,
2919 18, 487, 20, 280, 175, 281, 434, 285, 286, 347,
2920 180, 260, 348, -117, 176, 25, 363, 274, 364, 177,
2921 178, 371, 382, 529, 30, 31, 32, 274, 376, 600,
2922 2, 412, 179, 378, 180, 125, 139, 126, 384, 144,
2923 127, 128, 129, 390, 13, 450, 15, 16, 391, 18,
2924 318, 20, 144, 71, 56, 356, 320, 100, 101, 413,
2925 386, 71, 56, 356, 25, 392, 115, 101, 394, 396,
2926 102, 103, 529, 30, 31, 32, 100, 101, 530, 102,
2927 103, 320, 400, 104, 401, 409, -335, 435, 489, 102,
2928 103, 528, 104, 420, 462, 422, 463, -337, -336, 464,
2929 373, 466, 104, 415, 366, 189, -241, 470, 448, 429,
2930 430, -158, -116, 474, 446, 431, 433, 438, 442, 443,
2931 452, 144, 71, 56, 356, 454, 488, 530, 455, 469,
2932 485, 468, 472, 190, 191, 192, 494, 193, 194, 195,
2933 196, 197, 198, 493, 473, 498, 425, 518, -338, 520,
2934 516, 521, 320, 526, 535, 211, 541, 212, 213, 214,
2935 -159, 215, 216, 217, 537, 542, 547, 559, 560, 561,
2936 574, 318, 220, 221, 222, 565, 223, 224, 578, 225,
2937 226, 227, 228, 229, -338, -338, 572, 583, 573, 230,
2938 536, 231, 586, 587, 232, 531, 581, 540, 593, 592,
2939 212, 213, 214, 582, 215, 216, 217, 594, 591, 276,
2940 595, 165, 598, 421, 599, 238, 212, 213, 214, -338,
2941 -338, 169, 225, 226, 227, 228, 229, 553, 551, 552,
2942 557, 558, 230, 531, 231, 496, 267, 232, 225, 226,
2943 227, 228, 229, 543, 544, 440, 522, 523, 230, 183,
2944 231, 585, 575, 232, 497, 553, 551, 552, 557, 558,
2945 517, 405, 117, 562, 492, 576, 475, 138, 0, 0,
2946 0, 0, 0, 553, 551, 552, 557, 558, -4, 380,
2947 0, 1, 2, 3, 4, 0, 5, 6, 7, 8,
2948 9, 10, 11, 0, 0, 12, 13, 14, 15, 16,
2949 17, 18, 19, 20, 0, 0, 22, 23, 0, 0,
2950 189, 0, 0, 0, 24, 0, 25, 26, 0, 27,
2951 0, 28, 0, 29, 0, 30, 31, 32, 0, 0,
2952 33, 34, 0, 35, 36, 0, 0, 0, -338, -338,
2953 -338, 37, 38, 39, 0, 0, 197, 198, 0, 40,
2954 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2955 0, 0, 212, 213, 214, 0, 215, 216, 217, 0,
2956 41, 42, 0, 0, 0, 0, 0, 0, 0, 43,
2957 0, 223, 224, 0, 225, 226, 227, 228, 229, 44,
2958 0, 0, 45, 0, 230, 0, 231, 46, 47, 232,
2959 0, 0, 48, 0, 49, 0, 50, 0, 51, 0,
2960 0, 0, -4, 1, 2, 3, 4, 0, 5, 6,
2961 7, 8, 9, 10, 11, 0, 0, 0, 13, 14,
2962 15, 16, 17, 18, 19, 20, 21, 0, 22, 23,
2963 145, 0, 146, 0, 0, 0, 24, 147, 25, 26,
2964 0, 27, 148, 28, 0, 29, 149, 30, 31, 32,
2965 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
2966 2, 0, 0, 37, 38, 39, 0, 150, 0, 0,
2967 0, 40, 0, 0, 13, 0, 15, 16, 0, 18,
2968 0, 20, 0, 0, 212, 213, 214, 0, 0, 0,
2969 0, 0, 41, 42, 25, 0, 0, 0, 0, 0,
2970 0, 151, 0, 30, 31, 32, 0, 0, 227, 228,
2971 229, 44, 0, 0, 45, 0, 230, 0, 231, 46,
2972 47, 232, 0, 0, 48, 0, 49, 0, 50, 0,
2973 51, 0, 0, 0, 152, 1, 2, 3, 4, 0,
2974 5, 6, 7, 8, 9, 10, 11, 0, 0, 0,
2975 13, 14, 15, 16, 17, 18, 19, 20, 21, 0,
2976 22, 23, 145, 0, 146, 0, 0, 0, 24, 147,
2977 25, 26, 0, 27, 148, 28, 0, 29, 149, 30,
2978 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2979 0, 0, 0, 0, 0, 37, 38, 39, 0, 150,
2980 0, 0, 0, 40, 0, 0, 0, 0, 0, 0,
2981 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2982 0, 0, 0, 0, 41, 42, 0, 0, 0, 0,
2983 0, 0, 0, 151, 0, 0, 0, 0, 0, 0,
2984 0, 0, 0, 44, 0, 0, 45, 0, 0, 0,
2985 0, 46, 47, 0, 0, 0, 48, 0, 49, 0,
2986 50, 0, 51, 0, 0, 0, 273, 1, 2, 3,
2987 4, 0, 5, 6, 7, 8, 9, 10, 11, 0,
2988 0, 0, 13, 14, 15, 16, 17, 18, 19, 20,
2989 21, 0, 22, 23, 145, 0, 146, 0, 0, 0,
2990 24, 147, 25, 26, 0, 27, 148, 28, 0, 29,
2991 149, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2992 36, 0, 0, 0, 0, 0, 0, 37, 38, 39,
2993 0, 150, 0, 0, 0, 40, 0, 0, 0, 0,
2994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2995 0, 0, 0, 0, 0, 0, 41, 42, 0, 0,
2996 0, 0, 0, 0, 0, 151, 0, 0, 0, 0,
2997 0, 0, 0, 0, 0, 44, 0, 0, 45, 0,
2998 0, 0, 0, 46, 47, 0, 0, 0, 48, 0,
2999 49, 0, 50, 0, 51, 0, 0, 0, 441, 1,
3000 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3001 11, 0, 0, 12, 13, 14, 15, 16, 17, 18,
3002 19, 20, 0, 0, 22, 23, 0, 0, 0, 0,
3003 0, 0, 24, 0, 25, 26, 0, 27, 0, 28,
3004 0, 29, 0, 30, 31, 32, 0, 0, 33, 34,
3005 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3006 38, 39, 0, 0, 0, 0, 0, 40, 0, 0,
3007 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3008 0, 0, 0, 0, 0, 0, 0, 0, 41, 42,
3009 0, 0, 0, 0, 0, 0, 0, 43, 0, 0,
3010 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
3011 45, 0, 0, 0, 0, 46, 47, 0, 0, 0,
3012 48, 0, 49, 0, 50, 0, 51, 0, 0, 0,
3013 -3, 1, 2, 3, 4, 0, 5, 6, 7, 8,
3014 9, 10, 11, 0, 0, 0, 13, 14, 15, 16,
3015 17, 18, 19, 20, 0, 0, 22, 23, 0, 0,
3016 0, 0, 0, 0, 24, 0, 25, 26, 0, 27,
3017 0, 28, 0, 29, 0, 30, 31, 32, 0, 0,
3018 33, 34, 0, 35, 36, 0, 0, 0, 0, 0,
3019 0, 37, 38, 39, 0, 0, 0, 0, 0, 40,
3020 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3021 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3022 41, 42, 0, 0, 0, 0, 0, 0, 0, 350,
3023 0, 0, 0, 0, 0, 0, 0, 0, 0, 44,
3024 0, 0, 45, 0, 0, 0, 0, 46, 47, 0,
3025 0, 0, 48, 0, 351, 0, 50, 0, 51, 0,
3026 0, 0, -15, 1, 2, 3, 4, 0, 5, 6,
3027 7, 8, 9, 10, 11, 0, 0, 0, 13, 14,
3028 15, 16, 17, 18, 19, 20, 0, 0, 22, 23,
3029 0, 0, 0, 0, 0, 0, 24, 0, 25, 26,
3030 0, 27, 0, 28, 0, 29, 0, 30, 31, 32,
3031 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3032 0, 0, 0, 37, 38, 39, 0, 0, 0, 0,
3033 0, 40, 0, 0, 0, 0, 0, 0, 0, 0,
3034 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3035 0, 0, 41, 42, 0, 0, 0, 0, 0, 0,
3036 0, 350, 0, 0, 0, 0, 0, 0, 0, 0,
3037 0, 44, 0, 0, 45, 0, 0, 0, 0, 46,
3038 47, 0, 0, 0, 48, 0, 351, 0, 50, 0,
3039 51, 0, 0, 0, -16, 1, 2, 3, 4, 0,
3040 5, 6, 7, 8, 9, 10, 11, 0, 0, 0,
3041 13, 14, 15, 16, 17, 18, 19, 20, 0, 0,
3042 22, 23, 0, 0, 0, 0, 0, 0, 24, 0,
3043 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
3044 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
3045 0, 0, 0, 0, 0, 37, 38, 39, 0, 0,
3046 0, 0, 0, 40, 0, 0, 0, 0, 0, 0,
3047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3048 0, 0, 0, 0, 41, 42, 0, 0, 0, 0,
3049 0, 0, 0, 550, 0, 0, 0, 0, 0, 0,
3050 0, 0, 0, 44, 0, 0, 45, 0, 0, 0,
3051 0, 46, 47, 0, 0, 0, 48, 0, 49, 0,
3052 50, 0, 51, 0, 0, 0, -149, 1, 2, 3,
3053 4, 0, 5, 6, 7, 8, 9, 10, 11, 0,
3054 0, 0, 13, 14, 15, 16, 17, 18, 19, 20,
3055 0, 0, 22, 23, 0, 0, 0, 0, 0, 0,
3056 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3057 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3058 36, 0, 0, 0, 0, 0, 0, 37, 38, 39,
3059 0, 0, 0, 0, 0, 40, 0, 0, 0, 0,
3060 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3061 0, 0, 0, 0, 0, 0, 41, 42, 0, 0,
3062 0, 0, 0, 0, 0, 550, 0, 0, 0, 0,
3063 0, 0, 0, 0, 0, 44, 0, 0, 45, 0,
3064 0, 0, 0, 46, 47, 0, 0, 0, 48, 0,
3065 49, 0, 50, 0, 51, 0, -3, 0, -150, 1,
3066 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3067 11, 0, 0, 12, 13, 14, 15, 16, 17, 18,
3068 19, 20, 0, 0, 22, 23, 0, 0, 0, 0,
3069 0, 0, 24, 0, 25, 26, 0, 27, 0, 28,
3070 0, 29, 0, 30, 31, 32, 0, 0, 33, 34,
3071 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3072 38, 39, 0, 0, 0, 0, 0, 40, 0, 0,
3073 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3074 0, 0, 0, 0, 0, 0, 0, 0, 41, 42,
3075 0, 0, 0, 0, 0, 0, 0, 43, 0, 0,
3076 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
3077 45, 0, 0, 0, 0, 46, 47, 0, 0, 0,
3078 48, 0, 49, 0, 50, 0, 51, 1, 2, 3,
3079 4, 0, 5, 6, 7, 8, 9, 10, 11, 0,
3080 -125, 0, 13, 14, 15, 16, 17, 18, 19, 20,
3081 21, 0, 22, 23, 145, 0, 146, 0, 0, 0,
3082 24, 147, 25, 26, 0, 27, 148, 28, 0, 29,
3083 149, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3084 36, 0, 0, 0, 0, 0, 0, 37, 38, 39,
3085 0, 150, 0, 0, 0, 40, 0, 0, 0, 0,
3086 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3087 0, 0, 0, 0, 0, 0, 41, 42, 0, 0,
3088 0, 0, 0, 0, 0, 151, 0, 0, 0, 0,
3089 0, 0, 0, 0, 0, 44, 0, 0, 45, 0,
3090 0, 0, 0, 46, 47, 0, 0, 0, 48, 0,
3091 49, 0, 50, 0, 51, 1, 2, 3, 4, 0,
3092 5, 6, 7, 8, 9, 10, 11, 0, 0, 0,
3093 13, 14, 15, 16, 17, 18, 19, 20, 21, 0,
3094 22, 23, 145, 0, 146, 0, 0, 0, 24, 147,
3095 25, 26, 0, 27, 148, 28, 0, 29, 149, 30,
3096 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
3097 0, 0, 0, 0, 0, 37, 38, 39, 0, 150,
3098 0, 0, 0, 40, 0, 0, 0, 0, 0, 0,
3099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3100 0, 0, 0, 0, 41, 42, 0, 0, 0, 0,
3101 0, 0, 0, 151, 0, 0, 0, 0, 0, 0,
3102 0, 0, 0, 44, 0, 0, 45, 0, 0, 0,
3103 0, 46, 47, 0, 0, 0, 48, 0, 49, 0,
3104 50, 167, 51, 3, 4, 0, 5, 6, 7, 0,
3105 0, 0, 0, 0, 0, 0, 0, 14, 0, 0,
3106 0, 0, 19, 0, 21, 0, 22, 23, 0, 0,
3107 146, 0, 0, 0, 24, 0, 0, 0, 0, 0,
3108 0, 28, 0, 29, 168, 0, 0, 0, 0, 0,
3109 0, 34, 0, 35, 36, 0, 0, 0, 0, 0,
3110 0, 0, 38, 0, 0, 0, 0, 0, 0, 40,
3111 0, 0, 0, 109, 0, 3, 4, 0, 5, 6,
3112 7, 0, 0, 0, 0, 0, 0, 0, 0, 14,
3113 41, 42, 0, 0, 19, 0, 21, 0, 22, 23,
3114 0, 0, 0, 0, 0, 0, 24, 0, 0, 44,
3115 0, 0, 45, 28, 0, 29, 0, 46, 47, 0,
3116 0, 0, 48, 34, 49, 35, 36, 0, 51, 0,
3117 109, 0, 3, 4, 38, 5, 6, 7, 0, 0,
3118 0, 40, 0, 0, 0, 0, 14, 0, 0, 0,
3119 0, 19, 0, 21, 0, 22, 23, 0, 0, 0,
3120 0, 0, 41, 42, 0, 0, 0, 0, 0, 0,
3121 0, 0, 29, 0, 0, 0, 0, 0, 0, 0,
3122 34, 44, 35, 36, 45, 0, 0, 0, 0, 46,
3123 47, 0, 0, 0, 48, 0, 49, 0, 40, 0,
3124 51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3125 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,
3126 42, 0, 0, 0, 0, 0, 189, 0, 0, 0,
3127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3129 0, 48, 0, 49, 190, 191, 192, 51, 193, 194,
3130 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
3131 205, 206, 207, 208, 209, 210, 211, 0, 212, 213,
3132 214, 0, 215, 216, 217, 0, 0, 0, 0, 0,
3133 218, 219, 0, 220, 221, 222, 189, 223, 224, 0,
3134 225, 226, 227, 228, 229, 0, 0, 0, 0, 0,
3135 230, 0, 231, 0, 0, 232, 0, 0, 0, 0,
3136 0, 418, 0, 0, 190, 191, 192, 0, 193, 194,
3137 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
3138 205, 206, 207, 208, 209, 210, 211, 0, 212, 213,
3139 214, 0, 215, 216, 217, 0, 0, 0, 0, 0,
3140 218, 219, 0, 220, 221, 222, 189, 223, 224, 0,
3141 225, 226, 227, 228, 229, 0, 0, 0, 0, 0,
3142 230, 0, 231, 0, 0, 232, 0, 0, 0, 0,
3143 0, 507, 0, 0, 190, 191, 192, 0, 193, 194,
3144 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
3145 205, 206, 207, 208, 209, 210, 211, 0, 212, 213,
3146 214, 0, 215, 216, 217, 0, 0, 0, 189, 0,
3147 218, 219, 408, 220, 221, 222, 0, 223, 224, 0,
3148 225, 226, 227, 228, 229, 0, 0, 0, 0, 0,
3149 230, 0, 231, 0, 0, 232, 190, 191, 192, 0,
3150 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3151 203, 204, 205, 206, 207, 208, 209, 210, 211, 0,
3152 212, 213, 214, 0, 215, 216, 217, 0, 0, 0,
3153 189, 0, 218, 219, 0, 220, 221, 222, 0, 223,
3154 224, 0, 225, 226, 227, 228, 229, 0, 0, 0,
3155 0, 0, 230, 0, 231, 410, 0, 232, 190, 191,
3156 192, 0, 193, 194, 195, 196, 197, 198, 199, 200,
3157 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
3158 211, 0, 212, 213, 214, 0, 215, 216, 217, 0,
3159 0, 0, 189, 0, 218, 219, 0, 220, 221, 222,
3160 0, 223, 224, 0, 225, 226, 227, 228, 229, 0,
3161 0, 0, 0, 0, 230, 0, 231, 465, 0, 232,
3162 190, 191, 192, 0, 193, 194, 195, 196, 197, 198,
3163 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
3164 209, 210, 211, 0, 212, 213, 214, 0, 215, 216,
3165 217, 0, 0, 0, 189, 0, 218, 219, 0, 220,
3166 221, 222, 0, 223, 224, 0, 225, 226, 227, 228,
3167 229, 0, 0, 0, 0, 0, 230, 0, 231, 506,
3168 0, 232, 190, 191, 192, 0, 193, 194, 195, 196,
3169 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
3170 207, 208, 209, 210, 211, 0, 212, 213, 214, 0,
3171 215, 216, 217, 0, 0, 0, 189, 0, 218, 219,
3172 0, 220, 221, 222, 0, 223, 224, 0, 225, 226,
3173 227, 228, 229, 0, 0, 0, 0, 0, 230, 0,
3174 231, 508, 0, 232, 190, 191, 192, 0, 193, 194,
3175 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
3176 205, 206, 207, 208, 209, 210, 211, 0, 212, 213,
3177 214, 0, 215, 216, 217, 0, 0, 0, 189, 0,
3178 218, 219, 0, 220, 221, 222, 0, 223, 224, 0,
3179 225, 226, 227, 228, 229, 0, 0, 0, 0, 0,
3180 230, 0, 231, 515, 0, 232, 190, 191, 192, 0,
3181 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3182 203, 204, 205, 206, 207, 208, 209, 210, 211, 0,
3183 212, 213, 214, 0, 215, 216, 217, 0, 0, 0,
3184 189, 0, 218, 219, 567, 220, 221, 222, 0, 223,
3185 224, 0, 225, 226, 227, 228, 229, 0, 0, 0,
3186 0, 0, 230, 0, 231, 0, 0, 232, 190, 191,
3187 192, 0, 193, 194, 195, 196, 197, 198, 199, 200,
3188 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
3189 211, 0, 212, 213, 214, 0, 215, 216, 217, 0,
3190 0, 0, 189, 0, 218, 219, 0, 220, 221, 222,
3191 0, 223, 224, 0, 225, 226, 227, 228, 229, 0,
3192 0, 0, 0, 0, 230, 0, 231, 0, 0, 232,
3193 190, 191, 192, 0, 193, 194, 195, 196, 197, 198,
3194 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
3195 209, 210, 211, 0, 212, 213, 214, 0, 215, 216,
3196 217, 0, 0, 0, 189, 0, 218, 219, 0, 220,
3197 221, 222, 0, 0, 224, 0, 225, 226, 227, 228,
3198 229, 0, 0, 0, 0, 0, 230, 0, 231, 0,
3199 0, 232, 190, 191, 192, 0, 193, 194, 195, 196,
3200 197, 198, 0, 0, 0, 0, 0, 0, 0, 0,
3201 0, 0, 0, 0, 0, 0, 212, 213, 214, 0,
3202 215, 216, 217, 0, 0, 0, 189, 0, 0, 0,
3203 0, 220, 221, 222, 0, 223, 224, 0, 225, 226,
3204 227, 228, 229, 0, 0, 0, 0, 0, 230, 0,
3205 231, 0, 0, 232, 190, 191, 192, 0, 193, 194,
3206 195, 196, 197, 198, 0, 0, 0, 0, 0, 0,
3207 0, 0, 0, 0, 0, 0, 0, 0, 212, 213,
3208 214, 0, 215, 216, 217, 0, 0, 0, 189, 0,
3209 0, 0, 0, 0, 221, 222, 0, 223, 224, 0,
3210 225, 226, 227, 228, 229, 0, 0, 0, 0, 0,
3211 230, 0, 231, 0, 0, 232, 190, 191, 192, 0,
3212 193, 194, 195, 196, 197, 198, 0, 0, 0, 0,
3213 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3214 212, 213, 214, 0, 215, 216, 217, 0, 0, 0,
3215 189, 0, 0, 0, 0, 0, 0, 222, 0, 223,
3216 224, 0, 225, 226, 227, 228, 229, 0, 0, 0,
3217 0, 0, 230, 0, 231, 0, 0, 232, 190, 191,
3218 192, 0, 193, 194, 195, 196, 197, 198, 0, 0,
3219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3220 0, 0, 212, 213, 214, 0, 215, 216, 217, 0,
3221 0, 0, 189, 0, 0, 0, 0, 0, 0, -338,
3222 0, 223, 224, 0, 225, 226, 227, 228, 229, 0,
3223 0, 0, 0, 0, 230, 0, 231, 0, 0, 232,
3224 190, 191, 192, 0, -338, -338, -338, -338, 197, 198,
3225 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3226 0, 0, 0, 0, 212, 213, 214, 0, 215, 216,
3227 217, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3228 0, 0, 0, 223, 224, 0, 225, 226, 227, 228,
3229 229, 0, 0, 0, 0, 0, 230, 0, 231, 0,
3233 static const yytype_int16 yycheck[] =
3235 0, 0, 0, 0, 0, 108, 60, 19, 277, 67,
3236 142, 120, 24, 50, 3, 187, 28, 232, 446, 5,
3237 5, 361, 50, 3, 3, 3, 38, 541, 367, 41,
3238 42, 545, 546, 45, 46, 47, 48, 49, 461, 69,
3239 98, 92, 93, 94, 94, 128, 129, 535, 5, 12,
3240 102, 5, 505, 567, 54, 54, 54, 54, 54, 114,
3241 0, 102, 34, 112, 27, 0, 27, 116, 0, 124,
3242 584, 12, 33, 124, 104, 126, 126, 565, 129, 129,
3243 594, 504, 422, 135, 96, 538, 27, 3, 4, 35,
3244 62, 430, 147, 148, 135, 153, 124, 3, 4, 563,
3245 16, 17, 114, 91, 319, 51, 347, 3, 120, 5,
3246 16, 17, 124, 29, 54, 579, 95, 95, 124, 54,
3247 292, 230, 54, 29, 16, 3, 258, 396, 16, 344,
3248 142, 3, 4, 3, 4, 147, 148, 378, 477, 128,
3249 124, 124, 128, 128, 16, 17, 16, 17, 128, 3,
3250 4, 124, 128, 124, 111, 112, 129, 29, 112, 29,
3251 429, 3, 16, 17, 592, 0, 166, 166, 166, 166,
3252 166, 128, 128, 185, 128, 29, 188, 189, 190, 191,
3253 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
3254 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
3255 415, 117, 443, 215, 216, 217, 218, 219, 220, 221,
3256 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
3257 102, 3, 128, 278, 279, 124, 166, 239, 400, 401,
3258 104, 166, 106, 12, 166, 124, 3, 4, 275, 129,
3259 240, 240, 240, 255, 485, 117, 258, 117, 260, 16,
3260 17, 214, 124, 129, 126, 364, 3, 526, 130, 104,
3261 130, 134, 29, 117, 102, 106, 278, 279, 127, 232,
3262 102, 3, 126, 3, 4, 3, 3, 128, 547, 242,
3263 16, 4, 16, 69, 525, 3, 16, 17, 251, 392,
3264 26, 394, 101, 348, 69, 18, 32, 20, 21, 29,
3265 23, 433, 25, 101, 16, 3, 36, 3, 3, 135,
3266 46, 102, 124, 129, 26, 38, 129, 375, 124, 31,
3267 32, 135, 106, 46, 47, 48, 49, 385, 135, 598,
3268 4, 343, 44, 135, 46, 3, 348, 5, 102, 351,
3269 8, 9, 10, 104, 18, 448, 20, 21, 3, 23,
3270 117, 25, 364, 353, 353, 353, 319, 3, 4, 126,
3271 134, 361, 361, 361, 38, 54, 3, 4, 54, 3,
3272 16, 17, 46, 47, 48, 49, 3, 4, 101, 16,
3273 17, 344, 104, 29, 104, 135, 91, 117, 442, 16,
3274 17, 494, 29, 134, 406, 128, 408, 91, 91, 411,
3275 363, 413, 29, 91, 3, 40, 127, 419, 15, 135,
3276 102, 134, 129, 425, 124, 134, 106, 104, 101, 135,
3277 128, 433, 422, 422, 422, 102, 438, 101, 134, 128,
3278 66, 135, 134, 68, 69, 70, 102, 72, 73, 74,
3279 75, 76, 77, 128, 135, 112, 104, 128, 40, 128,
3280 134, 124, 415, 135, 116, 90, 106, 92, 93, 94,
3281 134, 96, 97, 98, 111, 134, 3, 3, 26, 134,
3282 134, 117, 107, 108, 109, 116, 111, 112, 134, 114,
3283 115, 116, 117, 118, 76, 77, 128, 135, 128, 124,
3284 502, 126, 3, 112, 129, 495, 134, 509, 112, 124,
3285 92, 93, 94, 134, 96, 97, 98, 128, 134, 166,
3286 134, 54, 135, 353, 134, 98, 92, 93, 94, 111,
3287 112, 60, 114, 115, 116, 117, 118, 527, 527, 527,
3288 527, 527, 124, 533, 126, 453, 146, 129, 114, 115,
3289 116, 117, 118, 512, 512, 384, 483, 483, 124, 72,
3290 126, 573, 555, 129, 454, 555, 555, 555, 555, 555,
3291 475, 292, 27, 533, 448, 560, 426, 48, -1, -1,
3292 -1, -1, -1, 573, 573, 573, 573, 573, 0, 259,
3293 -1, 3, 4, 5, 6, -1, 8, 9, 10, 11,
3294 12, 13, 14, -1, -1, 17, 18, 19, 20, 21,
3295 22, 23, 24, 25, -1, -1, 28, 29, -1, -1,
3296 40, -1, -1, -1, 36, -1, 38, 39, -1, 41,
3297 -1, 43, -1, 45, -1, 47, 48, 49, -1, -1,
3298 52, 53, -1, 55, 56, -1, -1, -1, 68, 69,
3299 70, 63, 64, 65, -1, -1, 76, 77, -1, 71,
3300 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3301 -1, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3302 92, 93, -1, -1, -1, -1, -1, -1, -1, 101,
3303 -1, 111, 112, -1, 114, 115, 116, 117, 118, 111,
3304 -1, -1, 114, -1, 124, -1, 126, 119, 120, 129,
3305 -1, -1, 124, -1, 126, -1, 128, -1, 130, -1,
3306 -1, -1, 134, 3, 4, 5, 6, -1, 8, 9,
3307 10, 11, 12, 13, 14, -1, -1, -1, 18, 19,
3308 20, 21, 22, 23, 24, 25, 26, -1, 28, 29,
3309 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3310 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3311 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3312 4, -1, -1, 63, 64, 65, -1, 67, -1, -1,
3313 -1, 71, -1, -1, 18, -1, 20, 21, -1, 23,
3314 -1, 25, -1, -1, 92, 93, 94, -1, -1, -1,
3315 -1, -1, 92, 93, 38, -1, -1, -1, -1, -1,
3316 -1, 101, -1, 47, 48, 49, -1, -1, 116, 117,
3317 118, 111, -1, -1, 114, -1, 124, -1, 126, 119,
3318 120, 129, -1, -1, 124, -1, 126, -1, 128, -1,
3319 130, -1, -1, -1, 134, 3, 4, 5, 6, -1,
3320 8, 9, 10, 11, 12, 13, 14, -1, -1, -1,
3321 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
3322 28, 29, 30, -1, 32, -1, -1, -1, 36, 37,
3323 38, 39, -1, 41, 42, 43, -1, 45, 46, 47,
3324 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3325 -1, -1, -1, -1, -1, 63, 64, 65, -1, 67,
3326 -1, -1, -1, 71, -1, -1, -1, -1, -1, -1,
3327 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3328 -1, -1, -1, -1, 92, 93, -1, -1, -1, -1,
3329 -1, -1, -1, 101, -1, -1, -1, -1, -1, -1,
3330 -1, -1, -1, 111, -1, -1, 114, -1, -1, -1,
3331 -1, 119, 120, -1, -1, -1, 124, -1, 126, -1,
3332 128, -1, 130, -1, -1, -1, 134, 3, 4, 5,
3333 6, -1, 8, 9, 10, 11, 12, 13, 14, -1,
3334 -1, -1, 18, 19, 20, 21, 22, 23, 24, 25,
3335 26, -1, 28, 29, 30, -1, 32, -1, -1, -1,
3336 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3337 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3338 56, -1, -1, -1, -1, -1, -1, 63, 64, 65,
3339 -1, 67, -1, -1, -1, 71, -1, -1, -1, -1,
3340 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3341 -1, -1, -1, -1, -1, -1, 92, 93, -1, -1,
3342 -1, -1, -1, -1, -1, 101, -1, -1, -1, -1,
3343 -1, -1, -1, -1, -1, 111, -1, -1, 114, -1,
3344 -1, -1, -1, 119, 120, -1, -1, -1, 124, -1,
3345 126, -1, 128, -1, 130, -1, -1, -1, 134, 3,
3346 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3347 14, -1, -1, 17, 18, 19, 20, 21, 22, 23,
3348 24, 25, -1, -1, 28, 29, -1, -1, -1, -1,
3349 -1, -1, 36, -1, 38, 39, -1, 41, -1, 43,
3350 -1, 45, -1, 47, 48, 49, -1, -1, 52, 53,
3351 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3352 64, 65, -1, -1, -1, -1, -1, 71, -1, -1,
3353 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3354 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3355 -1, -1, -1, -1, -1, -1, -1, 101, -1, -1,
3356 -1, -1, -1, -1, -1, -1, -1, 111, -1, -1,
3357 114, -1, -1, -1, -1, 119, 120, -1, -1, -1,
3358 124, -1, 126, -1, 128, -1, 130, -1, -1, -1,
3359 134, 3, 4, 5, 6, -1, 8, 9, 10, 11,
3360 12, 13, 14, -1, -1, -1, 18, 19, 20, 21,
3361 22, 23, 24, 25, -1, -1, 28, 29, -1, -1,
3362 -1, -1, -1, -1, 36, -1, 38, 39, -1, 41,
3363 -1, 43, -1, 45, -1, 47, 48, 49, -1, -1,
3364 52, 53, -1, 55, 56, -1, -1, -1, -1, -1,
3365 -1, 63, 64, 65, -1, -1, -1, -1, -1, 71,
3366 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3367 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3368 92, 93, -1, -1, -1, -1, -1, -1, -1, 101,
3369 -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
3370 -1, -1, 114, -1, -1, -1, -1, 119, 120, -1,
3371 -1, -1, 124, -1, 126, -1, 128, -1, 130, -1,
3372 -1, -1, 134, 3, 4, 5, 6, -1, 8, 9,
3373 10, 11, 12, 13, 14, -1, -1, -1, 18, 19,
3374 20, 21, 22, 23, 24, 25, -1, -1, 28, 29,
3375 -1, -1, -1, -1, -1, -1, 36, -1, 38, 39,
3376 -1, 41, -1, 43, -1, 45, -1, 47, 48, 49,
3377 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3378 -1, -1, -1, 63, 64, 65, -1, -1, -1, -1,
3379 -1, 71, -1, -1, -1, -1, -1, -1, -1, -1,
3380 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3381 -1, -1, 92, 93, -1, -1, -1, -1, -1, -1,
3382 -1, 101, -1, -1, -1, -1, -1, -1, -1, -1,
3383 -1, 111, -1, -1, 114, -1, -1, -1, -1, 119,
3384 120, -1, -1, -1, 124, -1, 126, -1, 128, -1,
3385 130, -1, -1, -1, 134, 3, 4, 5, 6, -1,
3386 8, 9, 10, 11, 12, 13, 14, -1, -1, -1,
3387 18, 19, 20, 21, 22, 23, 24, 25, -1, -1,
3388 28, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3389 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3390 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3391 -1, -1, -1, -1, -1, 63, 64, 65, -1, -1,
3392 -1, -1, -1, 71, -1, -1, -1, -1, -1, -1,
3393 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3394 -1, -1, -1, -1, 92, 93, -1, -1, -1, -1,
3395 -1, -1, -1, 101, -1, -1, -1, -1, -1, -1,
3396 -1, -1, -1, 111, -1, -1, 114, -1, -1, -1,
3397 -1, 119, 120, -1, -1, -1, 124, -1, 126, -1,
3398 128, -1, 130, -1, -1, -1, 134, 3, 4, 5,
3399 6, -1, 8, 9, 10, 11, 12, 13, 14, -1,
3400 -1, -1, 18, 19, 20, 21, 22, 23, 24, 25,
3401 -1, -1, 28, 29, -1, -1, -1, -1, -1, -1,
3402 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3403 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3404 56, -1, -1, -1, -1, -1, -1, 63, 64, 65,
3405 -1, -1, -1, -1, -1, 71, -1, -1, -1, -1,
3406 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3407 -1, -1, -1, -1, -1, -1, 92, 93, -1, -1,
3408 -1, -1, -1, -1, -1, 101, -1, -1, -1, -1,
3409 -1, -1, -1, -1, -1, 111, -1, -1, 114, -1,
3410 -1, -1, -1, 119, 120, -1, -1, -1, 124, -1,
3411 126, -1, 128, -1, 130, -1, 0, -1, 134, 3,
3412 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3413 14, -1, -1, 17, 18, 19, 20, 21, 22, 23,
3414 24, 25, -1, -1, 28, 29, -1, -1, -1, -1,
3415 -1, -1, 36, -1, 38, 39, -1, 41, -1, 43,
3416 -1, 45, -1, 47, 48, 49, -1, -1, 52, 53,
3417 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3418 64, 65, -1, -1, -1, -1, -1, 71, -1, -1,
3419 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3420 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3421 -1, -1, -1, -1, -1, -1, -1, 101, -1, -1,
3422 -1, -1, -1, -1, -1, -1, -1, 111, -1, -1,
3423 114, -1, -1, -1, -1, 119, 120, -1, -1, -1,
3424 124, -1, 126, -1, 128, -1, 130, 3, 4, 5,
3425 6, -1, 8, 9, 10, 11, 12, 13, 14, -1,
3426 16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
3427 26, -1, 28, 29, 30, -1, 32, -1, -1, -1,
3428 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3429 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3430 56, -1, -1, -1, -1, -1, -1, 63, 64, 65,
3431 -1, 67, -1, -1, -1, 71, -1, -1, -1, -1,
3432 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3433 -1, -1, -1, -1, -1, -1, 92, 93, -1, -1,
3434 -1, -1, -1, -1, -1, 101, -1, -1, -1, -1,
3435 -1, -1, -1, -1, -1, 111, -1, -1, 114, -1,
3436 -1, -1, -1, 119, 120, -1, -1, -1, 124, -1,
3437 126, -1, 128, -1, 130, 3, 4, 5, 6, -1,
3438 8, 9, 10, 11, 12, 13, 14, -1, -1, -1,
3439 18, 19, 20, 21, 22, 23, 24, 25, 26, -1,
3440 28, 29, 30, -1, 32, -1, -1, -1, 36, 37,
3441 38, 39, -1, 41, 42, 43, -1, 45, 46, 47,
3442 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3443 -1, -1, -1, -1, -1, 63, 64, 65, -1, 67,
3444 -1, -1, -1, 71, -1, -1, -1, -1, -1, -1,
3445 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3446 -1, -1, -1, -1, 92, 93, -1, -1, -1, -1,
3447 -1, -1, -1, 101, -1, -1, -1, -1, -1, -1,
3448 -1, -1, -1, 111, -1, -1, 114, -1, -1, -1,
3449 -1, 119, 120, -1, -1, -1, 124, -1, 126, -1,
3450 128, 3, 130, 5, 6, -1, 8, 9, 10, -1,
3451 -1, -1, -1, -1, -1, -1, -1, 19, -1, -1,
3452 -1, -1, 24, -1, 26, -1, 28, 29, -1, -1,
3453 32, -1, -1, -1, 36, -1, -1, -1, -1, -1,
3454 -1, 43, -1, 45, 46, -1, -1, -1, -1, -1,
3455 -1, 53, -1, 55, 56, -1, -1, -1, -1, -1,
3456 -1, -1, 64, -1, -1, -1, -1, -1, -1, 71,
3457 -1, -1, -1, 3, -1, 5, 6, -1, 8, 9,
3458 10, -1, -1, -1, -1, -1, -1, -1, -1, 19,
3459 92, 93, -1, -1, 24, -1, 26, -1, 28, 29,
3460 -1, -1, -1, -1, -1, -1, 36, -1, -1, 111,
3461 -1, -1, 114, 43, -1, 45, -1, 119, 120, -1,
3462 -1, -1, 124, 53, 126, 55, 56, -1, 130, -1,
3463 3, -1, 5, 6, 64, 8, 9, 10, -1, -1,
3464 -1, 71, -1, -1, -1, -1, 19, -1, -1, -1,
3465 -1, 24, -1, 26, -1, 28, 29, -1, -1, -1,
3466 -1, -1, 92, 93, -1, -1, -1, -1, -1, -1,
3467 -1, -1, 45, -1, -1, -1, -1, -1, -1, -1,
3468 53, 111, 55, 56, 114, -1, -1, -1, -1, 119,
3469 120, -1, -1, -1, 124, -1, 126, -1, 71, -1,
3470 130, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3471 -1, -1, -1, -1, -1, -1, -1, -1, -1, 92,
3472 93, -1, -1, -1, -1, -1, 40, -1, -1, -1,
3473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3475 -1, 124, -1, 126, 68, 69, 70, 130, 72, 73,
3476 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3477 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3478 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3479 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3480 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3481 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3482 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3483 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3484 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3485 94, -1, 96, 97, 98, -1, -1, -1, -1, -1,
3486 104, 105, -1, 107, 108, 109, 40, 111, 112, -1,
3487 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3488 124, -1, 126, -1, -1, 129, -1, -1, -1, -1,
3489 -1, 135, -1, -1, 68, 69, 70, -1, 72, 73,
3490 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3491 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3492 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3493 104, 105, 106, 107, 108, 109, -1, 111, 112, -1,
3494 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3495 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3496 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3497 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3498 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3499 40, -1, 104, 105, -1, 107, 108, 109, -1, 111,
3500 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3501 -1, -1, 124, -1, 126, 127, -1, 129, 68, 69,
3502 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3503 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3504 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3505 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3506 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3507 -1, -1, -1, -1, 124, -1, 126, 127, -1, 129,
3508 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3509 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3510 88, 89, 90, -1, 92, 93, 94, -1, 96, 97,
3511 98, -1, -1, -1, 40, -1, 104, 105, -1, 107,
3512 108, 109, -1, 111, 112, -1, 114, 115, 116, 117,
3513 118, -1, -1, -1, -1, -1, 124, -1, 126, 127,
3514 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3515 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3516 86, 87, 88, 89, 90, -1, 92, 93, 94, -1,
3517 96, 97, 98, -1, -1, -1, 40, -1, 104, 105,
3518 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3519 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3520 126, 127, -1, 129, 68, 69, 70, -1, 72, 73,
3521 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3522 84, 85, 86, 87, 88, 89, 90, -1, 92, 93,
3523 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3524 104, 105, -1, 107, 108, 109, -1, 111, 112, -1,
3525 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3526 124, -1, 126, 127, -1, 129, 68, 69, 70, -1,
3527 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3528 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
3529 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3530 40, -1, 104, 105, 106, 107, 108, 109, -1, 111,
3531 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3532 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3533 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
3534 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
3535 90, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3536 -1, -1, 40, -1, 104, 105, -1, 107, 108, 109,
3537 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3538 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3539 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3540 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3541 88, 89, 90, -1, 92, 93, 94, -1, 96, 97,
3542 98, -1, -1, -1, 40, -1, 104, 105, -1, 107,
3543 108, 109, -1, -1, 112, -1, 114, 115, 116, 117,
3544 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3545 -1, 129, 68, 69, 70, -1, 72, 73, 74, 75,
3546 76, 77, -1, -1, -1, -1, -1, -1, -1, -1,
3547 -1, -1, -1, -1, -1, -1, 92, 93, 94, -1,
3548 96, 97, 98, -1, -1, -1, 40, -1, -1, -1,
3549 -1, 107, 108, 109, -1, 111, 112, -1, 114, 115,
3550 116, 117, 118, -1, -1, -1, -1, -1, 124, -1,
3551 126, -1, -1, 129, 68, 69, 70, -1, 72, 73,
3552 74, 75, 76, 77, -1, -1, -1, -1, -1, -1,
3553 -1, -1, -1, -1, -1, -1, -1, -1, 92, 93,
3554 94, -1, 96, 97, 98, -1, -1, -1, 40, -1,
3555 -1, -1, -1, -1, 108, 109, -1, 111, 112, -1,
3556 114, 115, 116, 117, 118, -1, -1, -1, -1, -1,
3557 124, -1, 126, -1, -1, 129, 68, 69, 70, -1,
3558 72, 73, 74, 75, 76, 77, -1, -1, -1, -1,
3559 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3560 92, 93, 94, -1, 96, 97, 98, -1, -1, -1,
3561 40, -1, -1, -1, -1, -1, -1, 109, -1, 111,
3562 112, -1, 114, 115, 116, 117, 118, -1, -1, -1,
3563 -1, -1, 124, -1, 126, -1, -1, 129, 68, 69,
3564 70, -1, 72, 73, 74, 75, 76, 77, -1, -1,
3565 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3566 -1, -1, 92, 93, 94, -1, 96, 97, 98, -1,
3567 -1, -1, 40, -1, -1, -1, -1, -1, -1, 109,
3568 -1, 111, 112, -1, 114, 115, 116, 117, 118, -1,
3569 -1, -1, -1, -1, 124, -1, 126, -1, -1, 129,
3570 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
3571 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3572 -1, -1, -1, -1, 92, 93, 94, -1, 96, 97,
3573 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3574 -1, -1, -1, 111, 112, -1, 114, 115, 116, 117,
3575 118, -1, -1, -1, -1, -1, 124, -1, 126, -1,
3579 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3580 symbol of state STATE-NUM. */
3581 static const yytype_uint16 yystos[] =
3583 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3584 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3585 25, 26, 28, 29, 36, 38, 39, 41, 43, 45,
3586 47, 48, 49, 52, 53, 55, 56, 63, 64, 65,
3587 71, 92, 93, 101, 111, 114, 119, 120, 124, 126,
3588 128, 130, 137, 138, 139, 140, 146, 149, 151, 159,
3589 162, 163, 164, 165, 166, 173, 181, 184, 185, 188,
3590 191, 192, 193, 194, 198, 200, 209, 214, 215, 216,
3591 227, 234, 237, 250, 251, 252, 257, 261, 265, 266,
3592 268, 269, 270, 91, 50, 124, 124, 156, 157, 124,
3593 3, 4, 16, 17, 29, 128, 186, 187, 16, 3,
3594 261, 3, 236, 261, 124, 3, 187, 240, 261, 128,
3595 124, 129, 16, 261, 124, 3, 5, 8, 9, 10,
3596 258, 259, 260, 261, 261, 261, 261, 261, 256, 261,
3597 246, 247, 248, 254, 261, 30, 32, 37, 42, 46,
3598 67, 101, 134, 145, 146, 147, 151, 153, 167, 168,
3599 183, 192, 253, 3, 0, 140, 128, 3, 46, 153,
3600 160, 161, 257, 147, 148, 16, 26, 31, 32, 44,
3601 46, 208, 267, 194, 3, 128, 221, 225, 102, 40,
3602 68, 69, 70, 72, 73, 74, 75, 76, 77, 78,
3603 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3604 89, 90, 92, 93, 94, 96, 97, 98, 104, 105,
3605 107, 108, 109, 111, 112, 114, 115, 116, 117, 118,
3606 124, 126, 129, 3, 124, 255, 256, 12, 148, 174,
3607 190, 128, 129, 186, 187, 239, 240, 241, 249, 124,
3608 255, 129, 182, 246, 3, 104, 255, 134, 106, 102,
3609 102, 135, 127, 102, 254, 3, 3, 154, 155, 255,
3610 255, 154, 3, 134, 147, 128, 138, 3, 101, 69,
3611 101, 3, 35, 51, 233, 3, 3, 210, 261, 3,
3612 221, 226, 228, 229, 261, 261, 261, 261, 261, 261,
3613 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
3614 261, 261, 261, 261, 261, 261, 261, 261, 117, 130,
3615 186, 264, 261, 261, 261, 261, 261, 261, 261, 261,
3616 261, 261, 261, 261, 261, 261, 261, 246, 261, 3,
3617 4, 117, 124, 126, 130, 263, 264, 135, 124, 261,
3618 101, 126, 141, 142, 143, 149, 151, 198, 200, 209,
3619 234, 189, 186, 129, 124, 245, 3, 95, 230, 231,
3620 232, 135, 117, 186, 144, 145, 135, 261, 135, 254,
3621 259, 261, 106, 244, 102, 145, 134, 244, 255, 255,
3622 104, 3, 54, 195, 54, 196, 3, 211, 212, 222,
3623 104, 104, 112, 116, 217, 229, 126, 264, 106, 135,
3624 127, 262, 261, 126, 264, 91, 156, 255, 135, 150,
3625 134, 143, 128, 141, 246, 104, 106, 213, 232, 135,
3626 102, 134, 156, 106, 36, 117, 241, 243, 104, 152,
3627 155, 134, 101, 135, 3, 5, 124, 241, 15, 197,
3628 241, 242, 128, 244, 102, 134, 5, 221, 5, 221,
3629 218, 223, 261, 261, 261, 127, 261, 264, 135, 128,
3630 261, 141, 134, 135, 261, 243, 244, 95, 232, 27,
3631 33, 175, 177, 179, 180, 66, 158, 254, 261, 257,
3632 156, 230, 242, 128, 102, 201, 152, 212, 112, 5,
3633 111, 112, 128, 219, 224, 227, 127, 135, 127, 34,
3634 62, 169, 170, 171, 172, 127, 134, 213, 128, 232,
3635 128, 124, 175, 177, 156, 135, 135, 199, 241, 46,
3636 101, 192, 205, 206, 207, 116, 261, 111, 227, 223,
3637 261, 106, 134, 171, 172, 238, 178, 3, 156, 244,
3638 101, 146, 151, 192, 202, 203, 204, 209, 234, 3,
3639 26, 134, 207, 225, 220, 116, 223, 106, 144, 144,
3640 144, 244, 128, 128, 134, 204, 233, 218, 134, 225,
3641 144, 134, 134, 135, 235, 202, 3, 112, 218, 176,
3642 144, 134, 124, 112, 128, 134, 230, 144, 135, 134,
3646 #define yyerrok (yyerrstatus = 0)
3647 #define yyclearin (yychar = YYEMPTY)
3648 #define YYEMPTY (-2)
3651 #define YYACCEPT goto yyacceptlab
3652 #define YYABORT goto yyabortlab
3653 #define YYERROR goto yyerrorlab
3656 /* Like YYERROR except do call yyerror. This remains here temporarily
3657 to ease the transition to the new meaning of YYERROR, for GCC.
3658 Once GCC version 2 has supplanted version 1, this can go. */
3660 #define YYFAIL goto yyerrlab
3662 #define YYRECOVERING() (!!yyerrstatus)
3664 #define YYBACKUP(Token, Value) \
3666 if (yychar == YYEMPTY && yylen == 1) \
3670 yytoken = YYTRANSLATE (yychar); \
3676 yyerror (YY_("syntax error: cannot back up")); \
3683 #define YYERRCODE 256
3686 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3687 If N is 0, then set CURRENT to the empty location which ends
3688 the previous symbol: RHS[0] (always defined). */
3690 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3691 #ifndef YYLLOC_DEFAULT
3692 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3696 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3697 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3698 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3699 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3703 (Current).first_line = (Current).last_line = \
3704 YYRHSLOC (Rhs, 0).last_line; \
3705 (Current).first_column = (Current).last_column = \
3706 YYRHSLOC (Rhs, 0).last_column; \
3712 /* YY_LOCATION_PRINT -- Print the location on the stream.
3713 This macro was not mandated originally: define only if we know
3714 we won't break user code: when these are the locations we know. */
3716 #ifndef YY_LOCATION_PRINT
3717 # if YYLTYPE_IS_TRIVIAL
3718 # define YY_LOCATION_PRINT(File, Loc) \
3719 fprintf (File, "%d.%d-%d.%d", \
3720 (Loc).first_line, (Loc).first_column, \
3721 (Loc).last_line, (Loc).last_column)
3723 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3728 /* YYLEX -- calling `yylex' with the right arguments. */
3731 # define YYLEX yylex (YYLEX_PARAM)
3733 # define YYLEX yylex ()
3736 /* Enable debugging if requested. */
3740 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3741 # define YYFPRINTF fprintf
3744 # define YYDPRINTF(Args) \
3750 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3754 YYFPRINTF (stderr, "%s ", Title); \
3755 yy_symbol_print (stderr, \
3757 YYFPRINTF (stderr, "\n"); \
3762 /*--------------------------------.
3763 | Print this symbol on YYOUTPUT. |
3764 `--------------------------------*/
3767 #if (defined __STDC__ || defined __C99__FUNC__ \
3768 || defined __cplusplus || defined _MSC_VER)
3770 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3773 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3776 YYSTYPE const * const yyvaluep;
3782 if (yytype < YYNTOKENS)
3783 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3795 /*--------------------------------.
3796 | Print this symbol on YYOUTPUT. |
3797 `--------------------------------*/
3799 #if (defined __STDC__ || defined __C99__FUNC__ \
3800 || defined __cplusplus || defined _MSC_VER)
3802 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3805 yy_symbol_print (yyoutput, yytype, yyvaluep)
3808 YYSTYPE const * const yyvaluep;
3811 if (yytype < YYNTOKENS)
3812 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3814 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3816 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3817 YYFPRINTF (yyoutput, ")");
3820 /*------------------------------------------------------------------.
3821 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3823 `------------------------------------------------------------------*/
3825 #if (defined __STDC__ || defined __C99__FUNC__ \
3826 || defined __cplusplus || defined _MSC_VER)
3828 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3831 yy_stack_print (yybottom, yytop)
3832 yytype_int16 *yybottom;
3833 yytype_int16 *yytop;
3836 YYFPRINTF (stderr, "Stack now");
3837 for (; yybottom <= yytop; yybottom++)
3839 int yybot = *yybottom;
3840 YYFPRINTF (stderr, " %d", yybot);
3842 YYFPRINTF (stderr, "\n");
3845 # define YY_STACK_PRINT(Bottom, Top) \
3848 yy_stack_print ((Bottom), (Top)); \
3852 /*------------------------------------------------.
3853 | Report that the YYRULE is going to be reduced. |
3854 `------------------------------------------------*/
3856 #if (defined __STDC__ || defined __C99__FUNC__ \
3857 || defined __cplusplus || defined _MSC_VER)
3859 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3862 yy_reduce_print (yyvsp, yyrule)
3867 int yynrhs = yyr2[yyrule];
3869 unsigned long int yylno = yyrline[yyrule];
3870 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3872 /* The symbols being reduced. */
3873 for (yyi = 0; yyi < yynrhs; yyi++)
3875 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3876 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3877 &(yyvsp[(yyi + 1) - (yynrhs)])
3879 YYFPRINTF (stderr, "\n");
3883 # define YY_REDUCE_PRINT(Rule) \
3886 yy_reduce_print (yyvsp, Rule); \
3889 /* Nonzero means print parse trace. It is left uninitialized so that
3890 multiple parsers can coexist. */
3892 #else /* !YYDEBUG */
3893 # define YYDPRINTF(Args)
3894 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3895 # define YY_STACK_PRINT(Bottom, Top)
3896 # define YY_REDUCE_PRINT(Rule)
3897 #endif /* !YYDEBUG */
3900 /* YYINITDEPTH -- initial size of the parser's stacks. */
3902 # define YYINITDEPTH 200
3905 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3906 if the built-in stack extension method is used).
3908 Do not make this value too large; the results are undefined if
3909 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3910 evaluated with infinite-precision integer arithmetic. */
3913 # define YYMAXDEPTH 10000
3921 # if defined __GLIBC__ && defined _STRING_H
3922 # define yystrlen strlen
3924 /* Return the length of YYSTR. */
3925 #if (defined __STDC__ || defined __C99__FUNC__ \
3926 || defined __cplusplus || defined _MSC_VER)
3928 yystrlen (const char *yystr)
3936 for (yylen = 0; yystr[yylen]; yylen++)
3944 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3945 # define yystpcpy stpcpy
3947 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3949 #if (defined __STDC__ || defined __C99__FUNC__ \
3950 || defined __cplusplus || defined _MSC_VER)
3952 yystpcpy (char *yydest, const char *yysrc)
3955 yystpcpy (yydest, yysrc)
3961 const char *yys = yysrc;
3963 while ((*yyd++ = *yys++) != '\0')
3972 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3973 quotes and backslashes, so that it's suitable for yyerror. The
3974 heuristic is that double-quoting is unnecessary unless the string
3975 contains an apostrophe, a comma, or backslash (other than
3976 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3977 null, do not copy; instead, return the length of what the result
3980 yytnamerr (char *yyres, const char *yystr)
3985 char const *yyp = yystr;
3992 goto do_not_strip_quotes;
3996 goto do_not_strip_quotes;
4009 do_not_strip_quotes: ;
4013 return yystrlen (yystr);
4015 return yystpcpy (yyres, yystr) - yyres;
4019 /* Copy into YYRESULT an error message about the unexpected token
4020 YYCHAR while in state YYSTATE. Return the number of bytes copied,
4021 including the terminating null byte. If YYRESULT is null, do not
4022 copy anything; just return the number of bytes that would be
4023 copied. As a special case, return 0 if an ordinary "syntax error"
4024 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
4025 size calculation. */
4027 yysyntax_error (char *yyresult, int yystate, int yychar)
4029 int yyn = yypact[yystate];
4031 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
4035 int yytype = YYTRANSLATE (yychar);
4036 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
4037 YYSIZE_T yysize = yysize0;
4039 int yysize_overflow = 0;
4040 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
4041 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
4045 /* This is so xgettext sees the translatable formats that are
4046 constructed on the fly. */
4047 YY_("syntax error, unexpected %s");
4048 YY_("syntax error, unexpected %s, expecting %s");
4049 YY_("syntax error, unexpected %s, expecting %s or %s");
4050 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
4051 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4055 static char const yyunexpected[] = "syntax error, unexpected %s";
4056 static char const yyexpecting[] = ", expecting %s";
4057 static char const yyor[] = " or %s";
4058 char yyformat[sizeof yyunexpected
4059 + sizeof yyexpecting - 1
4060 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4061 * (sizeof yyor - 1))];
4062 char const *yyprefix = yyexpecting;
4064 /* Start YYX at -YYN if negative to avoid negative indexes in
4066 int yyxbegin = yyn < 0 ? -yyn : 0;
4068 /* Stay within bounds of both yycheck and yytname. */
4069 int yychecklim = YYLAST - yyn + 1;
4070 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4073 yyarg[0] = yytname[yytype];
4074 yyfmt = yystpcpy (yyformat, yyunexpected);
4076 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4077 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4079 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4083 yyformat[sizeof yyunexpected - 1] = '\0';
4086 yyarg[yycount++] = yytname[yyx];
4087 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4088 yysize_overflow |= (yysize1 < yysize);
4090 yyfmt = yystpcpy (yyfmt, yyprefix);
4094 yyf = YY_(yyformat);
4095 yysize1 = yysize + yystrlen (yyf);
4096 yysize_overflow |= (yysize1 < yysize);
4099 if (yysize_overflow)
4100 return YYSIZE_MAXIMUM;
4104 /* Avoid sprintf, as that infringes on the user's name space.
4105 Don't have undefined behavior even if the translation
4106 produced a string with the wrong number of "%s"s. */
4107 char *yyp = yyresult;
4109 while ((*yyp = *yyf) != '\0')
4111 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4113 yyp += yytnamerr (yyp, yyarg[yyi++]);
4126 #endif /* YYERROR_VERBOSE */
4129 /*-----------------------------------------------.
4130 | Release the memory associated to this symbol. |
4131 `-----------------------------------------------*/
4134 #if (defined __STDC__ || defined __C99__FUNC__ \
4135 || defined __cplusplus || defined _MSC_VER)
4137 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4140 yydestruct (yymsg, yytype, yyvaluep)
4150 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4159 /* Prevent warnings from -Wmissing-prototypes. */
4160 #ifdef YYPARSE_PARAM
4161 #if (defined __STDC__ || defined __C99__FUNC__ \
4162 || defined __cplusplus || defined _MSC_VER)
4163 int yyparse (void *YYPARSE_PARAM);
4167 #else /* ! YYPARSE_PARAM */
4168 #if (defined __STDC__ || defined __C99__FUNC__ \
4169 || defined __cplusplus || defined _MSC_VER)
4174 #endif /* ! YYPARSE_PARAM */
4177 /* The lookahead symbol. */
4180 /* The semantic value of the lookahead symbol. */
4183 /* Number of syntax errors so far. */
4188 /*-------------------------.
4189 | yyparse or yypush_parse. |
4190 `-------------------------*/
4192 #ifdef YYPARSE_PARAM
4193 #if (defined __STDC__ || defined __C99__FUNC__ \
4194 || defined __cplusplus || defined _MSC_VER)
4196 yyparse (void *YYPARSE_PARAM)
4199 yyparse (YYPARSE_PARAM)
4200 void *YYPARSE_PARAM;
4202 #else /* ! YYPARSE_PARAM */
4203 #if (defined __STDC__ || defined __C99__FUNC__ \
4204 || defined __cplusplus || defined _MSC_VER)
4217 /* Number of tokens to shift before error messages enabled. */
4220 /* The stacks and their tools:
4221 `yyss': related to states.
4222 `yyvs': related to semantic values.
4224 Refer to the stacks thru separate pointers, to allow yyoverflow
4225 to reallocate them elsewhere. */
4227 /* The state stack. */
4228 yytype_int16 yyssa[YYINITDEPTH];
4230 yytype_int16 *yyssp;
4232 /* The semantic value stack. */
4233 YYSTYPE yyvsa[YYINITDEPTH];
4237 YYSIZE_T yystacksize;
4241 /* Lookahead token as an internal (translated) token number. */
4243 /* The variables used to return semantic value and location from the
4248 /* Buffer for error messages, and its allocated size. */
4250 char *yymsg = yymsgbuf;
4251 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4254 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4256 /* The number of symbols on the RHS of the reduced rule.
4257 Keep to zero when no symbol should be popped. */
4263 yystacksize = YYINITDEPTH;
4265 YYDPRINTF ((stderr, "Starting parse\n"));
4270 yychar = YYEMPTY; /* Cause a token to be read. */
4272 /* Initialize stack pointers.
4273 Waste one element of value and location stack
4274 so that they stay on the same level as the state stack.
4275 The wasted elements are never initialized. */
4281 /*------------------------------------------------------------.
4282 | yynewstate -- Push a new state, which is found in yystate. |
4283 `------------------------------------------------------------*/
4285 /* In all cases, when you get here, the value and location stacks
4286 have just been pushed. So pushing a state here evens the stacks. */
4292 if (yyss + yystacksize - 1 <= yyssp)
4294 /* Get the current used size of the three stacks, in elements. */
4295 YYSIZE_T yysize = yyssp - yyss + 1;
4299 /* Give user a chance to reallocate the stack. Use copies of
4300 these so that the &'s don't force the real ones into
4302 YYSTYPE *yyvs1 = yyvs;
4303 yytype_int16 *yyss1 = yyss;
4305 /* Each stack pointer address is followed by the size of the
4306 data in use in that stack, in bytes. This used to be a
4307 conditional around just the two extra args, but that might
4308 be undefined if yyoverflow is a macro. */
4309 yyoverflow (YY_("memory exhausted"),
4310 &yyss1, yysize * sizeof (*yyssp),
4311 &yyvs1, yysize * sizeof (*yyvsp),
4317 #else /* no yyoverflow */
4318 # ifndef YYSTACK_RELOCATE
4319 goto yyexhaustedlab;
4321 /* Extend the stack our own way. */
4322 if (YYMAXDEPTH <= yystacksize)
4323 goto yyexhaustedlab;
4325 if (YYMAXDEPTH < yystacksize)
4326 yystacksize = YYMAXDEPTH;
4329 yytype_int16 *yyss1 = yyss;
4330 union yyalloc *yyptr =
4331 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4333 goto yyexhaustedlab;
4334 YYSTACK_RELOCATE (yyss_alloc, yyss);
4335 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4336 # undef YYSTACK_RELOCATE
4338 YYSTACK_FREE (yyss1);
4341 #endif /* no yyoverflow */
4343 yyssp = yyss + yysize - 1;
4344 yyvsp = yyvs + yysize - 1;
4346 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4347 (unsigned long int) yystacksize));
4349 if (yyss + yystacksize - 1 <= yyssp)
4353 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4355 if (yystate == YYFINAL)
4365 /* Do appropriate processing given the current state. Read a
4366 lookahead token if we need one and don't already have one. */
4368 /* First try to decide what to do without reference to lookahead token. */
4369 yyn = yypact[yystate];
4370 if (yyn == YYPACT_NINF)
4373 /* Not known => get a lookahead token if don't already have one. */
4375 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4376 if (yychar == YYEMPTY)
4378 YYDPRINTF ((stderr, "Reading a token: "));
4382 if (yychar <= YYEOF)
4384 yychar = yytoken = YYEOF;
4385 YYDPRINTF ((stderr, "Now at end of input.\n"));
4389 yytoken = YYTRANSLATE (yychar);
4390 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4393 /* If the proper action on seeing token YYTOKEN is to reduce or to
4394 detect an error, take that action. */
4396 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4401 if (yyn == 0 || yyn == YYTABLE_NINF)
4407 /* Count tokens shifted since error; after three, turn off error
4412 /* Shift the lookahead token. */
4413 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4415 /* Discard the shifted token. */
4424 /*-----------------------------------------------------------.
4425 | yydefault -- do the default action for the current state. |
4426 `-----------------------------------------------------------*/
4428 yyn = yydefact[yystate];
4434 /*-----------------------------.
4435 | yyreduce -- Do a reduction. |
4436 `-----------------------------*/
4438 /* yyn is the number of a rule to reduce with. */
4441 /* If YYLEN is nonzero, implement the default value of the action:
4444 Otherwise, the following line sets YYVAL to garbage.
4445 This behavior is undocumented and Bison
4446 users should not rely upon it. Assigning to YYVAL
4447 unconditionally makes the parser a bit smaller, and it avoids a
4448 GCC warning that YYVAL may be used uninitialized. */
4449 yyval = yyvsp[1-yylen];
4452 YY_REDUCE_PRINT (yyn);
4458 /* Line 1464 of skeleton.m4 */
4459 #line 1980 "parser.y"
4460 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4468 /* Line 1464 of skeleton.m4 */
4469 #line 1992 "parser.y"
4470 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4478 /* Line 1464 of skeleton.m4 */
4479 #line 1993 "parser.y"
4480 {PASS_ALWAYS as3_pass=(yyvsp[(2) - (4)].number_int);PASS1 as3_warning("embed command ignored");}
4488 /* Line 1464 of skeleton.m4 */
4489 #line 1996 "parser.y"
4490 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4498 /* Line 1464 of skeleton.m4 */
4499 #line 1997 "parser.y"
4500 {(yyval.code)=code_new();}
4508 /* Line 1464 of skeleton.m4 */
4509 #line 1999 "parser.y"
4511 (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));
4520 /* Line 1464 of skeleton.m4 */
4521 #line 2002 "parser.y"
4522 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4530 /* Line 1464 of skeleton.m4 */
4531 #line 2018 "parser.y"
4532 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4540 /* Line 1464 of skeleton.m4 */
4541 #line 2019 "parser.y"
4550 /* Line 1464 of skeleton.m4 */
4551 #line 2022 "parser.y"
4560 /* Line 1464 of skeleton.m4 */
4561 #line 2029 "parser.y"
4565 (yyval.code) = (yyvsp[(3) - (4)].code);
4569 as3_pass=(yyvsp[(1) - (4)].number_int);
4578 /* Line 1464 of skeleton.m4 */
4579 #line 2041 "parser.y"
4580 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4588 /* Line 1464 of skeleton.m4 */
4589 #line 2042 "parser.y"
4590 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4598 /* Line 1464 of skeleton.m4 */
4599 #line 2046 "parser.y"
4601 if((yyvsp[(1) - (1)].code)) {
4603 global->init = abc_initscript(global->file);
4604 code_t**cc = &global->init->method->body->code;
4605 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4615 /* Line 1464 of skeleton.m4 */
4616 #line 2057 "parser.y"
4619 (yyval.number_int) = as3_pass;
4629 /* Line 1464 of skeleton.m4 */
4630 #line 2065 "parser.y"
4633 (yyval.number_int)=as3_pass;
4634 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4635 if(!definitions || !dict_contains(definitions, key)) {
4647 /* Line 1464 of skeleton.m4 */
4648 #line 2092 "parser.y"
4649 {(yyval.node)=(yyvsp[(2) - (2)].node);}
4657 /* Line 1464 of skeleton.m4 */
4658 #line 2093 "parser.y"
4659 {(yyval.node)=mkdummynode();}
4667 /* Line 1464 of skeleton.m4 */
4668 #line 2095 "parser.y"
4669 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4677 /* Line 1464 of skeleton.m4 */
4678 #line 2096 "parser.y"
4679 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4687 /* Line 1464 of skeleton.m4 */
4688 #line 2098 "parser.y"
4689 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4697 /* Line 1464 of skeleton.m4 */
4698 #line 2099 "parser.y"
4699 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4707 /* Line 1464 of skeleton.m4 */
4708 #line 2102 "parser.y"
4711 if(variable_exists((yyvsp[(1) - (3)].id)))
4712 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4714 new_variable(state->method, (yyvsp[(1) - (3)].id), 0, 1, 0);
4720 if(state->method->uses_slots) {
4721 v = find_slot(state->method, (yyvsp[(1) - (3)].id));
4723 // this variable is stored in a slot
4725 v->type = (yyvsp[(2) - (3)].classinfo);
4730 v = new_variable2(state->method, (yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4733 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4735 typedcode_t val = node_read((yyvsp[(3) - (3)].node));
4736 if(!is_subtype_of(val.t, (yyvsp[(2) - (3)].classinfo))) {
4737 syntaxerror("Can't convert %s to %s", val.t->name, (yyvsp[(2) - (3)].classinfo)->name);
4739 if((yyvsp[(2) - (3)].classinfo)) {
4740 if(val.c->prev || val.c->opcode != OPCODE_PUSHUNDEFINED) {
4741 (yyval.code) = code_append((yyval.code), val.c);
4742 (yyval.code) = converttype((yyval.code), val.t, (yyvsp[(2) - (3)].classinfo));
4745 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4748 if(val.c->prev || val.c->opcode != OPCODE_PUSHUNDEFINED) {
4749 (yyval.code) = code_append((yyval.code), val.c);
4750 (yyval.code) = abc_coerce_a((yyval.code));
4752 // don't do anything
4754 code_free((yyval.code));
4760 (yyval.code) = abc_setslot((yyval.code), v->index);
4762 (yyval.code) = abc_setlocal((yyval.code), v->index);
4763 v->init = do_init_variable((yyvsp[(1) - (3)].id));
4773 /* Line 1464 of skeleton.m4 */
4774 #line 2162 "parser.y"
4775 {PASS12 new_state();}
4783 /* Line 1464 of skeleton.m4 */
4784 #line 2162 "parser.y"
4786 (yyval.code) = var_block((yyvsp[(2) - (2)].code), state->vars);
4796 /* Line 1464 of skeleton.m4 */
4797 #line 2166 "parser.y"
4798 {(yyval.code) = code_new();}
4806 /* Line 1464 of skeleton.m4 */
4807 #line 2167 "parser.y"
4808 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4816 /* Line 1464 of skeleton.m4 */
4817 #line 2170 "parser.y"
4819 (yyval.code) = code_new();
4820 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (6)].value).c);
4821 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4823 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (6)].code));
4824 if((yyvsp[(6) - (6)].code)) {
4825 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4827 myif->branch = (yyval.code) = abc_nop((yyval.code));
4828 if((yyvsp[(6) - (6)].code)) {
4829 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4830 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4840 /* Line 1464 of skeleton.m4 */
4841 #line 2186 "parser.y"
4842 {(yyval.code)=code_new();}
4850 /* Line 1464 of skeleton.m4 */
4851 #line 2193 "parser.y"
4853 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable(state->method, (yyvsp[(2) - (3)].id),0,1,0);
4854 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable(state->method, (yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4863 /* Line 1464 of skeleton.m4 */
4864 #line 2197 "parser.y"
4867 (yyval.id)=(yyvsp[(1) - (1)].id);
4876 /* Line 1464 of skeleton.m4 */
4877 #line 2202 "parser.y"
4878 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4886 /* Line 1464 of skeleton.m4 */
4887 #line 2203 "parser.y"
4888 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4896 /* Line 1464 of skeleton.m4 */
4897 #line 2205 "parser.y"
4899 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4900 (yyval.code) = code_new();
4901 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4902 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4903 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4904 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4905 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4906 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4907 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4908 (yyval.code) = abc_jump((yyval.code), loopstart);
4909 code_t*out = (yyval.code) = abc_nop((yyval.code));
4910 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4911 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4914 (yyval.code) = var_block((yyval.code), state->vars);
4924 /* Line 1464 of skeleton.m4 */
4925 #line 2225 "parser.y"
4927 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4929 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4931 int it = alloc_local();
4932 int array = alloc_local();
4934 (yyval.code) = code_new();
4935 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4936 (yyval.code) = abc_coerce_a((yyval.code));
4937 (yyval.code) = abc_setlocal((yyval.code), array);
4938 (yyval.code) = abc_pushbyte((yyval.code), 0);
4939 (yyval.code) = abc_setlocal((yyval.code), it);
4941 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4943 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4944 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4945 (yyval.code) = abc_getlocal((yyval.code), array);
4946 (yyval.code) = abc_getlocal((yyval.code), it);
4947 if(!(yyvsp[(1) - (6)].for_start).each)
4948 (yyval.code) = abc_nextname((yyval.code));
4950 (yyval.code) = abc_nextvalue((yyval.code));
4951 (yyval.code) = converttype((yyval.code), 0, var->type);
4952 (yyval.code) = abc_setlocal((yyval.code), var->index);
4954 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4955 (yyval.code) = abc_jump((yyval.code), loopstart);
4957 code_t*out = (yyval.code) = abc_nop((yyval.code));
4958 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4959 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4963 (yyval.code) = abc_kill((yyval.code), it);
4964 (yyval.code) = abc_kill((yyval.code), array);
4966 (yyval.code) = var_block((yyval.code), state->vars);
4976 /* Line 1464 of skeleton.m4 */
4977 #line 2269 "parser.y"
4980 (yyval.code) = code_new();
4982 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4983 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4984 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
4985 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4986 myjmp->branch = cont;
4987 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (5)].value).c);
4988 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4989 code_t*out = (yyval.code) = abc_nop((yyval.code));
4990 breakjumpsto((yyval.code), (yyvsp[(1) - (5)].id), out);
4991 continuejumpsto((yyval.code), (yyvsp[(1) - (5)].id), cont);
5000 /* Line 1464 of skeleton.m4 */
5001 #line 2285 "parser.y"
5003 (yyval.code) = code_new();
5004 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
5005 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (6)].code));
5006 code_t*cont = (yyval.code) = abc_nop((yyval.code));
5007 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (6)].value).c);
5008 (yyval.code) = abc_iftrue((yyval.code), loopstart);
5009 code_t*out = (yyval.code) = abc_nop((yyval.code));
5010 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
5011 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
5020 /* Line 1464 of skeleton.m4 */
5021 #line 2297 "parser.y"
5023 (yyval.code) = abc___break__(0, "");
5032 /* Line 1464 of skeleton.m4 */
5033 #line 2300 "parser.y"
5035 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5044 /* Line 1464 of skeleton.m4 */
5045 #line 2303 "parser.y"
5047 (yyval.code) = abc___continue__(0, "");
5056 /* Line 1464 of skeleton.m4 */
5057 #line 2306 "parser.y"
5059 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5068 /* Line 1464 of skeleton.m4 */
5069 #line 2310 "parser.y"
5078 /* Line 1464 of skeleton.m4 */
5079 #line 2311 "parser.y"
5080 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5088 /* Line 1464 of skeleton.m4 */
5089 #line 2312 "parser.y"
5090 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5098 /* Line 1464 of skeleton.m4 */
5099 #line 2313 "parser.y"
5100 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5108 /* Line 1464 of skeleton.m4 */
5109 #line 2314 "parser.y"
5110 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5118 /* Line 1464 of skeleton.m4 */
5119 #line 2315 "parser.y"
5120 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5128 /* Line 1464 of skeleton.m4 */
5129 #line 2317 "parser.y"
5131 (yyval.code) = abc_getlocal(0, state->switch_var);
5132 (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c);
5133 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5134 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5135 if((yyval.code)->opcode != OPCODE___BREAK__) {
5136 (yyval.code) = abc___fallthrough__((yyval.code), "");
5138 code_t*e = (yyval.code) = abc_nop((yyval.code));
5148 /* Line 1464 of skeleton.m4 */
5149 #line 2328 "parser.y"
5151 (yyval.code) = (yyvsp[(3) - (3)].code);
5160 /* Line 1464 of skeleton.m4 */
5161 #line 2331 "parser.y"
5162 {PASS12 new_state();state->switch_var=alloc_local();}
5170 /* Line 1464 of skeleton.m4 */
5171 #line 2331 "parser.y"
5173 (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c;
5174 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5175 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5177 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5178 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5180 code_t*c = (yyval.code),*lastblock=0;
5182 if(c->opcode == OPCODE_IFNE) {
5183 if(!c->next) syntaxerror("internal error in fallthrough handling");
5185 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5187 c->opcode = OPCODE_JUMP;
5188 c->branch = lastblock;
5190 /* fall through end of switch */
5191 c->opcode = OPCODE_NOP;
5197 (yyval.code) = var_block((yyval.code), state->vars);
5207 /* Line 1464 of skeleton.m4 */
5208 #line 2362 "parser.y"
5209 {PASS12 new_state();
5210 state->exception_name=(yyvsp[(3) - (5)].id);
5211 PASS1 new_variable(state->method, (yyvsp[(3) - (5)].id), 0, 0, 0);
5212 PASS2 new_variable(state->method, (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5221 /* Line 1464 of skeleton.m4 */
5222 #line 2367 "parser.y"
5224 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5225 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5227 NEW(abc_exception_t, e)
5228 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5229 e->var_name = multiname_clone(&name);
5230 (yyval.exception) = e;
5233 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5234 e->target = c = abc_nop(0);
5235 c = abc_setlocal(c, i);
5236 c = code_append(c, code_dup(state->method->scope_code));
5237 c = code_append(c, (yyvsp[(8) - (9)].code));
5240 c = var_block(c, state->vars);
5250 /* Line 1464 of skeleton.m4 */
5251 #line 2387 "parser.y"
5252 {PASS12 new_state();state->exception_name=0;}
5260 /* Line 1464 of skeleton.m4 */
5261 #line 2387 "parser.y"
5263 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code), state->vars);
5264 if(!(yyvsp[(4) - (5)].code)) {
5265 (yyval.exception)=0;
5267 NEW(abc_exception_t, e)
5268 e->exc_type = 0; //all exceptions
5269 e->var_name = 0; //no name
5272 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5273 (yyval.exception) = e;
5284 /* Line 1464 of skeleton.m4 */
5285 #line 2403 "parser.y"
5286 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5294 /* Line 1464 of skeleton.m4 */
5295 #line 2404 "parser.y"
5296 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5304 /* Line 1464 of skeleton.m4 */
5305 #line 2405 "parser.y"
5306 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5314 /* Line 1464 of skeleton.m4 */
5315 #line 2406 "parser.y"
5317 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5318 (yyval.catch_list).finally = 0;
5319 if((yyvsp[(2) - (2)].exception)) {
5320 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5321 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5331 /* Line 1464 of skeleton.m4 */
5332 #line 2414 "parser.y"
5334 (yyval.catch_list).l=list_new();
5335 (yyval.catch_list).finally = 0;
5336 if((yyvsp[(1) - (1)].exception)) {
5337 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5338 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5348 /* Line 1464 of skeleton.m4 */
5349 #line 2423 "parser.y"
5350 {PASS12 new_state();
5351 state->method->has_exceptions=1;
5352 state->method->late_binding=1;//for invariant scope_code
5361 /* Line 1464 of skeleton.m4 */
5362 #line 2426 "parser.y"
5364 code_t*out = abc_nop(0);
5366 code_t*start = abc_nop(0);
5367 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5368 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5369 (yyval.code) = abc_jump((yyval.code), out);
5371 code_t*end = (yyval.code) = abc_nop((yyval.code));
5374 if((yyvsp[(6) - (6)].catch_list).finally)
5375 tmp = alloc_local();
5377 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5380 abc_exception_t*e = l->abc_exception;
5382 (yyval.code) = code_append((yyval.code), e->target);
5383 (yyval.code) = abc_jump((yyval.code), out);
5385 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5387 e->target = (yyval.code) = abc_nop((yyval.code));
5388 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5389 (yyval.code) = abc___rethrow__((yyval.code));
5397 (yyval.code) = code_append((yyval.code), out);
5399 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5401 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5403 (yyval.code) = var_block((yyval.code), state->vars);
5413 /* Line 1464 of skeleton.m4 */
5414 #line 2472 "parser.y"
5416 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5417 (yyval.code)=abc_throw((yyval.code));
5426 /* Line 1464 of skeleton.m4 */
5427 #line 2476 "parser.y"
5429 if(!state->exception_name)
5430 syntaxerror("re-throw only possible within a catch block");
5431 variable_t*v = find_variable(state, state->exception_name);
5432 (yyval.code)=code_new();
5433 (yyval.code)=abc_getlocal((yyval.code), v->index);
5434 (yyval.code)=abc_throw((yyval.code));
5443 /* Line 1464 of skeleton.m4 */
5444 #line 2487 "parser.y"
5447 if(state->method->has_exceptions) {
5448 int v = alloc_local();
5449 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5450 state->method->scope_code = abc_pushwith(state->method->scope_code);
5451 (yyval.value_list).number = v;
5453 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5462 /* Line 1464 of skeleton.m4 */
5463 #line 2497 "parser.y"
5465 /* remove getlocal;pushwith from scope code again */
5466 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5468 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5469 if(state->method->has_exceptions) {
5470 (yyval.code) = abc_dup((yyval.code));
5471 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5473 (yyval.code) = abc_pushwith((yyval.code));
5474 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5475 (yyval.code) = abc_popscope((yyval.code));
5485 /* Line 1464 of skeleton.m4 */
5486 #line 2515 "parser.y"
5487 {PASS12 (yyval.id)="package";}
5495 /* Line 1464 of skeleton.m4 */
5496 #line 2516 "parser.y"
5497 {PASS12 (yyval.id)="namespace";}
5505 /* Line 1464 of skeleton.m4 */
5506 #line 2517 "parser.y"
5507 {PASS12 (yyval.id)="NaN";}
5515 /* Line 1464 of skeleton.m4 */
5516 #line 2518 "parser.y"
5517 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5525 /* Line 1464 of skeleton.m4 */
5526 #line 2520 "parser.y"
5527 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5535 /* Line 1464 of skeleton.m4 */
5536 #line 2521 "parser.y"
5537 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5545 /* Line 1464 of skeleton.m4 */
5546 #line 2523 "parser.y"
5547 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5555 /* Line 1464 of skeleton.m4 */
5556 #line 2524 "parser.y"
5557 {PASS12 endpackage();(yyval.code)=0;}
5565 /* Line 1464 of skeleton.m4 */
5566 #line 2525 "parser.y"
5567 {PASS12 startpackage("");}
5575 /* Line 1464 of skeleton.m4 */
5576 #line 2526 "parser.y"
5577 {PASS12 endpackage();(yyval.code)=0;}
5585 /* Line 1464 of skeleton.m4 */
5586 #line 2549 "parser.y"
5589 slotinfo_t*s = registry_find(state->package, (yyvsp[(2) - (2)].id));
5590 if(!s && as3_pass==1) {as3_schedule_class(state->package, (yyvsp[(2) - (2)].id));}
5591 state_has_imports();
5592 dict_put(state->imports, state->package, (yyvsp[(2) - (2)].id));
5602 /* Line 1464 of skeleton.m4 */
5603 #line 2557 "parser.y"
5606 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5607 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5608 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5610 state_has_imports();
5611 dict_put(state->imports, (yyvsp[(2) - (2)].classinfo)->name, (yyvsp[(2) - (2)].classinfo));
5612 import_toplevel((yyvsp[(2) - (2)].classinfo)->package);
5622 /* Line 1464 of skeleton.m4 */
5623 #line 2568 "parser.y"
5626 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5627 as3_schedule_package((yyvsp[(2) - (4)].id));
5631 i->package = (yyvsp[(2) - (4)].id);
5632 state_has_imports();
5633 list_append(state->wildcard_imports, i);
5634 import_toplevel(i->package);
5644 /* Line 1464 of skeleton.m4 */
5645 #line 2584 "parser.y"
5646 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5654 /* Line 1464 of skeleton.m4 */
5655 #line 2585 "parser.y"
5656 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5664 /* Line 1464 of skeleton.m4 */
5665 #line 2586 "parser.y"
5666 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5674 /* Line 1464 of skeleton.m4 */
5675 #line 2587 "parser.y"
5678 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5679 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5680 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5690 /* Line 1464 of skeleton.m4 */
5691 #line 2594 "parser.y"
5692 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5700 /* Line 1464 of skeleton.m4 */
5701 #line 2595 "parser.y"
5702 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5710 /* Line 1464 of skeleton.m4 */
5711 #line 2596 "parser.y"
5712 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5720 /* Line 1464 of skeleton.m4 */
5721 #line 2597 "parser.y"
5722 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5730 /* Line 1464 of skeleton.m4 */
5731 #line 2598 "parser.y"
5732 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5740 /* Line 1464 of skeleton.m4 */
5741 #line 2599 "parser.y"
5742 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5750 /* Line 1464 of skeleton.m4 */
5751 #line 2600 "parser.y"
5752 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5760 /* Line 1464 of skeleton.m4 */
5761 #line 2601 "parser.y"
5762 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5770 /* Line 1464 of skeleton.m4 */
5771 #line 2602 "parser.y"
5772 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5780 /* Line 1464 of skeleton.m4 */
5781 #line 2603 "parser.y"
5782 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5783 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5792 /* Line 1464 of skeleton.m4 */
5793 #line 2607 "parser.y"
5794 {PASS12 (yyval.classinfo)=0;}
5802 /* Line 1464 of skeleton.m4 */
5803 #line 2608 "parser.y"
5804 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5812 /* Line 1464 of skeleton.m4 */
5813 #line 2610 "parser.y"
5814 {PASS12 (yyval.classinfo_list)=list_new();}
5822 /* Line 1464 of skeleton.m4 */
5823 #line 2611 "parser.y"
5824 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5832 /* Line 1464 of skeleton.m4 */
5833 #line 2613 "parser.y"
5834 {PASS12 (yyval.classinfo_list)=list_new();}
5842 /* Line 1464 of skeleton.m4 */
5843 #line 2614 "parser.y"
5844 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5852 /* Line 1464 of skeleton.m4 */
5853 #line 2618 "parser.y"
5854 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5862 /* Line 1464 of skeleton.m4 */
5863 #line 2620 "parser.y"
5864 {PASS12 endclass();(yyval.code)=0;}
5872 /* Line 1464 of skeleton.m4 */
5873 #line 2624 "parser.y"
5874 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5875 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5883 /* Line 1464 of skeleton.m4 */
5884 #line 2627 "parser.y"
5885 {PASS12 endclass();(yyval.code)=0;}
5893 /* Line 1464 of skeleton.m4 */
5894 #line 2636 "parser.y"
5895 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
5903 /* Line 1464 of skeleton.m4 */
5904 #line 2640 "parser.y"
5906 code_t*c = state->cls->static_init->header;
5907 c = code_append(c, (yyvsp[(1) - (1)].code));
5908 state->cls->static_init->header = c;
5917 /* Line 1464 of skeleton.m4 */
5918 #line 2651 "parser.y"
5920 syntaxerror("variable declarations not allowed in interfaces");
5929 /* Line 1464 of skeleton.m4 */
5930 #line 2654 "parser.y"
5933 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5934 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5935 syntaxerror("invalid method modifiers: interface methods always need to be public");
5937 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5938 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5939 list_deep_free((yyvsp[(6) - (8)].params).list);
5948 /* Line 1464 of skeleton.m4 */
5949 #line 2729 "parser.y"
5950 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5958 /* Line 1464 of skeleton.m4 */
5959 #line 2729 "parser.y"
5960 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5968 /* Line 1464 of skeleton.m4 */
5969 #line 2731 "parser.y"
5970 {PASS12 (yyval.code)=0;}
5978 /* Line 1464 of skeleton.m4 */
5979 #line 2732 "parser.y"
5980 {PASS12 (yyval.code)=0;}
5988 /* Line 1464 of skeleton.m4 */
5989 #line 2735 "parser.y"
5992 int flags = slotstate_flags->flags;
5993 namespace_t ns = modifiers2access(slotstate_flags);
5997 varinfo_t* info = 0;
5999 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6001 check_override(i, flags);
6003 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6005 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6007 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6009 if(ns.name && ns.name[0]) {
6010 syntaxerror("namespaces not allowed on package-level variables");
6012 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6015 info->type = (yyvsp[(2) - (3)].classinfo);
6016 info->flags = flags;
6018 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6022 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6026 trait_t*t = add_abc_slot(slotstate_flags, (yyvsp[(1) - (3)].id), &mname, &code);
6028 if((yyvsp[(2) - (3)].classinfo)) {
6029 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6030 t->type_name = multiname_clone(&m);
6032 info->slot = t->slot_id;
6034 /* workaround for "VerifyError: Error #1053: Illegal override of ::test2 in C1"
6035 FIXME: is there a way to use slots and still don't have conflicting overrides?
6037 info->slot = t->slot_id = 0;
6039 constant_t cval = (yyvsp[(3) - (3)].node)->type->eval((yyvsp[(3) - (3)].node));
6040 if(cval.type!=CONSTANT_UNKNOWN) {
6041 /* compile time constant */
6042 t->value = malloc(sizeof(constant_t));
6043 memcpy(t->value, &cval, sizeof(constant_t));
6044 info->value = constant_clone(t->value);
6046 typedcode_t v = node_read((yyvsp[(3) - (3)].node));
6047 /* initalization code (if needed) */
6049 if(v.c && !is_pushundefined(v.c)) {
6050 c = abc_getlocal_0(c);
6051 c = code_append(c, v.c);
6052 c = converttype(c, v.t, (yyvsp[(2) - (3)].classinfo));
6054 c = abc_initproperty2(c, &mname);
6056 c = abc_setslot(c, t->slot_id);
6059 *code = code_append(*code, c);
6062 if(slotstate_varconst==KW_CONST) {
6063 t->kind= TRAIT_CONST;
6064 info->flags |= FLAG_CONST;
6077 /* Line 1464 of skeleton.m4 */
6078 #line 2818 "parser.y"
6079 {(yyval.constant)=0;}
6087 /* Line 1464 of skeleton.m4 */
6088 #line 2819 "parser.y"
6090 (yyval.constant) = malloc(sizeof(constant_t));
6091 *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node));
6092 if((yyval.constant)->type == CONSTANT_UNKNOWN) {
6093 syntaxerror("can't evaluate default parameter value (needs to be a compile-time constant)");
6103 /* Line 1464 of skeleton.m4 */
6104 #line 2828 "parser.y"
6105 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6113 /* Line 1464 of skeleton.m4 */
6114 #line 2829 "parser.y"
6116 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6125 /* Line 1464 of skeleton.m4 */
6126 #line 2832 "parser.y"
6127 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6135 /* Line 1464 of skeleton.m4 */
6136 #line 2833 "parser.y"
6137 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6145 /* Line 1464 of skeleton.m4 */
6146 #line 2834 "parser.y"
6147 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6155 /* Line 1464 of skeleton.m4 */
6156 #line 2835 "parser.y"
6157 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6165 /* Line 1464 of skeleton.m4 */
6166 #line 2836 "parser.y"
6167 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6175 /* Line 1464 of skeleton.m4 */
6176 #line 2837 "parser.y"
6177 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6185 /* Line 1464 of skeleton.m4 */
6186 #line 2838 "parser.y"
6187 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6195 /* Line 1464 of skeleton.m4 */
6196 #line 2851 "parser.y"
6198 multiname_t m = {QNAME, &stdns, 0, "XML"};
6201 v.c = abc_getlex2(v.c, &m);
6202 v.c = code_append(v.c, node_read((yyvsp[(1) - (1)].node)).c);
6203 v.c = abc_construct(v.c, 1);
6205 (yyval.node) = mkcodenode(v);
6214 /* Line 1464 of skeleton.m4 */
6215 #line 2862 "parser.y"
6216 {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();}
6224 /* Line 1464 of skeleton.m4 */
6225 #line 2863 "parser.y"
6226 {PASS_ALWAYS tokenizer_begin_xmltext();}
6234 /* Line 1464 of skeleton.m4 */
6235 #line 2864 "parser.y"
6236 {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();}
6244 /* Line 1464 of skeleton.m4 */
6245 #line 2866 "parser.y"
6246 {PASS_ALWAYS tokenizer_begin_xmltext();}
6254 /* Line 1464 of skeleton.m4 */
6255 #line 2866 "parser.y"
6257 (yyval.node) = (yyvsp[(2) - (4)].node);
6266 /* Line 1464 of skeleton.m4 */
6267 #line 2869 "parser.y"
6268 {PASS_ALWAYS tokenizer_begin_xml();}
6276 /* Line 1464 of skeleton.m4 */
6277 #line 2869 "parser.y"
6279 (yyval.node) = (yyvsp[(2) - (4)].node);
6288 /* Line 1464 of skeleton.m4 */
6289 #line 2872 "parser.y"
6290 {(yyval.node)=mkstringnode("");}
6298 /* Line 1464 of skeleton.m4 */
6299 #line 2873 "parser.y"
6301 (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node));
6310 /* Line 1464 of skeleton.m4 */
6311 #line 2876 "parser.y"
6313 char* str = string_cstr(&(yyvsp[(2) - (2)].str));
6314 (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node),mkstringnode(str));
6324 /* Line 1464 of skeleton.m4 */
6325 #line 2881 "parser.y"
6327 (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node), mkstringnode(">"));
6336 /* Line 1464 of skeleton.m4 */
6337 #line 2884 "parser.y"
6339 (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node));
6348 /* Line 1464 of skeleton.m4 */
6349 #line 2887 "parser.y"
6351 (yyval.node) = mkaddnode((yyvsp[(1) - (3)].node), mkaddnode((yyvsp[(2) - (3)].node),(yyvsp[(3) - (3)].node)));
6360 /* Line 1464 of skeleton.m4 */
6361 #line 2890 "parser.y"
6363 (yyval.node) = mkstringnode((yyvsp[(1) - (1)].id));
6372 /* Line 1464 of skeleton.m4 */
6373 #line 2893 "parser.y"
6375 (yyval.node) = (yyvsp[(1) - (1)].node);
6384 /* Line 1464 of skeleton.m4 */
6385 #line 2897 "parser.y"
6387 (yyval.node) = mkstringnode("");
6396 /* Line 1464 of skeleton.m4 */
6397 #line 2900 "parser.y"
6399 (yyval.node) = mkaddnode(mkstringnode(" "),(yyvsp[(1) - (1)].node));
6408 /* Line 1464 of skeleton.m4 */
6409 #line 2904 "parser.y"
6411 //$$ = allocprintf("<%s%s/>", $2, $3, $5, $8);
6412 (yyval.node) = mkaddnode(mkaddnode(mkaddnode(mkstringnode("<"),(yyvsp[(2) - (6)].node)),(yyvsp[(3) - (6)].node)),mkstringnode("/>"));
6421 /* Line 1464 of skeleton.m4 */
6422 #line 2908 "parser.y"
6424 //$$ = allocprintf("<%s%s>%s</%s>", $2, $3, $5, $8);
6425 (yyval.node) = mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(
6426 mkstringnode("<"),(yyvsp[(2) - (10)].node)),(yyvsp[(3) - (10)].node)),mkstringnode(">")),(yyvsp[(5) - (10)].node)),mkstringnode("</")),(yyvsp[(8) - (10)].node)),mkstringnode(">"));
6435 /* Line 1464 of skeleton.m4 */
6436 #line 2913 "parser.y"
6438 //$$ = allocprintf("<%s%s>%s%s</%s>", $2, $3, $5, $6, $9);
6439 (yyval.node) = mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(
6440 mkstringnode("<"),(yyvsp[(2) - (11)].node)),(yyvsp[(3) - (11)].node)),mkstringnode(">")),(yyvsp[(5) - (11)].node)),(yyvsp[(6) - (11)].node)),mkstringnode("</")),(yyvsp[(9) - (11)].node)),mkstringnode(">"));
6449 /* Line 1464 of skeleton.m4 */
6450 #line 2919 "parser.y"
6452 (yyval.node) = (yyvsp[(1) - (1)].node);
6461 /* Line 1464 of skeleton.m4 */
6462 #line 2922 "parser.y"
6464 (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node), mkaddnode(mkstringnode(" "),(yyvsp[(2) - (2)].node)));
6473 /* Line 1464 of skeleton.m4 */
6474 #line 2925 "parser.y"
6476 (yyval.node) = (yyvsp[(1) - (1)].node);
6485 /* Line 1464 of skeleton.m4 */
6486 #line 2928 "parser.y"
6488 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6489 (yyval.node) = mkaddnode((yyvsp[(1) - (3)].node), mkstringnode(concat2("=",str)));
6499 /* Line 1464 of skeleton.m4 */
6500 #line 2933 "parser.y"
6502 (yyval.node) = mkaddnode((yyvsp[(1) - (3)].node), mkaddnode(mkstringnode("=\""), mkaddnode((yyvsp[(3) - (3)].node), mkstringnode("\""))));
6511 /* Line 1464 of skeleton.m4 */
6512 #line 2936 "parser.y"
6514 (yyval.node) = mkaddnode(mkaddnode(mkstringnode(concat2((yyvsp[(1) - (3)].id),"=\"")), (yyvsp[(3) - (3)].node)), mkstringnode("\""));
6523 /* Line 1464 of skeleton.m4 */
6524 #line 2939 "parser.y"
6526 char* str = string_cstr(&(yyvsp[(3) - (3)].str));
6527 (yyval.node)=mkstringnode(allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str));
6529 free((yyvsp[(1) - (3)].id));free((char*)(yyvsp[(3) - (3)].str).str);
6538 /* Line 1464 of skeleton.m4 */
6539 #line 2949 "parser.y"
6542 memset(&(yyval.params),0,sizeof((yyval.params)));
6551 /* Line 1464 of skeleton.m4 */
6552 #line 2953 "parser.y"
6555 (yyval.params)=(yyvsp[(1) - (1)].params);
6564 /* Line 1464 of skeleton.m4 */
6565 #line 2959 "parser.y"
6568 memset(&(yyval.params),0,sizeof((yyval.params)));
6569 (yyval.params).varargs=1;
6570 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6579 /* Line 1464 of skeleton.m4 */
6580 #line 2965 "parser.y"
6583 (yyval.params) =(yyvsp[(1) - (4)].params);
6584 (yyval.params).varargs=1;
6585 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6594 /* Line 1464 of skeleton.m4 */
6595 #line 2973 "parser.y"
6598 (yyval.params) = (yyvsp[(1) - (3)].params);
6599 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6608 /* Line 1464 of skeleton.m4 */
6609 #line 2978 "parser.y"
6612 memset(&(yyval.params),0,sizeof((yyval.params)));
6613 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6622 /* Line 1464 of skeleton.m4 */
6623 #line 2984 "parser.y"
6626 (yyval.param) = rfx_calloc(sizeof(param_t));
6627 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6628 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6630 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6639 /* Line 1464 of skeleton.m4 */
6640 #line 2992 "parser.y"
6643 (yyval.param) = rfx_calloc(sizeof(param_t));
6644 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6645 (yyval.param)->type = TYPE_ANY;
6647 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6656 /* Line 1464 of skeleton.m4 */
6657 #line 3002 "parser.y"
6658 {PASS12 (yyval.token)=0;}
6666 /* Line 1464 of skeleton.m4 */
6667 #line 3005 "parser.y"
6668 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6676 /* Line 1464 of skeleton.m4 */
6677 #line 3006 "parser.y"
6680 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6682 if(!state->method->info) syntaxerror("internal error");
6684 code_t*c = method_header(state->method);
6685 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6687 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6689 list_deep_free((yyvsp[(6) - (12)].params).list);
6699 /* Line 1464 of skeleton.m4 */
6700 #line 3022 "parser.y"
6701 {PASS12 (yyval.id)=0;}
6709 /* Line 1464 of skeleton.m4 */
6710 #line 3024 "parser.y"
6711 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6719 /* Line 1464 of skeleton.m4 */
6720 #line 3025 "parser.y"
6723 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6725 methodinfo_t*f = state->method->info;
6726 if(!f || !f->kind) syntaxerror("internal error");
6728 code_t*c = method_header(state->method);
6729 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6731 int index = state->method->var_index;
6732 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6734 (yyval.value).c = abc_getlocal(0, index);
6735 (yyval.value).t = TYPE_FUNCTION(f);
6737 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6746 /* Line 1464 of skeleton.m4 */
6747 #line 3047 "parser.y"
6749 PASS1 NEW(unresolvedinfo_t,c);
6750 memset(c, 0, sizeof(*c));
6751 c->kind = INFOTYPE_UNRESOLVED;
6752 c->name = (yyvsp[(1) - (1)].id);
6753 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6755 c->nsset = get_current_imports();
6756 /* make the compiler look for this class in the current directory,
6758 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6760 (yyval.classinfo) = (classinfo_t*)c;
6762 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6763 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6764 (yyval.classinfo) = (classinfo_t*)s;
6773 /* Line 1464 of skeleton.m4 */
6774 #line 3066 "parser.y"
6776 PASS1 NEW(unresolvedinfo_t,c);
6777 memset(c, 0, sizeof(*c));
6778 c->kind = INFOTYPE_UNRESOLVED;
6779 c->package = (yyvsp[(1) - (3)].id);
6780 c->name = (yyvsp[(3) - (3)].id);
6781 (yyval.classinfo) = (classinfo_t*)c;
6783 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6784 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6785 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6786 (yyval.classinfo) = (classinfo_t*)s;
6795 /* Line 1464 of skeleton.m4 */
6796 #line 3083 "parser.y"
6797 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6805 /* Line 1464 of skeleton.m4 */
6806 #line 3084 "parser.y"
6807 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6815 /* Line 1464 of skeleton.m4 */
6816 #line 3086 "parser.y"
6817 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6825 /* Line 1464 of skeleton.m4 */
6826 #line 3087 "parser.y"
6827 {PASS12 (yyval.classinfo)=TYPE_ANY;}
6835 /* Line 1464 of skeleton.m4 */
6836 #line 3088 "parser.y"
6837 {PASS12 (yyval.classinfo)=TYPE_VOID;}
6845 /* Line 1464 of skeleton.m4 */
6846 #line 3097 "parser.y"
6847 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6855 /* Line 1464 of skeleton.m4 */
6856 #line 3098 "parser.y"
6857 {PASS12 (yyval.classinfo)=0;}
6865 /* Line 1464 of skeleton.m4 */
6866 #line 3102 "parser.y"
6867 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6875 /* Line 1464 of skeleton.m4 */
6876 #line 3103 "parser.y"
6877 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6885 /* Line 1464 of skeleton.m4 */
6886 #line 3105 "parser.y"
6887 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6895 /* Line 1464 of skeleton.m4 */
6896 #line 3109 "parser.y"
6897 {(yyval.value_list).number=1;
6898 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6907 /* Line 1464 of skeleton.m4 */
6908 #line 3113 "parser.y"
6909 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6917 /* Line 1464 of skeleton.m4 */
6918 #line 3114 "parser.y"
6920 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6921 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6930 /* Line 1464 of skeleton.m4 */
6931 #line 3120 "parser.y"
6933 typedcode_t v = node_read((yyvsp[(2) - (4)].node));
6934 (yyval.value).c = v.c;
6935 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6937 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6938 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6939 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6940 (yyval.value).c = code_cutlast((yyval.value).c);
6941 (yyval.value).c = code_append((yyval.value).c, paramcode);
6942 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6943 multiname_destroy(name);
6944 } else if(is_getlocal((yyval.value).c)) {
6945 (yyval.value).c = code_append((yyval.value).c, paramcode);
6946 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6947 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
6948 code_free((yyval.value).c);
6949 classinfo_t*c = v.t->data;
6951 (yyval.value).c = abc_findpropstrict2(0, &m);
6952 (yyval.value).c = code_append((yyval.value).c, paramcode);
6953 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(4) - (4)].value_list).number);
6954 /*} else if($$.c->opcode == OPCODE_GETSLOT) {
6955 int slot = (int)(ptroff_t)$$.c->data[0];
6956 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6957 multiname_t*name = t->name;
6958 $$.c = code_cutlast($$.c);
6959 $$.c = code_append($$.c, paramcode);
6960 $$.c = abc_constructprop2($$.c, name, $4.number);*/
6962 (yyval.value).c = code_append((yyval.value).c, paramcode);
6963 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6966 (yyval.value).t = TYPE_ANY;
6967 if(TYPE_IS_CLASS(v.t) && v.t->data) {
6968 (yyval.value).t = v.t->data;
6970 (yyval.value).c = abc_coerce_a((yyval.value).c);
6971 (yyval.value).t = TYPE_ANY;
6981 /* Line 1464 of skeleton.m4 */
6982 #line 3167 "parser.y"
6985 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
6986 (yyval.value).c = v.c;
6987 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6988 (yyval.value).c = code_cutlast((yyval.value).c);
6990 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6992 (yyval.value).t = TYPE_ANY;
6993 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6994 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6995 (yyval.value).c = code_cutlast((yyval.value).c);
6996 (yyval.value).c = code_append((yyval.value).c, paramcode);
6997 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6998 multiname_destroy(name);
6999 /* } else if($$.c->opcode == OPCODE_GETSLOT && $$.c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
7000 int slot = (int)(ptroff_t)$$.c->data[0];
7001 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
7002 if(t->kind!=TRAIT_METHOD) {
7003 //ok: flash allows to assign closures to members.
7005 multiname_t*name = t->name;
7006 $$.c = code_cutlast($$.c);
7007 $$.c = code_append($$.c, paramcode);
7008 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
7009 $$.c = abc_callproperty2($$.c, name, $3.number);*/
7010 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
7011 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
7012 (yyval.value).c = code_cutlast((yyval.value).c);
7013 (yyval.value).c = code_append((yyval.value).c, paramcode);
7014 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
7015 multiname_destroy(name);
7017 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7018 (yyval.value).c = code_append((yyval.value).c, paramcode);
7019 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7022 if(TYPE_IS_FUNCTION(v.t) && v.t->data) {
7023 (yyval.value).t = ((methodinfo_t*)(v.t->data))->return_type;
7024 } else if(TYPE_IS_CLASS(v.t) && v.t->data) {
7025 // calling a class is like a typecast
7026 (yyval.value).t = (classinfo_t*)v.t->data;
7028 (yyval.value).t = TYPE_ANY;
7029 (yyval.value).c = abc_coerce_a((yyval.value).c);
7039 /* Line 1464 of skeleton.m4 */
7040 #line 3217 "parser.y"
7042 if(!state->cls) syntaxerror("super() not allowed outside of a class");
7043 if(!state->method) syntaxerror("super() not allowed outside of a function");
7044 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
7046 (yyval.value).c = code_new();
7047 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7049 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
7051 this is dependent on the control path, check this somewhere else
7052 if(state->method->has_super)
7053 syntaxerror("constructor may call super() only once");
7055 state->method->has_super = 1;
7057 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
7058 (yyval.value).c = abc_pushundefined((yyval.value).c);
7059 (yyval.value).t = TYPE_ANY;
7068 /* Line 1464 of skeleton.m4 */
7069 #line 3238 "parser.y"
7071 typedcode_t v = node_read((yyvsp[(2) - (2)].node));
7072 (yyval.value).c = v.c;
7073 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
7074 (yyval.value).c = code_cutlast((yyval.value).c);
7076 multiname_t*name = 0;
7077 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
7078 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
7079 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
7080 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
7081 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
7082 (yyval.value).c = code_cutlast((yyval.value).c);
7083 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
7085 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7086 MULTINAME_LATE(m, v.t?v.t->access:ACCESS_PACKAGE, "");
7087 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
7089 (yyval.value).t = TYPE_BOOLEAN;
7098 /* Line 1464 of skeleton.m4 */
7099 #line 3260 "parser.y"
7101 (yyval.code) = abc_returnvoid(0);
7110 /* Line 1464 of skeleton.m4 */
7111 #line 3263 "parser.y"
7113 (yyval.code) = (yyvsp[(2) - (2)].value).c;
7114 (yyval.code) = abc_returnvalue((yyval.code));
7123 /* Line 1464 of skeleton.m4 */
7124 #line 3270 "parser.y"
7126 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7135 /* Line 1464 of skeleton.m4 */
7136 #line 3273 "parser.y"
7138 (yyval.value) = node_read((yyvsp[(1) - (1)].node));
7147 /* Line 1464 of skeleton.m4 */
7148 #line 3276 "parser.y"
7150 (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node));
7159 /* Line 1464 of skeleton.m4 */
7160 #line 3279 "parser.y"
7162 (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
7171 /* Line 1464 of skeleton.m4 */
7172 #line 3282 "parser.y"
7174 (yyval.code) = node_exec((yyvsp[(1) - (1)].node));
7183 /* Line 1464 of skeleton.m4 */
7184 #line 3285 "parser.y"
7186 (yyval.code) = (yyvsp[(1) - (3)].code);
7187 (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node)));
7196 /* Line 1464 of skeleton.m4 */
7197 #line 3290 "parser.y"
7198 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7206 /* Line 1464 of skeleton.m4 */
7207 #line 3291 "parser.y"
7208 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7216 /* Line 1464 of skeleton.m4 */
7217 #line 3293 "parser.y"
7218 {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));}
7226 /* Line 1464 of skeleton.m4 */
7227 #line 3294 "parser.y"
7228 {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));}
7236 /* Line 1464 of skeleton.m4 */
7237 #line 3295 "parser.y"
7238 {syntaxerror("dictionary keys must be strings");}
7246 /* Line 1464 of skeleton.m4 */
7247 #line 3296 "parser.y"
7248 {syntaxerror("dictionary keys must be strings");}
7256 /* Line 1464 of skeleton.m4 */
7257 #line 3297 "parser.y"
7258 {syntaxerror("dictionary keys must be strings");}
7266 /* Line 1464 of skeleton.m4 */
7267 #line 3299 "parser.y"
7269 (yyval.value_list).cc = 0;
7270 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code));
7271 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7272 (yyval.value_list).number = 2;
7281 /* Line 1464 of skeleton.m4 */
7282 #line 3305 "parser.y"
7284 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7285 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7286 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].code));
7287 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7296 /* Line 1464 of skeleton.m4 */
7297 #line 3314 "parser.y"
7298 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7306 /* Line 1464 of skeleton.m4 */
7307 #line 3315 "parser.y"
7308 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7316 /* Line 1464 of skeleton.m4 */
7317 #line 3316 "parser.y"
7318 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7326 /* Line 1464 of skeleton.m4 */
7327 #line 3317 "parser.y"
7328 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7336 /* Line 1464 of skeleton.m4 */
7337 #line 3318 "parser.y"
7338 {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));}
7346 /* Line 1464 of skeleton.m4 */
7347 #line 3319 "parser.y"
7348 {(yyval.node) = (yyvsp[(1) - (1)].node);}
7356 /* Line 1464 of skeleton.m4 */
7357 #line 3321 "parser.y"
7359 (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant));
7368 /* Line 1464 of skeleton.m4 */
7369 #line 3325 "parser.y"
7371 (yyval.node) = (yyvsp[(1) - (1)].node);
7380 /* Line 1464 of skeleton.m4 */
7381 #line 3330 "parser.y"
7385 multiname_t m = {QNAME, &stdns, 0, "RegExp"};
7386 if(!(yyvsp[(1) - (1)].regexp).options) {
7387 v.c = abc_getlex2(v.c, &m);
7388 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7389 v.c = abc_construct(v.c, 1);
7391 v.c = abc_getlex2(v.c, &m);
7392 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).pattern);
7393 v.c = abc_pushstring(v.c, (yyvsp[(1) - (1)].regexp).options);
7394 v.c = abc_construct(v.c, 2);
7397 (yyval.node) = mkcodenode(v);
7406 /* Line 1464 of skeleton.m4 */
7407 #line 3348 "parser.y"
7410 state->method->need_arguments = 1;
7413 v.c = abc_getlocal(0, state->method->need_arguments);
7415 (yyval.node) = mkcodenode(v);
7424 /* Line 1464 of skeleton.m4 */
7425 #line 3359 "parser.y"
7429 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7430 v.c = abc_newarray(v.c, (yyvsp[(2) - (3)].value_list).number);
7431 v.t = registry_getarrayclass();
7432 (yyval.node) = mkcodenode(v);
7441 /* Line 1464 of skeleton.m4 */
7442 #line 3369 "parser.y"
7446 v.c = code_append(v.c, (yyvsp[(2) - (3)].value_list).cc);
7447 v.c = abc_newobject(v.c, (yyvsp[(2) - (3)].value_list).number/2);
7448 v.t = registry_getobjectclass();
7449 (yyval.node) = mkcodenode(v);
7458 /* Line 1464 of skeleton.m4 */
7459 #line 3378 "parser.y"
7460 {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7468 /* Line 1464 of skeleton.m4 */
7469 #line 3379 "parser.y"
7470 {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7478 /* Line 1464 of skeleton.m4 */
7479 #line 3380 "parser.y"
7480 {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7488 /* Line 1464 of skeleton.m4 */
7489 #line 3381 "parser.y"
7490 {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7498 /* Line 1464 of skeleton.m4 */
7499 #line 3382 "parser.y"
7500 {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7508 /* Line 1464 of skeleton.m4 */
7509 #line 3383 "parser.y"
7510 {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7518 /* Line 1464 of skeleton.m4 */
7519 #line 3384 "parser.y"
7520 {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7528 /* Line 1464 of skeleton.m4 */
7529 #line 3385 "parser.y"
7530 {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7538 /* Line 1464 of skeleton.m4 */
7539 #line 3386 "parser.y"
7540 {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7548 /* Line 1464 of skeleton.m4 */
7549 #line 3387 "parser.y"
7550 {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));}
7558 /* Line 1464 of skeleton.m4 */
7559 #line 3388 "parser.y"
7560 {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));}
7568 /* Line 1464 of skeleton.m4 */
7569 #line 3389 "parser.y"
7570 {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));}
7578 /* Line 1464 of skeleton.m4 */
7579 #line 3390 "parser.y"
7580 {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7588 /* Line 1464 of skeleton.m4 */
7589 #line 3391 "parser.y"
7590 {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7598 /* Line 1464 of skeleton.m4 */
7599 #line 3392 "parser.y"
7600 {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7608 /* Line 1464 of skeleton.m4 */
7609 #line 3393 "parser.y"
7610 {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7618 /* Line 1464 of skeleton.m4 */
7619 #line 3394 "parser.y"
7620 {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7628 /* Line 1464 of skeleton.m4 */
7629 #line 3395 "parser.y"
7630 {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7638 /* Line 1464 of skeleton.m4 */
7639 #line 3396 "parser.y"
7640 {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7648 /* Line 1464 of skeleton.m4 */
7649 #line 3397 "parser.y"
7650 {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7658 /* Line 1464 of skeleton.m4 */
7659 #line 3398 "parser.y"
7660 {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7668 /* Line 1464 of skeleton.m4 */
7669 #line 3399 "parser.y"
7670 {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7678 /* Line 1464 of skeleton.m4 */
7679 #line 3400 "parser.y"
7680 {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7688 /* Line 1464 of skeleton.m4 */
7689 #line 3401 "parser.y"
7690 {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7698 /* Line 1464 of skeleton.m4 */
7699 #line 3402 "parser.y"
7700 {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7708 /* Line 1464 of skeleton.m4 */
7709 #line 3403 "parser.y"
7710 {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7718 /* Line 1464 of skeleton.m4 */
7719 #line 3404 "parser.y"
7720 {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7728 /* Line 1464 of skeleton.m4 */
7729 #line 3405 "parser.y"
7730 {(yyval.node) = mknode1(&node_typeof, (yyvsp[(2) - (2)].node));}
7738 /* Line 1464 of skeleton.m4 */
7739 #line 3406 "parser.y"
7740 {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));}
7748 /* Line 1464 of skeleton.m4 */
7749 #line 3407 "parser.y"
7750 { (yyval.node) = mkconstnode(constant_new_undefined());}
7758 /* Line 1464 of skeleton.m4 */
7759 #line 3408 "parser.y"
7760 { (yyval.node)=(yyvsp[(2) - (3)].node);}
7768 /* Line 1464 of skeleton.m4 */
7769 #line 3409 "parser.y"
7770 {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));}
7778 /* Line 1464 of skeleton.m4 */
7779 #line 3410 "parser.y"
7780 {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));}
7788 /* Line 1464 of skeleton.m4 */
7789 #line 3411 "parser.y"
7790 {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7798 /* Line 1464 of skeleton.m4 */
7799 #line 3412 "parser.y"
7800 {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7808 /* Line 1464 of skeleton.m4 */
7809 #line 3413 "parser.y"
7810 {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7818 /* Line 1464 of skeleton.m4 */
7819 #line 3414 "parser.y"
7820 {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7828 /* Line 1464 of skeleton.m4 */
7829 #line 3415 "parser.y"
7830 {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7838 /* Line 1464 of skeleton.m4 */
7839 #line 3416 "parser.y"
7840 { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7848 /* Line 1464 of skeleton.m4 */
7849 #line 3417 "parser.y"
7850 { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7858 /* Line 1464 of skeleton.m4 */
7859 #line 3418 "parser.y"
7860 { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7868 /* Line 1464 of skeleton.m4 */
7869 #line 3419 "parser.y"
7870 { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7878 /* Line 1464 of skeleton.m4 */
7879 #line 3420 "parser.y"
7880 { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7888 /* Line 1464 of skeleton.m4 */
7889 #line 3421 "parser.y"
7890 { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7898 /* Line 1464 of skeleton.m4 */
7899 #line 3422 "parser.y"
7900 { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));}
7908 /* Line 1464 of skeleton.m4 */
7909 #line 3423 "parser.y"
7910 { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));}
7918 /* Line 1464 of skeleton.m4 */
7919 #line 3425 "parser.y"
7920 { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));}
7928 /* Line 1464 of skeleton.m4 */
7929 #line 3426 "parser.y"
7930 { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));}
7938 /* Line 1464 of skeleton.m4 */
7939 #line 3427 "parser.y"
7940 {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); }
7948 /* Line 1464 of skeleton.m4 */
7949 #line 3428 "parser.y"
7950 {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); }
7958 /* Line 1464 of skeleton.m4 */
7959 #line 3431 "parser.y"
7960 { if(!state->cls->info)
7961 syntaxerror("super keyword not allowed outside a class");
7962 classinfo_t*t = state->cls->info->superclass;
7963 if(!t) t = TYPE_OBJECT;
7964 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7965 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7968 v.c = abc_getlocal_0(v.c);
7969 v.c = abc_getsuper2(v.c, &m);
7970 v.t = slotinfo_gettype((slotinfo_t*)f);
7971 (yyval.node) = mkcodenode(v);
7980 /* Line 1464 of skeleton.m4 */
7981 #line 3445 "parser.y"
7984 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)};
7985 v.c = abc_getlex2(0, &m);
7987 (yyval.node) = mkcodenode(v);
7996 /* Line 1464 of skeleton.m4 */
7997 #line 3453 "parser.y"
7998 {PASS12 new_state();state->xmlfilter=1;}
8006 /* Line 1464 of skeleton.m4 */
8007 #line 3453 "parser.y"
8011 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8012 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8014 int index = alloc_local();
8015 int result = alloc_local();
8016 int tmp = alloc_local();
8017 int xml = alloc_local();
8019 c = code_append(c, v.c);
8020 c = abc_checkfilter(c);
8021 c = abc_coerce_a(c); //hasnext2 converts to *
8022 c = abc_setlocal(c, xml);
8023 multiname_t m = {QNAME, &stdns, 0, "XMLList"};
8024 c = abc_getlex2(c, &m);
8025 c = abc_construct(c, 0);
8026 c = abc_setlocal(c, result);
8027 c = abc_pushbyte(c, 0);
8028 c = abc_setlocal(c, index);
8029 code_t*jmp = c = abc_jump(c, 0);
8030 code_t*loop = c = abc_label(c);
8031 c = abc_getlocal(c, xml);
8032 c = abc_getlocal(c, index);
8033 c = abc_nextvalue(c);
8035 c = abc_setlocal(c, tmp);
8036 c = abc_pushwith(c);
8037 c = code_append(c, w.c);
8038 c = abc_popscope(c);
8039 code_t*b = c = abc_iffalse(c, 0);
8040 c = abc_getlocal(c, result);
8041 c = abc_getlocal(c, index);
8042 c = abc_getlocal(c, tmp);
8043 multiname_t m2 = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8044 c = abc_setproperty2(c, &m2);
8045 c = b->branch = jmp->branch = abc_nop(c);
8046 c = abc_kill(c, tmp);
8047 c = abc_hasnext2(c, xml, index);
8048 c = abc_iftrue(c, loop);
8049 c = abc_getlocal(c, result);
8050 c = abc_kill(c, xml);
8051 c = abc_kill(c, result);
8052 c = abc_kill(c, index);
8054 c = var_block(c, state->vars);
8059 (yyval.node) = mkcodenode(r);
8068 /* Line 1464 of skeleton.m4 */
8069 #line 3507 "parser.y"
8070 {(yyval.id)=(yyvsp[(1) - (1)].id);}
8078 /* Line 1464 of skeleton.m4 */
8079 #line 3508 "parser.y"
8088 /* Line 1464 of skeleton.m4 */
8089 #line 3509 "parser.y"
8090 {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);}
8098 /* Line 1464 of skeleton.m4 */
8099 #line 3511 "parser.y"
8108 /* Line 1464 of skeleton.m4 */
8109 #line 3519 "parser.y"
8111 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8112 typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id)));
8113 v.c = code_append(v.c, w.c);
8114 if(!TYPE_IS_NAMESPACE(w.t)) {
8115 as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id));
8117 v.c = converttype(v.c, w.t, TYPE_NAMESPACE);
8118 multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)};
8119 v.c = abc_getproperty2(v.c, &m);
8120 if(TYPE_IS_XML(v.t)) {
8123 v.c = abc_coerce_a(v.c);
8126 (yyval.node) = mkcodenode(v);
8135 /* Line 1464 of skeleton.m4 */
8136 #line 3537 "parser.y"
8138 typedcode_t v = node_read((yyvsp[(1) - (3)].node));
8139 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8140 v.c = abc_getdescendants2(v.c, &m);
8142 (yyval.node) = mkcodenode(v);
8151 /* Line 1464 of skeleton.m4 */
8152 #line 3544 "parser.y"
8154 typedcode_t v = node_read((yyvsp[(1) - (5)].node));
8155 typedcode_t w = node_read((yyvsp[(4) - (5)].node));
8156 multiname_t m = {MULTINAMEL, 0, &nopackage_namespace_set, 0};
8157 v.c = code_append(v.c, w.c);
8158 v.c = converttype(w.c, w.t, TYPE_STRING);
8159 v.c = abc_getproperty2(v.c, &m);
8161 (yyval.node) = mkcodenode(v);
8170 /* Line 1464 of skeleton.m4 */
8171 #line 3555 "parser.y"
8173 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8174 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8175 v.c = abc_getproperty2(v.c, &m);
8177 (yyval.node) = mkcodenode(v);
8186 /* Line 1464 of skeleton.m4 */
8187 #line 3562 "parser.y"
8189 typedcode_t v = node_read((yyvsp[(1) - (4)].node));
8190 multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)};
8191 v.c = abc_getdescendants2(v.c, &m);
8193 (yyval.node) = mkcodenode(v);
8202 /* Line 1464 of skeleton.m4 */
8203 #line 3569 "parser.y"
8205 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8206 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8207 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8208 v.c = code_append(v.c, w.c);
8209 v.c = converttype(w.c, w.t, TYPE_STRING);
8210 v.c = abc_getproperty2(v.c, &m);
8212 (yyval.node) = mkcodenode(v);
8221 /* Line 1464 of skeleton.m4 */
8222 #line 3579 "parser.y"
8224 typedcode_t v = node_read((yyvsp[(1) - (6)].node));
8225 typedcode_t w = node_read((yyvsp[(5) - (6)].node));
8226 multiname_t m = {MULTINAMELA, 0, &nopackage_namespace_set, 0};
8227 v.c = code_append(v.c, w.c);
8228 v.c = converttype(w.c, w.t, TYPE_STRING);
8229 v.c = abc_getdescendants2(v.c, &m);
8231 (yyval.node) = mkcodenode(v);
8240 /* Line 1464 of skeleton.m4 */
8241 #line 3590 "parser.y"
8243 typedcode_t v1 = node_read((yyvsp[(1) - (3)].node));
8244 (yyval.value).c = v1.c;
8245 classinfo_t*t = v1.t;
8247 if(TYPE_IS_CLASS(t) && t->data) {
8251 if(TYPE_IS_XML(t)) {
8252 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8253 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8254 (yyval.value).c = abc_coerce_a((yyval.value).c);
8255 (yyval.value).t = TYPE_XMLLIST;
8257 if(t->subtype==INFOTYPE_UNRESOLVED) {
8258 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8260 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8262 if(f && !is_static != !(f->flags&FLAG_STATIC))
8264 if(f && f->slot && !noslot) {
8265 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8268 if(!TYPE_IS_XMLLIST(t)) {
8269 as3_softwarning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
8272 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8273 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8275 /* determine type */
8276 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8277 if(!(yyval.value).t)
8278 (yyval.value).c = abc_coerce_a((yyval.value).c);
8280 } else if(v1.c && v1.c->opcode == OPCODE___PUSHPACKAGE__) {
8281 string_t*package = v1.c->data[0];
8282 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8284 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8286 (yyval.value) = push_class(a);
8287 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8288 registry_ispackage(package2)) {
8289 (yyval.value).c = v1.c;
8290 (yyval.value).c->data[0] = string_new4(package2);
8291 (yyval.value).t = 0;
8293 syntaxerror("couldn't resolve %s", package2);
8296 /* when resolving a property on an unknown type, we do know the
8297 name of the property (and don't seem to need the package), but
8298 we need to make avm2 try out all access modes */
8299 as3_softwarning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8300 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8301 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8302 (yyval.value).c = abc_coerce_a((yyval.value).c);
8303 (yyval.value).t = TYPE_ANY;
8313 /* Line 1464 of skeleton.m4 */
8314 #line 3770 "parser.y"
8317 /* Queue unresolved identifiers for checking against the parent
8318 function's variables.
8319 We consider everything which is not a local variable "unresolved".
8320 This encompasses class names, members of the surrounding class
8321 etc. which is *correct* because local variables of the parent function
8325 if(!find_variable(state, (yyvsp[(1) - (1)].id))) {
8326 unknown_variable((yyvsp[(1) - (1)].id));
8327 /* let the compiler know that it might want to check the current directory/package
8328 for this identifier- maybe there's a file $1.as defining $1. */
8329 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8335 (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id));
8344 /* Line 1464 of skeleton.m4 */
8345 #line 3804 "parser.y"
8348 NEW(namespace_decl_t,n);
8349 n->name = (yyvsp[(2) - (2)].id);
8350 n->url = (yyvsp[(2) - (2)].id);
8351 (yyval.namespace_decl)=n;
8360 /* Line 1464 of skeleton.m4 */
8361 #line 3811 "parser.y"
8364 NEW(namespace_decl_t,n);
8365 n->name = (yyvsp[(2) - (4)].id);
8366 n->url = (yyvsp[(4) - (4)].id);
8367 (yyval.namespace_decl)=n;
8376 /* Line 1464 of skeleton.m4 */
8377 #line 3818 "parser.y"
8380 NEW(namespace_decl_t,n);
8381 n->name = (yyvsp[(2) - (4)].id);
8382 n->url = (yyvsp[(4) - (4)].str).str;
8383 (yyval.namespace_decl)=n;
8392 /* Line 1464 of skeleton.m4 */
8393 #line 3825 "parser.y"
8396 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8398 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8399 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8400 var->type = TYPE_NAMESPACE;
8402 ns.access = ACCESS_NAMESPACE;
8403 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8404 var->value = constant_new_namespace(&ns);
8407 MULTINAME(m, TYPE_NAMESPACE);
8408 trait_t*t = add_abc_slot(&(yyvsp[(1) - (2)].flags), (yyvsp[(2) - (2)].namespace_decl)->name, 0, 0);
8409 t->value = var->value;
8410 t->type_name = multiname_clone(&m);
8422 /* Line 1464 of skeleton.m4 */
8423 #line 3848 "parser.y"
8425 as3_warning("default xml namespaces not supported yet");
8435 /* Line 1464 of skeleton.m4 */
8436 #line 3853 "parser.y"
8439 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8441 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8442 if(s->kind == INFOTYPE_UNRESOLVED) {
8443 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8445 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8448 if(!s || s->kind != INFOTYPE_VAR)
8449 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8450 if(!s->value || !NS_TYPE(s->value->type))
8451 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8452 url = s->value->ns->name;
8454 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8455 add_active_url(url);
8463 /* Line 1464 of skeleton.m4 */
8464 #line 8465 "parser.tab.c"
8467 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8471 YY_STACK_PRINT (yyss, yyssp);
8475 /* Now `shift' the result of the reduction. Determine what state
8476 that goes to, based on the state we popped back to and the rule
8477 number reduced by. */
8481 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8482 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8483 yystate = yytable[yystate];
8485 yystate = yydefgoto[yyn - YYNTOKENS];
8490 /*------------------------------------.
8491 | yyerrlab -- here on detecting error |
8492 `------------------------------------*/
8494 /* If not already recovering from an error, report this error. */
8498 #if ! YYERROR_VERBOSE
8499 yyerror (YY_("syntax error"));
8502 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8503 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8505 YYSIZE_T yyalloc = 2 * yysize;
8506 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8507 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8508 if (yymsg != yymsgbuf)
8509 YYSTACK_FREE (yymsg);
8510 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8512 yymsg_alloc = yyalloc;
8516 yymsg_alloc = sizeof yymsgbuf;
8520 if (0 < yysize && yysize <= yymsg_alloc)
8522 (void) yysyntax_error (yymsg, yystate, yychar);
8527 yyerror (YY_("syntax error"));
8529 goto yyexhaustedlab;
8537 if (yyerrstatus == 3)
8539 /* If just tried and failed to reuse lookahead token after an
8540 error, discard it. */
8542 if (yychar <= YYEOF)
8544 /* Return failure if at end of input. */
8545 if (yychar == YYEOF)
8550 yydestruct ("Error: discarding",
8556 /* Else will try to reuse lookahead token after shifting the error
8561 /*---------------------------------------------------.
8562 | yyerrorlab -- error raised explicitly by YYERROR. |
8563 `---------------------------------------------------*/
8566 /* Pacify compilers like GCC when the user code never invokes
8567 YYERROR and the label yyerrorlab therefore never appears in user
8569 if (/*CONSTCOND*/ 0)
8572 /* Do not reclaim the symbols of the rule which action triggered
8576 YY_STACK_PRINT (yyss, yyssp);
8581 /*-------------------------------------------------------------.
8582 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8583 `-------------------------------------------------------------*/
8585 yyerrstatus = 3; /* Each real token shifted decrements this. */
8589 yyn = yypact[yystate];
8590 if (yyn != YYPACT_NINF)
8593 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8601 /* Pop the current state because it cannot handle the error token. */
8606 yydestruct ("Error: popping",
8607 yystos[yystate], yyvsp);
8610 YY_STACK_PRINT (yyss, yyssp);
8616 /* Shift the error token. */
8617 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8623 /*-------------------------------------.
8624 | yyacceptlab -- YYACCEPT comes here. |
8625 `-------------------------------------*/
8630 /*-----------------------------------.
8631 | yyabortlab -- YYABORT comes here. |
8632 `-----------------------------------*/
8637 #if !defined(yyoverflow) || YYERROR_VERBOSE
8638 /*-------------------------------------------------.
8639 | yyexhaustedlab -- memory exhaustion comes here. |
8640 `-------------------------------------------------*/
8642 yyerror (YY_("memory exhausted"));
8648 if (yychar != YYEMPTY)
8649 yydestruct ("Cleanup: discarding lookahead",
8651 /* Do not reclaim the symbols of the rule which action triggered
8652 this YYABORT or YYACCEPT. */
8654 YY_STACK_PRINT (yyss, yyssp);
8655 while (yyssp != yyss)
8657 yydestruct ("Cleanup: popping",
8658 yystos[*yyssp], yyvsp);
8663 YYSTACK_FREE (yyss);
8666 if (yymsg != yymsgbuf)
8667 YYSTACK_FREE (yymsg);
8669 /* Make sure YYID is used. */
8670 return YYID (yyresult);