2 /* A Bison parser, made by GNU Bison 2.4. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4"
52 #define YYSKELETON_NAME "./skeleton.m4"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse a3_parse
69 #define yyerror a3_error
70 #define yylval a3_lval
71 #define yychar a3_char
72 #define yydebug a3_debug
73 #define yynerrs a3_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 198 of skeleton.m4 */
87 #include "tokenizer.h"
97 /* Line 198 of skeleton.m4 */
98 #line 99 "parser.tab.c"
100 /* Enabling traces. */
105 /* Enabling verbose error messages. */
106 #ifdef YYERROR_VERBOSE
107 # undef YYERROR_VERBOSE
108 # define YYERROR_VERBOSE 1
110 # define YYERROR_VERBOSE 1
113 /* Enabling the token table. */
114 #ifndef YYTOKEN_TABLE
115 # define YYTOKEN_TABLE 0
122 /* Put the tokens into the symbol table, so that GDB and other debuggers
220 below_semicolon = 353,
221 below_assignment = 354,
223 minusminus_prefix = 357,
224 plusplus_prefix = 358,
227 above_identifier = 361,
235 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
237 /* Line 223 of skeleton.m4 */
242 /* Line 223 of skeleton.m4 */
245 enum yytokentype token;
247 classinfo_t*classinfo;
248 classinfo_list_t*classinfo_list;
250 slotinfo_list_t*slotinfo_list;
253 unsigned int number_uint;
257 //typedcode_list_t*value_list;
258 codeandnumber_t value_list;
264 for_start_t for_start;
265 abc_exception_t *exception;
268 namespace_decl_t* namespace_decl;
270 abc_exception_list_t *l;
276 /* Line 223 of skeleton.m4 */
277 #line 278 "parser.tab.c"
279 # define YYSTYPE_IS_TRIVIAL 1
280 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
281 # define YYSTYPE_IS_DECLARED 1
285 /* Copy the second part of user declarations. */
287 /* Line 273 of skeleton.m4 */
291 static int a3_error(char*s)
293 syntaxerror("%s", s);
294 return 0; //make gcc happy
298 static char* concat2(const char* t1, const char* t2)
302 char*text = malloc(l1+l2+1);
303 memcpy(text , t1, l1);
304 memcpy(text+l1, t2, l2);
308 static char* concat3(const char* t1, const char* t2, const char* t3)
313 char*text = malloc(l1+l2+l3+1);
314 memcpy(text , t1, l1);
315 memcpy(text+l1, t2, l2);
316 memcpy(text+l1+l2, t3, l3);
321 typedef struct _import {
325 DECLARE_LIST(import);
327 DECLARE(methodstate);
328 DECLARE_LIST(methodstate);
330 typedef struct _classstate {
336 methodstate_t*static_init;
338 //code_t*static_init;
340 char has_constructor;
343 struct _methodstate {
353 dict_t*unresolved_variables;
356 char uses_parent_function;
362 int var_index; // for inner methods
363 int slot_index; // for inner methods
364 char is_a_slot; // for inner methods
369 abc_exception_list_t*exceptions;
371 methodstate_list_t*innerfunctions;
374 typedef struct _state {
379 import_list_t*wildcard_imports;
380 dict_t*import_toplevel_packages;
383 namespace_list_t*active_namespace_urls;
385 char has_own_imports;
386 char new_vars; // e.g. transition between two functions
389 methodstate_t*method;
398 typedef struct _global {
402 dict_t*file2token2info;
405 static global_t*global = 0;
406 static state_t* state = 0;
410 #define MULTINAME(m,x) \
414 registry_fill_multiname(&m, &m##_ns, (slotinfo_t*)(x));
416 #define MEMBER_MULTINAME(m,f,n) \
420 if((m##_ns.access = ((slotinfo_t*)(f))->access)==ACCESS_NAMESPACE) \
421 m##_ns.name = ((slotinfo_t*)(f))->package; \
426 m.namespace_set = 0; \
427 m.name = ((slotinfo_t*)(f))->name; \
429 m.type = MULTINAME; \
431 m.namespace_set = &nopackage_namespace_set; \
435 /* warning: list length of namespace set is undefined */
436 #define MULTINAME_LATE(m, access, package) \
437 namespace_t m##_ns = {access, package}; \
438 namespace_set_t m##_nsset; \
439 namespace_list_t m##_l;m##_l.next = 0; \
440 m##_nsset.namespaces = &m##_l; \
441 m##_nsset = m##_nsset; \
442 m##_l.namespace = &m##_ns; \
443 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
445 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
446 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
447 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
448 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
449 static namespace_list_t nl4 = {&ns4,0};
450 static namespace_list_t nl3 = {&ns3,&nl4};
451 static namespace_list_t nl2 = {&ns2,&nl3};
452 static namespace_list_t nl1 = {&ns1,&nl2};
453 static namespace_set_t nopackage_namespace_set = {&nl1};
455 static void new_state()
458 state_t*oldstate = state;
460 memcpy(s, state, sizeof(state_t)); //shallow copy
462 s->imports = dict_new();
464 if(!s->import_toplevel_packages) {
465 s->import_toplevel_packages = dict_new();
469 state->has_own_imports = 0;
470 state->vars = dict_new();
471 state->old = oldstate;
474 trie_remember(active_namespaces);
477 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
479 static void state_has_imports()
481 state->wildcard_imports = list_clone(state->wildcard_imports);
482 state->imports = dict_clone(state->imports);
483 state->has_own_imports = 1;
485 static void import_toplevel(const char*package)
487 char* s = strdup(package);
489 dict_put(state->import_toplevel_packages, s, 0);
490 char*x = strrchr(s, '.');
498 static void state_destroy(state_t*state)
500 if(state->has_own_imports) {
501 list_free(state->wildcard_imports);
502 dict_destroy(state->imports);state->imports=0;
504 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
505 dict_destroy(state->imports);state->imports=0;
509 for(t=0;t<state->vars->hashsize;t++) {
510 dictentry_t*e =state->vars->slots[t];
512 free(e->data);e->data=0;
516 dict_destroy(state->vars);state->vars=0;
519 list_free(state->active_namespace_urls)
520 state->active_namespace_urls = 0;
525 static void old_state()
527 trie_rollback(active_namespaces);
529 if(!state || !state->old)
530 syntaxerror("invalid nesting");
531 state_t*leaving = state;
535 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
536 free(leaving->method);
539 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
544 state_destroy(leaving);
547 static code_t* method_header(methodstate_t*m);
548 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
549 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0);
552 static char* internal_filename_package = 0;
553 void initialize_file(char*filename)
556 syntaxerror("invalid call to initialize_file during parsing of another file");
559 active_namespaces = trie_new();
562 state->package = internal_filename_package = strdup(filename);
564 global->token2info = dict_lookup(global->file2token2info,
565 current_filename // use long version
567 if(!global->token2info) {
568 global->token2info = dict_new2(&ptr_type);
569 dict_put(global->file2token2info, current_filename, global->token2info);
573 state->method = rfx_calloc(sizeof(methodstate_t));
574 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
575 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
577 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
578 function_initvars(state->method, 0, 0, 1);
579 global->init = abc_initscript(global->file);
585 if(!state || state->level!=1) {
586 syntaxerror("unexpected end of file in pass %d", as3_pass);
590 code_t*header = method_header(state->method);
591 code_t*c = wrap_function(header, 0, global->init->method->body->code);
592 global->init->method->body->code = c;
593 free(state->method);state->method=0;
596 //free(state->package);state->package=0; // used in registry
597 state_destroy(state);state=0;
600 void initialize_parser()
602 global = rfx_calloc(sizeof(global_t));
603 global->file = abc_file_new();
604 global->file->flags &= ~ABCFILE_LAZY;
605 global->file2token2info = dict_new();
606 global->token2info = 0;
609 void* finish_parser()
611 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
613 global->token2info=0;
619 static void xx_scopetest()
621 /* findpropstrict doesn't just return a scope object- it
622 also makes it "active" somehow. Push local_0 on the
623 scope stack and read it back with findpropstrict, it'll
624 contain properties like "trace". Trying to find the same
625 property on a "vanilla" local_0 yields only a "undefined" */
626 //c = abc_findpropstrict(c, "[package]::trace");
628 /*c = abc_getlocal_0(c);
629 c = abc_findpropstrict(c, "[package]::trace");
631 c = abc_setlocal_1(c);
633 c = abc_pushbyte(c, 0);
634 c = abc_setlocal_2(c);
636 code_t*xx = c = abc_label(c);
637 c = abc_findpropstrict(c, "[package]::trace");
638 c = abc_pushstring(c, "prop:");
639 c = abc_hasnext2(c, 1, 2);
641 c = abc_setlocal_3(c);
642 c = abc_callpropvoid(c, "[package]::trace", 2);
643 c = abc_getlocal_3(c);
645 c = abc_iftrue(c,xx);*/
648 typedef struct _variable {
652 methodstate_t*is_inner_method;
655 static variable_t* find_variable(state_t*s, char*name)
659 v = dict_lookup(s->vars, name);
661 if(s->new_vars) break;
666 static variable_t* find_slot(state_t*s, const char*name)
668 if(s->method && s->method->slots)
669 return dict_lookup(s->method->slots, name);
673 static variable_t* find_variable_safe(state_t*s, char*name)
675 variable_t* v = find_variable(s, name);
677 syntaxerror("undefined variable: %s", name);
680 static char variable_exists(char*name)
682 return dict_contains(state->vars, name);
684 code_t*defaultvalue(code_t*c, classinfo_t*type);
686 static int alloc_local()
688 return state->method->variable_count++;
691 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
694 variable_t*v = find_slot(state, name);
700 v->index = alloc_local();
705 dict_put(state->vars, name, v);
709 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
711 return new_variable2(name, type, init, maybeslot)->index;
714 #define TEMPVARNAME "__as3_temp__"
715 static int gettempvar()
717 variable_t*v = find_variable(state, TEMPVARNAME);
720 return new_variable(TEMPVARNAME, 0, 0, 0);
723 code_t* var_block(code_t*body)
729 for(t=0;t<state->vars->hashsize;t++) {
730 dictentry_t*e = state->vars->slots[t];
732 variable_t*v = (variable_t*)e->data;
733 if(v->type && v->init) {
734 c = defaultvalue(c, v->type);
735 c = abc_setlocal(c, v->index);
736 k = abc_kill(k, v->index);
746 if(x->opcode== OPCODE___BREAK__ ||
747 x->opcode== OPCODE___CONTINUE__) {
748 /* link kill code before break/continue */
749 code_t*e = code_dup(k);
750 code_t*s = code_start(e);
762 c = code_append(c, body);
763 c = code_append(c, k);
767 void unknown_variable(char*name)
769 if(!state->method->unresolved_variables)
770 state->method->unresolved_variables = dict_new();
771 if(!dict_contains(state->method->unresolved_variables, name))
772 dict_put(state->method->unresolved_variables, name, 0);
775 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
777 static void parsererror(const char*file, int line, const char*f)
779 syntaxerror("internal error in %s, %s:%d", f, file, line);
783 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
785 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
786 c = abc_getlocal_0(c);
787 c = abc_pushscope(c);
790 /* FIXME: this alloc_local() causes variable indexes to be
791 different in pass2 than in pass1 */
792 if(!m->activation_var)
793 m->activation_var = alloc_local();
795 c = abc_newactivation(c);
797 c = abc_pushscope(c);
798 c = abc_setlocal(c, m->activation_var);
800 c = abc_getlocal(c, m->activation_var);
801 c = abc_pushscope(c);
807 static code_t* method_header(methodstate_t*m)
811 c = add_scope_code(c, m, 1);
813 methodstate_list_t*l = m->innerfunctions;
815 parserassert(l->methodstate->abc);
816 if(m->uses_slots && l->methodstate->is_a_slot) {
817 c = abc_getscopeobject(c, 1);
818 c = abc_newfunction(c, l->methodstate->abc);
820 c = abc_setlocal(c, l->methodstate->var_index);
821 c = abc_setslot(c, l->methodstate->slot_index);
823 c = abc_newfunction(c, l->methodstate->abc);
824 c = abc_setlocal(c, l->methodstate->var_index);
826 free(l->methodstate);l->methodstate=0;
830 c = code_append(c, m->header);
833 if(m->is_constructor && !m->has_super) {
834 // call default constructor
835 c = abc_getlocal_0(c);
836 c = abc_constructsuper(c, 0);
838 list_free(m->innerfunctions);
839 m->innerfunctions = 0;
844 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
846 c = code_append(c, header);
847 c = code_append(c, var_block(body));
848 /* append return if necessary */
849 if(!c || (c->opcode != OPCODE_RETURNVOID &&
850 c->opcode != OPCODE_RETURNVALUE)) {
851 c = abc_returnvoid(c);
857 static void startpackage(char*name)
860 /*printf("entering package \"%s\"\n", name);*/
861 state->package = strdup(name);
863 static void endpackage()
865 /*printf("leaving package \"%s\"\n", state->package);*/
867 //used e.g. in classinfo_register:
868 //free(state->package);state->package=0;
873 #define FLAG_PUBLIC 256
874 #define FLAG_PROTECTED 512
875 #define FLAG_PRIVATE 1024
876 #define FLAG_PACKAGEINTERNAL 2048
877 #define FLAG_NAMESPACE 4096
879 static namespace_t modifiers2access(modifiers_t*mod)
884 if(mod->flags&FLAG_NAMESPACE) {
885 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
886 syntaxerror("invalid combination of access levels and namespaces");
887 ns.access = ACCESS_NAMESPACE;
889 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
891 /* shouldn't happen- the tokenizer only reports something as a namespace
892 if it was already registered */
893 trie_dump(active_namespaces);
894 syntaxerror("unknown namespace: %s", mod->ns);
897 } else if(mod->flags&FLAG_PUBLIC) {
898 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
899 syntaxerror("invalid combination of access levels");
900 ns.access = ACCESS_PACKAGE;
901 } else if(mod->flags&FLAG_PRIVATE) {
902 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
903 syntaxerror("invalid combination of access levels");
904 ns.access = ACCESS_PRIVATE;
905 } else if(mod->flags&FLAG_PROTECTED) {
906 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
907 syntaxerror("invalid combination of access levels");
908 ns.access = ACCESS_PROTECTED;
910 ns.access = ACCESS_PACKAGEINTERNAL;
914 static slotinfo_t* find_class(const char*name);
916 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
918 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
921 void add_active_url(const char*url)
925 list_append(state->active_namespace_urls, n);
928 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
933 index = new_variable("this", 0, 0, 0);
934 else if(!m->is_global)
935 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
937 index = new_variable("globalscope", 0, 0, 0);
940 parserassert(!index);
944 /* as variables and slots share the same number, make sure
945 that those variable indices are reserved. It's up to the
946 optimizer to later shuffle the variables down to lower
948 m->variable_count = m->uses_slots;
953 for(p=params->list;p;p=p->next) {
954 new_variable(p->param->name, p->param->type, 0, 1);
958 methodstate_list_t*l = m->innerfunctions;
960 methodstate_t*m = l->methodstate;
962 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
963 m->var_index = v->index;
964 m->slot_index = v->index;
965 v->is_inner_method = m;
971 m->scope_code = add_scope_code(m->scope_code, m, 0);
974 if(as3_pass==2 && m->slots) {
975 /* exchange unresolved identifiers with the actual objects */
976 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
977 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
978 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
979 if(!type || type->kind != INFOTYPE_CLASS) {
980 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
989 char*as3_globalclass=0;
990 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
993 syntaxerror("inner classes now allowed");
998 classinfo_list_t*mlist=0;
1000 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1001 syntaxerror("invalid modifier(s)");
1003 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1004 syntaxerror("public and internal not supported at the same time.");
1006 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1007 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1008 // all classes extend object
1009 extends = registry_getobjectclass();
1012 /* create the class name, together with the proper attributes */
1016 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1017 access = ACCESS_PRIVATE; package = internal_filename_package;
1018 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1019 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1020 } else if(state->package!=internal_filename_package) {
1021 access = ACCESS_PACKAGE; package = state->package;
1023 syntaxerror("public classes only allowed inside a package");
1027 state->cls = rfx_calloc(sizeof(classstate_t));
1028 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1029 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1030 /* notice: we make no effort to initialize the top variable (local0) here,
1031 even though it has special meaning. We just rely on the facat
1032 that pass 1 won't do anything with variables */
1034 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1036 /* set current method to constructor- all code within the class-level (except
1037 static variable initializations) will be executed during construction time */
1038 state->method = state->cls->init;
1040 if(registry_find(package, classname)) {
1041 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1043 /* build info struct */
1044 int num_interfaces = (list_length(implements));
1045 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1046 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1049 classinfo_list_t*l = implements;
1050 for(l=implements;l;l=l->next) {
1051 state->cls->info->interfaces[pos++] = l->classinfo;
1056 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1058 state->method = state->cls->init;
1059 parserassert(state->cls && state->cls->info);
1061 function_initvars(state->cls->init, 0, 0, 1);
1062 function_initvars(state->cls->static_init, 0, 0, 0);
1064 if(extends && (extends->flags & FLAG_FINAL))
1065 syntaxerror("Can't extend final class '%s'", extends->name);
1068 while(state->cls->info->interfaces[pos]) {
1069 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1070 syntaxerror("'%s' is not an interface",
1071 state->cls->info->interfaces[pos]->name);
1075 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
1076 state->cls->info->superclass = extends;
1078 /* generate the abc code for this class */
1079 MULTINAME(classname2,state->cls->info);
1080 multiname_t*extends2 = sig2mname(extends);
1082 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1083 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1084 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1085 if(state->cls->info->flags&FLAG_INTERFACE) {
1086 abc_class_interface(state->cls->abc);
1089 abc_class_protectedNS(state->cls->abc, classname);
1091 for(mlist=implements;mlist;mlist=mlist->next) {
1092 MULTINAME(m, mlist->classinfo);
1093 abc_class_add_interface(state->cls->abc, &m);
1096 /* write the construction code for this class to the global init
1098 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1100 abc_method_body_t*m = global->init->method->body;
1101 __ getglobalscope(m);
1102 classinfo_t*s = extends;
1107 //TODO: take a look at the current scope stack, maybe
1108 // we can re-use something
1113 multiname_t*s2 = sig2mname(s);
1115 multiname_destroy(s2);
1117 __ pushscope(m); count++;
1118 m->code = m->code->prev->prev; // invert
1120 /* continue appending after last op end */
1121 while(m->code && m->code->next) m->code = m->code->next;
1123 /* TODO: if this is one of *our* classes, we can also
1124 do a getglobalscope/getslot <nr> (which references
1125 the init function's slots) */
1127 __ getlex2(m, extends2);
1129 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1130 stack is not the superclass */
1131 __ pushscope(m);count++;
1134 /* notice: we get a verify error #1107 if the top element on the scope
1135 stack is not the global object */
1137 __ pushscope(m);count++;
1139 __ newclass(m,state->cls->abc);
1143 __ setslot(m, slotindex);
1144 multiname_destroy(extends2);
1146 /* flash.display.MovieClip handling */
1148 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1149 if(state->package && state->package[0]) {
1150 as3_globalclass = concat3(state->package, ".", classname);
1152 as3_globalclass = strdup(classname);
1158 static int slotstate_varconst = 0;
1159 static modifiers_t*slotstate_flags = 0;
1160 static void setslotstate(modifiers_t* flags, int varconst)
1162 slotstate_varconst = varconst;
1163 slotstate_flags = flags;
1165 if(flags && flags->flags&FLAG_STATIC) {
1166 state->method = state->cls->static_init;
1168 state->method = state->cls->init;
1171 parserassert(state->method);
1175 static void endclass()
1178 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1180 c = abc_getlocal_0(c);
1181 c = abc_constructsuper(c, 0);
1182 state->cls->init->header = code_append(state->cls->init->header, c);
1183 state->cls->has_constructor=1;
1185 if(state->cls->init) {
1186 if(state->cls->info->flags&FLAG_INTERFACE) {
1187 if(state->cls->init->header)
1188 syntaxerror("interface can not have class-level code");
1190 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1191 code_t*c = method_header(state->cls->init);
1192 m->body->code = wrap_function(c, 0, m->body->code);
1195 if(state->cls->static_init) {
1196 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1197 code_t*c = method_header(state->cls->static_init);
1198 m->body->code = wrap_function(c, 0, m->body->code);
1205 void check_code_for_break(code_t*c)
1208 if(c->opcode == OPCODE___BREAK__) {
1209 char*name = string_cstr(c->data[0]);
1210 syntaxerror("Unresolved \"break %s\"", name);
1212 if(c->opcode == OPCODE___CONTINUE__) {
1213 char*name = string_cstr(c->data[0]);
1214 syntaxerror("Unresolved \"continue %s\"", name);
1216 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1217 char*name = string_cstr(c->data[0]);
1218 syntaxerror("Can't reference a package (%s) as such", name);
1225 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1228 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1229 if(TYPE_IS_NUMBER(t)) {
1230 xassert(c->type == CONSTANT_FLOAT
1231 || c->type == CONSTANT_INT
1232 || c->type == CONSTANT_UINT);
1233 } else if(TYPE_IS_UINT(t)) {
1234 xassert(c->type == CONSTANT_UINT ||
1235 (c->type == CONSTANT_INT && c->i>=0));
1236 } else if(TYPE_IS_INT(t)) {
1237 xassert(c->type == CONSTANT_INT);
1238 } else if(TYPE_IS_BOOLEAN(t)) {
1239 xassert(c->type == CONSTANT_TRUE
1240 || c->type == CONSTANT_FALSE);
1244 static void check_override(memberinfo_t*m, int flags)
1248 if(m->parent == state->cls->info)
1249 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1251 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1252 if(m->access==ACCESS_PRIVATE)
1254 if(m->flags & FLAG_FINAL)
1255 syntaxerror("can't override final member %s", m->name);
1257 /* allow this. it's no issue.
1258 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1259 syntaxerror("can't override static member %s", m->name);*/
1261 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1262 syntaxerror("can't override non-static member %s with static declaration", m->name);
1264 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1265 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1266 if(m->kind == INFOTYPE_METHOD)
1267 syntaxerror("can't override without explicit 'override' declaration");
1269 syntaxerror("can't override '%s'", m->name);
1274 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1276 methodinfo_t*minfo = 0;
1277 namespace_t ns = modifiers2access(mod);
1280 minfo = methodinfo_register_global(ns.access, state->package, name);
1281 minfo->return_type = 0; // save this for pass 2
1282 } else if(getset != KW_GET && getset != KW_SET) {
1284 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1286 printf("%s.%s | %s.%s\n",
1287 m->package, m->name,
1289 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1291 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1292 minfo->return_type = 0; // save this for pass 2
1293 // getslot on a member slot only returns "undefined", so no need
1294 // to actually store these
1295 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1297 //class getter/setter
1298 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1300 if(getset == KW_GET) {
1302 } else if(params->list && params->list->param && !params->list->next) {
1303 type = params->list->param->type;
1305 syntaxerror("setter function needs to take exactly one argument");
1306 // not sure wether to look into superclasses here, too
1307 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1309 if(minfo->kind!=INFOTYPE_SLOT)
1310 syntaxerror("class already contains a method called '%s'", name);
1311 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1312 syntaxerror("class already contains a field called '%s'", name);
1313 if(minfo->subtype & gs)
1314 syntaxerror("getter/setter for '%s' already defined", name);
1315 /* make a setter or getter into a getset */
1316 minfo->subtype |= gs;
1319 FIXME: this check needs to be done in pass 2
1321 if((!minfo->return_type != !type) ||
1322 (minfo->return_type && type &&
1323 !strcmp(minfo->return_type->name, type->name))) {
1324 syntaxerror("different type in getter and setter: %s and %s",
1325 minfo->return_type?minfo->return_type->name:"*",
1326 type?type->name:"*");
1329 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1330 minfo->kind = INFOTYPE_SLOT; //hack
1331 minfo->subtype = gs;
1332 minfo->return_type = 0;
1334 /* can't assign a slot as getter and setter might have different slots */
1335 //minfo->slot = slot;
1337 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1338 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1339 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1344 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1346 //parserassert(state->method && state->method->info);
1348 methodstate_t*parent_method = state->method;
1351 return_type = 0; // not valid in pass 1
1355 state->new_vars = 1;
1358 state->method = rfx_calloc(sizeof(methodstate_t));
1359 state->method->inner = 1;
1360 state->method->variable_count = 0;
1361 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1363 NEW(methodinfo_t,minfo);
1364 minfo->kind = INFOTYPE_METHOD;
1365 minfo->access = ACCESS_PACKAGEINTERNAL;
1367 state->method->info = minfo;
1370 list_append(parent_method->innerfunctions, state->method);
1372 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1374 function_initvars(state->method, params, 0, 1);
1378 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1379 state->method->variable_count = 0;
1380 parserassert(state->method);
1382 state->method->info->return_type = return_type;
1383 function_initvars(state->method, params, 0, 1);
1387 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1388 params_t*params, classinfo_t*return_type)
1390 if(state->method && state->method->info) {
1391 syntaxerror("not able to start another method scope");
1394 state->new_vars = 1;
1397 state->method = rfx_calloc(sizeof(methodstate_t));
1398 state->method->has_super = 0;
1401 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1403 state->method->is_global = 1;
1404 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1406 if(state->method->is_constructor)
1407 name = "__as3_constructor__";
1409 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1411 function_initvars(state->method, params, mod->flags, 1);
1413 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1417 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1418 state->method->variable_count = 0;
1419 parserassert(state->method);
1422 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1423 check_override(m, mod->flags);
1427 state->cls->has_constructor |= state->method->is_constructor;
1430 state->method->info->return_type = return_type;
1431 function_initvars(state->method, params, mod->flags, 1);
1435 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1436 params_t*params, classinfo_t*return_type, code_t*body)
1439 // store inner methods in variables
1440 function_initvars(state->method, 0, 0, 0);
1442 methodstate_list_t*ml = state->method->innerfunctions;
1444 dict_t*xvars = dict_new();
1447 methodstate_t*m = ml->methodstate;
1448 parserassert(m->inner);
1449 if(m->unresolved_variables) {
1450 dict_t*d = m->unresolved_variables;
1452 for(t=0;t<d->hashsize;t++) {
1453 dictentry_t*l = d->slots[t];
1455 /* check parent method's variables */
1457 if((v=find_variable(state, l->key))) {
1458 m->uses_parent_function = 1;
1459 state->method->uses_slots = 1;
1460 dict_put(xvars, l->key, 0);
1467 dict_destroy(m->unresolved_variables);
1468 m->unresolved_variables = 0;
1473 if(state->method->uses_slots) {
1474 state->method->slots = dict_new();
1476 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1477 if(!name) syntaxerror("internal error");
1478 if(v->index && dict_contains(xvars, name)) {
1481 if(v->is_inner_method) {
1482 v->is_inner_method->is_a_slot = 1;
1485 dict_put(state->method->slots, name, v);
1488 state->method->uses_slots = i;
1489 dict_destroy(state->vars);state->vars = 0;
1496 /*if(state->method->uses_parent_function){
1497 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1502 multiname_t*type2 = sig2mname(return_type);
1504 if(state->method->inner) {
1505 f = state->method->abc;
1506 abc_method_init(f, global->file, type2, 1);
1507 } else if(state->method->is_constructor) {
1508 f = abc_class_getconstructor(state->cls->abc, type2);
1509 } else if(!state->method->is_global) {
1510 namespace_t mname_ns = modifiers2access(mod);
1511 multiname_t mname = {QNAME, &mname_ns, 0, name};
1513 if(mod->flags&FLAG_STATIC)
1514 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1516 f = abc_class_method(state->cls->abc, type2, &mname);
1517 slot = f->trait->slot_id;
1519 namespace_t mname_ns = {state->method->info->access, state->package};
1520 multiname_t mname = {QNAME, &mname_ns, 0, name};
1522 f = abc_method_new(global->file, type2, 1);
1523 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1524 //abc_code_t*c = global->init->method->body->code;
1526 //flash doesn't seem to allow us to access function slots
1527 //state->method->info->slot = slot;
1529 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1530 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1531 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1532 if(params->varargs) f->flags |= METHOD_NEED_REST;
1536 for(p=params->list;p;p=p->next) {
1537 if(params->varargs && !p->next) {
1538 break; //varargs: omit last parameter in function signature
1540 multiname_t*m = sig2mname(p->param->type);
1541 list_append(f->parameters, m);
1542 if(p->param->value) {
1543 check_constant_against_type(p->param->type, p->param->value);
1544 opt=1;list_append(f->optional_parameters, p->param->value);
1546 syntaxerror("non-optional parameter not allowed after optional parameters");
1549 if(state->method->slots) {
1550 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1552 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1553 multiname_t*type = sig2mname(v->type);
1554 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1555 t->slot_id = v->index;
1560 check_code_for_break(body);
1562 /* Seems this works now.
1563 if(state->method->exceptions && state->method->uses_slots) {
1564 as3_warning("try/catch and activation not supported yet within the same method");
1568 f->body->code = body;
1569 f->body->exceptions = state->method->exceptions;
1570 } else { //interface
1572 syntaxerror("interface methods can't have a method body");
1582 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1587 void breakjumpsto(code_t*c, char*name, code_t*jump)
1590 if(c->opcode == OPCODE___BREAK__) {
1591 string_t*name2 = c->data[0];
1592 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1593 c->opcode = OPCODE_JUMP;
1600 void continuejumpsto(code_t*c, char*name, code_t*jump)
1603 if(c->opcode == OPCODE___CONTINUE__) {
1604 string_t*name2 = c->data[0];
1605 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1606 c->opcode = OPCODE_JUMP;
1614 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1615 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1616 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1618 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1620 if(!type1 || !type2)
1621 return registry_getanytype();
1622 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1623 return registry_getanytype();
1626 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1635 return registry_getanytype();
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 return abc_coerce2(c, &m);
1656 //printf("%s.%s\n", from.package, from.name);
1657 //printf("%s.%s\n", to.package, to.name);
1659 classinfo_t*supertype = from;
1661 if(supertype == to) {
1662 // target type is one of from's superclasses
1663 return abc_coerce2(c, &m);
1666 while(supertype->interfaces[t]) {
1667 if(supertype->interfaces[t]==to) {
1668 // target type is one of from's interfaces
1669 return abc_coerce2(c, &m);
1673 supertype = supertype->superclass;
1675 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1677 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1679 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1682 as3_error("can't convert type %s%s%s to %s%s%s",
1683 from->package, from->package?".":"", from->name,
1684 to->package, to->package?".":"", to->name);
1688 code_t*defaultvalue(code_t*c, classinfo_t*type)
1690 if(TYPE_IS_INT(type)) {
1691 c = abc_pushbyte(c, 0);
1692 } else if(TYPE_IS_UINT(type)) {
1693 c = abc_pushuint(c, 0);
1694 } else if(TYPE_IS_FLOAT(type)) {
1696 } else if(TYPE_IS_BOOLEAN(type)) {
1697 c = abc_pushfalse(c);
1699 //c = abc_pushundefined(c);
1701 c = abc_pushnull(c);
1703 c = abc_coerce2(c, &m);
1708 char is_pushundefined(code_t*c)
1710 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1713 static const char* get_package_from_name(const char*name)
1715 /* try explicit imports */
1716 dictentry_t* e = dict_get_slot(state->imports, name);
1718 if(!strcmp(e->key, name)) {
1719 slotinfo_t*c = (slotinfo_t*)e->data;
1720 if(c) return c->package;
1726 static namespace_list_t*get_current_imports()
1728 namespace_list_t*searchlist = 0;
1730 list_append(searchlist, namespace_new_package(state->package));
1732 import_list_t*l = state->wildcard_imports;
1734 namespace_t*ns = namespace_new_package(l->import->package);
1735 list_append(searchlist, ns);
1738 list_append(searchlist, namespace_new_package(""));
1739 list_append(searchlist, namespace_new_package(internal_filename_package));
1743 static slotinfo_t* find_class(const char*name)
1747 c = registry_find(state->package, name);
1750 /* try explicit imports */
1751 dictentry_t* e = dict_get_slot(state->imports, name);
1754 if(!strcmp(e->key, name)) {
1755 c = (slotinfo_t*)e->data;
1761 /* try package.* imports */
1762 import_list_t*l = state->wildcard_imports;
1764 //printf("does package %s contain a class %s?\n", l->import->package, name);
1765 c = registry_find(l->import->package, name);
1770 /* try global package */
1771 c = registry_find("", name);
1774 /* try local "filename" package */
1775 c = registry_find(internal_filename_package, name);
1780 typedcode_t push_class(slotinfo_t*a)
1785 if(a->access == ACCESS_PACKAGEINTERNAL &&
1786 strcmp(a->package, state->package) &&
1787 strcmp(a->package, internal_filename_package)
1789 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1790 infotypename(a), a->name, a->package, state->package);
1793 if(a->kind != INFOTYPE_CLASS) {
1795 x.c = abc_findpropstrict2(x.c, &m);
1796 x.c = abc_getproperty2(x.c, &m);
1797 if(a->kind == INFOTYPE_METHOD) {
1798 methodinfo_t*f = (methodinfo_t*)a;
1799 x.t = TYPE_FUNCTION(f);
1801 varinfo_t*v = (varinfo_t*)a;
1805 classinfo_t*c = (classinfo_t*)a;
1807 x.c = abc_getglobalscope(x.c);
1808 x.c = abc_getslot(x.c, c->slot);
1811 x.c = abc_getlex2(x.c, &m);
1813 x.t = TYPE_CLASS(c);
1818 static char is_getlocal(code_t*c)
1820 if(!c || c->prev || c->next)
1822 return(c->opcode == OPCODE_GETLOCAL
1823 || c->opcode == OPCODE_GETLOCAL_0
1824 || c->opcode == OPCODE_GETLOCAL_1
1825 || c->opcode == OPCODE_GETLOCAL_2
1826 || c->opcode == OPCODE_GETLOCAL_3);
1828 static int getlocalnr(code_t*c)
1830 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1831 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1832 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1833 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1834 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1835 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1839 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1843 [prefix code] [read instruction]
1847 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1849 if(in && in->opcode == OPCODE_COERCE_A) {
1850 in = code_cutlast(in);
1853 syntaxerror("internal error");
1855 /* chop off read instruction */
1859 prefix = r->prev;r->prev = 0;
1865 char use_temp_var = readbefore;
1867 /* generate the write instruction, and maybe append a dup to the prefix code */
1868 code_t* write = abc_nop(0);
1869 if(r->opcode == OPCODE_GETPROPERTY) {
1870 write->opcode = OPCODE_SETPROPERTY;
1871 multiname_t*m = (multiname_t*)r->data[0];
1872 write->data[0] = multiname_clone(m);
1873 if(m->type == QNAME || m->type == MULTINAME) {
1875 prefix = abc_dup(prefix); // we need the object, too
1878 } else if(m->type == MULTINAMEL) {
1880 /* dupping two values on the stack requires 5 operations and one register-
1881 couldn't adobe just have given us a dup2? */
1882 int temp = gettempvar();
1883 prefix = abc_setlocal(prefix, temp);
1884 prefix = abc_dup(prefix);
1885 prefix = abc_getlocal(prefix, temp);
1886 prefix = abc_swap(prefix);
1887 prefix = abc_getlocal(prefix, temp);
1889 prefix = abc_kill(prefix, temp);
1893 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1895 } else if(r->opcode == OPCODE_GETSLOT) {
1896 write->opcode = OPCODE_SETSLOT;
1897 write->data[0] = r->data[0];
1899 prefix = abc_dup(prefix); // we need the object, too
1902 } else if(r->opcode == OPCODE_GETLOCAL) {
1903 write->opcode = OPCODE_SETLOCAL;
1904 write->data[0] = r->data[0];
1905 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1906 write->opcode = OPCODE_SETLOCAL_0;
1907 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1908 write->opcode = OPCODE_SETLOCAL_1;
1909 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1910 write->opcode = OPCODE_SETLOCAL_2;
1911 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1912 write->opcode = OPCODE_SETLOCAL_3;
1913 } else if(r->opcode == OPCODE_GETSUPER) {
1914 write->opcode = OPCODE_SETSUPER;
1915 multiname_t*m = (multiname_t*)r->data[0];
1916 write->data[0] = multiname_clone(m);
1919 syntaxerror("illegal lvalue: can't assign a value to this expression");
1926 /* with getproperty/getslot, we have to be extra careful not
1927 to execute the read code twice, as it might have side-effects
1928 (e.g. if the property is in fact a setter/getter combination)
1930 So read the value, modify it, and write it again,
1931 using prefix only once and making sure (by using a temporary
1932 register) that the return value is what we just wrote */
1933 temp = gettempvar();
1934 c = code_append(c, prefix);
1935 c = code_append(c, r);
1938 c = abc_setlocal(c, temp);
1940 c = code_append(c, middlepart);
1943 c = abc_setlocal(c, temp);
1945 c = code_append(c, write);
1946 c = abc_getlocal(c, temp);
1947 c = abc_kill(c, temp);
1949 /* if we're allowed to execute the read code twice *and*
1950 the middlepart doesn't modify the code, things are easier.
1952 code_t* r2 = code_dup(r);
1953 //c = code_append(c, prefix);
1954 parserassert(!prefix);
1955 c = code_append(c, r);
1956 c = code_append(c, middlepart);
1957 c = code_append(c, write);
1958 c = code_append(c, r2);
1961 /* even smaller version: overwrite the value without reading
1965 c = code_append(c, prefix);
1968 c = code_append(c, middlepart);
1969 c = code_append(c, write);
1970 c = code_append(c, r);
1973 temp = gettempvar();
1975 c = code_append(c, prefix);
1977 c = code_append(c, middlepart);
1979 c = abc_setlocal(c, temp);
1980 c = code_append(c, write);
1981 c = abc_getlocal(c, temp);
1982 c = abc_kill(c, temp);
1988 char is_break_or_jump(code_t*c)
1992 if(c->opcode == OPCODE_JUMP ||
1993 c->opcode == OPCODE___BREAK__ ||
1994 c->opcode == OPCODE___CONTINUE__ ||
1995 c->opcode == OPCODE_THROW ||
1996 c->opcode == OPCODE_RETURNVOID ||
1997 c->opcode == OPCODE_RETURNVALUE) {
2003 #define IS_FINALLY_TARGET(op) \
2004 ((op) == OPCODE___CONTINUE__ || \
2005 (op) == OPCODE___BREAK__ || \
2006 (op) == OPCODE_RETURNVOID || \
2007 (op) == OPCODE_RETURNVALUE || \
2008 (op) == OPCODE___RETHROW__)
2010 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
2012 #define NEED_EXTRA_STACK_ARG
2013 code_t*finally_label = abc_nop(0);
2014 NEW(lookupswitch_t, l);
2020 code_t*prev = i->prev;
2021 if(IS_FINALLY_TARGET(i->opcode)) {
2024 if(i->opcode == OPCODE___RETHROW__ ||
2025 i->opcode == OPCODE_RETURNVALUE) {
2026 if(i->opcode == OPCODE___RETHROW__)
2027 i->opcode = OPCODE_THROW;
2029 p = abc_coerce_a(p);
2030 p = abc_setlocal(p, tempvar);
2032 p = abc_pushbyte(p, count++);
2033 p = abc_jump(p, finally_label);
2034 code_t*target = p = abc_label(p);
2035 #ifdef NEED_EXTRA_STACK_ARG
2039 p = abc_getlocal(p, tempvar);
2042 p->next = i;i->prev = p;
2043 list_append(l->targets, target);
2049 c = abc_pushbyte(c, -1);
2050 c = code_append(c, finally_label);
2051 c = code_append(c, finally);
2053 #ifdef NEED_EXTRA_STACK_ARG
2056 c = abc_lookupswitch(c, l);
2057 c = l->def = abc_label(c);
2058 #ifdef NEED_EXTRA_STACK_ARG
2065 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
2069 code_t*prev = i->prev;
2070 if(IS_FINALLY_TARGET(i->opcode)) {
2071 if(i->opcode == OPCODE___RETHROW__)
2072 i->opcode = OPCODE_THROW;
2073 code_t*end = code_dup(finally);
2074 code_t*start = code_start(end);
2075 if(prev) prev->next = start;
2082 return code_append(c, finally);
2085 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
2091 int num_insertion_points=0;
2093 if(IS_FINALLY_TARGET(i->opcode))
2094 num_insertion_points++;
2101 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2106 int simple_version_cost = (1+num_insertion_points)*code_size;
2107 int lookup_version_cost = 4*num_insertion_points + 5;
2109 if(cantdup || simple_version_cost > lookup_version_cost) {
2110 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
2111 return insert_finally_lookup(c, finally, tempvar);
2113 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
2114 return insert_finally_simple(c, finally, tempvar);
2118 #define PASS1 }} if(as3_pass == 1) {{
2119 #define PASS1END }} if(as3_pass == 2) {{
2120 #define PASS2 }} if(as3_pass == 2) {{
2121 #define PASS12 }} {{
2122 #define PASS12END }} if(as3_pass == 2) {{
2126 /* Line 273 of skeleton.m4 */
2127 #line 2128 "parser.tab.c"
2134 typedef YYTYPE_UINT8 yytype_uint8;
2136 typedef unsigned char yytype_uint8;
2140 typedef YYTYPE_INT8 yytype_int8;
2141 #elif (defined __STDC__ || defined __C99__FUNC__ \
2142 || defined __cplusplus || defined _MSC_VER)
2143 typedef signed char yytype_int8;
2145 typedef short int yytype_int8;
2148 #ifdef YYTYPE_UINT16
2149 typedef YYTYPE_UINT16 yytype_uint16;
2151 typedef unsigned short int yytype_uint16;
2155 typedef YYTYPE_INT16 yytype_int16;
2157 typedef short int yytype_int16;
2161 # ifdef __SIZE_TYPE__
2162 # define YYSIZE_T __SIZE_TYPE__
2163 # elif defined size_t
2164 # define YYSIZE_T size_t
2165 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2166 || defined __cplusplus || defined _MSC_VER)
2167 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2168 # define YYSIZE_T size_t
2170 # define YYSIZE_T unsigned int
2174 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2179 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2180 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2184 # define YY_(msgid) msgid
2188 /* Suppress unused-variable warnings by "using" E. */
2189 #if ! defined lint || defined __GNUC__
2190 # define YYUSE(e) ((void) (e))
2192 # define YYUSE(e) /* empty */
2195 /* Identity function, used to suppress warnings about constant conditions. */
2197 # define YYID(n) (n)
2199 #if (defined __STDC__ || defined __C99__FUNC__ \
2200 || defined __cplusplus || defined _MSC_VER)
2213 #if ! defined yyoverflow || YYERROR_VERBOSE
2215 /* The parser invokes alloca or malloc; define the necessary symbols. */
2217 # ifdef YYSTACK_USE_ALLOCA
2218 # if YYSTACK_USE_ALLOCA
2220 # define YYSTACK_ALLOC __builtin_alloca
2221 # elif defined __BUILTIN_VA_ARG_INCR
2222 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2224 # define YYSTACK_ALLOC __alloca
2225 # elif defined _MSC_VER
2226 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2227 # define alloca _alloca
2229 # define YYSTACK_ALLOC alloca
2230 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2231 || defined __cplusplus || defined _MSC_VER)
2232 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2234 # define _STDLIB_H 1
2241 # ifdef YYSTACK_ALLOC
2242 /* Pacify GCC's `empty if-body' warning. */
2243 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2244 # ifndef YYSTACK_ALLOC_MAXIMUM
2245 /* The OS might guarantee only one guard page at the bottom of the stack,
2246 and a page size can be as small as 4096 bytes. So we cannot safely
2247 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2248 to allow for a few compiler-allocated temporary stack slots. */
2249 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2252 # define YYSTACK_ALLOC YYMALLOC
2253 # define YYSTACK_FREE YYFREE
2254 # ifndef YYSTACK_ALLOC_MAXIMUM
2255 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2257 # if (defined __cplusplus && ! defined _STDLIB_H \
2258 && ! ((defined YYMALLOC || defined malloc) \
2259 && (defined YYFREE || defined free)))
2260 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2262 # define _STDLIB_H 1
2266 # define YYMALLOC malloc
2267 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2268 || defined __cplusplus || defined _MSC_VER)
2269 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2273 # define YYFREE free
2274 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2275 || defined __cplusplus || defined _MSC_VER)
2276 void free (void *); /* INFRINGES ON USER NAME SPACE */
2280 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2283 #if (! defined yyoverflow \
2284 && (! defined __cplusplus \
2285 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2287 /* A type that is properly aligned for any stack member. */
2290 yytype_int16 yyss_alloc;
2294 /* The size of the maximum gap between one aligned stack and the next. */
2295 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2297 /* The size of an array large to enough to hold all stacks, each with
2299 # define YYSTACK_BYTES(N) \
2300 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2301 + YYSTACK_GAP_MAXIMUM)
2303 /* Copy COUNT objects from FROM to TO. The source and destination do
2306 # if defined __GNUC__ && 1 < __GNUC__
2307 # define YYCOPY(To, From, Count) \
2308 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2310 # define YYCOPY(To, From, Count) \
2314 for (yyi = 0; yyi < (Count); yyi++) \
2315 (To)[yyi] = (From)[yyi]; \
2321 /* Relocate STACK from its old location to the new one. The
2322 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2323 elements in the stack, and YYPTR gives the new location of the
2324 stack. Advance YYPTR to a properly aligned location for the next
2326 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2329 YYSIZE_T yynewbytes; \
2330 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2331 Stack = &yyptr->Stack_alloc; \
2332 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2333 yyptr += yynewbytes / sizeof (*yyptr); \
2339 /* YYFINAL -- State number of the termination state. */
2341 /* YYLAST -- Last index in YYTABLE. */
2344 /* YYNTOKENS -- Number of terminals. */
2345 #define YYNTOKENS 134
2346 /* YYNNTS -- Number of nonterminals. */
2348 /* YYNRULES -- Number of rules. */
2349 #define YYNRULES 309
2350 /* YYNRULES -- Number of states. */
2351 #define YYNSTATES 521
2353 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2354 #define YYUNDEFTOK 2
2355 #define YYMAXUTOK 363
2357 #define YYTRANSLATE(YYX) \
2358 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2360 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2361 static const yytype_uint8 yytranslate[] =
2363 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2364 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2365 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2366 2, 2, 2, 118, 2, 2, 2, 116, 108, 2,
2367 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2368 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2369 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2372 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2375 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2378 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2379 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2380 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2381 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2382 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2383 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2384 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2385 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2386 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2387 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2388 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2389 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2390 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2391 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2392 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2393 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2394 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2395 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2396 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2397 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2398 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2403 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2405 static const yytype_uint16 yyprhs[] =
2407 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2408 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2409 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2410 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2411 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2412 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2413 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2414 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2415 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2416 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2417 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2418 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2419 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2420 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2421 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2422 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2423 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2424 468, 470, 472, 474, 476, 478, 480, 482, 484, 485,
2425 487, 490, 495, 499, 501, 506, 509, 511, 513, 514,
2426 515, 528, 530, 531, 532, 543, 545, 549, 551, 553,
2427 555, 559, 561, 563, 565, 568, 569, 570, 574, 575,
2428 577, 579, 581, 584, 587, 588, 593, 598, 603, 606,
2429 608, 611, 613, 615, 619, 621, 623, 625, 627, 629,
2430 631, 633, 635, 637, 639, 641, 643, 645, 647, 649,
2431 651, 653, 655, 659, 663, 667, 671, 675, 679, 683,
2432 687, 691, 695, 698, 701, 705, 709, 713, 717, 721,
2433 725, 729, 733, 737, 741, 745, 749, 753, 757, 761,
2434 766, 769, 771, 775, 778, 783, 787, 788, 790, 794,
2435 800, 804, 808, 812, 816, 820, 824, 828, 832, 836,
2436 840, 844, 848, 854, 857, 860, 863, 866, 870, 873,
2437 878, 884, 888, 894, 898, 900, 903, 908, 913, 916
2440 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2441 static const yytype_int16 yyrhs[] =
2443 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2444 137, 138, -1, 186, -1, 198, -1, 196, -1, 217,
2445 -1, 207, -1, 147, -1, 148, 126, 136, 132, -1,
2446 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2447 198, -1, 196, -1, 217, -1, 207, -1, 147, -1,
2448 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2449 143, 145, -1, 145, -1, 189, -1, 159, -1, 160,
2450 -1, 161, -1, 163, -1, 171, -1, 154, -1, 183,
2451 -1, 179, -1, 239, -1, 247, -1, 246, -1, 126,
2452 143, 132, -1, 126, 132, -1, 99, -1, 144, -1,
2453 150, -1, 165, -1, 166, -1, 236, -1, 181, -1,
2454 148, 126, 143, 132, -1, 145, 99, -1, 145, -1,
2455 144, -1, 3, 89, 3, -1, 102, 237, -1, -1,
2456 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2457 152, -1, 3, 227, 149, -1, -1, 65, 146, -1,
2458 -1, 64, 122, 155, 238, 133, 146, 153, -1, -1,
2459 150, -1, 239, -1, 46, 3, 227, -1, 3, -1,
2460 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2461 238, 99, 239, 133, 146, -1, 158, 157, 68, 238,
2462 133, 146, -1, -1, 14, 122, 162, 238, 133, 146,
2463 -1, -1, 15, 164, 146, 14, 122, 238, 133, -1,
2464 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2465 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2466 168, 169, -1, 34, 240, 105, 142, -1, 62, 105,
2467 142, -1, -1, 16, 122, 172, 240, 133, 126, 167,
2468 132, -1, -1, 33, 122, 3, 227, 133, 174, 126,
2469 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2470 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2471 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2472 37, 238, -1, 37, -1, 39, 122, 238, 133, -1,
2473 182, 146, -1, 3, -1, 19, -1, 4, -1, 185,
2474 127, 184, -1, 184, -1, -1, 19, 185, 126, 187,
2475 139, 132, -1, -1, 19, 126, 188, 139, 132, -1,
2476 41, 223, -1, 41, 185, 127, 115, -1, -1, 191,
2477 -1, 192, -1, 191, 192, -1, 21, -1, 22, -1,
2478 20, -1, 38, -1, 47, -1, 49, -1, 48, -1,
2479 26, -1, 24, -1, 4, -1, -1, 54, 224, -1,
2480 -1, 54, 225, -1, -1, 17, 225, -1, -1, 190,
2481 31, 3, 193, 195, 126, 197, 200, 132, -1, -1,
2482 190, 44, 3, 194, 126, 199, 203, 132, -1, -1,
2483 201, -1, 202, -1, 201, 202, -1, 99, -1, 148,
2484 126, 200, 132, -1, 207, -1, 217, -1, 144, -1,
2485 -1, 204, -1, 205, -1, 204, 205, -1, 99, -1,
2486 46, 3, -1, 190, 27, 216, 3, 122, 213, 133,
2487 227, -1, 46, -1, 32, -1, -1, 190, 206, 208,
2488 209, -1, 210, -1, 209, 100, 210, -1, 3, 227,
2489 149, -1, -1, 102, 212, -1, 10, -1, 8, -1,
2490 9, -1, 12, -1, 5, -1, 56, -1, 55, -1,
2491 45, -1, 3, -1, -1, 214, -1, 93, 215, -1,
2492 214, 100, 93, 215, -1, 214, 100, 215, -1, 215,
2493 -1, 3, 105, 226, 211, -1, 3, 211, -1, 51,
2494 -1, 35, -1, -1, -1, 190, 27, 216, 3, 122,
2495 213, 133, 227, 126, 218, 142, 132, -1, 3, -1,
2496 -1, -1, 27, 219, 122, 213, 133, 227, 126, 221,
2497 142, 132, -1, 184, -1, 185, 127, 184, -1, 223,
2498 -1, 222, -1, 224, -1, 225, 100, 224, -1, 224,
2499 -1, 115, -1, 36, -1, 105, 226, -1, -1, -1,
2500 122, 229, 133, -1, -1, 230, -1, 231, -1, 237,
2501 -1, 230, 100, -1, 231, 237, -1, -1, 25, 240,
2502 232, 228, -1, 240, 122, 229, 133, -1, 53, 122,
2503 229, 133, -1, 63, 240, -1, 42, -1, 42, 238,
2504 -1, 240, -1, 240, -1, 238, 100, 240, -1, 238,
2505 -1, 220, -1, 241, -1, 244, -1, 233, -1, 235,
2506 -1, 234, -1, 6, -1, 10, -1, 11, -1, 8,
2507 -1, 9, -1, 12, -1, 5, -1, 29, -1, 56,
2508 -1, 55, -1, 45, -1, 240, 109, 240, -1, 240,
2509 110, 240, -1, 240, 75, 240, -1, 240, 76, 240,
2510 -1, 240, 71, 240, -1, 240, 72, 240, -1, 240,
2511 74, 240, -1, 240, 73, 240, -1, 240, 87, 240,
2512 -1, 240, 88, 240, -1, 118, 240, -1, 117, 240,
2513 -1, 240, 108, 240, -1, 240, 107, 240, -1, 240,
2514 106, 240, -1, 240, 96, 240, -1, 240, 95, 240,
2515 -1, 240, 94, 240, -1, 240, 114, 240, -1, 240,
2516 116, 240, -1, 240, 113, 240, -1, 240, 112, 240,
2517 -1, 240, 115, 240, -1, 240, 68, 240, -1, 240,
2518 69, 240, -1, 240, 40, 240, -1, 240, 67, 240,
2519 -1, 43, 122, 240, 133, -1, 36, 240, -1, 36,
2520 -1, 122, 238, 133, -1, 112, 240, -1, 240, 124,
2521 240, 125, -1, 124, 229, 125, -1, -1, 243, -1,
2522 237, 105, 237, -1, 243, 100, 237, 105, 237, -1,
2523 70, 242, 132, -1, 240, 80, 240, -1, 240, 79,
2524 240, -1, 240, 85, 240, -1, 240, 84, 240, -1,
2525 240, 86, 240, -1, 240, 78, 240, -1, 240, 77,
2526 240, -1, 240, 83, 240, -1, 240, 81, 240, -1,
2527 240, 82, 240, -1, 240, 102, 240, -1, 240, 104,
2528 240, 105, 240, -1, 240, 91, -1, 240, 90, -1,
2529 91, 240, -1, 90, 240, -1, 53, 127, 3, -1,
2530 128, 3, -1, 240, 127, 128, 3, -1, 240, 127,
2531 3, 89, 3, -1, 240, 92, 3, -1, 240, 127,
2532 122, 240, 133, -1, 240, 127, 3, -1, 3, -1,
2533 18, 3, -1, 18, 3, 102, 3, -1, 18, 3,
2534 102, 5, -1, 190, 245, -1, 23, 18, 224, -1
2537 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2538 static const yytype_uint16 yyrline[] =
2540 0, 2106, 2106, 2108, 2108, 2109, 2110, 2112, 2113, 2114,
2541 2115, 2116, 2117, 2118, 2119, 2121, 2121, 2122, 2123, 2125,
2542 2126, 2127, 2128, 2129, 2130, 2131, 2133, 2134, 2136, 2137,
2543 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149,
2544 2150, 2151, 2152, 2153, 2156, 2157, 2158, 2159, 2160, 2161,
2545 2162, 2163, 2167, 2168, 2172, 2179, 2183, 2184, 2188, 2189,
2546 2191, 2192, 2194, 2255, 2256, 2259, 2259, 2278, 2279, 2280,
2547 2285, 2289, 2294, 2295, 2297, 2317, 2365, 2365, 2384, 2384,
2548 2399, 2402, 2405, 2408, 2412, 2413, 2414, 2415, 2416, 2417,
2549 2419, 2430, 2433, 2433, 2464, 2464, 2489, 2489, 2505, 2506,
2550 2507, 2508, 2516, 2525, 2525, 2574, 2578, 2589, 2599, 2616,
2551 2617, 2618, 2620, 2621, 2623, 2623, 2625, 2625, 2628, 2642,
2552 2658, 2659, 2660, 2661, 2668, 2669, 2670, 2671, 2672, 2673,
2553 2674, 2675, 2676, 2677, 2681, 2682, 2684, 2685, 2687, 2688,
2554 2692, 2690, 2698, 2696, 2705, 2706, 2707, 2708, 2709, 2710,
2555 2711, 2712, 2714, 2720, 2721, 2722, 2723, 2724, 2725, 2728,
2556 2741, 2741, 2743, 2743, 2745, 2746, 2748, 2823, 2824, 2826,
2557 2827, 2828, 2829, 2830, 2832, 2833, 2834, 2835, 2847, 2851,
2558 2857, 2863, 2871, 2876, 2882, 2890, 2898, 2899, 2900, 2903,
2559 2902, 2919, 2920, 2922, 2921, 2945, 2964, 2978, 2979, 2981,
2560 2982, 2984, 2985, 2986, 2995, 2996, 3000, 3001, 3003, 3004,
2561 3005, 3007, 3011, 3012, 3017, 3018, 3054, 3100, 3121, 3142,
2562 3145, 3152, 3153, 3154, 3160, 3166, 3168, 3170, 3172, 3174,
2563 3176, 3178, 3195, 3200, 3203, 3206, 3209, 3212, 3215, 3218,
2564 3221, 3224, 3228, 3231, 3234, 3237, 3240, 3243, 3246, 3249,
2565 3253, 3264, 3282, 3287, 3292, 3297, 3302, 3307, 3311, 3315,
2566 3320, 3324, 3328, 3337, 3346, 3356, 3361, 3373, 3379, 3384,
2567 3390, 3396, 3400, 3402, 3413, 3422, 3429, 3430, 3432, 3438,
2568 3447, 3454, 3466, 3472, 3478, 3484, 3490, 3496, 3502, 3508,
2569 3521, 3532, 3539, 3552, 3579, 3593, 3607, 3621, 3636, 3643,
2570 3650, 3657, 3664, 3675, 3727, 3836, 3843, 3850, 3857, 3872
2574 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2575 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2576 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2577 static const char *const yytname[] =
2579 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2580 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2581 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2582 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2583 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2584 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2585 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2586 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2587 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2588 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2589 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2590 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2591 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2592 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2593 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2594 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2595 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2596 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2597 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2598 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2599 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2600 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2601 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2602 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2603 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2604 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2605 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2606 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2607 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2608 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2609 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2610 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2611 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH_HEAD",
2612 "WITH", "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9",
2613 "IMPORT", "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2614 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2615 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2616 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2617 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2618 "ONE_SLOT", "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2619 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2620 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2621 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2622 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2623 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2624 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2625 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2626 "NAMESPACE_ID", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2631 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2633 static const yytype_uint16 yytoknum[] =
2635 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2636 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2637 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2638 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2639 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2640 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2641 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2642 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2643 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2644 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2645 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2646 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2647 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2652 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2653 static const yytype_uint8 yyr1[] =
2655 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2656 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2657 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2658 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2659 144, 144, 144, 144, 145, 145, 145, 145, 145, 145,
2660 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2661 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2662 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2663 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2664 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2665 178, 178, 178, 180, 179, 181, 181, 182, 183, 184,
2666 184, 184, 185, 185, 187, 186, 188, 186, 189, 189,
2667 190, 190, 191, 191, 192, 192, 192, 192, 192, 192,
2668 192, 192, 192, 192, 193, 193, 194, 194, 195, 195,
2669 197, 196, 199, 198, 200, 200, 201, 201, 202, 202,
2670 202, 202, 202, 203, 203, 204, 204, 205, 205, 205,
2671 206, 206, 208, 207, 209, 209, 210, 211, 211, 212,
2672 212, 212, 212, 212, 212, 212, 212, 212, 213, 213,
2673 213, 213, 214, 214, 215, 215, 216, 216, 216, 218,
2674 217, 219, 219, 221, 220, 222, 223, 224, 224, 225,
2675 225, 226, 226, 226, 227, 227, 228, 228, 229, 229,
2676 229, 230, 231, 230, 232, 233, 234, 234, 235, 236,
2677 236, 237, 238, 238, 239, 240, 240, 240, 240, 240,
2678 240, 240, 241, 241, 241, 241, 241, 241, 241, 241,
2679 241, 241, 240, 240, 240, 240, 240, 240, 240, 240,
2680 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2681 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2682 240, 240, 240, 240, 240, 240, 242, 242, 243, 243,
2683 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2684 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2685 240, 240, 240, 240, 244, 245, 245, 245, 246, 247
2688 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2689 static const yytype_uint8 yyr2[] =
2691 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2692 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2693 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2694 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2695 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2696 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2697 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2698 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2699 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2700 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2701 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2702 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2703 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2704 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2705 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2706 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2707 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2708 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
2709 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2710 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2711 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2712 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2713 2, 1, 1, 3, 1, 1, 1, 1, 1, 1,
2714 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2715 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
2716 3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
2717 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
2718 2, 1, 3, 2, 4, 3, 0, 1, 3, 5,
2719 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2720 3, 3, 5, 2, 2, 2, 2, 3, 2, 4,
2721 5, 3, 5, 3, 1, 2, 4, 4, 2, 3
2724 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2725 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2726 means the default is an error. */
2727 static const yytype_uint16 yydefact[] =
2729 120, 304, 133, 237, 231, 234, 235, 232, 233, 236,
2730 0, 0, 78, 0, 0, 126, 124, 125, 0, 132,
2731 0, 131, 192, 238, 271, 127, 0, 0, 0, 241,
2732 128, 130, 129, 0, 0, 240, 239, 0, 0, 276,
2733 0, 0, 14, 0, 0, 0, 0, 208, 120, 0,
2734 0, 2, 120, 5, 54, 12, 0, 36, 67, 31,
2735 32, 33, 34, 35, 38, 120, 37, 7, 30, 0,
2736 121, 122, 9, 8, 11, 10, 225, 228, 230, 229,
2737 224, 39, 222, 226, 227, 41, 40, 0, 0, 72,
2738 76, 120, 92, 109, 111, 110, 116, 113, 0, 0,
2739 304, 214, 191, 0, 270, 0, 0, 118, 0, 103,
2740 208, 0, 218, 65, 0, 221, 0, 277, 296, 295,
2741 273, 253, 252, 0, 0, 209, 210, 211, 82, 0,
2742 106, 219, 0, 80, 44, 43, 120, 45, 29, 0,
2743 46, 47, 48, 50, 0, 49, 298, 1, 6, 120,
2744 304, 0, 68, 0, 0, 69, 53, 108, 0, 188,
2745 0, 161, 0, 160, 162, 308, 123, 0, 0, 0,
2746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2747 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2748 294, 293, 0, 0, 0, 0, 0, 0, 0, 0,
2749 0, 0, 0, 0, 0, 0, 0, 0, 208, 0,
2750 0, 55, 73, 0, 0, 0, 120, 114, 0, 195,
2751 0, 198, 197, 309, 206, 178, 0, 0, 0, 27,
2752 0, 297, 0, 0, 280, 0, 272, 275, 212, 213,
2753 83, 205, 59, 60, 105, 220, 58, 81, 42, 28,
2754 120, 0, 205, 0, 0, 52, 305, 187, 186, 0,
2755 134, 136, 0, 223, 267, 268, 265, 266, 246, 247,
2756 249, 248, 244, 245, 287, 286, 282, 281, 289, 290,
2757 288, 284, 283, 285, 250, 251, 301, 259, 258, 257,
2758 291, 0, 256, 255, 254, 242, 243, 263, 262, 260,
2759 264, 261, 0, 0, 303, 0, 0, 0, 0, 0,
2760 25, 0, 120, 17, 23, 0, 20, 19, 22, 21,
2761 120, 112, 0, 208, 215, 167, 0, 0, 179, 183,
2762 107, 119, 196, 269, 0, 26, 217, 0, 278, 0,
2763 0, 57, 0, 120, 13, 57, 0, 0, 0, 0,
2764 0, 138, 0, 0, 205, 163, 164, 0, 216, 274,
2765 0, 0, 299, 120, 0, 0, 117, 18, 120, 0,
2766 0, 0, 0, 185, 180, 205, 0, 0, 120, 0,
2767 203, 202, 201, 204, 0, 62, 61, 51, 0, 120,
2768 306, 307, 178, 135, 0, 0, 199, 137, 142, 57,
2769 0, 292, 300, 302, 77, 0, 84, 0, 115, 207,
2770 177, 173, 170, 171, 169, 172, 176, 175, 174, 168,
2771 167, 0, 0, 182, 0, 0, 98, 102, 100, 104,
2772 63, 279, 56, 0, 75, 0, 139, 140, 0, 120,
2773 166, 165, 79, 0, 0, 0, 85, 88, 86, 24,
2774 184, 193, 181, 96, 0, 99, 101, 120, 66, 120,
2775 205, 120, 200, 0, 157, 0, 0, 120, 155, 0,
2776 27, 93, 89, 87, 27, 27, 205, 64, 74, 0,
2777 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2778 188, 143, 156, 27, 91, 0, 0, 0, 189, 120,
2779 141, 147, 0, 90, 194, 97, 94, 27, 0, 0,
2780 0, 0, 149, 178, 27, 190, 0, 0, 205, 95,
2784 /* YYDEFGOTO[NTERM-NUM]. */
2785 static const yytype_int16 yydefgoto[] =
2787 -1, 50, 51, 52, 53, 311, 312, 313, 334, 335,
2788 137, 138, 157, 314, 139, 385, 140, 246, 243, 458,
2789 57, 232, 153, 154, 58, 59, 60, 61, 213, 62,
2790 91, 141, 142, 445, 446, 447, 448, 63, 215, 426,
2791 510, 427, 475, 428, 429, 64, 229, 143, 65, 66,
2792 219, 220, 67, 320, 216, 68, 144, 70, 71, 351,
2793 353, 395, 316, 461, 317, 439, 484, 485, 486, 466,
2794 467, 468, 164, 318, 262, 355, 356, 373, 419, 327,
2795 328, 329, 259, 319, 507, 103, 76, 474, 221, 222,
2796 382, 397, 383, 341, 324, 124, 125, 126, 224, 77,
2797 78, 79, 145, 127, 80, 81, 82, 83, 116, 117,
2801 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2803 #define YYPACT_NINF -403
2804 static const yytype_int16 yypact[] =
2806 1674, -70, -403, -403, -403, -403, -403, -403, -403, -403,
2807 -15, -72, -403, -52, 19, -403, -403, -403, 80, -403,
2808 2094, -403, 99, -403, 2164, -403, -16, 42, -5, -403,
2809 -403, -403, -403, -1, 5, -403, -403, 2094, 13, 2094,
2810 2094, 2094, -403, 2094, 2094, 2094, 2094, 2094, 634, 123,
2811 128, -403, 504, -403, -403, -403, 8, -403, 2024, -403,
2812 -403, -403, -403, -403, -403, 1926, -403, -403, -403, 240,
2813 361, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2814 38, -403, 2569, -403, -403, -403, -403, 137, 20, -403,
2815 -403, 1926, -403, -403, -403, -403, -403, -403, -87, 42,
2816 -403, -67, -403, 21, -48, 2094, 79, -403, 2094, -403,
2817 2094, 138, -48, -403, 43, 2569, 76, 107, -48, -48,
2818 604, -48, -48, -29, 84, 110, 2094, -403, 210, 211,
2819 2094, 2094, 211, 212, -403, -403, 764, -403, -403, 85,
2820 -403, -403, -403, -403, 209, -403, -403, -403, -403, 1024,
2821 158, 232, -403, 139, 171, -403, 141, -403, 238, 12,
2822 239, -403, 247, -403, -403, -403, -403, 2094, 2094, 2094,
2823 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2824 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2825 -403, -403, 249, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2826 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2827 11, -403, -403, 2094, 229, 2094, 1154, -403, 42, 133,
2828 135, -403, -403, -403, 142, 15, -10, 90, 2189, 1800,
2829 130, -403, 2094, 2094, -403, 2094, -403, -403, -403, -403,
2830 -403, 161, 169, -403, 38, 38, 169, -403, -403, -403,
2831 1926, 149, 161, 2094, 2094, -403, 168, -403, -403, 280,
2832 231, 233, 286, 2569, 1016, 496, 496, 496, 322, 322,
2833 322, 322, 1016, 1016, 2569, 2569, 2569, 2569, 2569, 2569,
2834 2569, 2569, 2569, 2569, 2630, 2691, -403, 368, 368, 368,
2835 2569, 2386, 2752, 2813, 2874, 1016, 1016, 604, 604, -48,
2836 -48, -48, 157, 2447, 202, 2094, 291, 14, 173, 2260,
2837 -403, 165, 1284, -403, -403, 172, -403, -403, -403, -403,
2838 1154, -403, 42, 2094, -403, -43, 296, 167, 201, -403,
2839 -403, -403, 175, -403, 174, 1800, -403, 44, -403, 200,
2840 63, 207, 211, 894, -403, -27, -11, 46, 113, 189,
2841 42, 298, 42, 190, 161, 217, -403, 2094, -403, -403,
2842 315, 2323, -403, 1926, 2094, 193, -403, -403, 1154, 192,
2843 194, 75, 63, -403, -403, 161, 26, 96, 1926, 2094,
2844 -403, -403, -403, -403, 2094, -403, -403, -403, 2094, 1926,
2845 -403, -403, 15, -403, 42, 199, -403, 230, -403, 207,
2846 286, 2569, -403, -403, -403, 103, 24, 197, -403, -403,
2847 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2848 234, 205, 296, -403, 206, 213, -403, -403, 96, -403,
2849 268, -403, -403, 204, -403, 215, 230, -403, 42, 208,
2850 -403, -403, -403, 2094, 236, 214, 24, -403, -403, -403,
2851 -403, -403, -403, -403, 335, -403, -403, 1926, -403, 1926,
2852 161, 1414, -403, 339, -403, 316, 219, 227, -403, 2508,
2853 1800, -403, -403, -403, 1800, 1800, 161, -403, -403, 223,
2854 -403, -403, 226, 250, 221, 1544, -403, -403, -403, -403,
2855 12, -403, -403, 1800, -403, 222, 224, 225, -403, 1414,
2856 -403, -403, 354, -403, -403, -403, -403, 1800, 228, 241,
2857 235, 243, -403, 15, 1800, -403, 244, 246, 161, -403,
2861 /* YYPGOTO[NTERM-NUM]. */
2862 static const yytype_int16 yypgoto[] =
2864 -403, -403, 218, -403, 312, -299, -403, 61, -402, -31,
2865 1, -55, -85, 48, 2, -23, 321, 251, 58, -403,
2866 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2867 -403, -403, -403, -403, -403, -62, -60, -403, -403, -40,
2868 -403, -36, -403, -403, -403, -403, -403, -403, -403, -403,
2869 6, 50, -403, -403, -403, -403, 0, -403, 331, -403,
2870 -403, -403, 49, -403, 51, -403, -96, -403, -80, -403,
2871 -403, -61, -403, 3, -403, -403, 7, 9, -403, -376,
2872 -403, -311, -79, 4, -403, -403, -403, -403, -403, 388,
2873 -91, 25, 52, -239, -403, -98, -403, -403, -403, -403,
2874 -403, -403, -403, -34, -9, -49, -13, -403, -403, -403,
2875 -403, -403, -403, -403
2878 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2879 positive, shift that token. If negative, reduce the rule which
2880 number is the opposite. If zero, do what YYDEFACT says.
2881 If YYTABLE_NINF, syntax error. */
2882 #define YYTABLE_NINF -155
2883 static const yytype_int16 yytable[] =
2885 69, 54, 56, 74, 75, 114, 214, 101, 223, 155,
2886 156, 104, 230, 345, 304, 374, 435, 136, 325, 87,
2887 97, 369, 93, 94, 112, 192, 115, 118, 119, 325,
2888 120, 121, 122, 97, 115, 88, 156, 123, 95, 217,
2889 218, -70, 190, 191, 192, 93, 94, 257, 55, 72,
2890 90, 73, 69, 54, 56, 74, 75, 209, 443, 371,
2891 210, 95, 372, 258, 98, 423, 93, 94, 494, 407,
2892 92, 167, 495, 496, 208, 384, 209, 106, 410, 210,
2893 411, 249, 95, 412, 413, 414, 444, 415, 388, 167,
2894 167, 503, 239, 93, 94, 228, 226, 115, 99, 380,
2895 55, 72, 102, 73, 236, 511, 105, 89, 326, 95,
2896 302, 452, 517, 115, 167, 399, 390, 108, 391, 422,
2897 416, 244, 245, 330, 424, 109, 146, 110, 147, 425,
2898 417, 418, 111, 305, 149, 113, 421, 516, 167, 306,
2899 211, 231, 212, 225, 167, 96, 167, 363, 233, 69,
2900 54, 56, 74, 75, 263, 264, 265, 266, 267, 268,
2901 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
2902 279, 280, 281, 282, 283, 284, 285, 378, 381, 389,
2903 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
2904 297, 298, 299, 300, 301, 115, 303, 55, 72, 338,
2905 73, 339, 309, 167, 307, 331, 227, 235, 234, 237,
2906 238, 250, 2, 240, 241, 247, 69, 54, 315, 343,
2907 115, 479, 115, 337, 321, 370, -71, 158, 15, 16,
2908 17, 2, 19, 332, 21, 252, 442, 497, 253, 254,
2909 255, 256, 260, 308, 346, 347, 25, 15, 16, 17,
2910 261, 19, 286, 21, 463, 30, 31, 32, 158, 393,
2911 -113, 396, 322, 336, 323, 25, 340, 159, 158, 342,
2912 348, 160, 161, 463, 30, 31, 32, 159, 404, 520,
2913 249, 344, 161, 349, 162, 350, 163, 352, 249, 354,
2914 358, 360, 361, 430, 362, 364, 163, 366, 368, 325,
2915 375, 376, -112, 396, 434, 379, 377, 464, 156, 384,
2916 115, 392, 69, 54, 315, 394, 398, 400, 402, 406,
2917 69, 54, 315, 156, 408, 437, 464, 409, 332, 449,
2918 438, 451, 453, 457, 156, 454, 371, 459, 476, 433,
2919 -153, 470, 489, 490, 401, 431, 471, 462, 460, 498,
2920 432, 491, 499, 500, 504, 405, 505, 509, 506, -154,
2921 512, 514, 168, 513, 148, 2, 115, 251, 69, 54,
2922 315, 115, 477, 367, 478, 515, 440, 518, 519, 152,
2923 242, 15, 16, 17, 472, 19, 473, 21, 455, 169,
2924 170, 171, 456, -155, -155, -155, -155, 176, 177, 25,
2925 386, 166, 156, 508, 156, 501, 492, 441, 30, 31,
2926 32, 502, 190, 191, 192, 107, 193, 194, 195, 436,
2927 0, 0, 0, 0, 420, 0, 0, 0, 0, 450,
2928 469, 201, 202, 0, 203, 204, 205, 206, 207, 465,
2929 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
2930 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
2931 192, 483, 481, 482, 487, 488, 0, 465, 0, 0,
2932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2933 203, 204, 205, 206, 207, 483, 481, 482, 487, 488,
2934 208, 0, 209, 0, 0, 210, 0, 0, 0, 483,
2935 481, 482, 487, 488, -4, 0, 0, 1, 2, 3,
2936 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2937 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2938 21, 0, 0, 23, 0, 0, 168, 0, 0, 0,
2939 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2940 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2941 36, 0, 0, -155, -155, -155, 0, 37, 38, 0,
2942 0, 176, 177, 0, 39, 0, 0, 0, 0, 0,
2943 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2944 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2945 0, 0, 0, 42, 0, 201, 202, 0, 203, 204,
2946 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2947 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2948 48, 0, 49, 0, 0, 0, -4, 1, 2, 3,
2949 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2950 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2951 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2952 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2953 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2954 36, 0, 0, 0, 190, 191, 192, 37, 38, 0,
2955 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2956 0, 0, 0, 0, 0, 0, 0, 0, 205, 206,
2957 207, 0, 0, 0, 40, 41, 208, 0, 209, 0,
2958 0, 210, 0, 134, 0, 0, 0, 0, 0, 0,
2959 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2960 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2961 48, 0, 49, 0, 0, 0, 135, 1, 2, 3,
2962 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2963 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2964 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2965 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2966 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2967 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2968 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2969 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2970 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2971 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2972 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2973 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2974 48, 0, 49, 0, 0, 0, 248, 1, 2, 3,
2975 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2976 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2977 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2978 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2979 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2980 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2981 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2982 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2983 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2984 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2985 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2986 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2987 48, 0, 49, 0, 0, 0, 387, 1, 2, 3,
2988 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2989 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2990 21, 0, 0, 23, 0, 0, -155, 0, 0, 0,
2991 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2992 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2993 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2994 0, -155, -155, 0, 39, 0, 0, 0, 0, 0,
2995 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2996 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2997 0, 0, 0, 42, 0, -155, -155, 0, 203, 204,
2998 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2999 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
3000 48, 0, 49, 0, 0, 0, -3, 1, 2, 3,
3001 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3002 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3003 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3004 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3005 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3006 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3007 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3009 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3010 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3011 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3012 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3013 48, 0, 49, 0, 0, 0, -15, 1, 2, 3,
3014 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3015 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3016 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3017 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3018 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3019 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3020 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3021 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3022 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3023 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3024 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3025 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3026 48, 0, 49, 0, 0, 0, -16, 1, 2, 3,
3027 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3028 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3029 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3030 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3031 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3032 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3033 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3034 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3035 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3036 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3037 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3038 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3039 48, 0, 49, 0, 0, 0, -144, 1, 2, 3,
3040 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3041 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3042 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3043 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3044 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3045 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3046 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3048 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3049 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3050 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3051 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3052 48, 0, 49, 0, -3, 0, -145, 1, 2, 3,
3053 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3054 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3055 21, 0, 0, 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, 0,
3059 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3060 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3061 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3062 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
3063 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3064 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3065 48, 0, 49, 1, 2, 3, 4, 0, 5, 6,
3066 7, 8, 9, 10, 11, 12, 13, 0, -120, 0,
3067 15, 16, 17, 18, 19, 20, 21, 22, 0, 23,
3068 128, 0, 129, 0, 0, 0, 24, 130, 25, 26,
3069 0, 27, 131, 28, 0, 29, 132, 30, 31, 32,
3070 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3071 0, 0, 0, 37, 38, 0, 133, 0, 0, 0,
3072 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3073 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3074 40, 41, 0, 0, 0, 0, 0, 0, 0, 134,
3075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3076 0, 0, 43, 0, 0, 0, 0, 44, 45, 0,
3077 0, 0, 46, 0, 47, 0, 48, 0, 49, 1,
3078 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3079 11, 12, 13, 0, 0, 0, 15, 16, 17, 18,
3080 19, 20, 21, 22, 0, 23, 128, 0, 129, 0,
3081 0, 0, 24, 130, 25, 26, 0, 27, 131, 28,
3082 0, 29, 132, 30, 31, 32, 0, 0, 33, 34,
3083 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3084 38, 0, 133, 0, 0, 0, 39, 0, 0, 0,
3085 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3086 0, 0, 0, 0, 0, 0, 40, 41, 0, 0,
3087 0, 0, 0, 0, 0, 134, 0, 150, 0, 3,
3088 4, 0, 5, 6, 7, 8, 9, 0, 43, 0,
3089 0, 0, 0, 44, 45, 0, 0, 0, 46, 20,
3090 47, 22, 48, 23, 49, 0, 129, 0, 0, 0,
3091 24, 0, 0, 0, 0, 0, 0, 28, 0, 29,
3092 151, 0, 0, 0, 0, 0, 0, 34, 0, 35,
3093 36, 0, 0, 0, 0, 0, 0, 37, 0, 0,
3094 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3095 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3096 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3097 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3098 24, 0, 0, 0, 0, 0, 43, 28, 0, 29,
3099 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3100 36, 0, 49, 0, 0, 0, 0, 37, 0, 0,
3101 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3102 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3103 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3104 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3105 0, 0, 0, 0, 0, 0, 43, 0, 0, 29,
3106 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3107 36, 0, 49, 0, 0, 0, 0, 0, 0, 168,
3108 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3110 0, 0, 0, 0, 40, 41, 169, 170, 171, 0,
3111 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3112 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3113 191, 192, 0, 193, 194, 195, 46, 0, 47, 0,
3114 0, 196, 49, 197, 0, 198, 199, 200, 201, 202,
3115 168, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3116 0, 208, 0, 209, 0, 0, 210, 0, 0, 0,
3117 0, 0, 333, 0, 0, 0, 0, 169, 170, 171,
3118 0, 172, 173, 174, 175, 176, 177, 178, 179, 180,
3119 181, 182, 183, 184, 185, 186, 187, 188, 189, 0,
3120 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3121 0, 0, 196, 168, 197, 0, 198, 199, 200, 201,
3122 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3123 0, 0, 208, 0, 209, 0, 0, 210, 0, 0,
3124 169, 170, 171, 365, 172, 173, 174, 175, 176, 177,
3125 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
3126 188, 189, 0, 190, 191, 192, 0, 193, 194, 195,
3127 0, 0, 0, 0, 0, 196, 168, 197, 0, 198,
3128 199, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3129 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3130 210, 0, 0, 169, 170, 171, 403, 172, 173, 174,
3131 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
3132 185, 186, 187, 188, 189, 0, 190, 191, 192, 0,
3133 193, 194, 195, 0, 0, 0, 0, 168, 196, 0,
3134 197, 357, 198, 199, 200, 201, 202, 0, 203, 204,
3135 205, 206, 207, 0, 0, 0, 0, 0, 208, 0,
3136 209, 0, 0, 210, 169, 170, 171, 0, 172, 173,
3137 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
3138 184, 185, 186, 187, 188, 189, 0, 190, 191, 192,
3139 0, 193, 194, 195, 0, 0, 0, 0, 168, 196,
3140 0, 197, 0, 198, 199, 200, 201, 202, 0, 203,
3141 204, 205, 206, 207, 0, 0, 0, 0, 0, 208,
3142 0, 209, 359, 0, 210, 169, 170, 171, 0, 172,
3143 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3144 183, 184, 185, 186, 187, 188, 189, 0, 190, 191,
3145 192, 0, 193, 194, 195, 0, 0, 0, 0, 168,
3146 196, 0, 197, 493, 198, 199, 200, 201, 202, 0,
3147 203, 204, 205, 206, 207, 0, 0, 0, 0, 0,
3148 208, 0, 209, 0, 0, 210, 169, 170, 171, 0,
3149 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3150 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3151 191, 192, 0, 193, 194, 195, 0, 0, 0, 0,
3152 168, 196, 0, 197, 0, 198, 199, 200, 201, 202,
3153 0, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3154 0, 208, 0, 209, 0, 0, 210, 169, 170, 171,
3155 0, 172, 173, 174, 175, 176, 177, 0, 0, 0,
3156 0, 0, 0, 0, 0, 0, 0, 0, 189, 0,
3157 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3158 0, 168, 0, 0, 0, 0, 198, 199, 200, 201,
3159 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3160 0, 0, 208, 0, 209, 0, 0, 210, 169, 170,
3161 171, 0, 172, 173, 174, 175, 176, 177, 0, 0,
3162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3163 0, 190, 191, 192, 0, 193, 194, 195, 0, 0,
3164 0, 0, 168, 0, 0, 0, 0, 198, 199, 200,
3165 201, 202, 0, 203, 204, 205, 206, 207, 0, 0,
3166 0, 0, 0, 208, 0, 209, 0, 0, 210, 169,
3167 170, 171, 0, 172, 173, 174, 175, 176, 177, 0,
3168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3169 0, 0, 190, 191, 192, 0, 193, 194, 195, 0,
3170 0, 0, 0, 168, 0, 0, 0, 0, 0, 199,
3171 200, 201, 202, 0, 203, 204, 205, 206, 207, 0,
3172 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
3173 169, 170, 171, 0, 172, 173, 174, 175, 176, 177,
3174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3175 0, 0, 0, 190, 191, 192, 0, 193, 194, 195,
3176 0, 0, 0, 0, 168, 0, 0, 0, 0, 0,
3177 0, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3178 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3179 210, 169, 170, 171, 0, 172, 173, 174, 175, 176,
3180 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3181 0, 0, 0, 0, 190, 191, 192, 0, 193, 194,
3182 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3183 0, 0, -155, 201, 202, 0, 203, 204, 205, 206,
3184 207, 0, 0, 0, 0, 0, 208, 0, 209, 0,
3188 static const yytype_int16 yycheck[] =
3190 0, 0, 0, 0, 0, 39, 91, 20, 99, 58,
3191 65, 24, 110, 252, 3, 326, 392, 48, 3, 89,
3192 14, 320, 3, 4, 37, 92, 39, 40, 41, 3,
3193 43, 44, 45, 27, 47, 50, 91, 46, 19, 126,
3194 127, 68, 90, 91, 92, 3, 4, 35, 0, 0,
3195 122, 0, 52, 52, 52, 52, 52, 124, 34, 102,
3196 127, 19, 105, 51, 14, 376, 3, 4, 470, 368,
3197 122, 100, 474, 475, 122, 102, 124, 27, 3, 127,
3198 5, 136, 19, 8, 9, 10, 62, 12, 99, 100,
3199 100, 493, 126, 3, 4, 108, 105, 110, 18, 36,
3200 52, 52, 3, 52, 133, 507, 122, 122, 93, 19,
3201 208, 422, 514, 126, 100, 354, 3, 122, 5, 93,
3202 45, 130, 131, 133, 28, 126, 3, 122, 0, 33,
3203 55, 56, 127, 122, 126, 122, 375, 513, 100, 128,
3204 3, 3, 122, 122, 100, 126, 100, 133, 105, 149,
3205 149, 149, 149, 149, 167, 168, 169, 170, 171, 172,
3206 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3207 183, 184, 185, 186, 187, 188, 189, 133, 115, 133,
3208 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3209 203, 204, 205, 206, 207, 208, 209, 149, 149, 233,
3210 149, 235, 215, 100, 213, 115, 127, 100, 132, 125,
3211 100, 126, 4, 3, 3, 3, 216, 216, 216, 250,
3212 233, 460, 235, 232, 218, 323, 68, 18, 20, 21,
3213 22, 4, 24, 227, 26, 3, 133, 476, 99, 68,
3214 99, 3, 3, 14, 253, 254, 38, 20, 21, 22,
3215 3, 24, 3, 26, 46, 47, 48, 49, 18, 350,
3216 127, 352, 127, 133, 122, 38, 105, 27, 18, 100,
3217 102, 31, 32, 46, 47, 48, 49, 27, 363, 518,
3218 335, 132, 32, 3, 44, 54, 46, 54, 343, 3,
3219 133, 89, 305, 378, 3, 122, 46, 132, 126, 3,
3220 133, 100, 127, 394, 389, 105, 132, 99, 363, 102,
3221 323, 122, 312, 312, 312, 17, 126, 100, 3, 126,
3222 320, 320, 320, 378, 132, 126, 99, 133, 322, 132,
3223 100, 126, 126, 65, 389, 122, 102, 133, 3, 388,
3224 132, 105, 3, 27, 357, 379, 132, 438, 133, 126,
3225 384, 132, 126, 132, 132, 364, 132, 3, 133, 132,
3226 132, 126, 40, 122, 52, 4, 379, 149, 368, 368,
3227 368, 384, 457, 312, 459, 132, 399, 133, 132, 58,
3228 129, 20, 21, 22, 446, 24, 446, 26, 428, 67,
3229 68, 69, 428, 71, 72, 73, 74, 75, 76, 38,
3230 342, 70, 457, 499, 459, 485, 467, 400, 47, 48,
3231 49, 490, 90, 91, 92, 27, 94, 95, 96, 394,
3232 -1, -1, -1, -1, 372, -1, -1, -1, -1, 420,
3233 443, 109, 110, -1, 112, 113, 114, 115, 116, 439,
3234 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3235 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3236 92, 461, 461, 461, 461, 461, -1, 467, -1, -1,
3237 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3238 112, 113, 114, 115, 116, 485, 485, 485, 485, 485,
3239 122, -1, 124, -1, -1, 127, -1, -1, -1, 499,
3240 499, 499, 499, 499, 0, -1, -1, 3, 4, 5,
3241 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3242 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3243 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3244 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3245 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3246 56, -1, -1, 67, 68, 69, -1, 63, 64, -1,
3247 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3248 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3249 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3250 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3251 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3252 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3253 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3254 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3255 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3256 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3257 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3258 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3259 56, -1, -1, -1, 90, 91, 92, 63, 64, -1,
3260 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3261 -1, -1, -1, -1, -1, -1, -1, -1, 114, 115,
3262 116, -1, -1, -1, 90, 91, 122, -1, 124, -1,
3263 -1, 127, -1, 99, -1, -1, -1, -1, -1, -1,
3264 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3265 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3266 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3267 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3268 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3269 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3270 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3271 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3272 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3273 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3275 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3276 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3277 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3278 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3279 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3280 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3281 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3282 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3283 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3284 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3285 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3286 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3287 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3288 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3289 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3290 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3291 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3292 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3293 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3294 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3295 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3296 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3297 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3298 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3299 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3300 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3301 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3302 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3303 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3304 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3305 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3306 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3307 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3308 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3309 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3310 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3311 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3312 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3313 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3314 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3315 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3316 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3317 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3318 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3319 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3320 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3321 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3322 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3323 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3324 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3325 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3326 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3327 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3328 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3329 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3330 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3331 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3332 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3333 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3334 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3335 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3336 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3337 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3338 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3339 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3340 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3341 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3342 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3343 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3344 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3345 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3346 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3347 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3348 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3349 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3350 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3351 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3353 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3354 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3355 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3356 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3357 126, -1, 128, -1, 0, -1, 132, 3, 4, 5,
3358 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3359 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3360 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3361 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3362 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3363 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3364 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3365 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3366 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3367 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3368 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3369 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3370 126, -1, 128, 3, 4, 5, 6, -1, 8, 9,
3371 10, 11, 12, 13, 14, 15, 16, -1, 18, -1,
3372 20, 21, 22, 23, 24, 25, 26, 27, -1, 29,
3373 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3374 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3375 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3376 -1, -1, -1, 63, 64, -1, 66, -1, -1, -1,
3377 70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3378 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3379 90, 91, -1, -1, -1, -1, -1, -1, -1, 99,
3380 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3381 -1, -1, 112, -1, -1, -1, -1, 117, 118, -1,
3382 -1, -1, 122, -1, 124, -1, 126, -1, 128, 3,
3383 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3384 14, 15, 16, -1, -1, -1, 20, 21, 22, 23,
3385 24, 25, 26, 27, -1, 29, 30, -1, 32, -1,
3386 -1, -1, 36, 37, 38, 39, -1, 41, 42, 43,
3387 -1, 45, 46, 47, 48, 49, -1, -1, 52, 53,
3388 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3389 64, -1, 66, -1, -1, -1, 70, -1, -1, -1,
3390 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3391 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
3392 -1, -1, -1, -1, -1, 99, -1, 3, -1, 5,
3393 6, -1, 8, 9, 10, 11, 12, -1, 112, -1,
3394 -1, -1, -1, 117, 118, -1, -1, -1, 122, 25,
3395 124, 27, 126, 29, 128, -1, 32, -1, -1, -1,
3396 36, -1, -1, -1, -1, -1, -1, 43, -1, 45,
3397 46, -1, -1, -1, -1, -1, -1, 53, -1, 55,
3398 56, -1, -1, -1, -1, -1, -1, 63, -1, -1,
3399 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3400 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3401 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3402 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3403 36, -1, -1, -1, -1, -1, 112, 43, -1, 45,
3404 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3405 56, -1, 128, -1, -1, -1, -1, 63, -1, -1,
3406 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3407 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3408 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3409 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3410 -1, -1, -1, -1, -1, -1, 112, -1, -1, 45,
3411 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3412 56, -1, 128, -1, -1, -1, -1, -1, -1, 40,
3413 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3414 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3415 -1, -1, -1, -1, 90, 91, 67, 68, 69, -1,
3416 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3417 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3418 91, 92, -1, 94, 95, 96, 122, -1, 124, -1,
3419 -1, 102, 128, 104, -1, 106, 107, 108, 109, 110,
3420 40, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3421 -1, 122, -1, 124, -1, -1, 127, -1, -1, -1,
3422 -1, -1, 133, -1, -1, -1, -1, 67, 68, 69,
3423 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
3424 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
3425 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3426 -1, -1, 102, 40, 104, -1, 106, 107, 108, 109,
3427 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3428 -1, -1, 122, -1, 124, -1, -1, 127, -1, -1,
3429 67, 68, 69, 133, 71, 72, 73, 74, 75, 76,
3430 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3431 87, 88, -1, 90, 91, 92, -1, 94, 95, 96,
3432 -1, -1, -1, -1, -1, 102, 40, 104, -1, 106,
3433 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3434 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3435 127, -1, -1, 67, 68, 69, 133, 71, 72, 73,
3436 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3437 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3438 94, 95, 96, -1, -1, -1, -1, 40, 102, -1,
3439 104, 105, 106, 107, 108, 109, 110, -1, 112, 113,
3440 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3441 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3442 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3443 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3444 -1, 94, 95, 96, -1, -1, -1, -1, 40, 102,
3445 -1, 104, -1, 106, 107, 108, 109, 110, -1, 112,
3446 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3447 -1, 124, 125, -1, 127, 67, 68, 69, -1, 71,
3448 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3449 82, 83, 84, 85, 86, 87, 88, -1, 90, 91,
3450 92, -1, 94, 95, 96, -1, -1, -1, -1, 40,
3451 102, -1, 104, 105, 106, 107, 108, 109, 110, -1,
3452 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3453 122, -1, 124, -1, -1, 127, 67, 68, 69, -1,
3454 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3455 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3456 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3457 40, 102, -1, 104, -1, 106, 107, 108, 109, 110,
3458 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3459 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3460 -1, 71, 72, 73, 74, 75, 76, -1, -1, -1,
3461 -1, -1, -1, -1, -1, -1, -1, -1, 88, -1,
3462 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3463 -1, 40, -1, -1, -1, -1, 106, 107, 108, 109,
3464 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3465 -1, -1, 122, -1, 124, -1, -1, 127, 67, 68,
3466 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3467 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3468 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3469 -1, -1, 40, -1, -1, -1, -1, 106, 107, 108,
3470 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3471 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3472 68, 69, -1, 71, 72, 73, 74, 75, 76, -1,
3473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3474 -1, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3475 -1, -1, -1, 40, -1, -1, -1, -1, -1, 107,
3476 108, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3477 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3478 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3479 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3480 -1, -1, -1, 90, 91, 92, -1, 94, 95, 96,
3481 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
3482 -1, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3483 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3484 127, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3485 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3486 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3487 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3488 -1, -1, 108, 109, 110, -1, 112, 113, 114, 115,
3489 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3493 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3494 symbol of state STATE-NUM. */
3495 static const yytype_uint8 yystos[] =
3497 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3498 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3499 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3500 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3501 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3502 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3503 160, 161, 163, 171, 179, 182, 183, 186, 189, 190,
3504 191, 192, 196, 198, 207, 217, 220, 233, 234, 235,
3505 238, 239, 240, 241, 244, 246, 247, 89, 50, 122,
3506 122, 164, 122, 3, 4, 19, 126, 184, 185, 18,
3507 3, 240, 3, 219, 240, 122, 185, 223, 122, 126,
3508 122, 127, 240, 122, 237, 240, 242, 243, 240, 240,
3509 240, 240, 240, 238, 229, 230, 231, 237, 30, 32,
3510 37, 42, 46, 66, 99, 132, 143, 144, 145, 148,
3511 150, 165, 166, 181, 190, 236, 3, 0, 138, 126,
3512 3, 46, 150, 156, 157, 239, 145, 146, 18, 27,
3513 31, 32, 44, 46, 206, 245, 192, 100, 40, 67,
3514 68, 69, 71, 72, 73, 74, 75, 76, 77, 78,
3515 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3516 90, 91, 92, 94, 95, 96, 102, 104, 106, 107,
3517 108, 109, 110, 112, 113, 114, 115, 116, 122, 124,
3518 127, 3, 122, 162, 146, 172, 188, 126, 127, 184,
3519 185, 222, 223, 224, 232, 122, 238, 127, 240, 180,
3520 229, 3, 155, 105, 132, 100, 133, 125, 100, 237,
3521 3, 3, 151, 152, 238, 238, 151, 3, 132, 145,
3522 126, 136, 3, 99, 68, 99, 3, 35, 51, 216,
3523 3, 3, 208, 240, 240, 240, 240, 240, 240, 240,
3524 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3525 240, 240, 240, 240, 240, 240, 3, 240, 240, 240,
3526 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3527 240, 240, 229, 240, 3, 122, 128, 238, 14, 240,
3528 99, 139, 140, 141, 147, 148, 196, 198, 207, 217,
3529 187, 184, 127, 122, 228, 3, 93, 213, 214, 215,
3530 133, 115, 184, 133, 142, 143, 133, 238, 237, 237,
3531 105, 227, 100, 143, 132, 227, 238, 238, 102, 3,
3532 54, 193, 54, 194, 3, 209, 210, 105, 133, 125,
3533 89, 240, 3, 133, 122, 133, 132, 141, 126, 139,
3534 229, 102, 105, 211, 215, 133, 100, 132, 133, 105,
3535 36, 115, 224, 226, 102, 149, 152, 132, 99, 133,
3536 3, 5, 122, 224, 17, 195, 224, 225, 126, 227,
3537 100, 240, 3, 133, 146, 238, 126, 139, 132, 133,
3538 3, 5, 8, 9, 10, 12, 45, 55, 56, 212,
3539 226, 227, 93, 215, 28, 33, 173, 175, 177, 178,
3540 146, 237, 237, 239, 146, 213, 225, 126, 100, 199,
3541 149, 210, 133, 34, 62, 167, 168, 169, 170, 132,
3542 211, 126, 215, 126, 122, 173, 175, 65, 153, 133,
3543 133, 197, 224, 46, 99, 190, 203, 204, 205, 240,
3544 105, 132, 169, 170, 221, 176, 3, 146, 146, 227,
3545 99, 144, 148, 190, 200, 201, 202, 207, 217, 3,
3546 27, 132, 205, 105, 142, 142, 142, 227, 126, 126,
3547 132, 202, 216, 142, 132, 132, 133, 218, 200, 3,
3548 174, 142, 132, 122, 126, 132, 213, 142, 133, 132,
3552 #define yyerrok (yyerrstatus = 0)
3553 #define yyclearin (yychar = YYEMPTY)
3554 #define YYEMPTY (-2)
3557 #define YYACCEPT goto yyacceptlab
3558 #define YYABORT goto yyabortlab
3559 #define YYERROR goto yyerrorlab
3562 /* Like YYERROR except do call yyerror. This remains here temporarily
3563 to ease the transition to the new meaning of YYERROR, for GCC.
3564 Once GCC version 2 has supplanted version 1, this can go. */
3566 #define YYFAIL goto yyerrlab
3568 #define YYRECOVERING() (!!yyerrstatus)
3570 #define YYBACKUP(Token, Value) \
3572 if (yychar == YYEMPTY && yylen == 1) \
3576 yytoken = YYTRANSLATE (yychar); \
3582 yyerror (YY_("syntax error: cannot back up")); \
3589 #define YYERRCODE 256
3592 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3593 If N is 0, then set CURRENT to the empty location which ends
3594 the previous symbol: RHS[0] (always defined). */
3596 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3597 #ifndef YYLLOC_DEFAULT
3598 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3602 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3603 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3604 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3605 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3609 (Current).first_line = (Current).last_line = \
3610 YYRHSLOC (Rhs, 0).last_line; \
3611 (Current).first_column = (Current).last_column = \
3612 YYRHSLOC (Rhs, 0).last_column; \
3618 /* YY_LOCATION_PRINT -- Print the location on the stream.
3619 This macro was not mandated originally: define only if we know
3620 we won't break user code: when these are the locations we know. */
3622 #ifndef YY_LOCATION_PRINT
3623 # if YYLTYPE_IS_TRIVIAL
3624 # define YY_LOCATION_PRINT(File, Loc) \
3625 fprintf (File, "%d.%d-%d.%d", \
3626 (Loc).first_line, (Loc).first_column, \
3627 (Loc).last_line, (Loc).last_column)
3629 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3634 /* YYLEX -- calling `yylex' with the right arguments. */
3637 # define YYLEX yylex (YYLEX_PARAM)
3639 # define YYLEX yylex ()
3642 /* Enable debugging if requested. */
3646 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3647 # define YYFPRINTF fprintf
3650 # define YYDPRINTF(Args) \
3656 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3660 YYFPRINTF (stderr, "%s ", Title); \
3661 yy_symbol_print (stderr, \
3663 YYFPRINTF (stderr, "\n"); \
3668 /*--------------------------------.
3669 | Print this symbol on YYOUTPUT. |
3670 `--------------------------------*/
3673 #if (defined __STDC__ || defined __C99__FUNC__ \
3674 || defined __cplusplus || defined _MSC_VER)
3676 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3679 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3682 YYSTYPE const * const yyvaluep;
3688 if (yytype < YYNTOKENS)
3689 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3701 /*--------------------------------.
3702 | Print this symbol on YYOUTPUT. |
3703 `--------------------------------*/
3705 #if (defined __STDC__ || defined __C99__FUNC__ \
3706 || defined __cplusplus || defined _MSC_VER)
3708 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3711 yy_symbol_print (yyoutput, yytype, yyvaluep)
3714 YYSTYPE const * const yyvaluep;
3717 if (yytype < YYNTOKENS)
3718 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3720 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3722 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3723 YYFPRINTF (yyoutput, ")");
3726 /*------------------------------------------------------------------.
3727 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3729 `------------------------------------------------------------------*/
3731 #if (defined __STDC__ || defined __C99__FUNC__ \
3732 || defined __cplusplus || defined _MSC_VER)
3734 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3737 yy_stack_print (yybottom, yytop)
3738 yytype_int16 *yybottom;
3739 yytype_int16 *yytop;
3742 YYFPRINTF (stderr, "Stack now");
3743 for (; yybottom <= yytop; yybottom++)
3745 int yybot = *yybottom;
3746 YYFPRINTF (stderr, " %d", yybot);
3748 YYFPRINTF (stderr, "\n");
3751 # define YY_STACK_PRINT(Bottom, Top) \
3754 yy_stack_print ((Bottom), (Top)); \
3758 /*------------------------------------------------.
3759 | Report that the YYRULE is going to be reduced. |
3760 `------------------------------------------------*/
3762 #if (defined __STDC__ || defined __C99__FUNC__ \
3763 || defined __cplusplus || defined _MSC_VER)
3765 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3768 yy_reduce_print (yyvsp, yyrule)
3773 int yynrhs = yyr2[yyrule];
3775 unsigned long int yylno = yyrline[yyrule];
3776 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3778 /* The symbols being reduced. */
3779 for (yyi = 0; yyi < yynrhs; yyi++)
3781 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3782 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3783 &(yyvsp[(yyi + 1) - (yynrhs)])
3785 YYFPRINTF (stderr, "\n");
3789 # define YY_REDUCE_PRINT(Rule) \
3792 yy_reduce_print (yyvsp, Rule); \
3795 /* Nonzero means print parse trace. It is left uninitialized so that
3796 multiple parsers can coexist. */
3798 #else /* !YYDEBUG */
3799 # define YYDPRINTF(Args)
3800 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3801 # define YY_STACK_PRINT(Bottom, Top)
3802 # define YY_REDUCE_PRINT(Rule)
3803 #endif /* !YYDEBUG */
3806 /* YYINITDEPTH -- initial size of the parser's stacks. */
3808 # define YYINITDEPTH 200
3811 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3812 if the built-in stack extension method is used).
3814 Do not make this value too large; the results are undefined if
3815 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3816 evaluated with infinite-precision integer arithmetic. */
3819 # define YYMAXDEPTH 10000
3827 # if defined __GLIBC__ && defined _STRING_H
3828 # define yystrlen strlen
3830 /* Return the length of YYSTR. */
3831 #if (defined __STDC__ || defined __C99__FUNC__ \
3832 || defined __cplusplus || defined _MSC_VER)
3834 yystrlen (const char *yystr)
3842 for (yylen = 0; yystr[yylen]; yylen++)
3850 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3851 # define yystpcpy stpcpy
3853 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3855 #if (defined __STDC__ || defined __C99__FUNC__ \
3856 || defined __cplusplus || defined _MSC_VER)
3858 yystpcpy (char *yydest, const char *yysrc)
3861 yystpcpy (yydest, yysrc)
3867 const char *yys = yysrc;
3869 while ((*yyd++ = *yys++) != '\0')
3878 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3879 quotes and backslashes, so that it's suitable for yyerror. The
3880 heuristic is that double-quoting is unnecessary unless the string
3881 contains an apostrophe, a comma, or backslash (other than
3882 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3883 null, do not copy; instead, return the length of what the result
3886 yytnamerr (char *yyres, const char *yystr)
3891 char const *yyp = yystr;
3898 goto do_not_strip_quotes;
3902 goto do_not_strip_quotes;
3915 do_not_strip_quotes: ;
3919 return yystrlen (yystr);
3921 return yystpcpy (yyres, yystr) - yyres;
3925 /* Copy into YYRESULT an error message about the unexpected token
3926 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3927 including the terminating null byte. If YYRESULT is null, do not
3928 copy anything; just return the number of bytes that would be
3929 copied. As a special case, return 0 if an ordinary "syntax error"
3930 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3931 size calculation. */
3933 yysyntax_error (char *yyresult, int yystate, int yychar)
3935 int yyn = yypact[yystate];
3937 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3941 int yytype = YYTRANSLATE (yychar);
3942 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3943 YYSIZE_T yysize = yysize0;
3945 int yysize_overflow = 0;
3946 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3947 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3951 /* This is so xgettext sees the translatable formats that are
3952 constructed on the fly. */
3953 YY_("syntax error, unexpected %s");
3954 YY_("syntax error, unexpected %s, expecting %s");
3955 YY_("syntax error, unexpected %s, expecting %s or %s");
3956 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3957 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3961 static char const yyunexpected[] = "syntax error, unexpected %s";
3962 static char const yyexpecting[] = ", expecting %s";
3963 static char const yyor[] = " or %s";
3964 char yyformat[sizeof yyunexpected
3965 + sizeof yyexpecting - 1
3966 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3967 * (sizeof yyor - 1))];
3968 char const *yyprefix = yyexpecting;
3970 /* Start YYX at -YYN if negative to avoid negative indexes in
3972 int yyxbegin = yyn < 0 ? -yyn : 0;
3974 /* Stay within bounds of both yycheck and yytname. */
3975 int yychecklim = YYLAST - yyn + 1;
3976 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3979 yyarg[0] = yytname[yytype];
3980 yyfmt = yystpcpy (yyformat, yyunexpected);
3982 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3983 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3985 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3989 yyformat[sizeof yyunexpected - 1] = '\0';
3992 yyarg[yycount++] = yytname[yyx];
3993 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3994 yysize_overflow |= (yysize1 < yysize);
3996 yyfmt = yystpcpy (yyfmt, yyprefix);
4000 yyf = YY_(yyformat);
4001 yysize1 = yysize + yystrlen (yyf);
4002 yysize_overflow |= (yysize1 < yysize);
4005 if (yysize_overflow)
4006 return YYSIZE_MAXIMUM;
4010 /* Avoid sprintf, as that infringes on the user's name space.
4011 Don't have undefined behavior even if the translation
4012 produced a string with the wrong number of "%s"s. */
4013 char *yyp = yyresult;
4015 while ((*yyp = *yyf) != '\0')
4017 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4019 yyp += yytnamerr (yyp, yyarg[yyi++]);
4032 #endif /* YYERROR_VERBOSE */
4035 /*-----------------------------------------------.
4036 | Release the memory associated to this symbol. |
4037 `-----------------------------------------------*/
4040 #if (defined __STDC__ || defined __C99__FUNC__ \
4041 || defined __cplusplus || defined _MSC_VER)
4043 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4046 yydestruct (yymsg, yytype, yyvaluep)
4056 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4066 /* Prevent warnings from -Wmissing-prototypes. */
4067 #ifdef YYPARSE_PARAM
4068 #if defined __STDC__ || defined __cplusplus
4069 int yyparse (void *YYPARSE_PARAM);
4073 #else /* ! YYPARSE_PARAM */
4074 #if defined __STDC__ || defined __cplusplus
4079 #endif /* ! YYPARSE_PARAM */
4082 /* The lookahead symbol. */
4085 /* The semantic value of the lookahead symbol. */
4088 /* Number of syntax errors so far. */
4093 /*-------------------------.
4094 | yyparse or yypush_parse. |
4095 `-------------------------*/
4097 #ifdef YYPARSE_PARAM
4098 #if (defined __STDC__ || defined __C99__FUNC__ \
4099 || defined __cplusplus || defined _MSC_VER)
4101 yyparse (void *YYPARSE_PARAM)
4104 yyparse (YYPARSE_PARAM)
4105 void *YYPARSE_PARAM;
4107 #else /* ! YYPARSE_PARAM */
4108 #if (defined __STDC__ || defined __C99__FUNC__ \
4109 || defined __cplusplus || defined _MSC_VER)
4122 /* Number of tokens to shift before error messages enabled. */
4125 /* The stacks and their tools:
4126 `yyss': related to states.
4127 `yyvs': related to semantic values.
4129 Refer to the stacks thru separate pointers, to allow yyoverflow
4130 to reallocate them elsewhere. */
4132 /* The state stack. */
4133 yytype_int16 yyssa[YYINITDEPTH];
4135 yytype_int16 *yyssp;
4137 /* The semantic value stack. */
4138 YYSTYPE yyvsa[YYINITDEPTH];
4142 YYSIZE_T yystacksize;
4146 /* Lookahead token as an internal (translated) token number. */
4148 /* The variables used to return semantic value and location from the
4153 /* Buffer for error messages, and its allocated size. */
4155 char *yymsg = yymsgbuf;
4156 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4159 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4161 /* The number of symbols on the RHS of the reduced rule.
4162 Keep to zero when no symbol should be popped. */
4168 yystacksize = YYINITDEPTH;
4170 YYDPRINTF ((stderr, "Starting parse\n"));
4175 yychar = YYEMPTY; /* Cause a token to be read. */
4177 /* Initialize stack pointers.
4178 Waste one element of value and location stack
4179 so that they stay on the same level as the state stack.
4180 The wasted elements are never initialized. */
4186 /*------------------------------------------------------------.
4187 | yynewstate -- Push a new state, which is found in yystate. |
4188 `------------------------------------------------------------*/
4190 /* In all cases, when you get here, the value and location stacks
4191 have just been pushed. So pushing a state here evens the stacks. */
4197 if (yyss + yystacksize - 1 <= yyssp)
4199 /* Get the current used size of the three stacks, in elements. */
4200 YYSIZE_T yysize = yyssp - yyss + 1;
4204 /* Give user a chance to reallocate the stack. Use copies of
4205 these so that the &'s don't force the real ones into
4207 YYSTYPE *yyvs1 = yyvs;
4208 yytype_int16 *yyss1 = yyss;
4210 /* Each stack pointer address is followed by the size of the
4211 data in use in that stack, in bytes. This used to be a
4212 conditional around just the two extra args, but that might
4213 be undefined if yyoverflow is a macro. */
4214 yyoverflow (YY_("memory exhausted"),
4215 &yyss1, yysize * sizeof (*yyssp),
4216 &yyvs1, yysize * sizeof (*yyvsp),
4222 #else /* no yyoverflow */
4223 # ifndef YYSTACK_RELOCATE
4224 goto yyexhaustedlab;
4226 /* Extend the stack our own way. */
4227 if (YYMAXDEPTH <= yystacksize)
4228 goto yyexhaustedlab;
4230 if (YYMAXDEPTH < yystacksize)
4231 yystacksize = YYMAXDEPTH;
4234 yytype_int16 *yyss1 = yyss;
4235 union yyalloc *yyptr =
4236 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4238 goto yyexhaustedlab;
4239 YYSTACK_RELOCATE (yyss_alloc, yyss);
4240 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4241 # undef YYSTACK_RELOCATE
4243 YYSTACK_FREE (yyss1);
4246 #endif /* no yyoverflow */
4248 yyssp = yyss + yysize - 1;
4249 yyvsp = yyvs + yysize - 1;
4251 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4252 (unsigned long int) yystacksize));
4254 if (yyss + yystacksize - 1 <= yyssp)
4258 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4260 if (yystate == YYFINAL)
4270 /* Do appropriate processing given the current state. Read a
4271 lookahead token if we need one and don't already have one. */
4273 /* First try to decide what to do without reference to lookahead token. */
4274 yyn = yypact[yystate];
4275 if (yyn == YYPACT_NINF)
4278 /* Not known => get a lookahead token if don't already have one. */
4280 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4281 if (yychar == YYEMPTY)
4283 YYDPRINTF ((stderr, "Reading a token: "));
4287 if (yychar <= YYEOF)
4289 yychar = yytoken = YYEOF;
4290 YYDPRINTF ((stderr, "Now at end of input.\n"));
4294 yytoken = YYTRANSLATE (yychar);
4295 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4298 /* If the proper action on seeing token YYTOKEN is to reduce or to
4299 detect an error, take that action. */
4301 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4306 if (yyn == 0 || yyn == YYTABLE_NINF)
4312 /* Count tokens shifted since error; after three, turn off error
4317 /* Shift the lookahead token. */
4318 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4320 /* Discard the shifted token. */
4329 /*-----------------------------------------------------------.
4330 | yydefault -- do the default action for the current state. |
4331 `-----------------------------------------------------------*/
4333 yyn = yydefact[yystate];
4339 /*-----------------------------.
4340 | yyreduce -- Do a reduction. |
4341 `-----------------------------*/
4343 /* yyn is the number of a rule to reduce with. */
4346 /* If YYLEN is nonzero, implement the default value of the action:
4349 Otherwise, the following line sets YYVAL to garbage.
4350 This behavior is undocumented and Bison
4351 users should not rely upon it. Assigning to YYVAL
4352 unconditionally makes the parser a bit smaller, and it avoids a
4353 GCC warning that YYVAL may be used uninitialized. */
4354 yyval = yyvsp[1-yylen];
4357 YY_REDUCE_PRINT (yyn);
4364 /* Line 1464 of skeleton.m4 */
4365 #line 2133 "parser.y"
4366 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4375 /* Line 1464 of skeleton.m4 */
4376 #line 2134 "parser.y"
4377 {(yyval.code)=code_new();}
4386 /* Line 1464 of skeleton.m4 */
4387 #line 2136 "parser.y"
4388 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4397 /* Line 1464 of skeleton.m4 */
4398 #line 2137 "parser.y"
4399 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4408 /* Line 1464 of skeleton.m4 */
4409 #line 2152 "parser.y"
4410 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4419 /* Line 1464 of skeleton.m4 */
4420 #line 2153 "parser.y"
4430 /* Line 1464 of skeleton.m4 */
4431 #line 2156 "parser.y"
4441 /* Line 1464 of skeleton.m4 */
4442 #line 2163 "parser.y"
4443 {(yyval.code)=(yyvsp[(3) - (4)].code);}
4452 /* Line 1464 of skeleton.m4 */
4453 #line 2167 "parser.y"
4454 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4463 /* Line 1464 of skeleton.m4 */
4464 #line 2168 "parser.y"
4465 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4474 /* Line 1464 of skeleton.m4 */
4475 #line 2172 "parser.y"
4477 code_t**cc = &global->init->method->body->code;
4478 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4488 /* Line 1464 of skeleton.m4 */
4489 #line 2183 "parser.y"
4490 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4499 /* Line 1464 of skeleton.m4 */
4500 #line 2184 "parser.y"
4501 {(yyval.value).c=abc_pushundefined(0);
4502 (yyval.value).t=TYPE_ANY;
4512 /* Line 1464 of skeleton.m4 */
4513 #line 2188 "parser.y"
4514 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4523 /* Line 1464 of skeleton.m4 */
4524 #line 2189 "parser.y"
4525 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4534 /* Line 1464 of skeleton.m4 */
4535 #line 2191 "parser.y"
4536 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4545 /* Line 1464 of skeleton.m4 */
4546 #line 2192 "parser.y"
4547 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4556 /* Line 1464 of skeleton.m4 */
4557 #line 2195 "parser.y"
4560 if(variable_exists((yyvsp[(1) - (3)].id)))
4561 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4563 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4566 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4567 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4568 (yyvsp[(2) - (3)].classinfo)->name);
4573 if(state->method->uses_slots) {
4574 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4576 // this variable is stored in a slot
4578 v->type = (yyvsp[(2) - (3)].classinfo);
4584 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4587 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4589 if((yyvsp[(2) - (3)].classinfo)) {
4590 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4591 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4592 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4594 code_free((yyvsp[(3) - (3)].value).c);
4595 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4598 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4599 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4600 (yyval.code) = abc_coerce_a((yyval.code));
4602 // don't do anything
4603 code_free((yyvsp[(3) - (3)].value).c);
4604 code_free((yyval.code));
4610 (yyval.code) = abc_setslot((yyval.code), index);
4612 (yyval.code) = abc_setlocal((yyval.code), index);
4623 /* Line 1464 of skeleton.m4 */
4624 #line 2255 "parser.y"
4625 {(yyval.code) = code_new();}
4634 /* Line 1464 of skeleton.m4 */
4635 #line 2256 "parser.y"
4636 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4645 /* Line 1464 of skeleton.m4 */
4646 #line 2259 "parser.y"
4647 {PASS12 new_state();}
4656 /* Line 1464 of skeleton.m4 */
4657 #line 2259 "parser.y"
4660 (yyval.code) = code_new();
4661 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4662 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4664 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4665 if((yyvsp[(7) - (7)].code)) {
4666 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4668 myif->branch = (yyval.code) = abc_nop((yyval.code));
4669 if((yyvsp[(7) - (7)].code)) {
4670 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4671 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4673 (yyval.code) = var_block((yyval.code));
4684 /* Line 1464 of skeleton.m4 */
4685 #line 2278 "parser.y"
4686 {(yyval.code)=code_new();}
4695 /* Line 1464 of skeleton.m4 */
4696 #line 2285 "parser.y"
4698 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4699 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4709 /* Line 1464 of skeleton.m4 */
4710 #line 2289 "parser.y"
4713 (yyval.id)=(yyvsp[(1) - (1)].id);
4723 /* Line 1464 of skeleton.m4 */
4724 #line 2294 "parser.y"
4725 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4734 /* Line 1464 of skeleton.m4 */
4735 #line 2295 "parser.y"
4736 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4745 /* Line 1464 of skeleton.m4 */
4746 #line 2297 "parser.y"
4748 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4749 (yyval.code) = code_new();
4750 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4751 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4752 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4753 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4754 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4755 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4756 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4757 (yyval.code) = abc_jump((yyval.code), loopstart);
4758 code_t*out = (yyval.code) = abc_nop((yyval.code));
4759 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4760 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4763 (yyval.code) = var_block((yyval.code));
4774 /* Line 1464 of skeleton.m4 */
4775 #line 2317 "parser.y"
4777 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4779 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4782 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4783 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4784 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4785 int array = new_variable(tmp1name, 0, 0, 0);
4787 (yyval.code) = code_new();
4788 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4789 (yyval.code) = abc_coerce_a((yyval.code));
4790 (yyval.code) = abc_setlocal((yyval.code), array);
4791 (yyval.code) = abc_pushbyte((yyval.code), 0);
4792 (yyval.code) = abc_setlocal((yyval.code), it);
4794 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4796 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4797 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4798 (yyval.code) = abc_getlocal((yyval.code), array);
4799 (yyval.code) = abc_getlocal((yyval.code), it);
4800 if(!(yyvsp[(1) - (6)].for_start).each)
4801 (yyval.code) = abc_nextname((yyval.code));
4803 (yyval.code) = abc_nextvalue((yyval.code));
4804 (yyval.code) = converttype((yyval.code), 0, var->type);
4805 (yyval.code) = abc_setlocal((yyval.code), var->index);
4807 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4808 (yyval.code) = abc_jump((yyval.code), loopstart);
4810 code_t*out = (yyval.code) = abc_nop((yyval.code));
4811 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4812 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4816 (yyval.code) = var_block((yyval.code));
4831 /* Line 1464 of skeleton.m4 */
4832 #line 2365 "parser.y"
4833 {PASS12 new_state();}
4842 /* Line 1464 of skeleton.m4 */
4843 #line 2365 "parser.y"
4846 (yyval.code) = code_new();
4848 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4849 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4850 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4851 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4852 myjmp->branch = cont;
4853 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4854 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4855 code_t*out = (yyval.code) = abc_nop((yyval.code));
4856 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4857 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4859 (yyval.code) = var_block((yyval.code));
4870 /* Line 1464 of skeleton.m4 */
4871 #line 2384 "parser.y"
4872 {PASS12 new_state();}
4881 /* Line 1464 of skeleton.m4 */
4882 #line 2384 "parser.y"
4884 (yyval.code) = code_new();
4885 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4886 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4887 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4888 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4889 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4890 code_t*out = (yyval.code) = abc_nop((yyval.code));
4891 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4892 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4894 (yyval.code) = var_block((yyval.code));
4905 /* Line 1464 of skeleton.m4 */
4906 #line 2399 "parser.y"
4908 (yyval.code) = abc___break__(0, "");
4918 /* Line 1464 of skeleton.m4 */
4919 #line 2402 "parser.y"
4921 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4931 /* Line 1464 of skeleton.m4 */
4932 #line 2405 "parser.y"
4934 (yyval.code) = abc___continue__(0, "");
4944 /* Line 1464 of skeleton.m4 */
4945 #line 2408 "parser.y"
4947 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4957 /* Line 1464 of skeleton.m4 */
4958 #line 2412 "parser.y"
4968 /* Line 1464 of skeleton.m4 */
4969 #line 2413 "parser.y"
4970 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4979 /* Line 1464 of skeleton.m4 */
4980 #line 2414 "parser.y"
4981 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4990 /* Line 1464 of skeleton.m4 */
4991 #line 2415 "parser.y"
4992 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5001 /* Line 1464 of skeleton.m4 */
5002 #line 2416 "parser.y"
5003 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5012 /* Line 1464 of skeleton.m4 */
5013 #line 2417 "parser.y"
5014 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5023 /* Line 1464 of skeleton.m4 */
5024 #line 2419 "parser.y"
5026 (yyval.code) = abc_getlocal(0, state->switch_var);
5027 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
5028 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5029 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5030 if((yyval.code)->opcode != OPCODE___BREAK__) {
5031 (yyval.code) = abc___fallthrough__((yyval.code), "");
5033 code_t*e = (yyval.code) = abc_nop((yyval.code));
5044 /* Line 1464 of skeleton.m4 */
5045 #line 2430 "parser.y"
5047 (yyval.code) = (yyvsp[(3) - (3)].code);
5057 /* Line 1464 of skeleton.m4 */
5058 #line 2433 "parser.y"
5059 {PASS12 new_state();state->switch_var=alloc_local();}
5068 /* Line 1464 of skeleton.m4 */
5069 #line 2433 "parser.y"
5071 (yyval.code)=(yyvsp[(4) - (8)].value).c;
5072 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5073 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5075 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5076 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5078 code_t*c = (yyval.code),*lastblock=0;
5080 if(c->opcode == OPCODE_IFNE) {
5081 if(!c->next) syntaxerror("internal error in fallthrough handling");
5083 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5085 c->opcode = OPCODE_JUMP;
5086 c->branch = lastblock;
5088 /* fall through end of switch */
5089 c->opcode = OPCODE_NOP;
5095 (yyval.code) = var_block((yyval.code));
5106 /* Line 1464 of skeleton.m4 */
5107 #line 2464 "parser.y"
5108 {PASS12 new_state();
5109 state->exception_name=(yyvsp[(3) - (5)].id);
5110 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5111 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5121 /* Line 1464 of skeleton.m4 */
5122 #line 2469 "parser.y"
5124 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5125 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5127 NEW(abc_exception_t, e)
5128 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5129 e->var_name = multiname_clone(&name);
5130 (yyval.exception) = e;
5133 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5134 e->target = c = abc_nop(0);
5135 c = abc_setlocal(c, i);
5136 c = code_append(c, code_dup(state->method->scope_code));
5137 c = code_append(c, (yyvsp[(8) - (9)].code));
5151 /* Line 1464 of skeleton.m4 */
5152 #line 2489 "parser.y"
5153 {PASS12 new_state();state->exception_name=0;}
5162 /* Line 1464 of skeleton.m4 */
5163 #line 2489 "parser.y"
5165 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5166 if(!(yyvsp[(4) - (5)].code)) {
5167 (yyval.exception)=0;
5169 NEW(abc_exception_t, e)
5170 e->exc_type = 0; //all exceptions
5171 e->var_name = 0; //no name
5174 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5175 (yyval.exception) = e;
5187 /* Line 1464 of skeleton.m4 */
5188 #line 2505 "parser.y"
5189 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5198 /* Line 1464 of skeleton.m4 */
5199 #line 2506 "parser.y"
5200 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5209 /* Line 1464 of skeleton.m4 */
5210 #line 2507 "parser.y"
5211 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5220 /* Line 1464 of skeleton.m4 */
5221 #line 2508 "parser.y"
5223 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5224 (yyval.catch_list).finally = 0;
5225 if((yyvsp[(2) - (2)].exception)) {
5226 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5227 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5238 /* Line 1464 of skeleton.m4 */
5239 #line 2516 "parser.y"
5241 (yyval.catch_list).l=list_new();
5242 (yyval.catch_list).finally = 0;
5243 if((yyvsp[(1) - (1)].exception)) {
5244 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5245 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5256 /* Line 1464 of skeleton.m4 */
5257 #line 2525 "parser.y"
5258 {PASS12 new_state();
5259 state->method->has_exceptions=1;
5260 state->method->late_binding=1;//for invariant scope_code
5270 /* Line 1464 of skeleton.m4 */
5271 #line 2528 "parser.y"
5273 code_t*out = abc_nop(0);
5275 code_t*start = abc_nop(0);
5276 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5277 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5278 (yyval.code) = abc_jump((yyval.code), out);
5280 code_t*end = (yyval.code) = abc_nop((yyval.code));
5283 if((yyvsp[(6) - (6)].catch_list).finally)
5284 tmp = new_variable("__finally__", 0, 0, 0);
5286 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5289 abc_exception_t*e = l->abc_exception;
5291 (yyval.code) = code_append((yyval.code), e->target);
5292 (yyval.code) = abc_jump((yyval.code), out);
5294 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5296 e->target = (yyval.code) = abc_nop((yyval.code));
5297 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5298 (yyval.code) = abc___rethrow__((yyval.code));
5306 (yyval.code) = code_append((yyval.code), out);
5308 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5310 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5312 (yyval.code) = var_block((yyval.code));
5323 /* Line 1464 of skeleton.m4 */
5324 #line 2574 "parser.y"
5326 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5327 (yyval.code)=abc_throw((yyval.code));
5337 /* Line 1464 of skeleton.m4 */
5338 #line 2578 "parser.y"
5340 if(!state->exception_name)
5341 syntaxerror("re-throw only possible within a catch block");
5342 variable_t*v = find_variable(state, state->exception_name);
5343 (yyval.code)=code_new();
5344 (yyval.code)=abc_getlocal((yyval.code), v->index);
5345 (yyval.code)=abc_throw((yyval.code));
5355 /* Line 1464 of skeleton.m4 */
5356 #line 2589 "parser.y"
5359 if(state->method->has_exceptions) {
5360 int v = alloc_local();
5361 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5362 state->method->scope_code = abc_pushwith(state->method->scope_code);
5363 (yyval.value_list).number = v;
5365 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5375 /* Line 1464 of skeleton.m4 */
5376 #line 2599 "parser.y"
5378 /* remove getlocal;pushwith from scope code again */
5379 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5381 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5382 if(state->method->has_exceptions) {
5383 (yyval.code) = abc_dup((yyval.code));
5384 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5386 (yyval.code) = abc_pushwith((yyval.code));
5387 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5388 (yyval.code) = abc_popscope((yyval.code));
5399 /* Line 1464 of skeleton.m4 */
5400 #line 2617 "parser.y"
5401 {PASS12 (yyval.id)="package";}
5410 /* Line 1464 of skeleton.m4 */
5411 #line 2618 "parser.y"
5412 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5421 /* Line 1464 of skeleton.m4 */
5422 #line 2620 "parser.y"
5423 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5432 /* Line 1464 of skeleton.m4 */
5433 #line 2621 "parser.y"
5434 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5443 /* Line 1464 of skeleton.m4 */
5444 #line 2623 "parser.y"
5445 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5454 /* Line 1464 of skeleton.m4 */
5455 #line 2624 "parser.y"
5456 {PASS12 endpackage();(yyval.code)=0;}
5465 /* Line 1464 of skeleton.m4 */
5466 #line 2625 "parser.y"
5467 {PASS12 startpackage("");}
5476 /* Line 1464 of skeleton.m4 */
5477 #line 2626 "parser.y"
5478 {PASS12 endpackage();(yyval.code)=0;}
5487 /* Line 1464 of skeleton.m4 */
5488 #line 2628 "parser.y"
5491 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5492 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5493 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5495 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5497 syntaxerror("Couldn't import class\n");
5498 state_has_imports();
5499 dict_put(state->imports, c->name, c);
5500 import_toplevel(c->package);
5511 /* Line 1464 of skeleton.m4 */
5512 #line 2642 "parser.y"
5515 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5516 as3_schedule_package((yyvsp[(2) - (4)].id));
5520 i->package = (yyvsp[(2) - (4)].id);
5521 state_has_imports();
5522 list_append(state->wildcard_imports, i);
5523 import_toplevel(i->package);
5534 /* Line 1464 of skeleton.m4 */
5535 #line 2658 "parser.y"
5536 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5545 /* Line 1464 of skeleton.m4 */
5546 #line 2659 "parser.y"
5547 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5556 /* Line 1464 of skeleton.m4 */
5557 #line 2660 "parser.y"
5558 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5567 /* Line 1464 of skeleton.m4 */
5568 #line 2661 "parser.y"
5571 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5572 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5573 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5584 /* Line 1464 of skeleton.m4 */
5585 #line 2668 "parser.y"
5586 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5595 /* Line 1464 of skeleton.m4 */
5596 #line 2669 "parser.y"
5597 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5606 /* Line 1464 of skeleton.m4 */
5607 #line 2670 "parser.y"
5608 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5617 /* Line 1464 of skeleton.m4 */
5618 #line 2671 "parser.y"
5619 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5628 /* Line 1464 of skeleton.m4 */
5629 #line 2672 "parser.y"
5630 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5639 /* Line 1464 of skeleton.m4 */
5640 #line 2673 "parser.y"
5641 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5650 /* Line 1464 of skeleton.m4 */
5651 #line 2674 "parser.y"
5652 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5661 /* Line 1464 of skeleton.m4 */
5662 #line 2675 "parser.y"
5663 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5672 /* Line 1464 of skeleton.m4 */
5673 #line 2676 "parser.y"
5674 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5683 /* Line 1464 of skeleton.m4 */
5684 #line 2677 "parser.y"
5685 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5686 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5696 /* Line 1464 of skeleton.m4 */
5697 #line 2681 "parser.y"
5698 {PASS12 (yyval.classinfo)=0;}
5707 /* Line 1464 of skeleton.m4 */
5708 #line 2682 "parser.y"
5709 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5718 /* Line 1464 of skeleton.m4 */
5719 #line 2684 "parser.y"
5720 {PASS12 (yyval.classinfo_list)=list_new();}
5729 /* Line 1464 of skeleton.m4 */
5730 #line 2685 "parser.y"
5731 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5740 /* Line 1464 of skeleton.m4 */
5741 #line 2687 "parser.y"
5742 {PASS12 (yyval.classinfo_list)=list_new();}
5751 /* Line 1464 of skeleton.m4 */
5752 #line 2688 "parser.y"
5753 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5762 /* Line 1464 of skeleton.m4 */
5763 #line 2692 "parser.y"
5764 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5773 /* Line 1464 of skeleton.m4 */
5774 #line 2694 "parser.y"
5775 {PASS12 endclass();(yyval.code)=0;}
5784 /* Line 1464 of skeleton.m4 */
5785 #line 2698 "parser.y"
5786 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5787 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5796 /* Line 1464 of skeleton.m4 */
5797 #line 2701 "parser.y"
5798 {PASS12 endclass();(yyval.code)=0;}
5807 /* Line 1464 of skeleton.m4 */
5808 #line 2714 "parser.y"
5810 code_t*c = state->cls->static_init->header;
5811 c = code_append(c, (yyvsp[(1) - (1)].code));
5812 state->cls->static_init->header = c;
5822 /* Line 1464 of skeleton.m4 */
5823 #line 2725 "parser.y"
5825 syntaxerror("variable declarations not allowed in interfaces");
5835 /* Line 1464 of skeleton.m4 */
5836 #line 2728 "parser.y"
5839 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5840 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5841 syntaxerror("invalid method modifiers: interface methods always need to be public");
5843 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5844 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5845 list_deep_free((yyvsp[(6) - (8)].params).list);
5855 /* Line 1464 of skeleton.m4 */
5856 #line 2743 "parser.y"
5857 {setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5866 /* Line 1464 of skeleton.m4 */
5867 #line 2743 "parser.y"
5868 {(yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5877 /* Line 1464 of skeleton.m4 */
5878 #line 2745 "parser.y"
5879 {(yyval.code) = (yyvsp[(1) - (1)].code);}
5888 /* Line 1464 of skeleton.m4 */
5889 #line 2746 "parser.y"
5890 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
5899 /* Line 1464 of skeleton.m4 */
5900 #line 2749 "parser.y"
5902 int flags = slotstate_flags->flags;
5903 namespace_t ns = modifiers2access(slotstate_flags);
5905 varinfo_t* info = 0;
5907 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
5909 check_override(i, flags);
5911 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
5913 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
5915 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
5917 if(ns.name && ns.name[0]) {
5918 syntaxerror("namespaces not allowed on package-level variables");
5920 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
5923 info->type = (yyvsp[(2) - (3)].classinfo);
5924 info->flags = flags;
5927 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
5929 trait_list_t**traits;
5933 ns.name = state->package;
5934 traits = &global->init->traits;
5935 code = &global->init->method->body->code;
5936 } else if(flags&FLAG_STATIC) {
5938 traits = &state->cls->abc->static_traits;
5939 code = &state->cls->static_init->header;
5941 // instance variable
5942 traits = &state->cls->abc->traits;
5943 code = &state->cls->init->header;
5947 if((yyvsp[(2) - (3)].classinfo)) {
5948 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
5949 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5951 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5953 info->slot = t->slot_id;
5955 /* initalization code (if needed) */
5957 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
5958 c = abc_getlocal_0(c);
5959 c = code_append(c, (yyvsp[(3) - (3)].value).c);
5960 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
5961 c = abc_setslot(c, t->slot_id);
5964 *code = code_append(*code, c);
5966 if(slotstate_varconst==KW_CONST) {
5967 t->kind= TRAIT_CONST;
5980 /* Line 1464 of skeleton.m4 */
5981 #line 2823 "parser.y"
5982 {(yyval.constant)=0;}
5991 /* Line 1464 of skeleton.m4 */
5992 #line 2824 "parser.y"
5993 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
6002 /* Line 1464 of skeleton.m4 */
6003 #line 2826 "parser.y"
6004 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
6013 /* Line 1464 of skeleton.m4 */
6014 #line 2827 "parser.y"
6015 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6024 /* Line 1464 of skeleton.m4 */
6025 #line 2828 "parser.y"
6026 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
6035 /* Line 1464 of skeleton.m4 */
6036 #line 2829 "parser.y"
6037 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6046 /* Line 1464 of skeleton.m4 */
6047 #line 2830 "parser.y"
6048 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6057 /* Line 1464 of skeleton.m4 */
6058 #line 2832 "parser.y"
6059 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6068 /* Line 1464 of skeleton.m4 */
6069 #line 2833 "parser.y"
6070 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6079 /* Line 1464 of skeleton.m4 */
6080 #line 2834 "parser.y"
6081 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6090 /* Line 1464 of skeleton.m4 */
6091 #line 2835 "parser.y"
6093 if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) {
6094 (yyval.constant) = constant_new_float(__builtin_nan(""));
6096 as3_warning("Couldn't evaluate constant value of %s", (yyvsp[(1) - (1)].id));
6097 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
6108 /* Line 1464 of skeleton.m4 */
6109 #line 2847 "parser.y"
6112 memset(&(yyval.params),0,sizeof((yyval.params)));
6122 /* Line 1464 of skeleton.m4 */
6123 #line 2851 "parser.y"
6126 (yyval.params)=(yyvsp[(1) - (1)].params);
6136 /* Line 1464 of skeleton.m4 */
6137 #line 2857 "parser.y"
6140 memset(&(yyval.params),0,sizeof((yyval.params)));
6141 (yyval.params).varargs=1;
6142 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6152 /* Line 1464 of skeleton.m4 */
6153 #line 2863 "parser.y"
6156 (yyval.params) =(yyvsp[(1) - (4)].params);
6157 (yyval.params).varargs=1;
6158 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6168 /* Line 1464 of skeleton.m4 */
6169 #line 2871 "parser.y"
6172 (yyval.params) = (yyvsp[(1) - (3)].params);
6173 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6183 /* Line 1464 of skeleton.m4 */
6184 #line 2876 "parser.y"
6187 memset(&(yyval.params),0,sizeof((yyval.params)));
6188 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6198 /* Line 1464 of skeleton.m4 */
6199 #line 2882 "parser.y"
6202 (yyval.param) = rfx_calloc(sizeof(param_t));
6203 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6204 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6206 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6216 /* Line 1464 of skeleton.m4 */
6217 #line 2890 "parser.y"
6220 (yyval.param) = rfx_calloc(sizeof(param_t));
6221 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6222 (yyval.param)->type = TYPE_ANY;
6224 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6234 /* Line 1464 of skeleton.m4 */
6235 #line 2900 "parser.y"
6236 {PASS12 (yyval.token)=0;}
6245 /* Line 1464 of skeleton.m4 */
6246 #line 2903 "parser.y"
6247 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6256 /* Line 1464 of skeleton.m4 */
6257 #line 2904 "parser.y"
6260 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6262 if(!state->method->info) syntaxerror("internal error");
6264 code_t*c = method_header(state->method);
6265 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6267 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6269 list_deep_free((yyvsp[(6) - (12)].params).list);
6280 /* Line 1464 of skeleton.m4 */
6281 #line 2920 "parser.y"
6282 {PASS12 (yyval.id)=0;}
6291 /* Line 1464 of skeleton.m4 */
6292 #line 2922 "parser.y"
6293 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6302 /* Line 1464 of skeleton.m4 */
6303 #line 2923 "parser.y"
6306 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6308 methodinfo_t*f = state->method->info;
6309 if(!f || !f->kind) syntaxerror("internal error");
6311 code_t*c = method_header(state->method);
6312 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6314 int index = state->method->var_index;
6315 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6317 (yyval.value).c = abc_getlocal(0, index);
6318 (yyval.value).t = TYPE_FUNCTION(f);
6320 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6330 /* Line 1464 of skeleton.m4 */
6331 #line 2945 "parser.y"
6333 PASS1 NEW(unresolvedinfo_t,c);
6334 memset(c, 0, sizeof(*c));
6335 c->kind = INFOTYPE_UNRESOLVED;
6336 c->name = (yyvsp[(1) - (1)].id);
6337 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6339 c->nsset = get_current_imports();
6340 /* make the compiler look for this class in the current directory,
6342 //as3_schedule_class_noerror(state->package, $1);
6344 (yyval.classinfo) = (classinfo_t*)c;
6346 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6347 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6348 (yyval.classinfo) = (classinfo_t*)s;
6358 /* Line 1464 of skeleton.m4 */
6359 #line 2964 "parser.y"
6361 PASS1 NEW(unresolvedinfo_t,c);
6362 memset(c, 0, sizeof(*c));
6363 c->kind = INFOTYPE_UNRESOLVED;
6364 c->package = (yyvsp[(1) - (3)].id);
6365 c->name = (yyvsp[(3) - (3)].id);
6366 (yyval.classinfo) = (classinfo_t*)c;
6368 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6369 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6370 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6371 (yyval.classinfo) = (classinfo_t*)s;
6381 /* Line 1464 of skeleton.m4 */
6382 #line 2981 "parser.y"
6383 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6392 /* Line 1464 of skeleton.m4 */
6393 #line 2982 "parser.y"
6394 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6403 /* Line 1464 of skeleton.m4 */
6404 #line 2984 "parser.y"
6405 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6414 /* Line 1464 of skeleton.m4 */
6415 #line 2985 "parser.y"
6416 {PASS12 (yyval.classinfo)=registry_getanytype();}
6425 /* Line 1464 of skeleton.m4 */
6426 #line 2986 "parser.y"
6427 {PASS12 (yyval.classinfo)=registry_getanytype();}
6436 /* Line 1464 of skeleton.m4 */
6437 #line 2995 "parser.y"
6438 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6447 /* Line 1464 of skeleton.m4 */
6448 #line 2996 "parser.y"
6449 {PASS12 (yyval.classinfo)=0;}
6458 /* Line 1464 of skeleton.m4 */
6459 #line 3000 "parser.y"
6460 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6469 /* Line 1464 of skeleton.m4 */
6470 #line 3001 "parser.y"
6471 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6480 /* Line 1464 of skeleton.m4 */
6481 #line 3003 "parser.y"
6482 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6491 /* Line 1464 of skeleton.m4 */
6492 #line 3007 "parser.y"
6493 {(yyval.value_list).number=1;
6494 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6504 /* Line 1464 of skeleton.m4 */
6505 #line 3011 "parser.y"
6506 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6515 /* Line 1464 of skeleton.m4 */
6516 #line 3012 "parser.y"
6518 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6519 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6529 /* Line 1464 of skeleton.m4 */
6530 #line 3018 "parser.y"
6532 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6533 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6535 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6536 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6537 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6538 (yyval.value).c = code_cutlast((yyval.value).c);
6539 (yyval.value).c = code_append((yyval.value).c, paramcode);
6540 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6541 multiname_destroy(name);
6542 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6543 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6544 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6545 multiname_t*name = t->name;
6546 (yyval.value).c = code_cutlast((yyval.value).c);
6547 (yyval.value).c = code_append((yyval.value).c, paramcode);
6548 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6550 (yyval.value).c = code_append((yyval.value).c, paramcode);
6551 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6554 (yyval.value).t = TYPE_ANY;
6555 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6556 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6558 (yyval.value).c = abc_coerce_a((yyval.value).c);
6559 (yyval.value).t = TYPE_ANY;
6570 /* Line 1464 of skeleton.m4 */
6571 #line 3054 "parser.y"
6574 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6575 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6576 (yyval.value).c = code_cutlast((yyval.value).c);
6578 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6580 (yyval.value).t = TYPE_ANY;
6581 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6582 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6583 (yyval.value).c = code_cutlast((yyval.value).c);
6584 (yyval.value).c = code_append((yyval.value).c, paramcode);
6585 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6586 multiname_destroy(name);
6587 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6588 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6589 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6590 if(t->kind!=TRAIT_METHOD) {
6591 //ok: flash allows to assign closures to members.
6593 multiname_t*name = t->name;
6594 (yyval.value).c = code_cutlast((yyval.value).c);
6595 (yyval.value).c = code_append((yyval.value).c, paramcode);
6596 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6597 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6598 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6599 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6600 (yyval.value).c = code_cutlast((yyval.value).c);
6601 (yyval.value).c = code_append((yyval.value).c, paramcode);
6602 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6603 multiname_destroy(name);
6605 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6606 (yyval.value).c = code_append((yyval.value).c, paramcode);
6607 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6610 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6611 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6613 (yyval.value).c = abc_coerce_a((yyval.value).c);
6614 (yyval.value).t = TYPE_ANY;
6625 /* Line 1464 of skeleton.m4 */
6626 #line 3100 "parser.y"
6628 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6629 if(!state->method) syntaxerror("super() not allowed outside of a function");
6630 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6632 (yyval.value).c = code_new();
6633 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6635 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6637 this is dependent on the control path, check this somewhere else
6638 if(state->method->has_super)
6639 syntaxerror("constructor may call super() only once");
6641 state->method->has_super = 1;
6643 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6644 (yyval.value).c = abc_pushundefined((yyval.value).c);
6645 (yyval.value).t = TYPE_ANY;
6655 /* Line 1464 of skeleton.m4 */
6656 #line 3121 "parser.y"
6658 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6659 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6660 (yyval.value).c = code_cutlast((yyval.value).c);
6662 multiname_t*name = 0;
6663 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6664 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6665 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6666 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6667 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6668 (yyval.value).c = code_cutlast((yyval.value).c);
6669 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6671 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6672 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6673 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6675 (yyval.value).t = TYPE_BOOLEAN;
6685 /* Line 1464 of skeleton.m4 */
6686 #line 3142 "parser.y"
6688 (yyval.code) = abc_returnvoid(0);
6698 /* Line 1464 of skeleton.m4 */
6699 #line 3145 "parser.y"
6701 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6702 (yyval.code) = abc_returnvalue((yyval.code));
6712 /* Line 1464 of skeleton.m4 */
6713 #line 3152 "parser.y"
6714 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6723 /* Line 1464 of skeleton.m4 */
6724 #line 3153 "parser.y"
6725 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6734 /* Line 1464 of skeleton.m4 */
6735 #line 3154 "parser.y"
6737 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6738 (yyval.value).c = cut_last_push((yyval.value).c);
6739 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6740 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6750 /* Line 1464 of skeleton.m4 */
6751 #line 3160 "parser.y"
6753 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6763 /* Line 1464 of skeleton.m4 */
6764 #line 3166 "parser.y"
6765 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6774 /* Line 1464 of skeleton.m4 */
6775 #line 3170 "parser.y"
6776 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6785 /* Line 1464 of skeleton.m4 */
6786 #line 3172 "parser.y"
6787 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6796 /* Line 1464 of skeleton.m4 */
6797 #line 3174 "parser.y"
6798 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6807 /* Line 1464 of skeleton.m4 */
6808 #line 3178 "parser.y"
6810 (yyval.value).c = 0;
6811 namespace_t ns = {ACCESS_PACKAGE, ""};
6812 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6813 if(!(yyvsp[(1) - (1)].regexp).options) {
6814 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6815 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6816 (yyval.value).c = abc_construct((yyval.value).c, 1);
6818 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6819 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6820 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6821 (yyval.value).c = abc_construct((yyval.value).c, 2);
6823 (yyval.value).t = TYPE_REGEXP;
6833 /* Line 1464 of skeleton.m4 */
6834 #line 3195 "parser.y"
6835 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6836 //MULTINAME(m, registry_getintclass());
6837 //$$.c = abc_coerce2($$.c, &m); // FIXME
6838 (yyval.value).t = TYPE_INT;
6848 /* Line 1464 of skeleton.m4 */
6849 #line 3200 "parser.y"
6850 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6851 (yyval.value).t = TYPE_INT;
6861 /* Line 1464 of skeleton.m4 */
6862 #line 3203 "parser.y"
6863 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6864 (yyval.value).t = TYPE_INT;
6874 /* Line 1464 of skeleton.m4 */
6875 #line 3206 "parser.y"
6876 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6877 (yyval.value).t = TYPE_UINT;
6887 /* Line 1464 of skeleton.m4 */
6888 #line 3209 "parser.y"
6889 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6890 (yyval.value).t = TYPE_FLOAT;
6900 /* Line 1464 of skeleton.m4 */
6901 #line 3212 "parser.y"
6902 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6903 (yyval.value).t = TYPE_STRING;
6913 /* Line 1464 of skeleton.m4 */
6914 #line 3215 "parser.y"
6915 {(yyval.value).c = abc_pushundefined(0);
6916 (yyval.value).t = TYPE_ANY;
6926 /* Line 1464 of skeleton.m4 */
6927 #line 3218 "parser.y"
6928 {(yyval.value).c = abc_pushtrue(0);
6929 (yyval.value).t = TYPE_BOOLEAN;
6939 /* Line 1464 of skeleton.m4 */
6940 #line 3221 "parser.y"
6941 {(yyval.value).c = abc_pushfalse(0);
6942 (yyval.value).t = TYPE_BOOLEAN;
6952 /* Line 1464 of skeleton.m4 */
6953 #line 3224 "parser.y"
6954 {(yyval.value).c = abc_pushnull(0);
6955 (yyval.value).t = TYPE_NULL;
6965 /* Line 1464 of skeleton.m4 */
6966 #line 3228 "parser.y"
6967 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c);
6968 (yyval.value).t = TYPE_BOOLEAN;
6978 /* Line 1464 of skeleton.m4 */
6979 #line 3231 "parser.y"
6980 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6981 (yyval.value).t = TYPE_BOOLEAN;
6991 /* Line 1464 of skeleton.m4 */
6992 #line 3234 "parser.y"
6993 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c);
6994 (yyval.value).t = TYPE_BOOLEAN;
7004 /* Line 1464 of skeleton.m4 */
7005 #line 3237 "parser.y"
7006 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
7007 (yyval.value).t = TYPE_BOOLEAN;
7017 /* Line 1464 of skeleton.m4 */
7018 #line 3240 "parser.y"
7019 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
7020 (yyval.value).t = TYPE_BOOLEAN;
7030 /* Line 1464 of skeleton.m4 */
7031 #line 3243 "parser.y"
7032 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
7033 (yyval.value).t = TYPE_BOOLEAN;
7043 /* Line 1464 of skeleton.m4 */
7044 #line 3246 "parser.y"
7045 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c);
7046 (yyval.value).t = TYPE_BOOLEAN;
7056 /* Line 1464 of skeleton.m4 */
7057 #line 3249 "parser.y"
7058 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c);
7059 (yyval.value).t = TYPE_BOOLEAN;
7069 /* Line 1464 of skeleton.m4 */
7070 #line 3253 "parser.y"
7071 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
7072 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7073 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7074 (yyval.value).c = abc_dup((yyval.value).c);
7075 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
7076 (yyval.value).c = cut_last_push((yyval.value).c);
7077 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7078 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7079 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7080 jmp->branch = label;
7090 /* Line 1464 of skeleton.m4 */
7091 #line 3264 "parser.y"
7093 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
7094 /*printf("%08x:\n",$1.t);
7095 code_dump($1.c, 0, 0, "", stdout);
7096 printf("%08x:\n",$3.t);
7097 code_dump($3.c, 0, 0, "", stdout);
7098 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
7099 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7100 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7101 (yyval.value).c = abc_dup((yyval.value).c);
7102 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7103 (yyval.value).c = cut_last_push((yyval.value).c);
7104 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7105 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7106 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7107 jmp->branch = label;
7117 /* Line 1464 of skeleton.m4 */
7118 #line 3282 "parser.y"
7119 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7120 (yyval.value).c = abc_not((yyval.value).c);
7121 (yyval.value).t = TYPE_BOOLEAN;
7131 /* Line 1464 of skeleton.m4 */
7132 #line 3287 "parser.y"
7133 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7134 (yyval.value).c = abc_bitnot((yyval.value).c);
7135 (yyval.value).t = TYPE_INT;
7145 /* Line 1464 of skeleton.m4 */
7146 #line 3292 "parser.y"
7147 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7148 (yyval.value).c = abc_bitand((yyval.value).c);
7149 (yyval.value).t = TYPE_INT;
7159 /* Line 1464 of skeleton.m4 */
7160 #line 3297 "parser.y"
7161 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7162 (yyval.value).c = abc_bitxor((yyval.value).c);
7163 (yyval.value).t = TYPE_INT;
7173 /* Line 1464 of skeleton.m4 */
7174 #line 3302 "parser.y"
7175 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7176 (yyval.value).c = abc_bitor((yyval.value).c);
7177 (yyval.value).t = TYPE_INT;
7187 /* Line 1464 of skeleton.m4 */
7188 #line 3307 "parser.y"
7189 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7190 (yyval.value).c = abc_rshift((yyval.value).c);
7191 (yyval.value).t = TYPE_INT;
7201 /* Line 1464 of skeleton.m4 */
7202 #line 3311 "parser.y"
7203 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7204 (yyval.value).c = abc_urshift((yyval.value).c);
7205 (yyval.value).t = TYPE_INT;
7215 /* Line 1464 of skeleton.m4 */
7216 #line 3315 "parser.y"
7217 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7218 (yyval.value).c = abc_lshift((yyval.value).c);
7219 (yyval.value).t = TYPE_INT;
7229 /* Line 1464 of skeleton.m4 */
7230 #line 3320 "parser.y"
7231 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7232 (yyval.value).c = abc_divide((yyval.value).c);
7233 (yyval.value).t = TYPE_NUMBER;
7243 /* Line 1464 of skeleton.m4 */
7244 #line 3324 "parser.y"
7245 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7246 (yyval.value).c = abc_modulo((yyval.value).c);
7247 (yyval.value).t = TYPE_NUMBER;
7257 /* Line 1464 of skeleton.m4 */
7258 #line 3328 "parser.y"
7259 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7260 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7261 (yyval.value).c = abc_add_i((yyval.value).c);
7262 (yyval.value).t = TYPE_INT;
7264 (yyval.value).c = abc_add((yyval.value).c);
7265 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7276 /* Line 1464 of skeleton.m4 */
7277 #line 3337 "parser.y"
7278 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7279 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7280 (yyval.value).c = abc_subtract_i((yyval.value).c);
7281 (yyval.value).t = TYPE_INT;
7283 (yyval.value).c = abc_subtract((yyval.value).c);
7284 (yyval.value).t = TYPE_NUMBER;
7295 /* Line 1464 of skeleton.m4 */
7296 #line 3346 "parser.y"
7297 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7298 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7299 (yyval.value).c = abc_multiply_i((yyval.value).c);
7300 (yyval.value).t = TYPE_INT;
7302 (yyval.value).c = abc_multiply((yyval.value).c);
7303 (yyval.value).t = TYPE_NUMBER;
7314 /* Line 1464 of skeleton.m4 */
7315 #line 3356 "parser.y"
7316 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7317 (yyval.value).c = abc_in((yyval.value).c);
7318 (yyval.value).t = TYPE_BOOLEAN;
7328 /* Line 1464 of skeleton.m4 */
7329 #line 3361 "parser.y"
7330 {char use_astype=0; // flash player's astype works differently than astypelate
7331 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7332 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7333 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7334 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7336 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7337 (yyval.value).c = abc_astypelate((yyval.value).c);
7338 (yyval.value).t = TYPE_ANY;
7349 /* Line 1464 of skeleton.m4 */
7350 #line 3374 "parser.y"
7351 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7352 (yyval.value).c = abc_instanceof((yyval.value).c);
7353 (yyval.value).t = TYPE_BOOLEAN;
7363 /* Line 1464 of skeleton.m4 */
7364 #line 3379 "parser.y"
7365 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7366 (yyval.value).c = abc_istypelate((yyval.value).c);
7367 (yyval.value).t = TYPE_BOOLEAN;
7377 /* Line 1464 of skeleton.m4 */
7378 #line 3384 "parser.y"
7380 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7381 (yyval.value).c = abc_typeof((yyval.value).c);
7382 (yyval.value).t = TYPE_STRING;
7392 /* Line 1464 of skeleton.m4 */
7393 #line 3390 "parser.y"
7395 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7396 (yyval.value).c = abc_pushundefined((yyval.value).c);
7397 (yyval.value).t = TYPE_ANY;
7407 /* Line 1464 of skeleton.m4 */
7408 #line 3396 "parser.y"
7409 { (yyval.value).c = abc_pushundefined(0);
7410 (yyval.value).t = TYPE_ANY;
7420 /* Line 1464 of skeleton.m4 */
7421 #line 3400 "parser.y"
7422 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7431 /* Line 1464 of skeleton.m4 */
7432 #line 3402 "parser.y"
7434 (yyval.value)=(yyvsp[(2) - (2)].value);
7435 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7436 (yyval.value).c=abc_negate_i((yyval.value).c);
7437 (yyval.value).t = TYPE_INT;
7439 (yyval.value).c=abc_negate((yyval.value).c);
7440 (yyval.value).t = TYPE_NUMBER;
7451 /* Line 1464 of skeleton.m4 */
7452 #line 3413 "parser.y"
7454 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7455 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7457 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7458 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7459 (yyval.value).t = 0; // array elements have unknown type
7469 /* Line 1464 of skeleton.m4 */
7470 #line 3422 "parser.y"
7472 (yyval.value).c = code_new();
7473 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7474 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).number);
7475 (yyval.value).t = registry_getarrayclass();
7485 /* Line 1464 of skeleton.m4 */
7486 #line 3429 "parser.y"
7487 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7496 /* Line 1464 of skeleton.m4 */
7497 #line 3430 "parser.y"
7498 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7507 /* Line 1464 of skeleton.m4 */
7508 #line 3432 "parser.y"
7510 (yyval.value_list).cc = 0;
7511 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7512 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7513 (yyval.value_list).number = 2;
7523 /* Line 1464 of skeleton.m4 */
7524 #line 3438 "parser.y"
7526 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7527 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7528 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7529 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7539 /* Line 1464 of skeleton.m4 */
7540 #line 3447 "parser.y"
7542 (yyval.value).c = code_new();
7543 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7544 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).number/2);
7545 (yyval.value).t = registry_getobjectclass();
7555 /* Line 1464 of skeleton.m4 */
7556 #line 3454 "parser.y"
7558 code_t*c = (yyvsp[(3) - (3)].value).c;
7559 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7560 c=abc_multiply_i(c);
7564 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
7565 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7566 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7576 /* Line 1464 of skeleton.m4 */
7577 #line 3466 "parser.y"
7579 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
7580 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
7581 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7582 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7592 /* Line 1464 of skeleton.m4 */
7593 #line 3472 "parser.y"
7595 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
7596 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
7597 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7598 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7608 /* Line 1464 of skeleton.m4 */
7609 #line 3478 "parser.y"
7611 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7612 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7613 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7614 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7624 /* Line 1464 of skeleton.m4 */
7625 #line 3484 "parser.y"
7627 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7628 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7629 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7630 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7640 /* Line 1464 of skeleton.m4 */
7641 #line 3490 "parser.y"
7643 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7644 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7645 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7646 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7656 /* Line 1464 of skeleton.m4 */
7657 #line 3496 "parser.y"
7659 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
7660 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7661 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7662 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7672 /* Line 1464 of skeleton.m4 */
7673 #line 3502 "parser.y"
7675 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7676 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7677 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7678 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7688 /* Line 1464 of skeleton.m4 */
7689 #line 3508 "parser.y"
7691 code_t*c = (yyvsp[(3) - (3)].value).c;
7693 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7697 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7700 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7701 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7711 /* Line 1464 of skeleton.m4 */
7712 #line 3521 "parser.y"
7713 { code_t*c = (yyvsp[(3) - (3)].value).c;
7714 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7715 c=abc_subtract_i(c);
7718 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7721 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7722 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7732 /* Line 1464 of skeleton.m4 */
7733 #line 3532 "parser.y"
7735 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7736 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7737 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7738 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7748 /* Line 1464 of skeleton.m4 */
7749 #line 3539 "parser.y"
7751 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7752 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7753 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7754 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7755 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7756 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7757 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7758 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7759 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7760 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7770 /* Line 1464 of skeleton.m4 */
7771 #line 3552 "parser.y"
7773 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7774 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7775 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7776 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7777 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7778 (yyval.value).c = abc_getlocal(0, nr);
7779 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7780 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7781 (yyval.value).c = abc_getlocal(0, nr);
7782 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7783 } else syntaxerror("internal error");
7785 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7786 c=abc_increment_i(c);
7792 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7793 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7794 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7805 /* Line 1464 of skeleton.m4 */
7806 #line 3579 "parser.y"
7808 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7809 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7810 c=abc_decrement_i(c);
7816 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7817 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7818 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7828 /* Line 1464 of skeleton.m4 */
7829 #line 3593 "parser.y"
7831 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7832 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7833 c=abc_increment_i(c);
7839 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7840 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7841 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7851 /* Line 1464 of skeleton.m4 */
7852 #line 3607 "parser.y"
7854 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7855 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7856 c=abc_decrement_i(c);
7862 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7863 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7864 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7874 /* Line 1464 of skeleton.m4 */
7875 #line 3622 "parser.y"
7876 { if(!state->cls->info)
7877 syntaxerror("super keyword not allowed outside a class");
7878 classinfo_t*t = state->cls->info->superclass;
7879 if(!t) t = TYPE_OBJECT;
7881 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7883 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7884 (yyval.value).c = 0;
7885 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7886 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7887 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7897 /* Line 1464 of skeleton.m4 */
7898 #line 3636 "parser.y"
7901 (yyval.value).c = abc_pushundefined(0);
7902 (yyval.value).t = 0;
7903 as3_warning("ignored @ operator");
7913 /* Line 1464 of skeleton.m4 */
7914 #line 3643 "parser.y"
7916 // child attribute TODO
7917 (yyval.value).c = abc_pushundefined(0);
7918 (yyval.value).t = 0;
7919 as3_warning("ignored .@ operator");
7929 /* Line 1464 of skeleton.m4 */
7930 #line 3650 "parser.y"
7932 // namespace declaration TODO
7933 (yyval.value).c = abc_pushundefined(0);
7934 (yyval.value).t = 0;
7935 as3_warning("ignored :: operator");
7945 /* Line 1464 of skeleton.m4 */
7946 #line 3657 "parser.y"
7949 (yyval.value).c = abc_pushundefined(0);
7950 (yyval.value).t = 0;
7951 as3_warning("ignored .. operator");
7961 /* Line 1464 of skeleton.m4 */
7962 #line 3664 "parser.y"
7965 (yyval.value).c = abc_pushundefined(0);
7966 (yyval.value).t = 0;
7967 as3_warning("ignored .() operator");
7977 /* Line 1464 of skeleton.m4 */
7978 #line 3675 "parser.y"
7980 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7981 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7983 if(TYPE_IS_CLASS(t) && t->data) {
7988 if(t->subtype==INFOTYPE_UNRESOLVED) {
7989 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
7991 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7993 if(f && !is_static != !(f->flags&FLAG_STATIC))
7995 if(f && f->slot && !noslot) {
7996 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7998 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7999 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8001 /* determine type */
8002 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8003 if(!(yyval.value).t)
8004 (yyval.value).c = abc_coerce_a((yyval.value).c);
8005 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
8006 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
8007 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8009 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8011 (yyval.value) = push_class(a);
8012 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8013 registry_ispackage(package2)) {
8014 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
8015 (yyval.value).c->data[0] = string_new4(package2);
8016 (yyval.value).t = 0;
8018 syntaxerror("couldn't resolve %s", package2);
8021 /* when resolving a property on an unknown type, we do know the
8022 name of the property (and don't seem to need the package), but
8023 we need to make avm2 try out all access modes */
8024 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8025 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8026 (yyval.value).c = abc_coerce_a((yyval.value).c);
8027 (yyval.value).t = registry_getanytype();
8038 /* Line 1464 of skeleton.m4 */
8039 #line 3727 "parser.y"
8042 /* Queue unresolved identifiers for checking against the parent
8043 function's variables.
8044 We consider everything which is not a local variable "unresolved".
8045 This encompasses class names, members of the surrounding class
8046 etc. which is *correct* because local variables of the parent function
8049 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
8050 unknown_variable((yyvsp[(1) - (1)].id));
8053 /* let the compiler know that it might want to check the current directory/package
8054 for this identifier- maybe there's a file $1.as defining $1. */
8055 //as3_schedule_class_noerror(state->package, $1);
8058 (yyval.value).t = 0;
8059 (yyval.value).c = 0;
8064 /* look at variables */
8065 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
8066 // $1 is a local variable
8067 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
8068 (yyval.value).t = v->type;
8071 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
8072 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
8073 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
8074 (yyval.value).t = v->type;
8078 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
8080 /* look at current class' members */
8081 if(!state->method->inner &&
8083 (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
8084 (f->flags&FLAG_STATIC) >= i_am_static)
8086 // $1 is a function in this class
8087 int var_is_static = (f->flags&FLAG_STATIC);
8089 if(f->kind == INFOTYPE_METHOD) {
8090 (yyval.value).t = TYPE_FUNCTION(f);
8092 (yyval.value).t = f->type;
8094 if(var_is_static && !i_am_static) {
8095 /* access to a static member from a non-static location.
8096 do this via findpropstrict:
8097 there doesn't seem to be any non-lookup way to access
8098 static properties of a class */
8099 state->method->late_binding = 1;
8100 (yyval.value).t = f->type;
8101 namespace_t ns = {f->access, ""};
8102 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8103 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8104 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8106 } else if(f->slot>0) {
8107 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8108 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8111 namespace_t ns = {f->access, ""};
8112 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8113 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8114 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8119 /* look at actual classes, in the current package and imported */
8120 if((a = find_class((yyvsp[(1) - (1)].id)))) {
8121 (yyval.value) = push_class(a);
8125 /* look through package prefixes */
8126 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) ||
8127 registry_ispackage((yyvsp[(1) - (1)].id))) {
8128 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
8129 (yyval.value).t = 0;
8133 /* unknown object, let the avm2 resolve it */
8135 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
8136 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
8137 state->method->late_binding = 1;
8139 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
8141 (yyval.value).t = 0;
8142 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8143 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8154 /* Line 1464 of skeleton.m4 */
8155 #line 3836 "parser.y"
8158 NEW(namespace_decl_t,n);
8159 n->name = (yyvsp[(2) - (2)].id);
8160 n->url = (yyvsp[(2) - (2)].id);
8161 (yyval.namespace_decl)=n;
8171 /* Line 1464 of skeleton.m4 */
8172 #line 3843 "parser.y"
8175 NEW(namespace_decl_t,n);
8176 n->name = (yyvsp[(2) - (4)].id);
8177 n->url = (yyvsp[(4) - (4)].id);
8178 (yyval.namespace_decl)=n;
8188 /* Line 1464 of skeleton.m4 */
8189 #line 3850 "parser.y"
8192 NEW(namespace_decl_t,n);
8193 n->name = (yyvsp[(2) - (4)].id);
8194 n->url = (yyvsp[(4) - (4)].str).str;
8195 (yyval.namespace_decl)=n;
8205 /* Line 1464 of skeleton.m4 */
8206 #line 3857 "parser.y"
8209 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8211 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8212 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8213 var->type = TYPE_NAMESPACE;
8215 ns.access = ACCESS_NAMESPACE;
8216 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8217 var->value = constant_new_namespace(&ns);
8229 /* Line 1464 of skeleton.m4 */
8230 #line 3872 "parser.y"
8233 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8234 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8235 if(!s || s->kind != INFOTYPE_SLOT)
8236 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8237 if(!s->value || !NS_TYPE(s->value->type))
8238 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8239 url = s->value->ns->name;
8241 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8242 add_active_url(url);
8251 /* Line 1464 of skeleton.m4 */
8252 #line 8253 "parser.tab.c"
8255 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8259 YY_STACK_PRINT (yyss, yyssp);
8263 /* Now `shift' the result of the reduction. Determine what state
8264 that goes to, based on the state we popped back to and the rule
8265 number reduced by. */
8269 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8270 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8271 yystate = yytable[yystate];
8273 yystate = yydefgoto[yyn - YYNTOKENS];
8278 /*------------------------------------.
8279 | yyerrlab -- here on detecting error |
8280 `------------------------------------*/
8282 /* If not already recovering from an error, report this error. */
8286 #if ! YYERROR_VERBOSE
8287 yyerror (YY_("syntax error"));
8290 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8291 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8293 YYSIZE_T yyalloc = 2 * yysize;
8294 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8295 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8296 if (yymsg != yymsgbuf)
8297 YYSTACK_FREE (yymsg);
8298 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8300 yymsg_alloc = yyalloc;
8304 yymsg_alloc = sizeof yymsgbuf;
8308 if (0 < yysize && yysize <= yymsg_alloc)
8310 (void) yysyntax_error (yymsg, yystate, yychar);
8315 yyerror (YY_("syntax error"));
8317 goto yyexhaustedlab;
8325 if (yyerrstatus == 3)
8327 /* If just tried and failed to reuse lookahead token after an
8328 error, discard it. */
8330 if (yychar <= YYEOF)
8332 /* Return failure if at end of input. */
8333 if (yychar == YYEOF)
8338 yydestruct ("Error: discarding",
8344 /* Else will try to reuse lookahead token after shifting the error
8349 /*---------------------------------------------------.
8350 | yyerrorlab -- error raised explicitly by YYERROR. |
8351 `---------------------------------------------------*/
8354 /* Pacify compilers like GCC when the user code never invokes
8355 YYERROR and the label yyerrorlab therefore never appears in user
8357 if (/*CONSTCOND*/ 0)
8360 /* Do not reclaim the symbols of the rule which action triggered
8364 YY_STACK_PRINT (yyss, yyssp);
8369 /*-------------------------------------------------------------.
8370 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8371 `-------------------------------------------------------------*/
8373 yyerrstatus = 3; /* Each real token shifted decrements this. */
8377 yyn = yypact[yystate];
8378 if (yyn != YYPACT_NINF)
8381 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8389 /* Pop the current state because it cannot handle the error token. */
8394 yydestruct ("Error: popping",
8395 yystos[yystate], yyvsp);
8398 YY_STACK_PRINT (yyss, yyssp);
8404 /* Shift the error token. */
8405 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8411 /*-------------------------------------.
8412 | yyacceptlab -- YYACCEPT comes here. |
8413 `-------------------------------------*/
8418 /*-----------------------------------.
8419 | yyabortlab -- YYABORT comes here. |
8420 `-----------------------------------*/
8425 #if !defined(yyoverflow) || YYERROR_VERBOSE
8426 /*-------------------------------------------------.
8427 | yyexhaustedlab -- memory exhaustion comes here. |
8428 `-------------------------------------------------*/
8430 yyerror (YY_("memory exhausted"));
8436 if (yychar != YYEMPTY)
8437 yydestruct ("Cleanup: discarding lookahead",
8439 /* Do not reclaim the symbols of the rule which action triggered
8440 this YYABORT or YYACCEPT. */
8442 YY_STACK_PRINT (yyss, yyssp);
8443 while (yyssp != yyss)
8445 yydestruct ("Cleanup: popping",
8446 yystos[*yyssp], yyvsp);
8451 YYSTACK_FREE (yyss);
8454 if (yymsg != yymsgbuf)
8455 YYSTACK_FREE (yymsg);
8457 /* Make sure YYID is used. */
8458 return YYID (yyresult);