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 v->type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
979 if(!v->type || v->type->kind != INFOTYPE_CLASS) {
980 syntaxerror("Couldn't find class %s", v->type->name);
988 char*as3_globalclass=0;
989 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
992 syntaxerror("inner classes now allowed");
997 classinfo_list_t*mlist=0;
999 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1000 syntaxerror("invalid modifier(s)");
1002 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1003 syntaxerror("public and internal not supported at the same time.");
1005 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1006 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1007 // all classes extend object
1008 extends = registry_getobjectclass();
1011 /* create the class name, together with the proper attributes */
1015 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1016 access = ACCESS_PRIVATE; package = internal_filename_package;
1017 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1018 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1019 } else if(state->package!=internal_filename_package) {
1020 access = ACCESS_PACKAGE; package = state->package;
1022 syntaxerror("public classes only allowed inside a package");
1026 state->cls = rfx_calloc(sizeof(classstate_t));
1027 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1028 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1029 /* notice: we make no effort to initialize the top variable (local0) here,
1030 even though it has special meaning. We just rely on the facat
1031 that pass 1 won't do anything with variables */
1033 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1035 /* set current method to constructor- all code within the class-level (except
1036 static variable initializations) will be executed during construction time */
1037 state->method = state->cls->init;
1039 if(registry_find(package, classname)) {
1040 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1042 /* build info struct */
1043 int num_interfaces = (list_length(implements));
1044 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1045 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1048 classinfo_list_t*l = implements;
1049 for(l=implements;l;l=l->next) {
1050 state->cls->info->interfaces[pos++] = l->classinfo;
1055 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1057 state->method = state->cls->init;
1058 parserassert(state->cls && state->cls->info);
1060 function_initvars(state->cls->init, 0, 0, 1);
1061 function_initvars(state->cls->static_init, 0, 0, 0);
1063 if(extends && (extends->flags & FLAG_FINAL))
1064 syntaxerror("Can't extend final class '%s'", extends->name);
1067 while(state->cls->info->interfaces[pos]) {
1068 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1069 syntaxerror("'%s' is not an interface",
1070 state->cls->info->interfaces[pos]->name);
1074 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
1075 state->cls->info->superclass = extends;
1077 /* generate the abc code for this class */
1078 MULTINAME(classname2,state->cls->info);
1079 multiname_t*extends2 = sig2mname(extends);
1081 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1082 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1083 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1084 if(state->cls->info->flags&FLAG_INTERFACE) {
1085 abc_class_interface(state->cls->abc);
1088 abc_class_protectedNS(state->cls->abc, classname);
1090 for(mlist=implements;mlist;mlist=mlist->next) {
1091 MULTINAME(m, mlist->classinfo);
1092 abc_class_add_interface(state->cls->abc, &m);
1095 /* write the construction code for this class to the global init
1097 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1099 abc_method_body_t*m = global->init->method->body;
1100 __ getglobalscope(m);
1101 classinfo_t*s = extends;
1106 //TODO: take a look at the current scope stack, maybe
1107 // we can re-use something
1112 multiname_t*s2 = sig2mname(s);
1114 multiname_destroy(s2);
1116 __ pushscope(m); count++;
1117 m->code = m->code->prev->prev; // invert
1119 /* continue appending after last op end */
1120 while(m->code && m->code->next) m->code = m->code->next;
1122 /* TODO: if this is one of *our* classes, we can also
1123 do a getglobalscope/getslot <nr> (which references
1124 the init function's slots) */
1126 __ getlex2(m, extends2);
1128 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1129 stack is not the superclass */
1130 __ pushscope(m);count++;
1133 /* notice: we get a verify error #1107 if the top element on the scope
1134 stack is not the global object */
1136 __ pushscope(m);count++;
1138 __ newclass(m,state->cls->abc);
1142 __ setslot(m, slotindex);
1143 multiname_destroy(extends2);
1145 /* flash.display.MovieClip handling */
1147 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1148 if(state->package && state->package[0]) {
1149 as3_globalclass = concat3(state->package, ".", classname);
1151 as3_globalclass = strdup(classname);
1157 static int slotstate_varconst = 0;
1158 static modifiers_t*slotstate_flags = 0;
1159 static void setslotstate(modifiers_t* flags, int varconst)
1161 slotstate_varconst = varconst;
1162 slotstate_flags = flags;
1164 if(flags && flags->flags&FLAG_STATIC) {
1165 state->method = state->cls->static_init;
1167 state->method = state->cls->init;
1170 parserassert(state->method);
1174 static void endclass()
1177 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1179 c = abc_getlocal_0(c);
1180 c = abc_constructsuper(c, 0);
1181 state->cls->init->header = code_append(state->cls->init->header, c);
1182 state->cls->has_constructor=1;
1184 if(state->cls->init) {
1185 if(state->cls->info->flags&FLAG_INTERFACE) {
1186 if(state->cls->init->header)
1187 syntaxerror("interface can not have class-level code");
1189 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1190 code_t*c = method_header(state->cls->init);
1191 m->body->code = wrap_function(c, 0, m->body->code);
1194 if(state->cls->static_init) {
1195 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1196 code_t*c = method_header(state->cls->static_init);
1197 m->body->code = wrap_function(c, 0, m->body->code);
1204 void check_code_for_break(code_t*c)
1207 if(c->opcode == OPCODE___BREAK__) {
1208 char*name = string_cstr(c->data[0]);
1209 syntaxerror("Unresolved \"break %s\"", name);
1211 if(c->opcode == OPCODE___CONTINUE__) {
1212 char*name = string_cstr(c->data[0]);
1213 syntaxerror("Unresolved \"continue %s\"", name);
1215 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1216 char*name = string_cstr(c->data[0]);
1217 syntaxerror("Can't reference a package (%s) as such", name);
1224 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1227 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1228 if(TYPE_IS_NUMBER(t)) {
1229 xassert(c->type == CONSTANT_FLOAT
1230 || c->type == CONSTANT_INT
1231 || c->type == CONSTANT_UINT);
1232 } else if(TYPE_IS_UINT(t)) {
1233 xassert(c->type == CONSTANT_UINT ||
1234 (c->type == CONSTANT_INT && c->i>=0));
1235 } else if(TYPE_IS_INT(t)) {
1236 xassert(c->type == CONSTANT_INT);
1237 } else if(TYPE_IS_BOOLEAN(t)) {
1238 xassert(c->type == CONSTANT_TRUE
1239 || c->type == CONSTANT_FALSE);
1243 static void check_override(memberinfo_t*m, int flags)
1247 if(m->parent == state->cls->info)
1248 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1250 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1251 if(m->access==ACCESS_PRIVATE)
1253 if(m->flags & FLAG_FINAL)
1254 syntaxerror("can't override final member %s", m->name);
1256 /* allow this. it's no issue.
1257 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1258 syntaxerror("can't override static member %s", m->name);*/
1260 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1261 syntaxerror("can't override non-static member %s with static declaration", m->name);
1263 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1264 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1265 if(m->kind == INFOTYPE_METHOD)
1266 syntaxerror("can't override without explicit 'override' declaration");
1268 syntaxerror("can't override '%s'", m->name);
1273 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1275 methodinfo_t*minfo = 0;
1276 namespace_t ns = modifiers2access(mod);
1279 minfo = methodinfo_register_global(ns.access, state->package, name);
1280 minfo->return_type = 0; // save this for pass 2
1281 } else if(getset != KW_GET && getset != KW_SET) {
1283 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1285 printf("%s.%s | %s.%s\n",
1286 m->package, m->name,
1288 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1290 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1291 minfo->return_type = 0; // save this for pass 2
1292 // getslot on a member slot only returns "undefined", so no need
1293 // to actually store these
1294 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1296 //class getter/setter
1297 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1299 if(getset == KW_GET) {
1301 } else if(params->list && params->list->param && !params->list->next) {
1302 type = params->list->param->type;
1304 syntaxerror("setter function needs to take exactly one argument");
1305 // not sure wether to look into superclasses here, too
1306 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1308 if(minfo->kind!=INFOTYPE_SLOT)
1309 syntaxerror("class already contains a method called '%s'", name);
1310 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1311 syntaxerror("class already contains a field called '%s'", name);
1312 if(minfo->subtype & gs)
1313 syntaxerror("getter/setter for '%s' already defined", name);
1314 /* make a setter or getter into a getset */
1315 minfo->subtype |= gs;
1318 FIXME: this check needs to be done in pass 2
1320 if((!minfo->return_type != !type) ||
1321 (minfo->return_type && type &&
1322 !strcmp(minfo->return_type->name, type->name))) {
1323 syntaxerror("different type in getter and setter: %s and %s",
1324 minfo->return_type?minfo->return_type->name:"*",
1325 type?type->name:"*");
1328 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1329 minfo->kind = INFOTYPE_SLOT; //hack
1330 minfo->subtype = gs;
1331 minfo->return_type = 0;
1333 /* can't assign a slot as getter and setter might have different slots */
1334 //minfo->slot = slot;
1336 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1337 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1338 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1343 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1345 //parserassert(state->method && state->method->info);
1347 methodstate_t*parent_method = state->method;
1350 return_type = 0; // not valid in pass 1
1354 state->new_vars = 1;
1357 state->method = rfx_calloc(sizeof(methodstate_t));
1358 state->method->inner = 1;
1359 state->method->variable_count = 0;
1360 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1362 NEW(methodinfo_t,minfo);
1363 minfo->kind = INFOTYPE_METHOD;
1364 minfo->access = ACCESS_PACKAGEINTERNAL;
1366 state->method->info = minfo;
1369 list_append(parent_method->innerfunctions, state->method);
1371 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1373 function_initvars(state->method, params, 0, 1);
1377 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1378 state->method->variable_count = 0;
1379 parserassert(state->method);
1381 state->method->info->return_type = return_type;
1382 function_initvars(state->method, params, 0, 1);
1386 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1387 params_t*params, classinfo_t*return_type)
1389 if(state->method && state->method->info) {
1390 syntaxerror("not able to start another method scope");
1393 state->new_vars = 1;
1396 state->method = rfx_calloc(sizeof(methodstate_t));
1397 state->method->has_super = 0;
1400 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1402 state->method->is_global = 1;
1403 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1405 if(state->method->is_constructor)
1406 name = "__as3_constructor__";
1408 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1410 function_initvars(state->method, params, mod->flags, 1);
1412 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1416 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1417 state->method->variable_count = 0;
1418 parserassert(state->method);
1421 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1422 check_override(m, mod->flags);
1426 state->cls->has_constructor |= state->method->is_constructor;
1429 state->method->info->return_type = return_type;
1430 function_initvars(state->method, params, mod->flags, 1);
1434 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1435 params_t*params, classinfo_t*return_type, code_t*body)
1438 // store inner methods in variables
1439 function_initvars(state->method, 0, 0, 0);
1441 methodstate_list_t*ml = state->method->innerfunctions;
1443 dict_t*xvars = dict_new();
1446 methodstate_t*m = ml->methodstate;
1447 parserassert(m->inner);
1448 if(m->unresolved_variables) {
1449 dict_t*d = m->unresolved_variables;
1451 for(t=0;t<d->hashsize;t++) {
1452 dictentry_t*l = d->slots[t];
1454 /* check parent method's variables */
1456 if((v=find_variable(state, l->key))) {
1457 m->uses_parent_function = 1;
1458 state->method->uses_slots = 1;
1459 dict_put(xvars, l->key, 0);
1466 dict_destroy(m->unresolved_variables);
1467 m->unresolved_variables = 0;
1472 if(state->method->uses_slots) {
1473 state->method->slots = dict_new();
1475 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1476 if(!name) syntaxerror("internal error");
1477 if(v->index && dict_contains(xvars, name)) {
1480 if(v->is_inner_method) {
1481 v->is_inner_method->is_a_slot = 1;
1484 dict_put(state->method->slots, name, v);
1487 state->method->uses_slots = i;
1488 dict_destroy(state->vars);state->vars = 0;
1495 /*if(state->method->uses_parent_function){
1496 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1501 multiname_t*type2 = sig2mname(return_type);
1503 if(state->method->inner) {
1504 f = state->method->abc;
1505 abc_method_init(f, global->file, type2, 1);
1506 } else if(state->method->is_constructor) {
1507 f = abc_class_getconstructor(state->cls->abc, type2);
1508 } else if(!state->method->is_global) {
1509 namespace_t mname_ns = modifiers2access(mod);
1510 multiname_t mname = {QNAME, &mname_ns, 0, name};
1512 if(mod->flags&FLAG_STATIC)
1513 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1515 f = abc_class_method(state->cls->abc, type2, &mname);
1516 slot = f->trait->slot_id;
1518 namespace_t mname_ns = {state->method->info->access, state->package};
1519 multiname_t mname = {QNAME, &mname_ns, 0, name};
1521 f = abc_method_new(global->file, type2, 1);
1522 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1523 //abc_code_t*c = global->init->method->body->code;
1525 //flash doesn't seem to allow us to access function slots
1526 //state->method->info->slot = slot;
1528 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1529 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1530 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1531 if(params->varargs) f->flags |= METHOD_NEED_REST;
1535 for(p=params->list;p;p=p->next) {
1536 if(params->varargs && !p->next) {
1537 break; //varargs: omit last parameter in function signature
1539 multiname_t*m = sig2mname(p->param->type);
1540 list_append(f->parameters, m);
1541 if(p->param->value) {
1542 check_constant_against_type(p->param->type, p->param->value);
1543 opt=1;list_append(f->optional_parameters, p->param->value);
1545 syntaxerror("non-optional parameter not allowed after optional parameters");
1548 if(state->method->slots) {
1549 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1551 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1552 multiname_t*type = sig2mname(v->type);
1553 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1554 t->slot_id = v->index;
1559 check_code_for_break(body);
1561 /* Seems this works now.
1562 if(state->method->exceptions && state->method->uses_slots) {
1563 as3_warning("try/catch and activation not supported yet within the same method");
1567 f->body->code = body;
1568 f->body->exceptions = state->method->exceptions;
1569 } else { //interface
1571 syntaxerror("interface methods can't have a method body");
1581 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1586 void breakjumpsto(code_t*c, char*name, code_t*jump)
1589 if(c->opcode == OPCODE___BREAK__) {
1590 string_t*name2 = c->data[0];
1591 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1592 c->opcode = OPCODE_JUMP;
1599 void continuejumpsto(code_t*c, char*name, code_t*jump)
1602 if(c->opcode == OPCODE___CONTINUE__) {
1603 string_t*name2 = c->data[0];
1604 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1605 c->opcode = OPCODE_JUMP;
1613 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1614 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1615 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1617 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1619 if(!type1 || !type2)
1620 return registry_getanytype();
1621 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1622 return registry_getanytype();
1625 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1634 return registry_getanytype();
1636 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1641 return abc_coerce_a(c);
1645 // cast an "any" type to a specific type. subject to
1646 // runtime exceptions
1647 return abc_coerce2(c, &m);
1650 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1651 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1652 // allow conversion between number types
1653 return abc_coerce2(c, &m);
1655 //printf("%s.%s\n", from.package, from.name);
1656 //printf("%s.%s\n", to.package, to.name);
1658 classinfo_t*supertype = from;
1660 if(supertype == to) {
1661 // target type is one of from's superclasses
1662 return abc_coerce2(c, &m);
1665 while(supertype->interfaces[t]) {
1666 if(supertype->interfaces[t]==to) {
1667 // target type is one of from's interfaces
1668 return abc_coerce2(c, &m);
1672 supertype = supertype->superclass;
1674 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1676 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1678 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1681 as3_error("can't convert type %s%s%s to %s%s%s",
1682 from->package, from->package?".":"", from->name,
1683 to->package, to->package?".":"", to->name);
1687 code_t*defaultvalue(code_t*c, classinfo_t*type)
1689 if(TYPE_IS_INT(type)) {
1690 c = abc_pushbyte(c, 0);
1691 } else if(TYPE_IS_UINT(type)) {
1692 c = abc_pushuint(c, 0);
1693 } else if(TYPE_IS_FLOAT(type)) {
1695 } else if(TYPE_IS_BOOLEAN(type)) {
1696 c = abc_pushfalse(c);
1698 //c = abc_pushundefined(c);
1700 c = abc_pushnull(c);
1702 c = abc_coerce2(c, &m);
1707 char is_pushundefined(code_t*c)
1709 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1712 static const char* get_package_from_name(const char*name)
1714 /* try explicit imports */
1715 dictentry_t* e = dict_get_slot(state->imports, name);
1717 if(!strcmp(e->key, name)) {
1718 slotinfo_t*c = (slotinfo_t*)e->data;
1719 if(c) return c->package;
1725 static namespace_list_t*get_current_imports()
1727 namespace_list_t*searchlist = 0;
1729 list_append(searchlist, namespace_new_package(state->package));
1731 import_list_t*l = state->wildcard_imports;
1733 namespace_t*ns = namespace_new_package(l->import->package);
1734 list_append(searchlist, ns);
1737 list_append(searchlist, namespace_new_package(""));
1738 list_append(searchlist, namespace_new_package(internal_filename_package));
1742 static slotinfo_t* find_class(const char*name)
1746 c = registry_find(state->package, name);
1749 /* try explicit imports */
1750 dictentry_t* e = dict_get_slot(state->imports, name);
1753 if(!strcmp(e->key, name)) {
1754 c = (slotinfo_t*)e->data;
1760 /* try package.* imports */
1761 import_list_t*l = state->wildcard_imports;
1763 //printf("does package %s contain a class %s?\n", l->import->package, name);
1764 c = registry_find(l->import->package, name);
1769 /* try global package */
1770 c = registry_find("", name);
1773 /* try local "filename" package */
1774 c = registry_find(internal_filename_package, name);
1779 typedcode_t push_class(slotinfo_t*a)
1784 if(a->access == ACCESS_PACKAGEINTERNAL &&
1785 strcmp(a->package, state->package) &&
1786 strcmp(a->package, internal_filename_package)
1788 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1789 infotypename(a), a->name, a->package, state->package);
1792 if(a->kind != INFOTYPE_CLASS) {
1794 x.c = abc_findpropstrict2(x.c, &m);
1795 x.c = abc_getproperty2(x.c, &m);
1796 if(a->kind == INFOTYPE_METHOD) {
1797 methodinfo_t*f = (methodinfo_t*)a;
1798 x.t = TYPE_FUNCTION(f);
1800 varinfo_t*v = (varinfo_t*)a;
1804 classinfo_t*c = (classinfo_t*)a;
1806 x.c = abc_getglobalscope(x.c);
1807 x.c = abc_getslot(x.c, c->slot);
1810 x.c = abc_getlex2(x.c, &m);
1812 x.t = TYPE_CLASS(c);
1817 static char is_getlocal(code_t*c)
1819 if(!c || c->prev || c->next)
1821 return(c->opcode == OPCODE_GETLOCAL
1822 || c->opcode == OPCODE_GETLOCAL_0
1823 || c->opcode == OPCODE_GETLOCAL_1
1824 || c->opcode == OPCODE_GETLOCAL_2
1825 || c->opcode == OPCODE_GETLOCAL_3);
1827 static int getlocalnr(code_t*c)
1829 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1830 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1831 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1832 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1833 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1834 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1838 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1842 [prefix code] [read instruction]
1846 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1848 if(in && in->opcode == OPCODE_COERCE_A) {
1849 in = code_cutlast(in);
1852 syntaxerror("internal error");
1854 /* chop off read instruction */
1858 prefix = r->prev;r->prev = 0;
1864 char use_temp_var = readbefore;
1866 /* generate the write instruction, and maybe append a dup to the prefix code */
1867 code_t* write = abc_nop(0);
1868 if(r->opcode == OPCODE_GETPROPERTY) {
1869 write->opcode = OPCODE_SETPROPERTY;
1870 multiname_t*m = (multiname_t*)r->data[0];
1871 write->data[0] = multiname_clone(m);
1872 if(m->type == QNAME || m->type == MULTINAME) {
1874 prefix = abc_dup(prefix); // we need the object, too
1877 } else if(m->type == MULTINAMEL) {
1879 /* dupping two values on the stack requires 5 operations and one register-
1880 couldn't adobe just have given us a dup2? */
1881 int temp = gettempvar();
1882 prefix = abc_setlocal(prefix, temp);
1883 prefix = abc_dup(prefix);
1884 prefix = abc_getlocal(prefix, temp);
1885 prefix = abc_swap(prefix);
1886 prefix = abc_getlocal(prefix, temp);
1888 prefix = abc_kill(prefix, temp);
1892 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1894 } else if(r->opcode == OPCODE_GETSLOT) {
1895 write->opcode = OPCODE_SETSLOT;
1896 write->data[0] = r->data[0];
1898 prefix = abc_dup(prefix); // we need the object, too
1901 } else if(r->opcode == OPCODE_GETLOCAL) {
1902 write->opcode = OPCODE_SETLOCAL;
1903 write->data[0] = r->data[0];
1904 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1905 write->opcode = OPCODE_SETLOCAL_0;
1906 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1907 write->opcode = OPCODE_SETLOCAL_1;
1908 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1909 write->opcode = OPCODE_SETLOCAL_2;
1910 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1911 write->opcode = OPCODE_SETLOCAL_3;
1912 } else if(r->opcode == OPCODE_GETSUPER) {
1913 write->opcode = OPCODE_SETSUPER;
1914 multiname_t*m = (multiname_t*)r->data[0];
1915 write->data[0] = multiname_clone(m);
1918 syntaxerror("illegal lvalue: can't assign a value to this expression");
1925 /* with getproperty/getslot, we have to be extra careful not
1926 to execute the read code twice, as it might have side-effects
1927 (e.g. if the property is in fact a setter/getter combination)
1929 So read the value, modify it, and write it again,
1930 using prefix only once and making sure (by using a temporary
1931 register) that the return value is what we just wrote */
1932 temp = gettempvar();
1933 c = code_append(c, prefix);
1934 c = code_append(c, r);
1937 c = abc_setlocal(c, temp);
1939 c = code_append(c, middlepart);
1942 c = abc_setlocal(c, temp);
1944 c = code_append(c, write);
1945 c = abc_getlocal(c, temp);
1946 c = abc_kill(c, temp);
1948 /* if we're allowed to execute the read code twice *and*
1949 the middlepart doesn't modify the code, things are easier.
1951 code_t* r2 = code_dup(r);
1952 //c = code_append(c, prefix);
1953 parserassert(!prefix);
1954 c = code_append(c, r);
1955 c = code_append(c, middlepart);
1956 c = code_append(c, write);
1957 c = code_append(c, r2);
1960 /* even smaller version: overwrite the value without reading
1964 c = code_append(c, prefix);
1967 c = code_append(c, middlepart);
1968 c = code_append(c, write);
1969 c = code_append(c, r);
1972 temp = gettempvar();
1974 c = code_append(c, prefix);
1976 c = code_append(c, middlepart);
1978 c = abc_setlocal(c, temp);
1979 c = code_append(c, write);
1980 c = abc_getlocal(c, temp);
1981 c = abc_kill(c, temp);
1987 char is_break_or_jump(code_t*c)
1991 if(c->opcode == OPCODE_JUMP ||
1992 c->opcode == OPCODE___BREAK__ ||
1993 c->opcode == OPCODE___CONTINUE__ ||
1994 c->opcode == OPCODE_THROW ||
1995 c->opcode == OPCODE_RETURNVOID ||
1996 c->opcode == OPCODE_RETURNVALUE) {
2002 #define IS_FINALLY_TARGET(op) \
2003 ((op) == OPCODE___CONTINUE__ || \
2004 (op) == OPCODE___BREAK__ || \
2005 (op) == OPCODE_RETURNVOID || \
2006 (op) == OPCODE_RETURNVALUE || \
2007 (op) == OPCODE___RETHROW__)
2009 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
2011 #define NEED_EXTRA_STACK_ARG
2012 code_t*finally_label = abc_nop(0);
2013 NEW(lookupswitch_t, l);
2019 code_t*prev = i->prev;
2020 if(IS_FINALLY_TARGET(i->opcode)) {
2023 if(i->opcode == OPCODE___RETHROW__ ||
2024 i->opcode == OPCODE_RETURNVALUE) {
2025 if(i->opcode == OPCODE___RETHROW__)
2026 i->opcode = OPCODE_THROW;
2028 p = abc_coerce_a(p);
2029 p = abc_setlocal(p, tempvar);
2031 p = abc_pushbyte(p, count++);
2032 p = abc_jump(p, finally_label);
2033 code_t*target = p = abc_label(p);
2034 #ifdef NEED_EXTRA_STACK_ARG
2038 p = abc_getlocal(p, tempvar);
2041 p->next = i;i->prev = p;
2042 list_append(l->targets, target);
2048 c = abc_pushbyte(c, -1);
2049 c = code_append(c, finally_label);
2050 c = code_append(c, finally);
2052 #ifdef NEED_EXTRA_STACK_ARG
2055 c = abc_lookupswitch(c, l);
2056 c = l->def = abc_label(c);
2057 #ifdef NEED_EXTRA_STACK_ARG
2064 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
2068 code_t*prev = i->prev;
2069 if(IS_FINALLY_TARGET(i->opcode)) {
2070 if(i->opcode == OPCODE___RETHROW__)
2071 i->opcode = OPCODE_THROW;
2072 code_t*end = code_dup(finally);
2073 code_t*start = code_start(end);
2074 if(prev) prev->next = start;
2081 return code_append(c, finally);
2084 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
2090 int num_insertion_points=0;
2092 if(IS_FINALLY_TARGET(i->opcode))
2093 num_insertion_points++;
2100 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2105 int simple_version_cost = (1+num_insertion_points)*code_size;
2106 int lookup_version_cost = 4*num_insertion_points + 5;
2108 if(cantdup || simple_version_cost > lookup_version_cost) {
2109 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
2110 return insert_finally_lookup(c, finally, tempvar);
2112 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
2113 return insert_finally_simple(c, finally, tempvar);
2117 #define PASS1 }} if(as3_pass == 1) {{
2118 #define PASS1END }} if(as3_pass == 2) {{
2119 #define PASS2 }} if(as3_pass == 2) {{
2120 #define PASS12 }} {{
2121 #define PASS12END }} if(as3_pass == 2) {{
2125 /* Line 273 of skeleton.m4 */
2126 #line 2127 "parser.tab.c"
2133 typedef YYTYPE_UINT8 yytype_uint8;
2135 typedef unsigned char yytype_uint8;
2139 typedef YYTYPE_INT8 yytype_int8;
2140 #elif (defined __STDC__ || defined __C99__FUNC__ \
2141 || defined __cplusplus || defined _MSC_VER)
2142 typedef signed char yytype_int8;
2144 typedef short int yytype_int8;
2147 #ifdef YYTYPE_UINT16
2148 typedef YYTYPE_UINT16 yytype_uint16;
2150 typedef unsigned short int yytype_uint16;
2154 typedef YYTYPE_INT16 yytype_int16;
2156 typedef short int yytype_int16;
2160 # ifdef __SIZE_TYPE__
2161 # define YYSIZE_T __SIZE_TYPE__
2162 # elif defined size_t
2163 # define YYSIZE_T size_t
2164 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2165 || defined __cplusplus || defined _MSC_VER)
2166 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2167 # define YYSIZE_T size_t
2169 # define YYSIZE_T unsigned int
2173 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2178 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2179 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2183 # define YY_(msgid) msgid
2187 /* Suppress unused-variable warnings by "using" E. */
2188 #if ! defined lint || defined __GNUC__
2189 # define YYUSE(e) ((void) (e))
2191 # define YYUSE(e) /* empty */
2194 /* Identity function, used to suppress warnings about constant conditions. */
2196 # define YYID(n) (n)
2198 #if (defined __STDC__ || defined __C99__FUNC__ \
2199 || defined __cplusplus || defined _MSC_VER)
2212 #if ! defined yyoverflow || YYERROR_VERBOSE
2214 /* The parser invokes alloca or malloc; define the necessary symbols. */
2216 # ifdef YYSTACK_USE_ALLOCA
2217 # if YYSTACK_USE_ALLOCA
2219 # define YYSTACK_ALLOC __builtin_alloca
2220 # elif defined __BUILTIN_VA_ARG_INCR
2221 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2223 # define YYSTACK_ALLOC __alloca
2224 # elif defined _MSC_VER
2225 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2226 # define alloca _alloca
2228 # define YYSTACK_ALLOC alloca
2229 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2230 || defined __cplusplus || defined _MSC_VER)
2231 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2233 # define _STDLIB_H 1
2240 # ifdef YYSTACK_ALLOC
2241 /* Pacify GCC's `empty if-body' warning. */
2242 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2243 # ifndef YYSTACK_ALLOC_MAXIMUM
2244 /* The OS might guarantee only one guard page at the bottom of the stack,
2245 and a page size can be as small as 4096 bytes. So we cannot safely
2246 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2247 to allow for a few compiler-allocated temporary stack slots. */
2248 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2251 # define YYSTACK_ALLOC YYMALLOC
2252 # define YYSTACK_FREE YYFREE
2253 # ifndef YYSTACK_ALLOC_MAXIMUM
2254 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2256 # if (defined __cplusplus && ! defined _STDLIB_H \
2257 && ! ((defined YYMALLOC || defined malloc) \
2258 && (defined YYFREE || defined free)))
2259 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2261 # define _STDLIB_H 1
2265 # define YYMALLOC malloc
2266 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2267 || defined __cplusplus || defined _MSC_VER)
2268 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2272 # define YYFREE free
2273 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2274 || defined __cplusplus || defined _MSC_VER)
2275 void free (void *); /* INFRINGES ON USER NAME SPACE */
2279 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2282 #if (! defined yyoverflow \
2283 && (! defined __cplusplus \
2284 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2286 /* A type that is properly aligned for any stack member. */
2289 yytype_int16 yyss_alloc;
2293 /* The size of the maximum gap between one aligned stack and the next. */
2294 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2296 /* The size of an array large to enough to hold all stacks, each with
2298 # define YYSTACK_BYTES(N) \
2299 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2300 + YYSTACK_GAP_MAXIMUM)
2302 /* Copy COUNT objects from FROM to TO. The source and destination do
2305 # if defined __GNUC__ && 1 < __GNUC__
2306 # define YYCOPY(To, From, Count) \
2307 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2309 # define YYCOPY(To, From, Count) \
2313 for (yyi = 0; yyi < (Count); yyi++) \
2314 (To)[yyi] = (From)[yyi]; \
2320 /* Relocate STACK from its old location to the new one. The
2321 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2322 elements in the stack, and YYPTR gives the new location of the
2323 stack. Advance YYPTR to a properly aligned location for the next
2325 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2328 YYSIZE_T yynewbytes; \
2329 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2330 Stack = &yyptr->Stack_alloc; \
2331 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2332 yyptr += yynewbytes / sizeof (*yyptr); \
2338 /* YYFINAL -- State number of the termination state. */
2340 /* YYLAST -- Last index in YYTABLE. */
2343 /* YYNTOKENS -- Number of terminals. */
2344 #define YYNTOKENS 134
2345 /* YYNNTS -- Number of nonterminals. */
2347 /* YYNRULES -- Number of rules. */
2348 #define YYNRULES 309
2349 /* YYNRULES -- Number of states. */
2350 #define YYNSTATES 521
2352 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2353 #define YYUNDEFTOK 2
2354 #define YYMAXUTOK 363
2356 #define YYTRANSLATE(YYX) \
2357 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2359 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2360 static const yytype_uint8 yytranslate[] =
2362 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2363 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2364 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2365 2, 2, 2, 118, 2, 2, 2, 116, 108, 2,
2366 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2367 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2368 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2369 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2371 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2374 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2375 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
2388 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2389 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2390 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2391 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2392 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2393 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2394 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2395 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2396 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2397 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2402 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2404 static const yytype_uint16 yyprhs[] =
2406 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2407 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2408 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2409 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2410 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2411 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2412 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2413 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2414 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2415 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2416 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2417 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2418 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2419 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2420 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2421 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2422 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2423 468, 470, 472, 474, 476, 478, 480, 482, 484, 485,
2424 487, 490, 495, 499, 501, 506, 509, 511, 513, 514,
2425 515, 528, 530, 531, 532, 543, 545, 549, 551, 553,
2426 555, 559, 561, 563, 565, 568, 569, 570, 574, 575,
2427 577, 579, 581, 584, 587, 588, 593, 598, 603, 606,
2428 608, 611, 613, 615, 619, 621, 623, 625, 627, 629,
2429 631, 633, 635, 637, 639, 641, 643, 645, 647, 649,
2430 651, 653, 655, 659, 663, 667, 671, 675, 679, 683,
2431 687, 691, 695, 698, 701, 705, 709, 713, 717, 721,
2432 725, 729, 733, 737, 741, 745, 749, 753, 757, 761,
2433 766, 769, 771, 775, 778, 783, 787, 788, 790, 794,
2434 800, 804, 808, 812, 816, 820, 824, 828, 832, 836,
2435 840, 844, 848, 854, 857, 860, 863, 866, 870, 873,
2436 878, 884, 888, 894, 898, 900, 903, 908, 913, 916
2439 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2440 static const yytype_int16 yyrhs[] =
2442 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2443 137, 138, -1, 186, -1, 198, -1, 196, -1, 217,
2444 -1, 207, -1, 147, -1, 148, 126, 136, 132, -1,
2445 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2446 198, -1, 196, -1, 217, -1, 207, -1, 147, -1,
2447 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2448 143, 145, -1, 145, -1, 189, -1, 159, -1, 160,
2449 -1, 161, -1, 163, -1, 171, -1, 154, -1, 183,
2450 -1, 179, -1, 239, -1, 247, -1, 246, -1, 126,
2451 143, 132, -1, 126, 132, -1, 99, -1, 144, -1,
2452 150, -1, 165, -1, 166, -1, 236, -1, 181, -1,
2453 148, 126, 143, 132, -1, 145, 99, -1, 145, -1,
2454 144, -1, 3, 89, 3, -1, 102, 237, -1, -1,
2455 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2456 152, -1, 3, 227, 149, -1, -1, 65, 146, -1,
2457 -1, 64, 122, 155, 238, 133, 146, 153, -1, -1,
2458 150, -1, 239, -1, 46, 3, 227, -1, 3, -1,
2459 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2460 238, 99, 239, 133, 146, -1, 158, 157, 68, 238,
2461 133, 146, -1, -1, 14, 122, 162, 238, 133, 146,
2462 -1, -1, 15, 164, 146, 14, 122, 238, 133, -1,
2463 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2464 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2465 168, 169, -1, 34, 240, 105, 142, -1, 62, 105,
2466 142, -1, -1, 16, 122, 172, 240, 133, 126, 167,
2467 132, -1, -1, 33, 122, 3, 227, 133, 174, 126,
2468 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2469 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2470 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2471 37, 238, -1, 37, -1, 39, 122, 238, 133, -1,
2472 182, 146, -1, 3, -1, 19, -1, 4, -1, 185,
2473 127, 184, -1, 184, -1, -1, 19, 185, 126, 187,
2474 139, 132, -1, -1, 19, 126, 188, 139, 132, -1,
2475 41, 223, -1, 41, 185, 127, 115, -1, -1, 191,
2476 -1, 192, -1, 191, 192, -1, 21, -1, 22, -1,
2477 20, -1, 38, -1, 47, -1, 49, -1, 48, -1,
2478 26, -1, 24, -1, 4, -1, -1, 54, 224, -1,
2479 -1, 54, 225, -1, -1, 17, 225, -1, -1, 190,
2480 31, 3, 193, 195, 126, 197, 200, 132, -1, -1,
2481 190, 44, 3, 194, 126, 199, 203, 132, -1, -1,
2482 201, -1, 202, -1, 201, 202, -1, 99, -1, 148,
2483 126, 200, 132, -1, 207, -1, 217, -1, 144, -1,
2484 -1, 204, -1, 205, -1, 204, 205, -1, 99, -1,
2485 46, 3, -1, 190, 27, 216, 3, 122, 213, 133,
2486 227, -1, 46, -1, 32, -1, -1, 190, 206, 208,
2487 209, -1, 210, -1, 209, 100, 210, -1, 3, 227,
2488 149, -1, -1, 102, 212, -1, 10, -1, 8, -1,
2489 9, -1, 12, -1, 5, -1, 56, -1, 55, -1,
2490 45, -1, 3, -1, -1, 214, -1, 93, 215, -1,
2491 214, 100, 93, 215, -1, 214, 100, 215, -1, 215,
2492 -1, 3, 105, 226, 211, -1, 3, 211, -1, 51,
2493 -1, 35, -1, -1, -1, 190, 27, 216, 3, 122,
2494 213, 133, 227, 126, 218, 142, 132, -1, 3, -1,
2495 -1, -1, 27, 219, 122, 213, 133, 227, 126, 221,
2496 142, 132, -1, 184, -1, 185, 127, 184, -1, 223,
2497 -1, 222, -1, 224, -1, 225, 100, 224, -1, 224,
2498 -1, 115, -1, 36, -1, 105, 226, -1, -1, -1,
2499 122, 229, 133, -1, -1, 230, -1, 231, -1, 237,
2500 -1, 230, 100, -1, 231, 237, -1, -1, 25, 240,
2501 232, 228, -1, 240, 122, 229, 133, -1, 53, 122,
2502 229, 133, -1, 63, 240, -1, 42, -1, 42, 238,
2503 -1, 240, -1, 240, -1, 238, 100, 240, -1, 238,
2504 -1, 220, -1, 241, -1, 244, -1, 233, -1, 235,
2505 -1, 234, -1, 6, -1, 10, -1, 11, -1, 8,
2506 -1, 9, -1, 12, -1, 5, -1, 29, -1, 56,
2507 -1, 55, -1, 45, -1, 240, 109, 240, -1, 240,
2508 110, 240, -1, 240, 75, 240, -1, 240, 76, 240,
2509 -1, 240, 71, 240, -1, 240, 72, 240, -1, 240,
2510 74, 240, -1, 240, 73, 240, -1, 240, 87, 240,
2511 -1, 240, 88, 240, -1, 118, 240, -1, 117, 240,
2512 -1, 240, 108, 240, -1, 240, 107, 240, -1, 240,
2513 106, 240, -1, 240, 96, 240, -1, 240, 95, 240,
2514 -1, 240, 94, 240, -1, 240, 114, 240, -1, 240,
2515 116, 240, -1, 240, 113, 240, -1, 240, 112, 240,
2516 -1, 240, 115, 240, -1, 240, 68, 240, -1, 240,
2517 69, 240, -1, 240, 40, 240, -1, 240, 67, 240,
2518 -1, 43, 122, 240, 133, -1, 36, 240, -1, 36,
2519 -1, 122, 238, 133, -1, 112, 240, -1, 240, 124,
2520 240, 125, -1, 124, 229, 125, -1, -1, 243, -1,
2521 237, 105, 237, -1, 243, 100, 237, 105, 237, -1,
2522 70, 242, 132, -1, 240, 80, 240, -1, 240, 79,
2523 240, -1, 240, 85, 240, -1, 240, 84, 240, -1,
2524 240, 86, 240, -1, 240, 78, 240, -1, 240, 77,
2525 240, -1, 240, 83, 240, -1, 240, 81, 240, -1,
2526 240, 82, 240, -1, 240, 102, 240, -1, 240, 104,
2527 240, 105, 240, -1, 240, 91, -1, 240, 90, -1,
2528 91, 240, -1, 90, 240, -1, 53, 127, 3, -1,
2529 128, 3, -1, 240, 127, 128, 3, -1, 240, 127,
2530 3, 89, 3, -1, 240, 92, 3, -1, 240, 127,
2531 122, 240, 133, -1, 240, 127, 3, -1, 3, -1,
2532 18, 3, -1, 18, 3, 102, 3, -1, 18, 3,
2533 102, 5, -1, 190, 245, -1, 23, 18, 224, -1
2536 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2537 static const yytype_uint16 yyrline[] =
2539 0, 2105, 2105, 2107, 2107, 2108, 2109, 2111, 2112, 2113,
2540 2114, 2115, 2116, 2117, 2118, 2120, 2120, 2121, 2122, 2124,
2541 2125, 2126, 2127, 2128, 2129, 2130, 2132, 2133, 2135, 2136,
2542 2139, 2140, 2141, 2142, 2143, 2144, 2145, 2146, 2147, 2148,
2543 2149, 2150, 2151, 2152, 2155, 2156, 2157, 2158, 2159, 2160,
2544 2161, 2162, 2166, 2167, 2171, 2178, 2182, 2183, 2187, 2188,
2545 2190, 2191, 2193, 2254, 2255, 2258, 2258, 2277, 2278, 2279,
2546 2284, 2288, 2293, 2294, 2296, 2316, 2364, 2364, 2383, 2383,
2547 2398, 2401, 2404, 2407, 2411, 2412, 2413, 2414, 2415, 2416,
2548 2418, 2429, 2432, 2432, 2463, 2463, 2488, 2488, 2504, 2505,
2549 2506, 2507, 2515, 2524, 2524, 2573, 2577, 2588, 2598, 2615,
2550 2616, 2617, 2619, 2620, 2622, 2622, 2624, 2624, 2627, 2643,
2551 2660, 2661, 2662, 2663, 2670, 2671, 2672, 2673, 2674, 2675,
2552 2676, 2677, 2678, 2679, 2683, 2684, 2686, 2687, 2689, 2690,
2553 2694, 2692, 2700, 2698, 2707, 2708, 2709, 2710, 2711, 2712,
2554 2713, 2714, 2716, 2722, 2723, 2724, 2725, 2726, 2727, 2730,
2555 2743, 2743, 2745, 2745, 2747, 2748, 2750, 2825, 2826, 2828,
2556 2829, 2830, 2831, 2832, 2834, 2835, 2836, 2837, 2849, 2853,
2557 2859, 2865, 2873, 2878, 2884, 2892, 2900, 2901, 2902, 2905,
2558 2904, 2921, 2922, 2924, 2923, 2947, 2966, 2980, 2981, 2983,
2559 2984, 2986, 2987, 2988, 2997, 2998, 3002, 3003, 3005, 3006,
2560 3007, 3009, 3013, 3014, 3019, 3020, 3056, 3102, 3123, 3144,
2561 3147, 3154, 3155, 3156, 3162, 3168, 3170, 3172, 3174, 3176,
2562 3178, 3180, 3197, 3202, 3205, 3208, 3211, 3214, 3217, 3220,
2563 3223, 3226, 3230, 3233, 3236, 3239, 3242, 3245, 3248, 3251,
2564 3255, 3266, 3284, 3289, 3294, 3299, 3304, 3309, 3313, 3317,
2565 3322, 3326, 3330, 3339, 3348, 3358, 3363, 3375, 3381, 3386,
2566 3392, 3398, 3402, 3404, 3415, 3424, 3431, 3432, 3434, 3440,
2567 3449, 3456, 3468, 3474, 3480, 3486, 3492, 3498, 3504, 3510,
2568 3523, 3534, 3541, 3554, 3581, 3595, 3609, 3623, 3638, 3645,
2569 3652, 3659, 3666, 3677, 3729, 3838, 3845, 3852, 3859, 3874
2573 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2574 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2575 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2576 static const char *const yytname[] =
2578 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2579 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2580 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2581 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2582 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2583 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2584 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2585 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2586 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2587 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2588 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2589 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2590 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2591 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2592 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2593 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2594 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2595 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2596 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2597 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2598 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2599 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2600 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2601 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2602 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2603 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2604 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2605 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2606 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2607 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2608 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2609 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2610 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH_HEAD",
2611 "WITH", "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9",
2612 "IMPORT", "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2613 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2614 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2615 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2616 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2617 "ONE_SLOT", "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2618 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2619 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2620 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2621 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2622 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2623 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2624 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2625 "NAMESPACE_ID", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2630 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2632 static const yytype_uint16 yytoknum[] =
2634 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2635 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2636 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2637 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2638 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2639 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2640 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2641 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2642 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2643 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2644 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2645 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2646 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2651 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2652 static const yytype_uint8 yyr1[] =
2654 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2655 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2656 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2657 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2658 144, 144, 144, 144, 145, 145, 145, 145, 145, 145,
2659 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2660 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2661 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2662 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2663 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2664 178, 178, 178, 180, 179, 181, 181, 182, 183, 184,
2665 184, 184, 185, 185, 187, 186, 188, 186, 189, 189,
2666 190, 190, 191, 191, 192, 192, 192, 192, 192, 192,
2667 192, 192, 192, 192, 193, 193, 194, 194, 195, 195,
2668 197, 196, 199, 198, 200, 200, 201, 201, 202, 202,
2669 202, 202, 202, 203, 203, 204, 204, 205, 205, 205,
2670 206, 206, 208, 207, 209, 209, 210, 211, 211, 212,
2671 212, 212, 212, 212, 212, 212, 212, 212, 213, 213,
2672 213, 213, 214, 214, 215, 215, 216, 216, 216, 218,
2673 217, 219, 219, 221, 220, 222, 223, 224, 224, 225,
2674 225, 226, 226, 226, 227, 227, 228, 228, 229, 229,
2675 229, 230, 231, 230, 232, 233, 234, 234, 235, 236,
2676 236, 237, 238, 238, 239, 240, 240, 240, 240, 240,
2677 240, 240, 241, 241, 241, 241, 241, 241, 241, 241,
2678 241, 241, 240, 240, 240, 240, 240, 240, 240, 240,
2679 240, 240, 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, 242, 242, 243, 243,
2682 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2683 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2684 240, 240, 240, 240, 244, 245, 245, 245, 246, 247
2687 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2688 static const yytype_uint8 yyr2[] =
2690 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2691 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2692 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2693 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2694 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2695 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2696 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2697 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2698 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2699 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2700 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2701 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2702 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2703 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2704 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2705 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2706 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2707 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
2708 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2709 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2710 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2711 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2712 2, 1, 1, 3, 1, 1, 1, 1, 1, 1,
2713 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2714 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
2715 3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
2716 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
2717 2, 1, 3, 2, 4, 3, 0, 1, 3, 5,
2718 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2719 3, 3, 5, 2, 2, 2, 2, 3, 2, 4,
2720 5, 3, 5, 3, 1, 2, 4, 4, 2, 3
2723 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2724 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2725 means the default is an error. */
2726 static const yytype_uint16 yydefact[] =
2728 120, 304, 133, 237, 231, 234, 235, 232, 233, 236,
2729 0, 0, 78, 0, 0, 126, 124, 125, 0, 132,
2730 0, 131, 192, 238, 271, 127, 0, 0, 0, 241,
2731 128, 130, 129, 0, 0, 240, 239, 0, 0, 276,
2732 0, 0, 14, 0, 0, 0, 0, 208, 120, 0,
2733 0, 2, 120, 5, 54, 12, 0, 36, 67, 31,
2734 32, 33, 34, 35, 38, 120, 37, 7, 30, 0,
2735 121, 122, 9, 8, 11, 10, 225, 228, 230, 229,
2736 224, 39, 222, 226, 227, 41, 40, 0, 0, 72,
2737 76, 120, 92, 109, 111, 110, 116, 113, 0, 0,
2738 304, 214, 191, 0, 270, 0, 0, 118, 0, 103,
2739 208, 0, 218, 65, 0, 221, 0, 277, 296, 295,
2740 273, 253, 252, 0, 0, 209, 210, 211, 82, 0,
2741 106, 219, 0, 80, 44, 43, 120, 45, 29, 0,
2742 46, 47, 48, 50, 0, 49, 298, 1, 6, 120,
2743 304, 0, 68, 0, 0, 69, 53, 108, 0, 188,
2744 0, 161, 0, 160, 162, 308, 123, 0, 0, 0,
2745 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2747 294, 293, 0, 0, 0, 0, 0, 0, 0, 0,
2748 0, 0, 0, 0, 0, 0, 0, 0, 208, 0,
2749 0, 55, 73, 0, 0, 0, 120, 114, 0, 195,
2750 0, 198, 197, 309, 206, 178, 0, 0, 0, 27,
2751 0, 297, 0, 0, 280, 0, 272, 275, 212, 213,
2752 83, 205, 59, 60, 105, 220, 58, 81, 42, 28,
2753 120, 0, 205, 0, 0, 52, 305, 187, 186, 0,
2754 134, 136, 0, 223, 267, 268, 265, 266, 246, 247,
2755 249, 248, 244, 245, 287, 286, 282, 281, 289, 290,
2756 288, 284, 283, 285, 250, 251, 301, 259, 258, 257,
2757 291, 0, 256, 255, 254, 242, 243, 263, 262, 260,
2758 264, 261, 0, 0, 303, 0, 0, 0, 0, 0,
2759 25, 0, 120, 17, 23, 0, 20, 19, 22, 21,
2760 120, 112, 0, 208, 215, 167, 0, 0, 179, 183,
2761 107, 119, 196, 269, 0, 26, 217, 0, 278, 0,
2762 0, 57, 0, 120, 13, 57, 0, 0, 0, 0,
2763 0, 138, 0, 0, 205, 163, 164, 0, 216, 274,
2764 0, 0, 299, 120, 0, 0, 117, 18, 120, 0,
2765 0, 0, 0, 185, 180, 205, 0, 0, 120, 0,
2766 203, 202, 201, 204, 0, 62, 61, 51, 0, 120,
2767 306, 307, 178, 135, 0, 0, 199, 137, 142, 57,
2768 0, 292, 300, 302, 77, 0, 84, 0, 115, 207,
2769 177, 173, 170, 171, 169, 172, 176, 175, 174, 168,
2770 167, 0, 0, 182, 0, 0, 98, 102, 100, 104,
2771 63, 279, 56, 0, 75, 0, 139, 140, 0, 120,
2772 166, 165, 79, 0, 0, 0, 85, 88, 86, 24,
2773 184, 193, 181, 96, 0, 99, 101, 120, 66, 120,
2774 205, 120, 200, 0, 157, 0, 0, 120, 155, 0,
2775 27, 93, 89, 87, 27, 27, 205, 64, 74, 0,
2776 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2777 188, 143, 156, 27, 91, 0, 0, 0, 189, 120,
2778 141, 147, 0, 90, 194, 97, 94, 27, 0, 0,
2779 0, 0, 149, 178, 27, 190, 0, 0, 205, 95,
2783 /* YYDEFGOTO[NTERM-NUM]. */
2784 static const yytype_int16 yydefgoto[] =
2786 -1, 50, 51, 52, 53, 311, 312, 313, 334, 335,
2787 137, 138, 157, 314, 139, 385, 140, 246, 243, 458,
2788 57, 232, 153, 154, 58, 59, 60, 61, 213, 62,
2789 91, 141, 142, 445, 446, 447, 448, 63, 215, 426,
2790 510, 427, 475, 428, 429, 64, 229, 143, 65, 66,
2791 219, 220, 67, 320, 216, 68, 144, 70, 71, 351,
2792 353, 395, 316, 461, 317, 439, 484, 485, 486, 466,
2793 467, 468, 164, 318, 262, 355, 356, 373, 419, 327,
2794 328, 329, 259, 319, 507, 103, 76, 474, 221, 222,
2795 382, 397, 383, 341, 324, 124, 125, 126, 224, 77,
2796 78, 79, 145, 127, 80, 81, 82, 83, 116, 117,
2800 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2802 #define YYPACT_NINF -403
2803 static const yytype_int16 yypact[] =
2805 1674, -70, -403, -403, -403, -403, -403, -403, -403, -403,
2806 -15, -72, -403, -52, 19, -403, -403, -403, 80, -403,
2807 2094, -403, 99, -403, 2164, -403, -16, 42, -5, -403,
2808 -403, -403, -403, -1, 5, -403, -403, 2094, 13, 2094,
2809 2094, 2094, -403, 2094, 2094, 2094, 2094, 2094, 634, 123,
2810 128, -403, 504, -403, -403, -403, 8, -403, 2024, -403,
2811 -403, -403, -403, -403, -403, 1926, -403, -403, -403, 240,
2812 361, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2813 38, -403, 2569, -403, -403, -403, -403, 137, 20, -403,
2814 -403, 1926, -403, -403, -403, -403, -403, -403, -87, 42,
2815 -403, -67, -403, 21, -48, 2094, 79, -403, 2094, -403,
2816 2094, 138, -48, -403, 43, 2569, 76, 107, -48, -48,
2817 604, -48, -48, -29, 84, 110, 2094, -403, 210, 211,
2818 2094, 2094, 211, 212, -403, -403, 764, -403, -403, 85,
2819 -403, -403, -403, -403, 209, -403, -403, -403, -403, 1024,
2820 158, 232, -403, 139, 171, -403, 141, -403, 238, 12,
2821 239, -403, 247, -403, -403, -403, -403, 2094, 2094, 2094,
2822 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2823 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2824 -403, -403, 249, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2825 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2826 11, -403, -403, 2094, 229, 2094, 1154, -403, 42, 133,
2827 135, -403, -403, -403, 142, 15, -10, 90, 2189, 1800,
2828 130, -403, 2094, 2094, -403, 2094, -403, -403, -403, -403,
2829 -403, 161, 169, -403, 38, 38, 169, -403, -403, -403,
2830 1926, 149, 161, 2094, 2094, -403, 168, -403, -403, 280,
2831 231, 233, 286, 2569, 1016, 496, 496, 496, 322, 322,
2832 322, 322, 1016, 1016, 2569, 2569, 2569, 2569, 2569, 2569,
2833 2569, 2569, 2569, 2569, 2630, 2691, -403, 368, 368, 368,
2834 2569, 2386, 2752, 2813, 2874, 1016, 1016, 604, 604, -48,
2835 -48, -48, 157, 2447, 202, 2094, 291, 14, 173, 2260,
2836 -403, 165, 1284, -403, -403, 172, -403, -403, -403, -403,
2837 1154, -403, 42, 2094, -403, -43, 296, 167, 201, -403,
2838 -403, -403, 175, -403, 174, 1800, -403, 44, -403, 200,
2839 63, 207, 211, 894, -403, -27, -11, 46, 113, 189,
2840 42, 298, 42, 190, 161, 217, -403, 2094, -403, -403,
2841 315, 2323, -403, 1926, 2094, 193, -403, -403, 1154, 192,
2842 194, 75, 63, -403, -403, 161, 26, 96, 1926, 2094,
2843 -403, -403, -403, -403, 2094, -403, -403, -403, 2094, 1926,
2844 -403, -403, 15, -403, 42, 199, -403, 230, -403, 207,
2845 286, 2569, -403, -403, -403, 103, 24, 197, -403, -403,
2846 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2847 234, 205, 296, -403, 206, 213, -403, -403, 96, -403,
2848 268, -403, -403, 204, -403, 215, 230, -403, 42, 208,
2849 -403, -403, -403, 2094, 236, 214, 24, -403, -403, -403,
2850 -403, -403, -403, -403, 335, -403, -403, 1926, -403, 1926,
2851 161, 1414, -403, 339, -403, 316, 219, 227, -403, 2508,
2852 1800, -403, -403, -403, 1800, 1800, 161, -403, -403, 223,
2853 -403, -403, 226, 250, 221, 1544, -403, -403, -403, -403,
2854 12, -403, -403, 1800, -403, 222, 224, 225, -403, 1414,
2855 -403, -403, 354, -403, -403, -403, -403, 1800, 228, 241,
2856 235, 243, -403, 15, 1800, -403, 244, 246, 161, -403,
2860 /* YYPGOTO[NTERM-NUM]. */
2861 static const yytype_int16 yypgoto[] =
2863 -403, -403, 218, -403, 312, -299, -403, 61, -402, -31,
2864 1, -55, -85, 48, 2, -23, 321, 251, 58, -403,
2865 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2866 -403, -403, -403, -403, -403, -62, -60, -403, -403, -40,
2867 -403, -36, -403, -403, -403, -403, -403, -403, -403, -403,
2868 6, 50, -403, -403, -403, -403, 0, -403, 331, -403,
2869 -403, -403, 49, -403, 51, -403, -96, -403, -80, -403,
2870 -403, -61, -403, 3, -403, -403, 7, 9, -403, -376,
2871 -403, -311, -79, 4, -403, -403, -403, -403, -403, 388,
2872 -91, 25, 52, -239, -403, -98, -403, -403, -403, -403,
2873 -403, -403, -403, -34, -9, -49, -13, -403, -403, -403,
2874 -403, -403, -403, -403
2877 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2878 positive, shift that token. If negative, reduce the rule which
2879 number is the opposite. If zero, do what YYDEFACT says.
2880 If YYTABLE_NINF, syntax error. */
2881 #define YYTABLE_NINF -155
2882 static const yytype_int16 yytable[] =
2884 69, 54, 56, 74, 75, 114, 214, 101, 223, 155,
2885 156, 104, 230, 345, 304, 374, 435, 136, 325, 87,
2886 97, 369, 93, 94, 112, 192, 115, 118, 119, 325,
2887 120, 121, 122, 97, 115, 88, 156, 123, 95, 217,
2888 218, -70, 190, 191, 192, 93, 94, 257, 55, 72,
2889 90, 73, 69, 54, 56, 74, 75, 209, 443, 371,
2890 210, 95, 372, 258, 98, 423, 93, 94, 494, 407,
2891 92, 167, 495, 496, 208, 384, 209, 106, 410, 210,
2892 411, 249, 95, 412, 413, 414, 444, 415, 388, 167,
2893 167, 503, 239, 93, 94, 228, 226, 115, 99, 380,
2894 55, 72, 102, 73, 236, 511, 105, 89, 326, 95,
2895 302, 452, 517, 115, 167, 399, 390, 108, 391, 422,
2896 416, 244, 245, 330, 424, 109, 146, 110, 147, 425,
2897 417, 418, 111, 305, 149, 113, 421, 516, 167, 306,
2898 211, 231, 212, 225, 167, 96, 167, 363, 233, 69,
2899 54, 56, 74, 75, 263, 264, 265, 266, 267, 268,
2900 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
2901 279, 280, 281, 282, 283, 284, 285, 378, 381, 389,
2902 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
2903 297, 298, 299, 300, 301, 115, 303, 55, 72, 338,
2904 73, 339, 309, 167, 307, 331, 227, 235, 234, 237,
2905 238, 250, 2, 240, 241, 247, 69, 54, 315, 343,
2906 115, 479, 115, 337, 321, 370, -71, 158, 15, 16,
2907 17, 2, 19, 332, 21, 252, 442, 497, 253, 254,
2908 255, 256, 260, 308, 346, 347, 25, 15, 16, 17,
2909 261, 19, 286, 21, 463, 30, 31, 32, 158, 393,
2910 -113, 396, 322, 336, 323, 25, 340, 159, 158, 342,
2911 348, 160, 161, 463, 30, 31, 32, 159, 404, 520,
2912 249, 344, 161, 349, 162, 350, 163, 352, 249, 354,
2913 358, 360, 361, 430, 362, 364, 163, 366, 368, 325,
2914 375, 376, -112, 396, 434, 379, 377, 464, 156, 384,
2915 115, 392, 69, 54, 315, 394, 398, 400, 402, 406,
2916 69, 54, 315, 156, 408, 437, 464, 409, 332, 449,
2917 438, 451, 453, 457, 156, 454, 371, 459, 476, 433,
2918 -153, 470, 489, 490, 401, 431, 471, 462, 460, 498,
2919 432, 491, 499, 500, 504, 405, 505, 509, 506, -154,
2920 512, 514, 168, 513, 148, 2, 115, 251, 69, 54,
2921 315, 115, 477, 367, 478, 515, 440, 518, 519, 152,
2922 242, 15, 16, 17, 472, 19, 473, 21, 455, 169,
2923 170, 171, 456, -155, -155, -155, -155, 176, 177, 25,
2924 386, 166, 156, 508, 156, 501, 492, 441, 30, 31,
2925 32, 502, 190, 191, 192, 107, 193, 194, 195, 436,
2926 0, 0, 0, 0, 420, 0, 0, 0, 0, 450,
2927 469, 201, 202, 0, 203, 204, 205, 206, 207, 465,
2928 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
2929 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
2930 192, 483, 481, 482, 487, 488, 0, 465, 0, 0,
2931 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2932 203, 204, 205, 206, 207, 483, 481, 482, 487, 488,
2933 208, 0, 209, 0, 0, 210, 0, 0, 0, 483,
2934 481, 482, 487, 488, -4, 0, 0, 1, 2, 3,
2935 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2936 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2937 21, 0, 0, 23, 0, 0, 168, 0, 0, 0,
2938 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2939 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2940 36, 0, 0, -155, -155, -155, 0, 37, 38, 0,
2941 0, 176, 177, 0, 39, 0, 0, 0, 0, 0,
2942 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2943 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2944 0, 0, 0, 42, 0, 201, 202, 0, 203, 204,
2945 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2946 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2947 48, 0, 49, 0, 0, 0, -4, 1, 2, 3,
2948 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2949 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2950 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2951 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2952 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2953 36, 0, 0, 0, 190, 191, 192, 37, 38, 0,
2954 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2955 0, 0, 0, 0, 0, 0, 0, 0, 205, 206,
2956 207, 0, 0, 0, 40, 41, 208, 0, 209, 0,
2957 0, 210, 0, 134, 0, 0, 0, 0, 0, 0,
2958 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2959 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2960 48, 0, 49, 0, 0, 0, 135, 1, 2, 3,
2961 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2962 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2963 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2964 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2965 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2966 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2967 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2968 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2969 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2970 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2971 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2972 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2973 48, 0, 49, 0, 0, 0, 248, 1, 2, 3,
2974 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2975 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2976 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2977 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2978 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2979 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2980 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2981 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2982 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2983 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2984 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2985 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2986 48, 0, 49, 0, 0, 0, 387, 1, 2, 3,
2987 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2988 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2989 21, 0, 0, 23, 0, 0, -155, 0, 0, 0,
2990 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2991 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2992 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2993 0, -155, -155, 0, 39, 0, 0, 0, 0, 0,
2994 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2995 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2996 0, 0, 0, 42, 0, -155, -155, 0, 203, 204,
2997 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2998 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2999 48, 0, 49, 0, 0, 0, -3, 1, 2, 3,
3000 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3001 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3002 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3003 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3004 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3005 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3006 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3007 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3008 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3009 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3010 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3011 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3012 48, 0, 49, 0, 0, 0, -15, 1, 2, 3,
3013 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3014 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3015 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3016 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3017 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3018 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3019 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3020 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3021 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3022 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3023 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3024 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3025 48, 0, 49, 0, 0, 0, -16, 1, 2, 3,
3026 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3027 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3028 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3029 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3030 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3031 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3032 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3033 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3034 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3035 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3036 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3037 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3038 48, 0, 49, 0, 0, 0, -144, 1, 2, 3,
3039 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3040 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3041 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3042 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3043 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3044 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3045 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3047 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3048 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3049 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3050 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3051 48, 0, 49, 0, -3, 0, -145, 1, 2, 3,
3052 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3053 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3054 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3055 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3056 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3057 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3058 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3059 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3060 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3061 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
3062 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3063 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3064 48, 0, 49, 1, 2, 3, 4, 0, 5, 6,
3065 7, 8, 9, 10, 11, 12, 13, 0, -120, 0,
3066 15, 16, 17, 18, 19, 20, 21, 22, 0, 23,
3067 128, 0, 129, 0, 0, 0, 24, 130, 25, 26,
3068 0, 27, 131, 28, 0, 29, 132, 30, 31, 32,
3069 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3070 0, 0, 0, 37, 38, 0, 133, 0, 0, 0,
3071 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3072 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3073 40, 41, 0, 0, 0, 0, 0, 0, 0, 134,
3074 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3075 0, 0, 43, 0, 0, 0, 0, 44, 45, 0,
3076 0, 0, 46, 0, 47, 0, 48, 0, 49, 1,
3077 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3078 11, 12, 13, 0, 0, 0, 15, 16, 17, 18,
3079 19, 20, 21, 22, 0, 23, 128, 0, 129, 0,
3080 0, 0, 24, 130, 25, 26, 0, 27, 131, 28,
3081 0, 29, 132, 30, 31, 32, 0, 0, 33, 34,
3082 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3083 38, 0, 133, 0, 0, 0, 39, 0, 0, 0,
3084 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3085 0, 0, 0, 0, 0, 0, 40, 41, 0, 0,
3086 0, 0, 0, 0, 0, 134, 0, 150, 0, 3,
3087 4, 0, 5, 6, 7, 8, 9, 0, 43, 0,
3088 0, 0, 0, 44, 45, 0, 0, 0, 46, 20,
3089 47, 22, 48, 23, 49, 0, 129, 0, 0, 0,
3090 24, 0, 0, 0, 0, 0, 0, 28, 0, 29,
3091 151, 0, 0, 0, 0, 0, 0, 34, 0, 35,
3092 36, 0, 0, 0, 0, 0, 0, 37, 0, 0,
3093 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3094 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3095 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3096 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3097 24, 0, 0, 0, 0, 0, 43, 28, 0, 29,
3098 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3099 36, 0, 49, 0, 0, 0, 0, 37, 0, 0,
3100 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3101 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3102 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3103 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3104 0, 0, 0, 0, 0, 0, 43, 0, 0, 29,
3105 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3106 36, 0, 49, 0, 0, 0, 0, 0, 0, 168,
3107 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3109 0, 0, 0, 0, 40, 41, 169, 170, 171, 0,
3110 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3111 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3112 191, 192, 0, 193, 194, 195, 46, 0, 47, 0,
3113 0, 196, 49, 197, 0, 198, 199, 200, 201, 202,
3114 168, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3115 0, 208, 0, 209, 0, 0, 210, 0, 0, 0,
3116 0, 0, 333, 0, 0, 0, 0, 169, 170, 171,
3117 0, 172, 173, 174, 175, 176, 177, 178, 179, 180,
3118 181, 182, 183, 184, 185, 186, 187, 188, 189, 0,
3119 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3120 0, 0, 196, 168, 197, 0, 198, 199, 200, 201,
3121 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3122 0, 0, 208, 0, 209, 0, 0, 210, 0, 0,
3123 169, 170, 171, 365, 172, 173, 174, 175, 176, 177,
3124 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
3125 188, 189, 0, 190, 191, 192, 0, 193, 194, 195,
3126 0, 0, 0, 0, 0, 196, 168, 197, 0, 198,
3127 199, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3128 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3129 210, 0, 0, 169, 170, 171, 403, 172, 173, 174,
3130 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
3131 185, 186, 187, 188, 189, 0, 190, 191, 192, 0,
3132 193, 194, 195, 0, 0, 0, 0, 168, 196, 0,
3133 197, 357, 198, 199, 200, 201, 202, 0, 203, 204,
3134 205, 206, 207, 0, 0, 0, 0, 0, 208, 0,
3135 209, 0, 0, 210, 169, 170, 171, 0, 172, 173,
3136 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
3137 184, 185, 186, 187, 188, 189, 0, 190, 191, 192,
3138 0, 193, 194, 195, 0, 0, 0, 0, 168, 196,
3139 0, 197, 0, 198, 199, 200, 201, 202, 0, 203,
3140 204, 205, 206, 207, 0, 0, 0, 0, 0, 208,
3141 0, 209, 359, 0, 210, 169, 170, 171, 0, 172,
3142 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3143 183, 184, 185, 186, 187, 188, 189, 0, 190, 191,
3144 192, 0, 193, 194, 195, 0, 0, 0, 0, 168,
3145 196, 0, 197, 493, 198, 199, 200, 201, 202, 0,
3146 203, 204, 205, 206, 207, 0, 0, 0, 0, 0,
3147 208, 0, 209, 0, 0, 210, 169, 170, 171, 0,
3148 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3149 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3150 191, 192, 0, 193, 194, 195, 0, 0, 0, 0,
3151 168, 196, 0, 197, 0, 198, 199, 200, 201, 202,
3152 0, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3153 0, 208, 0, 209, 0, 0, 210, 169, 170, 171,
3154 0, 172, 173, 174, 175, 176, 177, 0, 0, 0,
3155 0, 0, 0, 0, 0, 0, 0, 0, 189, 0,
3156 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3157 0, 168, 0, 0, 0, 0, 198, 199, 200, 201,
3158 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3159 0, 0, 208, 0, 209, 0, 0, 210, 169, 170,
3160 171, 0, 172, 173, 174, 175, 176, 177, 0, 0,
3161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3162 0, 190, 191, 192, 0, 193, 194, 195, 0, 0,
3163 0, 0, 168, 0, 0, 0, 0, 198, 199, 200,
3164 201, 202, 0, 203, 204, 205, 206, 207, 0, 0,
3165 0, 0, 0, 208, 0, 209, 0, 0, 210, 169,
3166 170, 171, 0, 172, 173, 174, 175, 176, 177, 0,
3167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3168 0, 0, 190, 191, 192, 0, 193, 194, 195, 0,
3169 0, 0, 0, 168, 0, 0, 0, 0, 0, 199,
3170 200, 201, 202, 0, 203, 204, 205, 206, 207, 0,
3171 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
3172 169, 170, 171, 0, 172, 173, 174, 175, 176, 177,
3173 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3174 0, 0, 0, 190, 191, 192, 0, 193, 194, 195,
3175 0, 0, 0, 0, 168, 0, 0, 0, 0, 0,
3176 0, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3177 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3178 210, 169, 170, 171, 0, 172, 173, 174, 175, 176,
3179 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3180 0, 0, 0, 0, 190, 191, 192, 0, 193, 194,
3181 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3182 0, 0, -155, 201, 202, 0, 203, 204, 205, 206,
3183 207, 0, 0, 0, 0, 0, 208, 0, 209, 0,
3187 static const yytype_int16 yycheck[] =
3189 0, 0, 0, 0, 0, 39, 91, 20, 99, 58,
3190 65, 24, 110, 252, 3, 326, 392, 48, 3, 89,
3191 14, 320, 3, 4, 37, 92, 39, 40, 41, 3,
3192 43, 44, 45, 27, 47, 50, 91, 46, 19, 126,
3193 127, 68, 90, 91, 92, 3, 4, 35, 0, 0,
3194 122, 0, 52, 52, 52, 52, 52, 124, 34, 102,
3195 127, 19, 105, 51, 14, 376, 3, 4, 470, 368,
3196 122, 100, 474, 475, 122, 102, 124, 27, 3, 127,
3197 5, 136, 19, 8, 9, 10, 62, 12, 99, 100,
3198 100, 493, 126, 3, 4, 108, 105, 110, 18, 36,
3199 52, 52, 3, 52, 133, 507, 122, 122, 93, 19,
3200 208, 422, 514, 126, 100, 354, 3, 122, 5, 93,
3201 45, 130, 131, 133, 28, 126, 3, 122, 0, 33,
3202 55, 56, 127, 122, 126, 122, 375, 513, 100, 128,
3203 3, 3, 122, 122, 100, 126, 100, 133, 105, 149,
3204 149, 149, 149, 149, 167, 168, 169, 170, 171, 172,
3205 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3206 183, 184, 185, 186, 187, 188, 189, 133, 115, 133,
3207 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3208 203, 204, 205, 206, 207, 208, 209, 149, 149, 233,
3209 149, 235, 215, 100, 213, 115, 127, 100, 132, 125,
3210 100, 126, 4, 3, 3, 3, 216, 216, 216, 250,
3211 233, 460, 235, 232, 218, 323, 68, 18, 20, 21,
3212 22, 4, 24, 227, 26, 3, 133, 476, 99, 68,
3213 99, 3, 3, 14, 253, 254, 38, 20, 21, 22,
3214 3, 24, 3, 26, 46, 47, 48, 49, 18, 350,
3215 127, 352, 127, 133, 122, 38, 105, 27, 18, 100,
3216 102, 31, 32, 46, 47, 48, 49, 27, 363, 518,
3217 335, 132, 32, 3, 44, 54, 46, 54, 343, 3,
3218 133, 89, 305, 378, 3, 122, 46, 132, 126, 3,
3219 133, 100, 127, 394, 389, 105, 132, 99, 363, 102,
3220 323, 122, 312, 312, 312, 17, 126, 100, 3, 126,
3221 320, 320, 320, 378, 132, 126, 99, 133, 322, 132,
3222 100, 126, 126, 65, 389, 122, 102, 133, 3, 388,
3223 132, 105, 3, 27, 357, 379, 132, 438, 133, 126,
3224 384, 132, 126, 132, 132, 364, 132, 3, 133, 132,
3225 132, 126, 40, 122, 52, 4, 379, 149, 368, 368,
3226 368, 384, 457, 312, 459, 132, 399, 133, 132, 58,
3227 129, 20, 21, 22, 446, 24, 446, 26, 428, 67,
3228 68, 69, 428, 71, 72, 73, 74, 75, 76, 38,
3229 342, 70, 457, 499, 459, 485, 467, 400, 47, 48,
3230 49, 490, 90, 91, 92, 27, 94, 95, 96, 394,
3231 -1, -1, -1, -1, 372, -1, -1, -1, -1, 420,
3232 443, 109, 110, -1, 112, 113, 114, 115, 116, 439,
3233 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3234 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3235 92, 461, 461, 461, 461, 461, -1, 467, -1, -1,
3236 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3237 112, 113, 114, 115, 116, 485, 485, 485, 485, 485,
3238 122, -1, 124, -1, -1, 127, -1, -1, -1, 499,
3239 499, 499, 499, 499, 0, -1, -1, 3, 4, 5,
3240 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3241 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3242 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3243 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3244 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3245 56, -1, -1, 67, 68, 69, -1, 63, 64, -1,
3246 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3247 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3248 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3249 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3250 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3251 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3252 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3253 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3254 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3255 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3256 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3257 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3258 56, -1, -1, -1, 90, 91, 92, 63, 64, -1,
3259 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3260 -1, -1, -1, -1, -1, -1, -1, -1, 114, 115,
3261 116, -1, -1, -1, 90, 91, 122, -1, 124, -1,
3262 -1, 127, -1, 99, -1, -1, -1, -1, -1, -1,
3263 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3264 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3265 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3266 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3267 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3268 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3269 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3270 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3271 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3272 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3274 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3275 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3276 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3277 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3278 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3279 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3280 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3281 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3282 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3283 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3284 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3285 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3287 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3288 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3289 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3290 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3291 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3292 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3293 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3294 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3295 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3296 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3297 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3298 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3299 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3300 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3301 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3302 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3303 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3304 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3305 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3306 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3307 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3308 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3309 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3310 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3311 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3312 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3313 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3314 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3315 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3316 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3317 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3318 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3319 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3320 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3321 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3322 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3323 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3324 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3326 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3327 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3328 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3329 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3330 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3331 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3332 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3333 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3334 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3335 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3336 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3337 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3338 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3339 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3340 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3341 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3342 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3343 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3344 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3345 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3346 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3347 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3348 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3349 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3350 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3351 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3352 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3353 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3354 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3355 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3356 126, -1, 128, -1, 0, -1, 132, 3, 4, 5,
3357 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3358 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3359 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3360 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3361 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3362 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3363 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3364 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3365 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3366 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3367 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3368 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3369 126, -1, 128, 3, 4, 5, 6, -1, 8, 9,
3370 10, 11, 12, 13, 14, 15, 16, -1, 18, -1,
3371 20, 21, 22, 23, 24, 25, 26, 27, -1, 29,
3372 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3373 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3374 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3375 -1, -1, -1, 63, 64, -1, 66, -1, -1, -1,
3376 70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3377 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3378 90, 91, -1, -1, -1, -1, -1, -1, -1, 99,
3379 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3380 -1, -1, 112, -1, -1, -1, -1, 117, 118, -1,
3381 -1, -1, 122, -1, 124, -1, 126, -1, 128, 3,
3382 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3383 14, 15, 16, -1, -1, -1, 20, 21, 22, 23,
3384 24, 25, 26, 27, -1, 29, 30, -1, 32, -1,
3385 -1, -1, 36, 37, 38, 39, -1, 41, 42, 43,
3386 -1, 45, 46, 47, 48, 49, -1, -1, 52, 53,
3387 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3388 64, -1, 66, -1, -1, -1, 70, -1, -1, -1,
3389 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3390 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
3391 -1, -1, -1, -1, -1, 99, -1, 3, -1, 5,
3392 6, -1, 8, 9, 10, 11, 12, -1, 112, -1,
3393 -1, -1, -1, 117, 118, -1, -1, -1, 122, 25,
3394 124, 27, 126, 29, 128, -1, 32, -1, -1, -1,
3395 36, -1, -1, -1, -1, -1, -1, 43, -1, 45,
3396 46, -1, -1, -1, -1, -1, -1, 53, -1, 55,
3397 56, -1, -1, -1, -1, -1, -1, 63, -1, -1,
3398 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3399 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3400 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3401 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3402 36, -1, -1, -1, -1, -1, 112, 43, -1, 45,
3403 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3404 56, -1, 128, -1, -1, -1, -1, 63, -1, -1,
3405 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3406 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3407 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3408 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3409 -1, -1, -1, -1, -1, -1, 112, -1, -1, 45,
3410 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3411 56, -1, 128, -1, -1, -1, -1, -1, -1, 40,
3412 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3413 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3414 -1, -1, -1, -1, 90, 91, 67, 68, 69, -1,
3415 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3416 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3417 91, 92, -1, 94, 95, 96, 122, -1, 124, -1,
3418 -1, 102, 128, 104, -1, 106, 107, 108, 109, 110,
3419 40, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3420 -1, 122, -1, 124, -1, -1, 127, -1, -1, -1,
3421 -1, -1, 133, -1, -1, -1, -1, 67, 68, 69,
3422 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
3423 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
3424 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3425 -1, -1, 102, 40, 104, -1, 106, 107, 108, 109,
3426 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3427 -1, -1, 122, -1, 124, -1, -1, 127, -1, -1,
3428 67, 68, 69, 133, 71, 72, 73, 74, 75, 76,
3429 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3430 87, 88, -1, 90, 91, 92, -1, 94, 95, 96,
3431 -1, -1, -1, -1, -1, 102, 40, 104, -1, 106,
3432 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3433 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3434 127, -1, -1, 67, 68, 69, 133, 71, 72, 73,
3435 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3436 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3437 94, 95, 96, -1, -1, -1, -1, 40, 102, -1,
3438 104, 105, 106, 107, 108, 109, 110, -1, 112, 113,
3439 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3440 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3441 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3442 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3443 -1, 94, 95, 96, -1, -1, -1, -1, 40, 102,
3444 -1, 104, -1, 106, 107, 108, 109, 110, -1, 112,
3445 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3446 -1, 124, 125, -1, 127, 67, 68, 69, -1, 71,
3447 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3448 82, 83, 84, 85, 86, 87, 88, -1, 90, 91,
3449 92, -1, 94, 95, 96, -1, -1, -1, -1, 40,
3450 102, -1, 104, 105, 106, 107, 108, 109, 110, -1,
3451 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3452 122, -1, 124, -1, -1, 127, 67, 68, 69, -1,
3453 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3454 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3455 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3456 40, 102, -1, 104, -1, 106, 107, 108, 109, 110,
3457 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3458 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3459 -1, 71, 72, 73, 74, 75, 76, -1, -1, -1,
3460 -1, -1, -1, -1, -1, -1, -1, -1, 88, -1,
3461 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3462 -1, 40, -1, -1, -1, -1, 106, 107, 108, 109,
3463 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3464 -1, -1, 122, -1, 124, -1, -1, 127, 67, 68,
3465 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3466 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3467 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3468 -1, -1, 40, -1, -1, -1, -1, 106, 107, 108,
3469 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3470 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3471 68, 69, -1, 71, 72, 73, 74, 75, 76, -1,
3472 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3473 -1, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3474 -1, -1, -1, 40, -1, -1, -1, -1, -1, 107,
3475 108, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3476 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3477 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3478 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3479 -1, -1, -1, 90, 91, 92, -1, 94, 95, 96,
3480 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
3481 -1, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3482 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3483 127, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3484 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3485 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3486 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3487 -1, -1, 108, 109, 110, -1, 112, 113, 114, 115,
3488 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3492 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3493 symbol of state STATE-NUM. */
3494 static const yytype_uint8 yystos[] =
3496 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3497 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3498 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3499 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3500 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3501 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3502 160, 161, 163, 171, 179, 182, 183, 186, 189, 190,
3503 191, 192, 196, 198, 207, 217, 220, 233, 234, 235,
3504 238, 239, 240, 241, 244, 246, 247, 89, 50, 122,
3505 122, 164, 122, 3, 4, 19, 126, 184, 185, 18,
3506 3, 240, 3, 219, 240, 122, 185, 223, 122, 126,
3507 122, 127, 240, 122, 237, 240, 242, 243, 240, 240,
3508 240, 240, 240, 238, 229, 230, 231, 237, 30, 32,
3509 37, 42, 46, 66, 99, 132, 143, 144, 145, 148,
3510 150, 165, 166, 181, 190, 236, 3, 0, 138, 126,
3511 3, 46, 150, 156, 157, 239, 145, 146, 18, 27,
3512 31, 32, 44, 46, 206, 245, 192, 100, 40, 67,
3513 68, 69, 71, 72, 73, 74, 75, 76, 77, 78,
3514 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3515 90, 91, 92, 94, 95, 96, 102, 104, 106, 107,
3516 108, 109, 110, 112, 113, 114, 115, 116, 122, 124,
3517 127, 3, 122, 162, 146, 172, 188, 126, 127, 184,
3518 185, 222, 223, 224, 232, 122, 238, 127, 240, 180,
3519 229, 3, 155, 105, 132, 100, 133, 125, 100, 237,
3520 3, 3, 151, 152, 238, 238, 151, 3, 132, 145,
3521 126, 136, 3, 99, 68, 99, 3, 35, 51, 216,
3522 3, 3, 208, 240, 240, 240, 240, 240, 240, 240,
3523 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3524 240, 240, 240, 240, 240, 240, 3, 240, 240, 240,
3525 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3526 240, 240, 229, 240, 3, 122, 128, 238, 14, 240,
3527 99, 139, 140, 141, 147, 148, 196, 198, 207, 217,
3528 187, 184, 127, 122, 228, 3, 93, 213, 214, 215,
3529 133, 115, 184, 133, 142, 143, 133, 238, 237, 237,
3530 105, 227, 100, 143, 132, 227, 238, 238, 102, 3,
3531 54, 193, 54, 194, 3, 209, 210, 105, 133, 125,
3532 89, 240, 3, 133, 122, 133, 132, 141, 126, 139,
3533 229, 102, 105, 211, 215, 133, 100, 132, 133, 105,
3534 36, 115, 224, 226, 102, 149, 152, 132, 99, 133,
3535 3, 5, 122, 224, 17, 195, 224, 225, 126, 227,
3536 100, 240, 3, 133, 146, 238, 126, 139, 132, 133,
3537 3, 5, 8, 9, 10, 12, 45, 55, 56, 212,
3538 226, 227, 93, 215, 28, 33, 173, 175, 177, 178,
3539 146, 237, 237, 239, 146, 213, 225, 126, 100, 199,
3540 149, 210, 133, 34, 62, 167, 168, 169, 170, 132,
3541 211, 126, 215, 126, 122, 173, 175, 65, 153, 133,
3542 133, 197, 224, 46, 99, 190, 203, 204, 205, 240,
3543 105, 132, 169, 170, 221, 176, 3, 146, 146, 227,
3544 99, 144, 148, 190, 200, 201, 202, 207, 217, 3,
3545 27, 132, 205, 105, 142, 142, 142, 227, 126, 126,
3546 132, 202, 216, 142, 132, 132, 133, 218, 200, 3,
3547 174, 142, 132, 122, 126, 132, 213, 142, 133, 132,
3551 #define yyerrok (yyerrstatus = 0)
3552 #define yyclearin (yychar = YYEMPTY)
3553 #define YYEMPTY (-2)
3556 #define YYACCEPT goto yyacceptlab
3557 #define YYABORT goto yyabortlab
3558 #define YYERROR goto yyerrorlab
3561 /* Like YYERROR except do call yyerror. This remains here temporarily
3562 to ease the transition to the new meaning of YYERROR, for GCC.
3563 Once GCC version 2 has supplanted version 1, this can go. */
3565 #define YYFAIL goto yyerrlab
3567 #define YYRECOVERING() (!!yyerrstatus)
3569 #define YYBACKUP(Token, Value) \
3571 if (yychar == YYEMPTY && yylen == 1) \
3575 yytoken = YYTRANSLATE (yychar); \
3581 yyerror (YY_("syntax error: cannot back up")); \
3588 #define YYERRCODE 256
3591 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3592 If N is 0, then set CURRENT to the empty location which ends
3593 the previous symbol: RHS[0] (always defined). */
3595 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3596 #ifndef YYLLOC_DEFAULT
3597 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3601 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3602 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3603 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3604 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3608 (Current).first_line = (Current).last_line = \
3609 YYRHSLOC (Rhs, 0).last_line; \
3610 (Current).first_column = (Current).last_column = \
3611 YYRHSLOC (Rhs, 0).last_column; \
3617 /* YY_LOCATION_PRINT -- Print the location on the stream.
3618 This macro was not mandated originally: define only if we know
3619 we won't break user code: when these are the locations we know. */
3621 #ifndef YY_LOCATION_PRINT
3622 # if YYLTYPE_IS_TRIVIAL
3623 # define YY_LOCATION_PRINT(File, Loc) \
3624 fprintf (File, "%d.%d-%d.%d", \
3625 (Loc).first_line, (Loc).first_column, \
3626 (Loc).last_line, (Loc).last_column)
3628 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3633 /* YYLEX -- calling `yylex' with the right arguments. */
3636 # define YYLEX yylex (YYLEX_PARAM)
3638 # define YYLEX yylex ()
3641 /* Enable debugging if requested. */
3645 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3646 # define YYFPRINTF fprintf
3649 # define YYDPRINTF(Args) \
3655 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3659 YYFPRINTF (stderr, "%s ", Title); \
3660 yy_symbol_print (stderr, \
3662 YYFPRINTF (stderr, "\n"); \
3667 /*--------------------------------.
3668 | Print this symbol on YYOUTPUT. |
3669 `--------------------------------*/
3672 #if (defined __STDC__ || defined __C99__FUNC__ \
3673 || defined __cplusplus || defined _MSC_VER)
3675 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3678 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3681 YYSTYPE const * const yyvaluep;
3687 if (yytype < YYNTOKENS)
3688 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3700 /*--------------------------------.
3701 | Print this symbol on YYOUTPUT. |
3702 `--------------------------------*/
3704 #if (defined __STDC__ || defined __C99__FUNC__ \
3705 || defined __cplusplus || defined _MSC_VER)
3707 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3710 yy_symbol_print (yyoutput, yytype, yyvaluep)
3713 YYSTYPE const * const yyvaluep;
3716 if (yytype < YYNTOKENS)
3717 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3719 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3721 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3722 YYFPRINTF (yyoutput, ")");
3725 /*------------------------------------------------------------------.
3726 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3728 `------------------------------------------------------------------*/
3730 #if (defined __STDC__ || defined __C99__FUNC__ \
3731 || defined __cplusplus || defined _MSC_VER)
3733 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3736 yy_stack_print (yybottom, yytop)
3737 yytype_int16 *yybottom;
3738 yytype_int16 *yytop;
3741 YYFPRINTF (stderr, "Stack now");
3742 for (; yybottom <= yytop; yybottom++)
3744 int yybot = *yybottom;
3745 YYFPRINTF (stderr, " %d", yybot);
3747 YYFPRINTF (stderr, "\n");
3750 # define YY_STACK_PRINT(Bottom, Top) \
3753 yy_stack_print ((Bottom), (Top)); \
3757 /*------------------------------------------------.
3758 | Report that the YYRULE is going to be reduced. |
3759 `------------------------------------------------*/
3761 #if (defined __STDC__ || defined __C99__FUNC__ \
3762 || defined __cplusplus || defined _MSC_VER)
3764 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3767 yy_reduce_print (yyvsp, yyrule)
3772 int yynrhs = yyr2[yyrule];
3774 unsigned long int yylno = yyrline[yyrule];
3775 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3777 /* The symbols being reduced. */
3778 for (yyi = 0; yyi < yynrhs; yyi++)
3780 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3781 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3782 &(yyvsp[(yyi + 1) - (yynrhs)])
3784 YYFPRINTF (stderr, "\n");
3788 # define YY_REDUCE_PRINT(Rule) \
3791 yy_reduce_print (yyvsp, Rule); \
3794 /* Nonzero means print parse trace. It is left uninitialized so that
3795 multiple parsers can coexist. */
3797 #else /* !YYDEBUG */
3798 # define YYDPRINTF(Args)
3799 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3800 # define YY_STACK_PRINT(Bottom, Top)
3801 # define YY_REDUCE_PRINT(Rule)
3802 #endif /* !YYDEBUG */
3805 /* YYINITDEPTH -- initial size of the parser's stacks. */
3807 # define YYINITDEPTH 200
3810 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3811 if the built-in stack extension method is used).
3813 Do not make this value too large; the results are undefined if
3814 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3815 evaluated with infinite-precision integer arithmetic. */
3818 # define YYMAXDEPTH 10000
3826 # if defined __GLIBC__ && defined _STRING_H
3827 # define yystrlen strlen
3829 /* Return the length of YYSTR. */
3830 #if (defined __STDC__ || defined __C99__FUNC__ \
3831 || defined __cplusplus || defined _MSC_VER)
3833 yystrlen (const char *yystr)
3841 for (yylen = 0; yystr[yylen]; yylen++)
3849 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3850 # define yystpcpy stpcpy
3852 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3854 #if (defined __STDC__ || defined __C99__FUNC__ \
3855 || defined __cplusplus || defined _MSC_VER)
3857 yystpcpy (char *yydest, const char *yysrc)
3860 yystpcpy (yydest, yysrc)
3866 const char *yys = yysrc;
3868 while ((*yyd++ = *yys++) != '\0')
3877 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3878 quotes and backslashes, so that it's suitable for yyerror. The
3879 heuristic is that double-quoting is unnecessary unless the string
3880 contains an apostrophe, a comma, or backslash (other than
3881 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3882 null, do not copy; instead, return the length of what the result
3885 yytnamerr (char *yyres, const char *yystr)
3890 char const *yyp = yystr;
3897 goto do_not_strip_quotes;
3901 goto do_not_strip_quotes;
3914 do_not_strip_quotes: ;
3918 return yystrlen (yystr);
3920 return yystpcpy (yyres, yystr) - yyres;
3924 /* Copy into YYRESULT an error message about the unexpected token
3925 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3926 including the terminating null byte. If YYRESULT is null, do not
3927 copy anything; just return the number of bytes that would be
3928 copied. As a special case, return 0 if an ordinary "syntax error"
3929 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3930 size calculation. */
3932 yysyntax_error (char *yyresult, int yystate, int yychar)
3934 int yyn = yypact[yystate];
3936 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3940 int yytype = YYTRANSLATE (yychar);
3941 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3942 YYSIZE_T yysize = yysize0;
3944 int yysize_overflow = 0;
3945 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3946 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3950 /* This is so xgettext sees the translatable formats that are
3951 constructed on the fly. */
3952 YY_("syntax error, unexpected %s");
3953 YY_("syntax error, unexpected %s, expecting %s");
3954 YY_("syntax error, unexpected %s, expecting %s or %s");
3955 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3956 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3960 static char const yyunexpected[] = "syntax error, unexpected %s";
3961 static char const yyexpecting[] = ", expecting %s";
3962 static char const yyor[] = " or %s";
3963 char yyformat[sizeof yyunexpected
3964 + sizeof yyexpecting - 1
3965 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3966 * (sizeof yyor - 1))];
3967 char const *yyprefix = yyexpecting;
3969 /* Start YYX at -YYN if negative to avoid negative indexes in
3971 int yyxbegin = yyn < 0 ? -yyn : 0;
3973 /* Stay within bounds of both yycheck and yytname. */
3974 int yychecklim = YYLAST - yyn + 1;
3975 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3978 yyarg[0] = yytname[yytype];
3979 yyfmt = yystpcpy (yyformat, yyunexpected);
3981 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3982 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3984 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3988 yyformat[sizeof yyunexpected - 1] = '\0';
3991 yyarg[yycount++] = yytname[yyx];
3992 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3993 yysize_overflow |= (yysize1 < yysize);
3995 yyfmt = yystpcpy (yyfmt, yyprefix);
3999 yyf = YY_(yyformat);
4000 yysize1 = yysize + yystrlen (yyf);
4001 yysize_overflow |= (yysize1 < yysize);
4004 if (yysize_overflow)
4005 return YYSIZE_MAXIMUM;
4009 /* Avoid sprintf, as that infringes on the user's name space.
4010 Don't have undefined behavior even if the translation
4011 produced a string with the wrong number of "%s"s. */
4012 char *yyp = yyresult;
4014 while ((*yyp = *yyf) != '\0')
4016 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4018 yyp += yytnamerr (yyp, yyarg[yyi++]);
4031 #endif /* YYERROR_VERBOSE */
4034 /*-----------------------------------------------.
4035 | Release the memory associated to this symbol. |
4036 `-----------------------------------------------*/
4039 #if (defined __STDC__ || defined __C99__FUNC__ \
4040 || defined __cplusplus || defined _MSC_VER)
4042 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4045 yydestruct (yymsg, yytype, yyvaluep)
4055 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4065 /* Prevent warnings from -Wmissing-prototypes. */
4066 #ifdef YYPARSE_PARAM
4067 #if defined __STDC__ || defined __cplusplus
4068 int yyparse (void *YYPARSE_PARAM);
4072 #else /* ! YYPARSE_PARAM */
4073 #if defined __STDC__ || defined __cplusplus
4078 #endif /* ! YYPARSE_PARAM */
4081 /* The lookahead symbol. */
4084 /* The semantic value of the lookahead symbol. */
4087 /* Number of syntax errors so far. */
4092 /*-------------------------.
4093 | yyparse or yypush_parse. |
4094 `-------------------------*/
4096 #ifdef YYPARSE_PARAM
4097 #if (defined __STDC__ || defined __C99__FUNC__ \
4098 || defined __cplusplus || defined _MSC_VER)
4100 yyparse (void *YYPARSE_PARAM)
4103 yyparse (YYPARSE_PARAM)
4104 void *YYPARSE_PARAM;
4106 #else /* ! YYPARSE_PARAM */
4107 #if (defined __STDC__ || defined __C99__FUNC__ \
4108 || defined __cplusplus || defined _MSC_VER)
4121 /* Number of tokens to shift before error messages enabled. */
4124 /* The stacks and their tools:
4125 `yyss': related to states.
4126 `yyvs': related to semantic values.
4128 Refer to the stacks thru separate pointers, to allow yyoverflow
4129 to reallocate them elsewhere. */
4131 /* The state stack. */
4132 yytype_int16 yyssa[YYINITDEPTH];
4134 yytype_int16 *yyssp;
4136 /* The semantic value stack. */
4137 YYSTYPE yyvsa[YYINITDEPTH];
4141 YYSIZE_T yystacksize;
4145 /* Lookahead token as an internal (translated) token number. */
4147 /* The variables used to return semantic value and location from the
4152 /* Buffer for error messages, and its allocated size. */
4154 char *yymsg = yymsgbuf;
4155 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4158 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4160 /* The number of symbols on the RHS of the reduced rule.
4161 Keep to zero when no symbol should be popped. */
4167 yystacksize = YYINITDEPTH;
4169 YYDPRINTF ((stderr, "Starting parse\n"));
4174 yychar = YYEMPTY; /* Cause a token to be read. */
4176 /* Initialize stack pointers.
4177 Waste one element of value and location stack
4178 so that they stay on the same level as the state stack.
4179 The wasted elements are never initialized. */
4185 /*------------------------------------------------------------.
4186 | yynewstate -- Push a new state, which is found in yystate. |
4187 `------------------------------------------------------------*/
4189 /* In all cases, when you get here, the value and location stacks
4190 have just been pushed. So pushing a state here evens the stacks. */
4196 if (yyss + yystacksize - 1 <= yyssp)
4198 /* Get the current used size of the three stacks, in elements. */
4199 YYSIZE_T yysize = yyssp - yyss + 1;
4203 /* Give user a chance to reallocate the stack. Use copies of
4204 these so that the &'s don't force the real ones into
4206 YYSTYPE *yyvs1 = yyvs;
4207 yytype_int16 *yyss1 = yyss;
4209 /* Each stack pointer address is followed by the size of the
4210 data in use in that stack, in bytes. This used to be a
4211 conditional around just the two extra args, but that might
4212 be undefined if yyoverflow is a macro. */
4213 yyoverflow (YY_("memory exhausted"),
4214 &yyss1, yysize * sizeof (*yyssp),
4215 &yyvs1, yysize * sizeof (*yyvsp),
4221 #else /* no yyoverflow */
4222 # ifndef YYSTACK_RELOCATE
4223 goto yyexhaustedlab;
4225 /* Extend the stack our own way. */
4226 if (YYMAXDEPTH <= yystacksize)
4227 goto yyexhaustedlab;
4229 if (YYMAXDEPTH < yystacksize)
4230 yystacksize = YYMAXDEPTH;
4233 yytype_int16 *yyss1 = yyss;
4234 union yyalloc *yyptr =
4235 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4237 goto yyexhaustedlab;
4238 YYSTACK_RELOCATE (yyss_alloc, yyss);
4239 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4240 # undef YYSTACK_RELOCATE
4242 YYSTACK_FREE (yyss1);
4245 #endif /* no yyoverflow */
4247 yyssp = yyss + yysize - 1;
4248 yyvsp = yyvs + yysize - 1;
4250 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4251 (unsigned long int) yystacksize));
4253 if (yyss + yystacksize - 1 <= yyssp)
4257 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4259 if (yystate == YYFINAL)
4269 /* Do appropriate processing given the current state. Read a
4270 lookahead token if we need one and don't already have one. */
4272 /* First try to decide what to do without reference to lookahead token. */
4273 yyn = yypact[yystate];
4274 if (yyn == YYPACT_NINF)
4277 /* Not known => get a lookahead token if don't already have one. */
4279 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4280 if (yychar == YYEMPTY)
4282 YYDPRINTF ((stderr, "Reading a token: "));
4286 if (yychar <= YYEOF)
4288 yychar = yytoken = YYEOF;
4289 YYDPRINTF ((stderr, "Now at end of input.\n"));
4293 yytoken = YYTRANSLATE (yychar);
4294 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4297 /* If the proper action on seeing token YYTOKEN is to reduce or to
4298 detect an error, take that action. */
4300 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4305 if (yyn == 0 || yyn == YYTABLE_NINF)
4311 /* Count tokens shifted since error; after three, turn off error
4316 /* Shift the lookahead token. */
4317 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4319 /* Discard the shifted token. */
4328 /*-----------------------------------------------------------.
4329 | yydefault -- do the default action for the current state. |
4330 `-----------------------------------------------------------*/
4332 yyn = yydefact[yystate];
4338 /*-----------------------------.
4339 | yyreduce -- Do a reduction. |
4340 `-----------------------------*/
4342 /* yyn is the number of a rule to reduce with. */
4345 /* If YYLEN is nonzero, implement the default value of the action:
4348 Otherwise, the following line sets YYVAL to garbage.
4349 This behavior is undocumented and Bison
4350 users should not rely upon it. Assigning to YYVAL
4351 unconditionally makes the parser a bit smaller, and it avoids a
4352 GCC warning that YYVAL may be used uninitialized. */
4353 yyval = yyvsp[1-yylen];
4356 YY_REDUCE_PRINT (yyn);
4363 /* Line 1464 of skeleton.m4 */
4364 #line 2132 "parser.y"
4365 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4374 /* Line 1464 of skeleton.m4 */
4375 #line 2133 "parser.y"
4376 {(yyval.code)=code_new();}
4385 /* Line 1464 of skeleton.m4 */
4386 #line 2135 "parser.y"
4387 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4396 /* Line 1464 of skeleton.m4 */
4397 #line 2136 "parser.y"
4398 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4407 /* Line 1464 of skeleton.m4 */
4408 #line 2151 "parser.y"
4409 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4418 /* Line 1464 of skeleton.m4 */
4419 #line 2152 "parser.y"
4429 /* Line 1464 of skeleton.m4 */
4430 #line 2155 "parser.y"
4440 /* Line 1464 of skeleton.m4 */
4441 #line 2162 "parser.y"
4442 {(yyval.code)=(yyvsp[(3) - (4)].code);}
4451 /* Line 1464 of skeleton.m4 */
4452 #line 2166 "parser.y"
4453 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4462 /* Line 1464 of skeleton.m4 */
4463 #line 2167 "parser.y"
4464 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4473 /* Line 1464 of skeleton.m4 */
4474 #line 2171 "parser.y"
4476 code_t**cc = &global->init->method->body->code;
4477 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4487 /* Line 1464 of skeleton.m4 */
4488 #line 2182 "parser.y"
4489 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4498 /* Line 1464 of skeleton.m4 */
4499 #line 2183 "parser.y"
4500 {(yyval.value).c=abc_pushundefined(0);
4501 (yyval.value).t=TYPE_ANY;
4511 /* Line 1464 of skeleton.m4 */
4512 #line 2187 "parser.y"
4513 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4522 /* Line 1464 of skeleton.m4 */
4523 #line 2188 "parser.y"
4524 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4533 /* Line 1464 of skeleton.m4 */
4534 #line 2190 "parser.y"
4535 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4544 /* Line 1464 of skeleton.m4 */
4545 #line 2191 "parser.y"
4546 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4555 /* Line 1464 of skeleton.m4 */
4556 #line 2194 "parser.y"
4559 if(variable_exists((yyvsp[(1) - (3)].id)))
4560 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4562 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4565 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4566 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4567 (yyvsp[(2) - (3)].classinfo)->name);
4572 if(state->method->uses_slots) {
4573 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4575 // this variable is stored in a slot
4577 v->type = (yyvsp[(2) - (3)].classinfo);
4583 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4586 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4588 if((yyvsp[(2) - (3)].classinfo)) {
4589 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4590 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4591 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4593 code_free((yyvsp[(3) - (3)].value).c);
4594 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4597 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4598 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4599 (yyval.code) = abc_coerce_a((yyval.code));
4601 // don't do anything
4602 code_free((yyvsp[(3) - (3)].value).c);
4603 code_free((yyval.code));
4609 (yyval.code) = abc_setslot((yyval.code), index);
4611 (yyval.code) = abc_setlocal((yyval.code), index);
4622 /* Line 1464 of skeleton.m4 */
4623 #line 2254 "parser.y"
4624 {(yyval.code) = code_new();}
4633 /* Line 1464 of skeleton.m4 */
4634 #line 2255 "parser.y"
4635 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4644 /* Line 1464 of skeleton.m4 */
4645 #line 2258 "parser.y"
4646 {PASS12 new_state();}
4655 /* Line 1464 of skeleton.m4 */
4656 #line 2258 "parser.y"
4659 (yyval.code) = code_new();
4660 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4661 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4663 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4664 if((yyvsp[(7) - (7)].code)) {
4665 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4667 myif->branch = (yyval.code) = abc_nop((yyval.code));
4668 if((yyvsp[(7) - (7)].code)) {
4669 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4670 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4672 (yyval.code) = var_block((yyval.code));
4683 /* Line 1464 of skeleton.m4 */
4684 #line 2277 "parser.y"
4685 {(yyval.code)=code_new();}
4694 /* Line 1464 of skeleton.m4 */
4695 #line 2284 "parser.y"
4697 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4698 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4708 /* Line 1464 of skeleton.m4 */
4709 #line 2288 "parser.y"
4712 (yyval.id)=(yyvsp[(1) - (1)].id);
4722 /* Line 1464 of skeleton.m4 */
4723 #line 2293 "parser.y"
4724 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4733 /* Line 1464 of skeleton.m4 */
4734 #line 2294 "parser.y"
4735 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4744 /* Line 1464 of skeleton.m4 */
4745 #line 2296 "parser.y"
4747 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4748 (yyval.code) = code_new();
4749 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4750 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4751 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4752 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4753 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4754 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4755 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4756 (yyval.code) = abc_jump((yyval.code), loopstart);
4757 code_t*out = (yyval.code) = abc_nop((yyval.code));
4758 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4759 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4762 (yyval.code) = var_block((yyval.code));
4773 /* Line 1464 of skeleton.m4 */
4774 #line 2316 "parser.y"
4776 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4778 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4781 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4782 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4783 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4784 int array = new_variable(tmp1name, 0, 0, 0);
4786 (yyval.code) = code_new();
4787 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4788 (yyval.code) = abc_coerce_a((yyval.code));
4789 (yyval.code) = abc_setlocal((yyval.code), array);
4790 (yyval.code) = abc_pushbyte((yyval.code), 0);
4791 (yyval.code) = abc_setlocal((yyval.code), it);
4793 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4795 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4796 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4797 (yyval.code) = abc_getlocal((yyval.code), array);
4798 (yyval.code) = abc_getlocal((yyval.code), it);
4799 if(!(yyvsp[(1) - (6)].for_start).each)
4800 (yyval.code) = abc_nextname((yyval.code));
4802 (yyval.code) = abc_nextvalue((yyval.code));
4803 (yyval.code) = converttype((yyval.code), 0, var->type);
4804 (yyval.code) = abc_setlocal((yyval.code), var->index);
4806 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4807 (yyval.code) = abc_jump((yyval.code), loopstart);
4809 code_t*out = (yyval.code) = abc_nop((yyval.code));
4810 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4811 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4815 (yyval.code) = var_block((yyval.code));
4830 /* Line 1464 of skeleton.m4 */
4831 #line 2364 "parser.y"
4832 {PASS12 new_state();}
4841 /* Line 1464 of skeleton.m4 */
4842 #line 2364 "parser.y"
4845 (yyval.code) = code_new();
4847 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4848 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4849 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4850 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4851 myjmp->branch = cont;
4852 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4853 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4854 code_t*out = (yyval.code) = abc_nop((yyval.code));
4855 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4856 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4858 (yyval.code) = var_block((yyval.code));
4869 /* Line 1464 of skeleton.m4 */
4870 #line 2383 "parser.y"
4871 {PASS12 new_state();}
4880 /* Line 1464 of skeleton.m4 */
4881 #line 2383 "parser.y"
4883 (yyval.code) = code_new();
4884 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4885 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4886 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4887 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4888 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4889 code_t*out = (yyval.code) = abc_nop((yyval.code));
4890 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4891 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4893 (yyval.code) = var_block((yyval.code));
4904 /* Line 1464 of skeleton.m4 */
4905 #line 2398 "parser.y"
4907 (yyval.code) = abc___break__(0, "");
4917 /* Line 1464 of skeleton.m4 */
4918 #line 2401 "parser.y"
4920 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4930 /* Line 1464 of skeleton.m4 */
4931 #line 2404 "parser.y"
4933 (yyval.code) = abc___continue__(0, "");
4943 /* Line 1464 of skeleton.m4 */
4944 #line 2407 "parser.y"
4946 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4956 /* Line 1464 of skeleton.m4 */
4957 #line 2411 "parser.y"
4967 /* Line 1464 of skeleton.m4 */
4968 #line 2412 "parser.y"
4969 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4978 /* Line 1464 of skeleton.m4 */
4979 #line 2413 "parser.y"
4980 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4989 /* Line 1464 of skeleton.m4 */
4990 #line 2414 "parser.y"
4991 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5000 /* Line 1464 of skeleton.m4 */
5001 #line 2415 "parser.y"
5002 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5011 /* Line 1464 of skeleton.m4 */
5012 #line 2416 "parser.y"
5013 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5022 /* Line 1464 of skeleton.m4 */
5023 #line 2418 "parser.y"
5025 (yyval.code) = abc_getlocal(0, state->switch_var);
5026 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
5027 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5028 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5029 if((yyval.code)->opcode != OPCODE___BREAK__) {
5030 (yyval.code) = abc___fallthrough__((yyval.code), "");
5032 code_t*e = (yyval.code) = abc_nop((yyval.code));
5043 /* Line 1464 of skeleton.m4 */
5044 #line 2429 "parser.y"
5046 (yyval.code) = (yyvsp[(3) - (3)].code);
5056 /* Line 1464 of skeleton.m4 */
5057 #line 2432 "parser.y"
5058 {PASS12 new_state();state->switch_var=alloc_local();}
5067 /* Line 1464 of skeleton.m4 */
5068 #line 2432 "parser.y"
5070 (yyval.code)=(yyvsp[(4) - (8)].value).c;
5071 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5072 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5074 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5075 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5077 code_t*c = (yyval.code),*lastblock=0;
5079 if(c->opcode == OPCODE_IFNE) {
5080 if(!c->next) syntaxerror("internal error in fallthrough handling");
5082 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5084 c->opcode = OPCODE_JUMP;
5085 c->branch = lastblock;
5087 /* fall through end of switch */
5088 c->opcode = OPCODE_NOP;
5094 (yyval.code) = var_block((yyval.code));
5105 /* Line 1464 of skeleton.m4 */
5106 #line 2463 "parser.y"
5107 {PASS12 new_state();
5108 state->exception_name=(yyvsp[(3) - (5)].id);
5109 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5110 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5120 /* Line 1464 of skeleton.m4 */
5121 #line 2468 "parser.y"
5123 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5124 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5126 NEW(abc_exception_t, e)
5127 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5128 e->var_name = multiname_clone(&name);
5129 (yyval.exception) = e;
5132 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5133 e->target = c = abc_nop(0);
5134 c = abc_setlocal(c, i);
5135 c = code_append(c, code_dup(state->method->scope_code));
5136 c = code_append(c, (yyvsp[(8) - (9)].code));
5150 /* Line 1464 of skeleton.m4 */
5151 #line 2488 "parser.y"
5152 {PASS12 new_state();state->exception_name=0;}
5161 /* Line 1464 of skeleton.m4 */
5162 #line 2488 "parser.y"
5164 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5165 if(!(yyvsp[(4) - (5)].code)) {
5166 (yyval.exception)=0;
5168 NEW(abc_exception_t, e)
5169 e->exc_type = 0; //all exceptions
5170 e->var_name = 0; //no name
5173 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5174 (yyval.exception) = e;
5186 /* Line 1464 of skeleton.m4 */
5187 #line 2504 "parser.y"
5188 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5197 /* Line 1464 of skeleton.m4 */
5198 #line 2505 "parser.y"
5199 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5208 /* Line 1464 of skeleton.m4 */
5209 #line 2506 "parser.y"
5210 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5219 /* Line 1464 of skeleton.m4 */
5220 #line 2507 "parser.y"
5222 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5223 (yyval.catch_list).finally = 0;
5224 if((yyvsp[(2) - (2)].exception)) {
5225 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5226 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5237 /* Line 1464 of skeleton.m4 */
5238 #line 2515 "parser.y"
5240 (yyval.catch_list).l=list_new();
5241 (yyval.catch_list).finally = 0;
5242 if((yyvsp[(1) - (1)].exception)) {
5243 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5244 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5255 /* Line 1464 of skeleton.m4 */
5256 #line 2524 "parser.y"
5257 {PASS12 new_state();
5258 state->method->has_exceptions=1;
5259 state->method->late_binding=1;//for invariant scope_code
5269 /* Line 1464 of skeleton.m4 */
5270 #line 2527 "parser.y"
5272 code_t*out = abc_nop(0);
5274 code_t*start = abc_nop(0);
5275 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5276 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5277 (yyval.code) = abc_jump((yyval.code), out);
5279 code_t*end = (yyval.code) = abc_nop((yyval.code));
5282 if((yyvsp[(6) - (6)].catch_list).finally)
5283 tmp = new_variable("__finally__", 0, 0, 0);
5285 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5288 abc_exception_t*e = l->abc_exception;
5290 (yyval.code) = code_append((yyval.code), e->target);
5291 (yyval.code) = abc_jump((yyval.code), out);
5293 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5295 e->target = (yyval.code) = abc_nop((yyval.code));
5296 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5297 (yyval.code) = abc___rethrow__((yyval.code));
5305 (yyval.code) = code_append((yyval.code), out);
5307 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5309 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5311 (yyval.code) = var_block((yyval.code));
5322 /* Line 1464 of skeleton.m4 */
5323 #line 2573 "parser.y"
5325 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5326 (yyval.code)=abc_throw((yyval.code));
5336 /* Line 1464 of skeleton.m4 */
5337 #line 2577 "parser.y"
5339 if(!state->exception_name)
5340 syntaxerror("re-throw only possible within a catch block");
5341 variable_t*v = find_variable(state, state->exception_name);
5342 (yyval.code)=code_new();
5343 (yyval.code)=abc_getlocal((yyval.code), v->index);
5344 (yyval.code)=abc_throw((yyval.code));
5354 /* Line 1464 of skeleton.m4 */
5355 #line 2588 "parser.y"
5358 if(state->method->has_exceptions) {
5359 int v = alloc_local();
5360 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5361 state->method->scope_code = abc_pushwith(state->method->scope_code);
5362 (yyval.value_list).number = v;
5364 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5374 /* Line 1464 of skeleton.m4 */
5375 #line 2598 "parser.y"
5377 /* remove getlocal;pushwith from scope code again */
5378 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5380 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5381 if(state->method->has_exceptions) {
5382 (yyval.code) = abc_dup((yyval.code));
5383 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5385 (yyval.code) = abc_pushwith((yyval.code));
5386 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5387 (yyval.code) = abc_popscope((yyval.code));
5398 /* Line 1464 of skeleton.m4 */
5399 #line 2616 "parser.y"
5400 {PASS12 (yyval.id)="package";}
5409 /* Line 1464 of skeleton.m4 */
5410 #line 2617 "parser.y"
5411 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5420 /* Line 1464 of skeleton.m4 */
5421 #line 2619 "parser.y"
5422 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5431 /* Line 1464 of skeleton.m4 */
5432 #line 2620 "parser.y"
5433 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5442 /* Line 1464 of skeleton.m4 */
5443 #line 2622 "parser.y"
5444 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5453 /* Line 1464 of skeleton.m4 */
5454 #line 2623 "parser.y"
5455 {PASS12 endpackage();(yyval.code)=0;}
5464 /* Line 1464 of skeleton.m4 */
5465 #line 2624 "parser.y"
5466 {PASS12 startpackage("");}
5475 /* Line 1464 of skeleton.m4 */
5476 #line 2625 "parser.y"
5477 {PASS12 endpackage();(yyval.code)=0;}
5486 /* Line 1464 of skeleton.m4 */
5487 #line 2627 "parser.y"
5490 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5491 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5492 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5496 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5498 syntaxerror("Couldn't import class\n");
5499 state_has_imports();
5500 dict_put(state->imports, c->name, c);
5501 import_toplevel(c->package);
5512 /* Line 1464 of skeleton.m4 */
5513 #line 2643 "parser.y"
5516 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5517 as3_schedule_package((yyvsp[(2) - (4)].id));
5522 i->package = (yyvsp[(2) - (4)].id);
5523 state_has_imports();
5524 list_append(state->wildcard_imports, i);
5525 import_toplevel(i->package);
5536 /* Line 1464 of skeleton.m4 */
5537 #line 2660 "parser.y"
5538 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5547 /* Line 1464 of skeleton.m4 */
5548 #line 2661 "parser.y"
5549 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5558 /* Line 1464 of skeleton.m4 */
5559 #line 2662 "parser.y"
5560 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5569 /* Line 1464 of skeleton.m4 */
5570 #line 2663 "parser.y"
5573 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5574 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5575 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5586 /* Line 1464 of skeleton.m4 */
5587 #line 2670 "parser.y"
5588 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5597 /* Line 1464 of skeleton.m4 */
5598 #line 2671 "parser.y"
5599 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5608 /* Line 1464 of skeleton.m4 */
5609 #line 2672 "parser.y"
5610 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5619 /* Line 1464 of skeleton.m4 */
5620 #line 2673 "parser.y"
5621 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5630 /* Line 1464 of skeleton.m4 */
5631 #line 2674 "parser.y"
5632 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5641 /* Line 1464 of skeleton.m4 */
5642 #line 2675 "parser.y"
5643 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5652 /* Line 1464 of skeleton.m4 */
5653 #line 2676 "parser.y"
5654 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5663 /* Line 1464 of skeleton.m4 */
5664 #line 2677 "parser.y"
5665 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5674 /* Line 1464 of skeleton.m4 */
5675 #line 2678 "parser.y"
5676 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5685 /* Line 1464 of skeleton.m4 */
5686 #line 2679 "parser.y"
5687 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5688 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5698 /* Line 1464 of skeleton.m4 */
5699 #line 2683 "parser.y"
5700 {PASS12 (yyval.classinfo)=0;}
5709 /* Line 1464 of skeleton.m4 */
5710 #line 2684 "parser.y"
5711 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5720 /* Line 1464 of skeleton.m4 */
5721 #line 2686 "parser.y"
5722 {PASS12 (yyval.classinfo_list)=list_new();}
5731 /* Line 1464 of skeleton.m4 */
5732 #line 2687 "parser.y"
5733 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5742 /* Line 1464 of skeleton.m4 */
5743 #line 2689 "parser.y"
5744 {PASS12 (yyval.classinfo_list)=list_new();}
5753 /* Line 1464 of skeleton.m4 */
5754 #line 2690 "parser.y"
5755 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5764 /* Line 1464 of skeleton.m4 */
5765 #line 2694 "parser.y"
5766 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5775 /* Line 1464 of skeleton.m4 */
5776 #line 2696 "parser.y"
5777 {PASS12 endclass();(yyval.code)=0;}
5786 /* Line 1464 of skeleton.m4 */
5787 #line 2700 "parser.y"
5788 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5789 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5798 /* Line 1464 of skeleton.m4 */
5799 #line 2703 "parser.y"
5800 {PASS12 endclass();(yyval.code)=0;}
5809 /* Line 1464 of skeleton.m4 */
5810 #line 2716 "parser.y"
5812 code_t*c = state->cls->static_init->header;
5813 c = code_append(c, (yyvsp[(1) - (1)].code));
5814 state->cls->static_init->header = c;
5824 /* Line 1464 of skeleton.m4 */
5825 #line 2727 "parser.y"
5827 syntaxerror("variable declarations not allowed in interfaces");
5837 /* Line 1464 of skeleton.m4 */
5838 #line 2730 "parser.y"
5841 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5842 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5843 syntaxerror("invalid method modifiers: interface methods always need to be public");
5845 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5846 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5847 list_deep_free((yyvsp[(6) - (8)].params).list);
5857 /* Line 1464 of skeleton.m4 */
5858 #line 2745 "parser.y"
5859 {setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5868 /* Line 1464 of skeleton.m4 */
5869 #line 2745 "parser.y"
5870 {(yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5879 /* Line 1464 of skeleton.m4 */
5880 #line 2747 "parser.y"
5881 {(yyval.code) = (yyvsp[(1) - (1)].code);}
5890 /* Line 1464 of skeleton.m4 */
5891 #line 2748 "parser.y"
5892 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
5901 /* Line 1464 of skeleton.m4 */
5902 #line 2751 "parser.y"
5904 int flags = slotstate_flags->flags;
5905 namespace_t ns = modifiers2access(slotstate_flags);
5907 varinfo_t* info = 0;
5909 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
5911 check_override(i, flags);
5913 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
5915 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
5917 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
5919 if(ns.name && ns.name[0]) {
5920 syntaxerror("namespaces not allowed on package-level variables");
5922 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
5925 info->type = (yyvsp[(2) - (3)].classinfo);
5926 info->flags = flags;
5929 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
5931 trait_list_t**traits;
5935 ns.name = state->package;
5936 traits = &global->init->traits;
5937 code = &global->init->method->body->code;
5938 } else if(flags&FLAG_STATIC) {
5940 traits = &state->cls->abc->static_traits;
5941 code = &state->cls->static_init->header;
5943 // instance variable
5944 traits = &state->cls->abc->traits;
5945 code = &state->cls->init->header;
5949 if((yyvsp[(2) - (3)].classinfo)) {
5950 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
5951 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5953 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5955 info->slot = t->slot_id;
5957 /* initalization code (if needed) */
5959 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
5960 c = abc_getlocal_0(c);
5961 c = code_append(c, (yyvsp[(3) - (3)].value).c);
5962 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
5963 c = abc_setslot(c, t->slot_id);
5966 *code = code_append(*code, c);
5968 if(slotstate_varconst==KW_CONST) {
5969 t->kind= TRAIT_CONST;
5982 /* Line 1464 of skeleton.m4 */
5983 #line 2825 "parser.y"
5984 {(yyval.constant)=0;}
5993 /* Line 1464 of skeleton.m4 */
5994 #line 2826 "parser.y"
5995 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
6004 /* Line 1464 of skeleton.m4 */
6005 #line 2828 "parser.y"
6006 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
6015 /* Line 1464 of skeleton.m4 */
6016 #line 2829 "parser.y"
6017 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6026 /* Line 1464 of skeleton.m4 */
6027 #line 2830 "parser.y"
6028 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
6037 /* Line 1464 of skeleton.m4 */
6038 #line 2831 "parser.y"
6039 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6048 /* Line 1464 of skeleton.m4 */
6049 #line 2832 "parser.y"
6050 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6059 /* Line 1464 of skeleton.m4 */
6060 #line 2834 "parser.y"
6061 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6070 /* Line 1464 of skeleton.m4 */
6071 #line 2835 "parser.y"
6072 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6081 /* Line 1464 of skeleton.m4 */
6082 #line 2836 "parser.y"
6083 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6092 /* Line 1464 of skeleton.m4 */
6093 #line 2837 "parser.y"
6095 if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) {
6096 (yyval.constant) = constant_new_float(__builtin_nan(""));
6098 as3_warning("Couldn't evaluate constant value of %s", (yyvsp[(1) - (1)].id));
6099 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
6110 /* Line 1464 of skeleton.m4 */
6111 #line 2849 "parser.y"
6114 memset(&(yyval.params),0,sizeof((yyval.params)));
6124 /* Line 1464 of skeleton.m4 */
6125 #line 2853 "parser.y"
6128 (yyval.params)=(yyvsp[(1) - (1)].params);
6138 /* Line 1464 of skeleton.m4 */
6139 #line 2859 "parser.y"
6142 memset(&(yyval.params),0,sizeof((yyval.params)));
6143 (yyval.params).varargs=1;
6144 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6154 /* Line 1464 of skeleton.m4 */
6155 #line 2865 "parser.y"
6158 (yyval.params) =(yyvsp[(1) - (4)].params);
6159 (yyval.params).varargs=1;
6160 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6170 /* Line 1464 of skeleton.m4 */
6171 #line 2873 "parser.y"
6174 (yyval.params) = (yyvsp[(1) - (3)].params);
6175 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6185 /* Line 1464 of skeleton.m4 */
6186 #line 2878 "parser.y"
6189 memset(&(yyval.params),0,sizeof((yyval.params)));
6190 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6200 /* Line 1464 of skeleton.m4 */
6201 #line 2884 "parser.y"
6204 (yyval.param) = rfx_calloc(sizeof(param_t));
6205 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6206 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6208 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6218 /* Line 1464 of skeleton.m4 */
6219 #line 2892 "parser.y"
6222 (yyval.param) = rfx_calloc(sizeof(param_t));
6223 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6224 (yyval.param)->type = TYPE_ANY;
6226 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6236 /* Line 1464 of skeleton.m4 */
6237 #line 2902 "parser.y"
6238 {PASS12 (yyval.token)=0;}
6247 /* Line 1464 of skeleton.m4 */
6248 #line 2905 "parser.y"
6249 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6258 /* Line 1464 of skeleton.m4 */
6259 #line 2906 "parser.y"
6262 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6264 if(!state->method->info) syntaxerror("internal error");
6266 code_t*c = method_header(state->method);
6267 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6269 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6271 list_deep_free((yyvsp[(6) - (12)].params).list);
6282 /* Line 1464 of skeleton.m4 */
6283 #line 2922 "parser.y"
6284 {PASS12 (yyval.id)=0;}
6293 /* Line 1464 of skeleton.m4 */
6294 #line 2924 "parser.y"
6295 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6304 /* Line 1464 of skeleton.m4 */
6305 #line 2925 "parser.y"
6308 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6310 methodinfo_t*f = state->method->info;
6311 if(!f || !f->kind) syntaxerror("internal error");
6313 code_t*c = method_header(state->method);
6314 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6316 int index = state->method->var_index;
6317 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6319 (yyval.value).c = abc_getlocal(0, index);
6320 (yyval.value).t = TYPE_FUNCTION(f);
6322 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6332 /* Line 1464 of skeleton.m4 */
6333 #line 2947 "parser.y"
6335 PASS1 NEW(unresolvedinfo_t,c);
6336 memset(c, 0, sizeof(*c));
6337 c->kind = INFOTYPE_UNRESOLVED;
6338 c->name = (yyvsp[(1) - (1)].id);
6339 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6341 c->nsset = get_current_imports();
6342 /* make the compiler look for this class in the current directory,
6344 //as3_schedule_class_noerror(state->package, $1);
6346 (yyval.classinfo) = (classinfo_t*)c;
6348 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6349 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6350 (yyval.classinfo) = (classinfo_t*)s;
6360 /* Line 1464 of skeleton.m4 */
6361 #line 2966 "parser.y"
6363 PASS1 NEW(unresolvedinfo_t,c);
6364 memset(c, 0, sizeof(*c));
6365 c->kind = INFOTYPE_UNRESOLVED;
6366 c->package = (yyvsp[(1) - (3)].id);
6367 c->name = (yyvsp[(3) - (3)].id);
6368 (yyval.classinfo) = (classinfo_t*)c;
6370 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6371 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6372 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6373 (yyval.classinfo) = (classinfo_t*)s;
6383 /* Line 1464 of skeleton.m4 */
6384 #line 2983 "parser.y"
6385 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6394 /* Line 1464 of skeleton.m4 */
6395 #line 2984 "parser.y"
6396 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6405 /* Line 1464 of skeleton.m4 */
6406 #line 2986 "parser.y"
6407 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6416 /* Line 1464 of skeleton.m4 */
6417 #line 2987 "parser.y"
6418 {PASS12 (yyval.classinfo)=registry_getanytype();}
6427 /* Line 1464 of skeleton.m4 */
6428 #line 2988 "parser.y"
6429 {PASS12 (yyval.classinfo)=registry_getanytype();}
6438 /* Line 1464 of skeleton.m4 */
6439 #line 2997 "parser.y"
6440 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6449 /* Line 1464 of skeleton.m4 */
6450 #line 2998 "parser.y"
6451 {PASS12 (yyval.classinfo)=0;}
6460 /* Line 1464 of skeleton.m4 */
6461 #line 3002 "parser.y"
6462 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6471 /* Line 1464 of skeleton.m4 */
6472 #line 3003 "parser.y"
6473 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6482 /* Line 1464 of skeleton.m4 */
6483 #line 3005 "parser.y"
6484 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6493 /* Line 1464 of skeleton.m4 */
6494 #line 3009 "parser.y"
6495 {(yyval.value_list).number=1;
6496 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6506 /* Line 1464 of skeleton.m4 */
6507 #line 3013 "parser.y"
6508 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6517 /* Line 1464 of skeleton.m4 */
6518 #line 3014 "parser.y"
6520 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6521 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6531 /* Line 1464 of skeleton.m4 */
6532 #line 3020 "parser.y"
6534 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6535 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6537 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6538 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6539 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6540 (yyval.value).c = code_cutlast((yyval.value).c);
6541 (yyval.value).c = code_append((yyval.value).c, paramcode);
6542 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6543 multiname_destroy(name);
6544 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6545 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6546 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6547 multiname_t*name = t->name;
6548 (yyval.value).c = code_cutlast((yyval.value).c);
6549 (yyval.value).c = code_append((yyval.value).c, paramcode);
6550 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6552 (yyval.value).c = code_append((yyval.value).c, paramcode);
6553 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6556 (yyval.value).t = TYPE_ANY;
6557 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6558 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6560 (yyval.value).c = abc_coerce_a((yyval.value).c);
6561 (yyval.value).t = TYPE_ANY;
6572 /* Line 1464 of skeleton.m4 */
6573 #line 3056 "parser.y"
6576 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6577 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6578 (yyval.value).c = code_cutlast((yyval.value).c);
6580 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6582 (yyval.value).t = TYPE_ANY;
6583 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6584 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6585 (yyval.value).c = code_cutlast((yyval.value).c);
6586 (yyval.value).c = code_append((yyval.value).c, paramcode);
6587 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6588 multiname_destroy(name);
6589 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6590 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6591 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6592 if(t->kind!=TRAIT_METHOD) {
6593 //ok: flash allows to assign closures to members.
6595 multiname_t*name = t->name;
6596 (yyval.value).c = code_cutlast((yyval.value).c);
6597 (yyval.value).c = code_append((yyval.value).c, paramcode);
6598 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6599 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6600 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6601 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6602 (yyval.value).c = code_cutlast((yyval.value).c);
6603 (yyval.value).c = code_append((yyval.value).c, paramcode);
6604 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6605 multiname_destroy(name);
6607 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6608 (yyval.value).c = code_append((yyval.value).c, paramcode);
6609 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6612 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6613 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6615 (yyval.value).c = abc_coerce_a((yyval.value).c);
6616 (yyval.value).t = TYPE_ANY;
6627 /* Line 1464 of skeleton.m4 */
6628 #line 3102 "parser.y"
6630 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6631 if(!state->method) syntaxerror("super() not allowed outside of a function");
6632 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6634 (yyval.value).c = code_new();
6635 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6637 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6639 this is dependent on the control path, check this somewhere else
6640 if(state->method->has_super)
6641 syntaxerror("constructor may call super() only once");
6643 state->method->has_super = 1;
6645 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6646 (yyval.value).c = abc_pushundefined((yyval.value).c);
6647 (yyval.value).t = TYPE_ANY;
6657 /* Line 1464 of skeleton.m4 */
6658 #line 3123 "parser.y"
6660 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6661 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6662 (yyval.value).c = code_cutlast((yyval.value).c);
6664 multiname_t*name = 0;
6665 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6666 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6667 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6668 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6669 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6670 (yyval.value).c = code_cutlast((yyval.value).c);
6671 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6673 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6674 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6675 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6677 (yyval.value).t = TYPE_BOOLEAN;
6687 /* Line 1464 of skeleton.m4 */
6688 #line 3144 "parser.y"
6690 (yyval.code) = abc_returnvoid(0);
6700 /* Line 1464 of skeleton.m4 */
6701 #line 3147 "parser.y"
6703 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6704 (yyval.code) = abc_returnvalue((yyval.code));
6714 /* Line 1464 of skeleton.m4 */
6715 #line 3154 "parser.y"
6716 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6725 /* Line 1464 of skeleton.m4 */
6726 #line 3155 "parser.y"
6727 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6736 /* Line 1464 of skeleton.m4 */
6737 #line 3156 "parser.y"
6739 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6740 (yyval.value).c = cut_last_push((yyval.value).c);
6741 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6742 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6752 /* Line 1464 of skeleton.m4 */
6753 #line 3162 "parser.y"
6755 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6765 /* Line 1464 of skeleton.m4 */
6766 #line 3168 "parser.y"
6767 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6776 /* Line 1464 of skeleton.m4 */
6777 #line 3172 "parser.y"
6778 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6787 /* Line 1464 of skeleton.m4 */
6788 #line 3174 "parser.y"
6789 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6798 /* Line 1464 of skeleton.m4 */
6799 #line 3176 "parser.y"
6800 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6809 /* Line 1464 of skeleton.m4 */
6810 #line 3180 "parser.y"
6812 (yyval.value).c = 0;
6813 namespace_t ns = {ACCESS_PACKAGE, ""};
6814 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6815 if(!(yyvsp[(1) - (1)].regexp).options) {
6816 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6817 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6818 (yyval.value).c = abc_construct((yyval.value).c, 1);
6820 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6821 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6822 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6823 (yyval.value).c = abc_construct((yyval.value).c, 2);
6825 (yyval.value).t = TYPE_REGEXP;
6835 /* Line 1464 of skeleton.m4 */
6836 #line 3197 "parser.y"
6837 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6838 //MULTINAME(m, registry_getintclass());
6839 //$$.c = abc_coerce2($$.c, &m); // FIXME
6840 (yyval.value).t = TYPE_INT;
6850 /* Line 1464 of skeleton.m4 */
6851 #line 3202 "parser.y"
6852 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6853 (yyval.value).t = TYPE_INT;
6863 /* Line 1464 of skeleton.m4 */
6864 #line 3205 "parser.y"
6865 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6866 (yyval.value).t = TYPE_INT;
6876 /* Line 1464 of skeleton.m4 */
6877 #line 3208 "parser.y"
6878 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6879 (yyval.value).t = TYPE_UINT;
6889 /* Line 1464 of skeleton.m4 */
6890 #line 3211 "parser.y"
6891 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6892 (yyval.value).t = TYPE_FLOAT;
6902 /* Line 1464 of skeleton.m4 */
6903 #line 3214 "parser.y"
6904 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6905 (yyval.value).t = TYPE_STRING;
6915 /* Line 1464 of skeleton.m4 */
6916 #line 3217 "parser.y"
6917 {(yyval.value).c = abc_pushundefined(0);
6918 (yyval.value).t = TYPE_ANY;
6928 /* Line 1464 of skeleton.m4 */
6929 #line 3220 "parser.y"
6930 {(yyval.value).c = abc_pushtrue(0);
6931 (yyval.value).t = TYPE_BOOLEAN;
6941 /* Line 1464 of skeleton.m4 */
6942 #line 3223 "parser.y"
6943 {(yyval.value).c = abc_pushfalse(0);
6944 (yyval.value).t = TYPE_BOOLEAN;
6954 /* Line 1464 of skeleton.m4 */
6955 #line 3226 "parser.y"
6956 {(yyval.value).c = abc_pushnull(0);
6957 (yyval.value).t = TYPE_NULL;
6967 /* Line 1464 of skeleton.m4 */
6968 #line 3230 "parser.y"
6969 {(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);
6970 (yyval.value).t = TYPE_BOOLEAN;
6980 /* Line 1464 of skeleton.m4 */
6981 #line 3233 "parser.y"
6982 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6983 (yyval.value).t = TYPE_BOOLEAN;
6993 /* Line 1464 of skeleton.m4 */
6994 #line 3236 "parser.y"
6995 {(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);
6996 (yyval.value).t = TYPE_BOOLEAN;
7006 /* Line 1464 of skeleton.m4 */
7007 #line 3239 "parser.y"
7008 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
7009 (yyval.value).t = TYPE_BOOLEAN;
7019 /* Line 1464 of skeleton.m4 */
7020 #line 3242 "parser.y"
7021 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
7022 (yyval.value).t = TYPE_BOOLEAN;
7032 /* Line 1464 of skeleton.m4 */
7033 #line 3245 "parser.y"
7034 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
7035 (yyval.value).t = TYPE_BOOLEAN;
7045 /* Line 1464 of skeleton.m4 */
7046 #line 3248 "parser.y"
7047 {(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);
7048 (yyval.value).t = TYPE_BOOLEAN;
7058 /* Line 1464 of skeleton.m4 */
7059 #line 3251 "parser.y"
7060 {(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);
7061 (yyval.value).t = TYPE_BOOLEAN;
7071 /* Line 1464 of skeleton.m4 */
7072 #line 3255 "parser.y"
7073 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
7074 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7075 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7076 (yyval.value).c = abc_dup((yyval.value).c);
7077 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
7078 (yyval.value).c = cut_last_push((yyval.value).c);
7079 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7080 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7081 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7082 jmp->branch = label;
7092 /* Line 1464 of skeleton.m4 */
7093 #line 3266 "parser.y"
7095 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
7096 /*printf("%08x:\n",$1.t);
7097 code_dump($1.c, 0, 0, "", stdout);
7098 printf("%08x:\n",$3.t);
7099 code_dump($3.c, 0, 0, "", stdout);
7100 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
7101 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7102 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7103 (yyval.value).c = abc_dup((yyval.value).c);
7104 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7105 (yyval.value).c = cut_last_push((yyval.value).c);
7106 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7107 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7108 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7109 jmp->branch = label;
7119 /* Line 1464 of skeleton.m4 */
7120 #line 3284 "parser.y"
7121 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7122 (yyval.value).c = abc_not((yyval.value).c);
7123 (yyval.value).t = TYPE_BOOLEAN;
7133 /* Line 1464 of skeleton.m4 */
7134 #line 3289 "parser.y"
7135 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7136 (yyval.value).c = abc_bitnot((yyval.value).c);
7137 (yyval.value).t = TYPE_INT;
7147 /* Line 1464 of skeleton.m4 */
7148 #line 3294 "parser.y"
7149 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7150 (yyval.value).c = abc_bitand((yyval.value).c);
7151 (yyval.value).t = TYPE_INT;
7161 /* Line 1464 of skeleton.m4 */
7162 #line 3299 "parser.y"
7163 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7164 (yyval.value).c = abc_bitxor((yyval.value).c);
7165 (yyval.value).t = TYPE_INT;
7175 /* Line 1464 of skeleton.m4 */
7176 #line 3304 "parser.y"
7177 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7178 (yyval.value).c = abc_bitor((yyval.value).c);
7179 (yyval.value).t = TYPE_INT;
7189 /* Line 1464 of skeleton.m4 */
7190 #line 3309 "parser.y"
7191 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7192 (yyval.value).c = abc_rshift((yyval.value).c);
7193 (yyval.value).t = TYPE_INT;
7203 /* Line 1464 of skeleton.m4 */
7204 #line 3313 "parser.y"
7205 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7206 (yyval.value).c = abc_urshift((yyval.value).c);
7207 (yyval.value).t = TYPE_INT;
7217 /* Line 1464 of skeleton.m4 */
7218 #line 3317 "parser.y"
7219 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7220 (yyval.value).c = abc_lshift((yyval.value).c);
7221 (yyval.value).t = TYPE_INT;
7231 /* Line 1464 of skeleton.m4 */
7232 #line 3322 "parser.y"
7233 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7234 (yyval.value).c = abc_divide((yyval.value).c);
7235 (yyval.value).t = TYPE_NUMBER;
7245 /* Line 1464 of skeleton.m4 */
7246 #line 3326 "parser.y"
7247 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7248 (yyval.value).c = abc_modulo((yyval.value).c);
7249 (yyval.value).t = TYPE_NUMBER;
7259 /* Line 1464 of skeleton.m4 */
7260 #line 3330 "parser.y"
7261 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7262 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7263 (yyval.value).c = abc_add_i((yyval.value).c);
7264 (yyval.value).t = TYPE_INT;
7266 (yyval.value).c = abc_add((yyval.value).c);
7267 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7278 /* Line 1464 of skeleton.m4 */
7279 #line 3339 "parser.y"
7280 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7281 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7282 (yyval.value).c = abc_subtract_i((yyval.value).c);
7283 (yyval.value).t = TYPE_INT;
7285 (yyval.value).c = abc_subtract((yyval.value).c);
7286 (yyval.value).t = TYPE_NUMBER;
7297 /* Line 1464 of skeleton.m4 */
7298 #line 3348 "parser.y"
7299 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7300 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7301 (yyval.value).c = abc_multiply_i((yyval.value).c);
7302 (yyval.value).t = TYPE_INT;
7304 (yyval.value).c = abc_multiply((yyval.value).c);
7305 (yyval.value).t = TYPE_NUMBER;
7316 /* Line 1464 of skeleton.m4 */
7317 #line 3358 "parser.y"
7318 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7319 (yyval.value).c = abc_in((yyval.value).c);
7320 (yyval.value).t = TYPE_BOOLEAN;
7330 /* Line 1464 of skeleton.m4 */
7331 #line 3363 "parser.y"
7332 {char use_astype=0; // flash player's astype works differently than astypelate
7333 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7334 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7335 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7336 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7338 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7339 (yyval.value).c = abc_astypelate((yyval.value).c);
7340 (yyval.value).t = TYPE_ANY;
7351 /* Line 1464 of skeleton.m4 */
7352 #line 3376 "parser.y"
7353 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7354 (yyval.value).c = abc_instanceof((yyval.value).c);
7355 (yyval.value).t = TYPE_BOOLEAN;
7365 /* Line 1464 of skeleton.m4 */
7366 #line 3381 "parser.y"
7367 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7368 (yyval.value).c = abc_istypelate((yyval.value).c);
7369 (yyval.value).t = TYPE_BOOLEAN;
7379 /* Line 1464 of skeleton.m4 */
7380 #line 3386 "parser.y"
7382 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7383 (yyval.value).c = abc_typeof((yyval.value).c);
7384 (yyval.value).t = TYPE_STRING;
7394 /* Line 1464 of skeleton.m4 */
7395 #line 3392 "parser.y"
7397 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7398 (yyval.value).c = abc_pushundefined((yyval.value).c);
7399 (yyval.value).t = TYPE_ANY;
7409 /* Line 1464 of skeleton.m4 */
7410 #line 3398 "parser.y"
7411 { (yyval.value).c = abc_pushundefined(0);
7412 (yyval.value).t = TYPE_ANY;
7422 /* Line 1464 of skeleton.m4 */
7423 #line 3402 "parser.y"
7424 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7433 /* Line 1464 of skeleton.m4 */
7434 #line 3404 "parser.y"
7436 (yyval.value)=(yyvsp[(2) - (2)].value);
7437 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7438 (yyval.value).c=abc_negate_i((yyval.value).c);
7439 (yyval.value).t = TYPE_INT;
7441 (yyval.value).c=abc_negate((yyval.value).c);
7442 (yyval.value).t = TYPE_NUMBER;
7453 /* Line 1464 of skeleton.m4 */
7454 #line 3415 "parser.y"
7456 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7457 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7459 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7460 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7461 (yyval.value).t = 0; // array elements have unknown type
7471 /* Line 1464 of skeleton.m4 */
7472 #line 3424 "parser.y"
7474 (yyval.value).c = code_new();
7475 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7476 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).number);
7477 (yyval.value).t = registry_getarrayclass();
7487 /* Line 1464 of skeleton.m4 */
7488 #line 3431 "parser.y"
7489 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7498 /* Line 1464 of skeleton.m4 */
7499 #line 3432 "parser.y"
7500 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7509 /* Line 1464 of skeleton.m4 */
7510 #line 3434 "parser.y"
7512 (yyval.value_list).cc = 0;
7513 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7514 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7515 (yyval.value_list).number = 2;
7525 /* Line 1464 of skeleton.m4 */
7526 #line 3440 "parser.y"
7528 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7529 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7530 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7531 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7541 /* Line 1464 of skeleton.m4 */
7542 #line 3449 "parser.y"
7544 (yyval.value).c = code_new();
7545 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7546 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).number/2);
7547 (yyval.value).t = registry_getobjectclass();
7557 /* Line 1464 of skeleton.m4 */
7558 #line 3456 "parser.y"
7560 code_t*c = (yyvsp[(3) - (3)].value).c;
7561 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7562 c=abc_multiply_i(c);
7566 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
7567 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7568 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7578 /* Line 1464 of skeleton.m4 */
7579 #line 3468 "parser.y"
7581 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
7582 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
7583 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7584 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7594 /* Line 1464 of skeleton.m4 */
7595 #line 3474 "parser.y"
7597 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
7598 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
7599 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7600 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7610 /* Line 1464 of skeleton.m4 */
7611 #line 3480 "parser.y"
7613 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7614 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7615 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7616 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7626 /* Line 1464 of skeleton.m4 */
7627 #line 3486 "parser.y"
7629 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7630 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7631 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7632 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7642 /* Line 1464 of skeleton.m4 */
7643 #line 3492 "parser.y"
7645 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7646 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7647 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7648 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7658 /* Line 1464 of skeleton.m4 */
7659 #line 3498 "parser.y"
7661 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
7662 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7663 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7664 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7674 /* Line 1464 of skeleton.m4 */
7675 #line 3504 "parser.y"
7677 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7678 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7679 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7680 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7690 /* Line 1464 of skeleton.m4 */
7691 #line 3510 "parser.y"
7693 code_t*c = (yyvsp[(3) - (3)].value).c;
7695 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7699 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7702 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7703 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7713 /* Line 1464 of skeleton.m4 */
7714 #line 3523 "parser.y"
7715 { code_t*c = (yyvsp[(3) - (3)].value).c;
7716 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7717 c=abc_subtract_i(c);
7720 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7723 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7724 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7734 /* Line 1464 of skeleton.m4 */
7735 #line 3534 "parser.y"
7737 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7738 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7739 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7740 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7750 /* Line 1464 of skeleton.m4 */
7751 #line 3541 "parser.y"
7753 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7754 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7755 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7756 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7757 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7758 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7759 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7760 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7761 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7762 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7772 /* Line 1464 of skeleton.m4 */
7773 #line 3554 "parser.y"
7775 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7776 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7777 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7778 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7779 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7780 (yyval.value).c = abc_getlocal(0, nr);
7781 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7782 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7783 (yyval.value).c = abc_getlocal(0, nr);
7784 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7785 } else syntaxerror("internal error");
7787 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7788 c=abc_increment_i(c);
7794 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7795 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7796 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7807 /* Line 1464 of skeleton.m4 */
7808 #line 3581 "parser.y"
7810 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7811 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7812 c=abc_decrement_i(c);
7818 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7819 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7820 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7830 /* Line 1464 of skeleton.m4 */
7831 #line 3595 "parser.y"
7833 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7834 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7835 c=abc_increment_i(c);
7841 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7842 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7843 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7853 /* Line 1464 of skeleton.m4 */
7854 #line 3609 "parser.y"
7856 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7857 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7858 c=abc_decrement_i(c);
7864 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7865 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7866 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7876 /* Line 1464 of skeleton.m4 */
7877 #line 3624 "parser.y"
7878 { if(!state->cls->info)
7879 syntaxerror("super keyword not allowed outside a class");
7880 classinfo_t*t = state->cls->info->superclass;
7881 if(!t) t = TYPE_OBJECT;
7883 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7885 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7886 (yyval.value).c = 0;
7887 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7888 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7889 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7899 /* Line 1464 of skeleton.m4 */
7900 #line 3638 "parser.y"
7903 (yyval.value).c = abc_pushundefined(0);
7904 (yyval.value).t = 0;
7905 as3_warning("ignored @ operator");
7915 /* Line 1464 of skeleton.m4 */
7916 #line 3645 "parser.y"
7918 // child attribute TODO
7919 (yyval.value).c = abc_pushundefined(0);
7920 (yyval.value).t = 0;
7921 as3_warning("ignored .@ operator");
7931 /* Line 1464 of skeleton.m4 */
7932 #line 3652 "parser.y"
7934 // namespace declaration TODO
7935 (yyval.value).c = abc_pushundefined(0);
7936 (yyval.value).t = 0;
7937 as3_warning("ignored :: operator");
7947 /* Line 1464 of skeleton.m4 */
7948 #line 3659 "parser.y"
7951 (yyval.value).c = abc_pushundefined(0);
7952 (yyval.value).t = 0;
7953 as3_warning("ignored .. operator");
7963 /* Line 1464 of skeleton.m4 */
7964 #line 3666 "parser.y"
7967 (yyval.value).c = abc_pushundefined(0);
7968 (yyval.value).t = 0;
7969 as3_warning("ignored .() operator");
7979 /* Line 1464 of skeleton.m4 */
7980 #line 3677 "parser.y"
7982 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7983 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7985 if(TYPE_IS_CLASS(t) && t->data) {
7990 if(t->subtype==INFOTYPE_UNRESOLVED) {
7991 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
7993 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7995 if(f && !is_static != !(f->flags&FLAG_STATIC))
7997 if(f && f->slot && !noslot) {
7998 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8000 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8001 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8003 /* determine type */
8004 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8005 if(!(yyval.value).t)
8006 (yyval.value).c = abc_coerce_a((yyval.value).c);
8007 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
8008 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
8009 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8011 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8013 (yyval.value) = push_class(a);
8014 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8015 registry_ispackage(package2)) {
8016 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
8017 (yyval.value).c->data[0] = string_new4(package2);
8018 (yyval.value).t = 0;
8020 syntaxerror("couldn't resolve %s", package2);
8023 /* when resolving a property on an unknown type, we do know the
8024 name of the property (and don't seem to need the package), but
8025 we need to make avm2 try out all access modes */
8026 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8027 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8028 (yyval.value).c = abc_coerce_a((yyval.value).c);
8029 (yyval.value).t = registry_getanytype();
8040 /* Line 1464 of skeleton.m4 */
8041 #line 3729 "parser.y"
8044 /* Queue unresolved identifiers for checking against the parent
8045 function's variables.
8046 We consider everything which is not a local variable "unresolved".
8047 This encompasses class names, members of the surrounding class
8048 etc. which is *correct* because local variables of the parent function
8051 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
8052 unknown_variable((yyvsp[(1) - (1)].id));
8055 /* let the compiler know that it might want to check the current directory/package
8056 for this identifier- maybe there's a file $1.as defining $1. */
8057 //as3_schedule_class_noerror(state->package, $1);
8060 (yyval.value).t = 0;
8061 (yyval.value).c = 0;
8066 /* look at variables */
8067 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
8068 // $1 is a local variable
8069 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
8070 (yyval.value).t = v->type;
8073 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
8074 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
8075 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
8076 (yyval.value).t = v->type;
8080 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
8082 /* look at current class' members */
8083 if(!state->method->inner &&
8085 (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
8086 (f->flags&FLAG_STATIC) >= i_am_static)
8088 // $1 is a function in this class
8089 int var_is_static = (f->flags&FLAG_STATIC);
8091 if(f->kind == INFOTYPE_METHOD) {
8092 (yyval.value).t = TYPE_FUNCTION(f);
8094 (yyval.value).t = f->type;
8096 if(var_is_static && !i_am_static) {
8097 /* access to a static member from a non-static location.
8098 do this via findpropstrict:
8099 there doesn't seem to be any non-lookup way to access
8100 static properties of a class */
8101 state->method->late_binding = 1;
8102 (yyval.value).t = f->type;
8103 namespace_t ns = {f->access, ""};
8104 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8105 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8106 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8108 } else if(f->slot>0) {
8109 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8110 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8113 namespace_t ns = {f->access, ""};
8114 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8115 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8116 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8121 /* look at actual classes, in the current package and imported */
8122 if((a = find_class((yyvsp[(1) - (1)].id)))) {
8123 (yyval.value) = push_class(a);
8127 /* look through package prefixes */
8128 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) ||
8129 registry_ispackage((yyvsp[(1) - (1)].id))) {
8130 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
8131 (yyval.value).t = 0;
8135 /* unknown object, let the avm2 resolve it */
8137 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
8138 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
8139 state->method->late_binding = 1;
8141 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
8143 (yyval.value).t = 0;
8144 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8145 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8156 /* Line 1464 of skeleton.m4 */
8157 #line 3838 "parser.y"
8160 NEW(namespace_decl_t,n);
8161 n->name = (yyvsp[(2) - (2)].id);
8162 n->url = (yyvsp[(2) - (2)].id);
8163 (yyval.namespace_decl)=n;
8173 /* Line 1464 of skeleton.m4 */
8174 #line 3845 "parser.y"
8177 NEW(namespace_decl_t,n);
8178 n->name = (yyvsp[(2) - (4)].id);
8179 n->url = (yyvsp[(4) - (4)].id);
8180 (yyval.namespace_decl)=n;
8190 /* Line 1464 of skeleton.m4 */
8191 #line 3852 "parser.y"
8194 NEW(namespace_decl_t,n);
8195 n->name = (yyvsp[(2) - (4)].id);
8196 n->url = (yyvsp[(4) - (4)].str).str;
8197 (yyval.namespace_decl)=n;
8207 /* Line 1464 of skeleton.m4 */
8208 #line 3859 "parser.y"
8211 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8213 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8214 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8215 var->type = TYPE_NAMESPACE;
8217 ns.access = ACCESS_NAMESPACE;
8218 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8219 var->value = constant_new_namespace(&ns);
8231 /* Line 1464 of skeleton.m4 */
8232 #line 3874 "parser.y"
8235 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8236 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8237 if(!s || s->kind != INFOTYPE_SLOT)
8238 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8239 if(!s->value || !NS_TYPE(s->value->type))
8240 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8241 url = s->value->ns->name;
8243 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8244 add_active_url(url);
8253 /* Line 1464 of skeleton.m4 */
8254 #line 8255 "parser.tab.c"
8257 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8261 YY_STACK_PRINT (yyss, yyssp);
8265 /* Now `shift' the result of the reduction. Determine what state
8266 that goes to, based on the state we popped back to and the rule
8267 number reduced by. */
8271 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8272 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8273 yystate = yytable[yystate];
8275 yystate = yydefgoto[yyn - YYNTOKENS];
8280 /*------------------------------------.
8281 | yyerrlab -- here on detecting error |
8282 `------------------------------------*/
8284 /* If not already recovering from an error, report this error. */
8288 #if ! YYERROR_VERBOSE
8289 yyerror (YY_("syntax error"));
8292 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8293 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8295 YYSIZE_T yyalloc = 2 * yysize;
8296 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8297 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8298 if (yymsg != yymsgbuf)
8299 YYSTACK_FREE (yymsg);
8300 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8302 yymsg_alloc = yyalloc;
8306 yymsg_alloc = sizeof yymsgbuf;
8310 if (0 < yysize && yysize <= yymsg_alloc)
8312 (void) yysyntax_error (yymsg, yystate, yychar);
8317 yyerror (YY_("syntax error"));
8319 goto yyexhaustedlab;
8327 if (yyerrstatus == 3)
8329 /* If just tried and failed to reuse lookahead token after an
8330 error, discard it. */
8332 if (yychar <= YYEOF)
8334 /* Return failure if at end of input. */
8335 if (yychar == YYEOF)
8340 yydestruct ("Error: discarding",
8346 /* Else will try to reuse lookahead token after shifting the error
8351 /*---------------------------------------------------.
8352 | yyerrorlab -- error raised explicitly by YYERROR. |
8353 `---------------------------------------------------*/
8356 /* Pacify compilers like GCC when the user code never invokes
8357 YYERROR and the label yyerrorlab therefore never appears in user
8359 if (/*CONSTCOND*/ 0)
8362 /* Do not reclaim the symbols of the rule which action triggered
8366 YY_STACK_PRINT (yyss, yyssp);
8371 /*-------------------------------------------------------------.
8372 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8373 `-------------------------------------------------------------*/
8375 yyerrstatus = 3; /* Each real token shifted decrements this. */
8379 yyn = yypact[yystate];
8380 if (yyn != YYPACT_NINF)
8383 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8391 /* Pop the current state because it cannot handle the error token. */
8396 yydestruct ("Error: popping",
8397 yystos[yystate], yyvsp);
8400 YY_STACK_PRINT (yyss, yyssp);
8406 /* Shift the error token. */
8407 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8413 /*-------------------------------------.
8414 | yyacceptlab -- YYACCEPT comes here. |
8415 `-------------------------------------*/
8420 /*-----------------------------------.
8421 | yyabortlab -- YYABORT comes here. |
8422 `-----------------------------------*/
8427 #if !defined(yyoverflow) || YYERROR_VERBOSE
8428 /*-------------------------------------------------.
8429 | yyexhaustedlab -- memory exhaustion comes here. |
8430 `-------------------------------------------------*/
8432 yyerror (YY_("memory exhausted"));
8438 if (yychar != YYEMPTY)
8439 yydestruct ("Cleanup: discarding lookahead",
8441 /* Do not reclaim the symbols of the rule which action triggered
8442 this YYABORT or YYACCEPT. */
8444 YY_STACK_PRINT (yyss, yyssp);
8445 while (yyssp != yyss)
8447 yydestruct ("Cleanup: popping",
8448 yystos[*yyssp], yyvsp);
8453 YYSTACK_FREE (yyss);
8456 if (yymsg != yymsgbuf)
8457 YYSTACK_FREE (yymsg);
8459 /* Make sure YYID is used. */
8460 return YYID (yyresult);