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 {
653 methodstate_t*is_inner_method;
656 static variable_t* find_variable(state_t*s, char*name)
660 v = dict_lookup(s->vars, name);
662 if(s->new_vars) break;
667 static variable_t* find_slot(state_t*s, const char*name)
669 if(s->method && s->method->slots)
670 return dict_lookup(s->method->slots, name);
674 static variable_t* find_variable_safe(state_t*s, char*name)
676 variable_t* v = find_variable(s, name);
678 syntaxerror("undefined variable: %s", name);
681 static char variable_exists(char*name)
683 return dict_contains(state->vars, name);
685 code_t*defaultvalue(code_t*c, classinfo_t*type);
687 static int alloc_local()
689 return state->method->variable_count++;
692 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
695 variable_t*v = find_slot(state, name);
701 v->index = alloc_local();
706 dict_put(state->vars, name, v);
710 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
712 return new_variable2(name, type, init, maybeslot)->index;
715 #define TEMPVARNAME "__as3_temp__"
716 static int gettempvar()
718 variable_t*v = find_variable(state, TEMPVARNAME);
721 return new_variable(TEMPVARNAME, 0, 0, 0);
724 code_t* var_block(code_t*body)
730 for(t=0;t<state->vars->hashsize;t++) {
731 dictentry_t*e = state->vars->slots[t];
733 variable_t*v = (variable_t*)e->data;
734 if(v->type && v->init) {
735 c = defaultvalue(c, v->type);
736 c = abc_setlocal(c, v->index);
737 k = abc_kill(k, v->index);
747 if(x->opcode== OPCODE___BREAK__ ||
748 x->opcode== OPCODE___CONTINUE__) {
749 /* link kill code before break/continue */
750 code_t*e = code_dup(k);
751 code_t*s = code_start(e);
763 c = code_append(c, body);
764 c = code_append(c, k);
768 void unknown_variable(char*name)
770 if(!state->method->unresolved_variables)
771 state->method->unresolved_variables = dict_new();
772 if(!dict_contains(state->method->unresolved_variables, name))
773 dict_put(state->method->unresolved_variables, name, 0);
776 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
778 static void parsererror(const char*file, int line, const char*f)
780 syntaxerror("internal error in %s, %s:%d", f, file, line);
784 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
786 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
787 c = abc_getlocal_0(c);
788 c = abc_pushscope(c);
791 /* FIXME: this alloc_local() causes variable indexes to be
792 different in pass2 than in pass1 */
793 if(!m->activation_var)
794 m->activation_var = alloc_local();
796 c = abc_newactivation(c);
798 c = abc_pushscope(c);
799 c = abc_setlocal(c, m->activation_var);
801 c = abc_getlocal(c, m->activation_var);
802 c = abc_pushscope(c);
808 static code_t* method_header(methodstate_t*m)
812 c = add_scope_code(c, m, 1);
814 methodstate_list_t*l = m->innerfunctions;
816 parserassert(l->methodstate->abc);
817 if(m->uses_slots && l->methodstate->is_a_slot) {
818 c = abc_getscopeobject(c, 1);
819 c = abc_newfunction(c, l->methodstate->abc);
821 c = abc_setlocal(c, l->methodstate->var_index);
822 c = abc_setslot(c, l->methodstate->slot_index);
824 c = abc_newfunction(c, l->methodstate->abc);
825 c = abc_setlocal(c, l->methodstate->var_index);
827 free(l->methodstate);l->methodstate=0;
831 c = code_append(c, m->header);
834 if(m->is_constructor && !m->has_super) {
835 // call default constructor
836 c = abc_getlocal_0(c);
837 c = abc_constructsuper(c, 0);
841 /* all parameters that are used by inner functions
842 need to be copied from local to slot */
843 parserassert(m->activation_var);
844 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
845 if(v->is_parameter) {
846 c = abc_getlocal(c, m->activation_var);
847 c = abc_getlocal(c, v->index);
848 c = abc_setslot(c, v->index);
852 list_free(m->innerfunctions);
853 m->innerfunctions = 0;
858 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
860 c = code_append(c, header);
861 c = code_append(c, var_block(body));
862 /* append return if necessary */
863 if(!c || (c->opcode != OPCODE_RETURNVOID &&
864 c->opcode != OPCODE_RETURNVALUE)) {
865 c = abc_returnvoid(c);
871 static void startpackage(char*name)
874 /*printf("entering package \"%s\"\n", name);*/
875 state->package = strdup(name);
877 static void endpackage()
879 /*printf("leaving package \"%s\"\n", state->package);*/
881 //used e.g. in classinfo_register:
882 //free(state->package);state->package=0;
887 #define FLAG_PUBLIC 256
888 #define FLAG_PROTECTED 512
889 #define FLAG_PRIVATE 1024
890 #define FLAG_PACKAGEINTERNAL 2048
891 #define FLAG_NAMESPACE 4096
893 static namespace_t modifiers2access(modifiers_t*mod)
898 if(mod->flags&FLAG_NAMESPACE) {
899 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
900 syntaxerror("invalid combination of access levels and namespaces");
901 ns.access = ACCESS_NAMESPACE;
903 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
905 /* shouldn't happen- the tokenizer only reports something as a namespace
906 if it was already registered */
907 trie_dump(active_namespaces);
908 syntaxerror("unknown namespace: %s", mod->ns);
911 } else if(mod->flags&FLAG_PUBLIC) {
912 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
913 syntaxerror("invalid combination of access levels");
914 ns.access = ACCESS_PACKAGE;
915 } else if(mod->flags&FLAG_PRIVATE) {
916 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
917 syntaxerror("invalid combination of access levels");
918 ns.access = ACCESS_PRIVATE;
919 } else if(mod->flags&FLAG_PROTECTED) {
920 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
921 syntaxerror("invalid combination of access levels");
922 ns.access = ACCESS_PROTECTED;
924 ns.access = ACCESS_PACKAGEINTERNAL;
928 static slotinfo_t* find_class(const char*name);
930 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
932 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
935 void add_active_url(const char*url)
939 list_append(state->active_namespace_urls, n);
942 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
947 index = new_variable("this", 0, 0, 0);
948 else if(!m->is_global)
949 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
951 index = new_variable("globalscope", 0, 0, 0);
954 parserassert(!index);
958 /* as variables and slots share the same number, make sure
959 that those variable indices are reserved. It's up to the
960 optimizer to later shuffle the variables down to lower
962 m->variable_count = m->uses_slots;
967 for(p=params->list;p;p=p->next) {
968 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
973 dict_dump(m->slots, stdout, "");
976 methodstate_list_t*l = m->innerfunctions;
978 methodstate_t*m = l->methodstate;
980 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
981 m->var_index = v->index;
982 m->slot_index = v->index;
983 v->is_inner_method = m;
989 m->scope_code = add_scope_code(m->scope_code, m, 0);
992 if(as3_pass==2 && m->slots) {
993 /* exchange unresolved identifiers with the actual objects */
994 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
995 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
996 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
997 if(!type || type->kind != INFOTYPE_CLASS) {
998 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
1007 char*as3_globalclass=0;
1008 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
1011 syntaxerror("inner classes now allowed");
1016 classinfo_list_t*mlist=0;
1018 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
1019 syntaxerror("invalid modifier(s)");
1021 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
1022 syntaxerror("public and internal not supported at the same time.");
1024 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1025 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
1026 // all classes extend object
1027 extends = registry_getobjectclass();
1030 /* create the class name, together with the proper attributes */
1034 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1035 access = ACCESS_PRIVATE; package = internal_filename_package;
1036 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1037 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1038 } else if(state->package!=internal_filename_package) {
1039 access = ACCESS_PACKAGE; package = state->package;
1041 syntaxerror("public classes only allowed inside a package");
1045 state->cls = rfx_calloc(sizeof(classstate_t));
1046 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1047 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1048 /* notice: we make no effort to initialize the top variable (local0) here,
1049 even though it has special meaning. We just rely on the facat
1050 that pass 1 won't do anything with variables */
1052 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1054 /* set current method to constructor- all code within the class-level (except
1055 static variable initializations) will be executed during construction time */
1056 state->method = state->cls->init;
1058 if(registry_find(package, classname)) {
1059 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1061 /* build info struct */
1062 int num_interfaces = (list_length(implements));
1063 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1064 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1067 classinfo_list_t*l = implements;
1068 for(l=implements;l;l=l->next) {
1069 state->cls->info->interfaces[pos++] = l->classinfo;
1074 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1076 state->method = state->cls->init;
1077 parserassert(state->cls && state->cls->info);
1079 function_initvars(state->cls->init, 0, 0, 1);
1080 function_initvars(state->cls->static_init, 0, 0, 0);
1082 if(extends && (extends->flags & FLAG_FINAL))
1083 syntaxerror("Can't extend final class '%s'", extends->name);
1086 while(state->cls->info->interfaces[pos]) {
1087 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1088 syntaxerror("'%s' is not an interface",
1089 state->cls->info->interfaces[pos]->name);
1093 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
1094 state->cls->info->superclass = extends;
1096 /* generate the abc code for this class */
1097 MULTINAME(classname2,state->cls->info);
1098 multiname_t*extends2 = sig2mname(extends);
1100 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1101 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1102 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1103 if(state->cls->info->flags&FLAG_INTERFACE) {
1104 abc_class_interface(state->cls->abc);
1107 abc_class_protectedNS(state->cls->abc, classname);
1109 for(mlist=implements;mlist;mlist=mlist->next) {
1110 MULTINAME(m, mlist->classinfo);
1111 abc_class_add_interface(state->cls->abc, &m);
1114 /* write the construction code for this class to the global init
1116 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1118 abc_method_body_t*m = global->init->method->body;
1119 __ getglobalscope(m);
1120 classinfo_t*s = extends;
1125 //TODO: take a look at the current scope stack, maybe
1126 // we can re-use something
1131 multiname_t*s2 = sig2mname(s);
1133 multiname_destroy(s2);
1135 __ pushscope(m); count++;
1136 m->code = m->code->prev->prev; // invert
1138 /* continue appending after last op end */
1139 while(m->code && m->code->next) m->code = m->code->next;
1141 /* TODO: if this is one of *our* classes, we can also
1142 do a getglobalscope/getslot <nr> (which references
1143 the init function's slots) */
1145 __ getlex2(m, extends2);
1147 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1148 stack is not the superclass */
1149 __ pushscope(m);count++;
1152 /* notice: we get a verify error #1107 if the top element on the scope
1153 stack is not the global object */
1155 __ pushscope(m);count++;
1157 __ newclass(m,state->cls->abc);
1161 __ setslot(m, slotindex);
1162 multiname_destroy(extends2);
1164 /* flash.display.MovieClip handling */
1166 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1167 if(state->package && state->package[0]) {
1168 as3_globalclass = concat3(state->package, ".", classname);
1170 as3_globalclass = strdup(classname);
1176 static int slotstate_varconst = 0;
1177 static modifiers_t*slotstate_flags = 0;
1178 static void setslotstate(modifiers_t* flags, int varconst)
1180 slotstate_varconst = varconst;
1181 slotstate_flags = flags;
1183 if(flags && flags->flags&FLAG_STATIC) {
1184 state->method = state->cls->static_init;
1186 state->method = state->cls->init;
1189 parserassert(state->method);
1193 static void endclass()
1196 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1198 c = abc_getlocal_0(c);
1199 c = abc_constructsuper(c, 0);
1200 state->cls->init->header = code_append(state->cls->init->header, c);
1201 state->cls->has_constructor=1;
1203 if(state->cls->init) {
1204 if(state->cls->info->flags&FLAG_INTERFACE) {
1205 if(state->cls->init->header)
1206 syntaxerror("interface can not have class-level code");
1208 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1209 code_t*c = method_header(state->cls->init);
1210 m->body->code = wrap_function(c, 0, m->body->code);
1213 if(state->cls->static_init) {
1214 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1215 code_t*c = method_header(state->cls->static_init);
1216 m->body->code = wrap_function(c, 0, m->body->code);
1223 void check_code_for_break(code_t*c)
1226 if(c->opcode == OPCODE___BREAK__) {
1227 char*name = string_cstr(c->data[0]);
1228 syntaxerror("Unresolved \"break %s\"", name);
1230 if(c->opcode == OPCODE___CONTINUE__) {
1231 char*name = string_cstr(c->data[0]);
1232 syntaxerror("Unresolved \"continue %s\"", name);
1234 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1235 char*name = string_cstr(c->data[0]);
1236 syntaxerror("Can't reference a package (%s) as such", name);
1243 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1246 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1247 if(TYPE_IS_NUMBER(t)) {
1248 xassert(c->type == CONSTANT_FLOAT
1249 || c->type == CONSTANT_INT
1250 || c->type == CONSTANT_UINT);
1251 } else if(TYPE_IS_UINT(t)) {
1252 xassert(c->type == CONSTANT_UINT ||
1253 (c->type == CONSTANT_INT && c->i>=0));
1254 } else if(TYPE_IS_INT(t)) {
1255 xassert(c->type == CONSTANT_INT);
1256 } else if(TYPE_IS_BOOLEAN(t)) {
1257 xassert(c->type == CONSTANT_TRUE
1258 || c->type == CONSTANT_FALSE);
1262 static void check_override(memberinfo_t*m, int flags)
1266 if(m->parent == state->cls->info)
1267 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1269 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1270 if(m->access==ACCESS_PRIVATE)
1272 if(m->flags & FLAG_FINAL)
1273 syntaxerror("can't override final member %s", m->name);
1275 /* allow this. it's no issue.
1276 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1277 syntaxerror("can't override static member %s", m->name);*/
1279 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1280 syntaxerror("can't override non-static member %s with static declaration", m->name);
1282 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1283 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1284 if(m->kind == INFOTYPE_METHOD)
1285 syntaxerror("can't override without explicit 'override' declaration");
1287 syntaxerror("can't override '%s'", m->name);
1292 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1294 methodinfo_t*minfo = 0;
1295 namespace_t ns = modifiers2access(mod);
1298 minfo = methodinfo_register_global(ns.access, state->package, name);
1299 minfo->return_type = 0; // save this for pass 2
1300 } else if(getset != KW_GET && getset != KW_SET) {
1302 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1304 printf("%s.%s | %s.%s\n",
1305 m->package, m->name,
1307 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1309 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1310 minfo->return_type = 0; // save this for pass 2
1311 // getslot on a member slot only returns "undefined", so no need
1312 // to actually store these
1313 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1315 //class getter/setter
1316 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1318 if(getset == KW_GET) {
1320 } else if(params->list && params->list->param && !params->list->next) {
1321 type = params->list->param->type;
1323 syntaxerror("setter function needs to take exactly one argument");
1324 // not sure wether to look into superclasses here, too
1325 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1327 if(minfo->kind!=INFOTYPE_SLOT)
1328 syntaxerror("class already contains a method called '%s'", name);
1329 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1330 syntaxerror("class already contains a field called '%s'", name);
1331 if(minfo->subtype & gs)
1332 syntaxerror("getter/setter for '%s' already defined", name);
1333 /* make a setter or getter into a getset */
1334 minfo->subtype |= gs;
1337 FIXME: this check needs to be done in pass 2
1339 if((!minfo->return_type != !type) ||
1340 (minfo->return_type && type &&
1341 !strcmp(minfo->return_type->name, type->name))) {
1342 syntaxerror("different type in getter and setter: %s and %s",
1343 minfo->return_type?minfo->return_type->name:"*",
1344 type?type->name:"*");
1347 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1348 minfo->kind = INFOTYPE_SLOT; //hack
1349 minfo->subtype = gs;
1350 minfo->return_type = 0;
1352 /* can't assign a slot as getter and setter might have different slots */
1353 //minfo->slot = slot;
1355 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1356 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1357 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1362 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1364 //parserassert(state->method && state->method->info);
1366 methodstate_t*parent_method = state->method;
1369 return_type = 0; // not valid in pass 1
1373 state->new_vars = 1;
1376 state->method = rfx_calloc(sizeof(methodstate_t));
1377 state->method->inner = 1;
1378 state->method->variable_count = 0;
1379 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1381 NEW(methodinfo_t,minfo);
1382 minfo->kind = INFOTYPE_METHOD;
1383 minfo->access = ACCESS_PACKAGEINTERNAL;
1385 state->method->info = minfo;
1388 list_append(parent_method->innerfunctions, state->method);
1390 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1392 function_initvars(state->method, params, 0, 1);
1396 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1397 state->method->variable_count = 0;
1398 parserassert(state->method);
1400 state->method->info->return_type = return_type;
1401 function_initvars(state->method, params, 0, 1);
1405 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1406 params_t*params, classinfo_t*return_type)
1408 if(state->method && state->method->info) {
1409 syntaxerror("not able to start another method scope");
1412 state->new_vars = 1;
1415 state->method = rfx_calloc(sizeof(methodstate_t));
1416 state->method->has_super = 0;
1419 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1421 state->method->is_global = 1;
1422 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1424 if(state->method->is_constructor)
1425 name = "__as3_constructor__";
1427 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1429 function_initvars(state->method, params, mod->flags, 1);
1431 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1435 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1436 state->method->variable_count = 0;
1437 parserassert(state->method);
1440 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1441 check_override(m, mod->flags);
1445 state->cls->has_constructor |= state->method->is_constructor;
1448 state->method->info->return_type = return_type;
1449 function_initvars(state->method, params, mod->flags, 1);
1453 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1454 params_t*params, classinfo_t*return_type, code_t*body)
1457 // store inner methods in variables
1458 function_initvars(state->method, 0, 0, 0);
1460 methodstate_list_t*ml = state->method->innerfunctions;
1462 dict_t*xvars = dict_new();
1465 methodstate_t*m = ml->methodstate;
1466 parserassert(m->inner);
1467 if(m->unresolved_variables) {
1468 dict_t*d = m->unresolved_variables;
1470 for(t=0;t<d->hashsize;t++) {
1471 dictentry_t*l = d->slots[t];
1473 /* check parent method's variables */
1475 if((v=find_variable(state, l->key))) {
1476 m->uses_parent_function = 1;
1477 state->method->uses_slots = 1;
1478 dict_put(xvars, l->key, 0);
1485 dict_destroy(m->unresolved_variables);
1486 m->unresolved_variables = 0;
1491 if(state->method->uses_slots) {
1492 state->method->slots = dict_new();
1494 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1495 if(!name) syntaxerror("internal error");
1496 if(v->index && dict_contains(xvars, name)) {
1499 if(v->is_inner_method) {
1500 v->is_inner_method->is_a_slot = 1;
1503 dict_put(state->method->slots, name, v);
1506 state->method->uses_slots = i;
1507 dict_destroy(state->vars);state->vars = 0;
1514 /*if(state->method->uses_parent_function){
1515 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1520 multiname_t*type2 = sig2mname(return_type);
1522 if(state->method->inner) {
1523 f = state->method->abc;
1524 abc_method_init(f, global->file, type2, 1);
1525 } else if(state->method->is_constructor) {
1526 f = abc_class_getconstructor(state->cls->abc, type2);
1527 } else if(!state->method->is_global) {
1528 namespace_t mname_ns = modifiers2access(mod);
1529 multiname_t mname = {QNAME, &mname_ns, 0, name};
1531 if(mod->flags&FLAG_STATIC)
1532 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1534 f = abc_class_method(state->cls->abc, type2, &mname);
1535 slot = f->trait->slot_id;
1537 namespace_t mname_ns = {state->method->info->access, state->package};
1538 multiname_t mname = {QNAME, &mname_ns, 0, name};
1540 f = abc_method_new(global->file, type2, 1);
1541 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1542 //abc_code_t*c = global->init->method->body->code;
1544 //flash doesn't seem to allow us to access function slots
1545 //state->method->info->slot = slot;
1547 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1548 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1549 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1550 if(params->varargs) f->flags |= METHOD_NEED_REST;
1554 for(p=params->list;p;p=p->next) {
1555 if(params->varargs && !p->next) {
1556 break; //varargs: omit last parameter in function signature
1558 multiname_t*m = sig2mname(p->param->type);
1559 list_append(f->parameters, m);
1560 if(p->param->value) {
1561 check_constant_against_type(p->param->type, p->param->value);
1562 opt=1;list_append(f->optional_parameters, p->param->value);
1564 syntaxerror("non-optional parameter not allowed after optional parameters");
1567 if(state->method->slots) {
1568 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1570 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1571 multiname_t*type = sig2mname(v->type);
1572 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1573 t->slot_id = v->index;
1578 check_code_for_break(body);
1580 /* Seems this works now.
1581 if(state->method->exceptions && state->method->uses_slots) {
1582 as3_warning("try/catch and activation not supported yet within the same method");
1586 f->body->code = body;
1587 f->body->exceptions = state->method->exceptions;
1588 } else { //interface
1590 syntaxerror("interface methods can't have a method body");
1600 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1605 void breakjumpsto(code_t*c, char*name, code_t*jump)
1608 if(c->opcode == OPCODE___BREAK__) {
1609 string_t*name2 = c->data[0];
1610 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1611 c->opcode = OPCODE_JUMP;
1618 void continuejumpsto(code_t*c, char*name, code_t*jump)
1621 if(c->opcode == OPCODE___CONTINUE__) {
1622 string_t*name2 = c->data[0];
1623 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1624 c->opcode = OPCODE_JUMP;
1632 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1633 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1634 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1636 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1638 if(!type1 || !type2)
1639 return registry_getanytype();
1640 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1641 return registry_getanytype();
1644 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1653 return registry_getanytype();
1655 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1660 return abc_coerce_a(c);
1664 // cast an "any" type to a specific type. subject to
1665 // runtime exceptions
1666 return abc_coerce2(c, &m);
1669 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1670 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1671 // allow conversion between number types
1672 return abc_coerce2(c, &m);
1674 //printf("%s.%s\n", from.package, from.name);
1675 //printf("%s.%s\n", to.package, to.name);
1677 classinfo_t*supertype = from;
1679 if(supertype == to) {
1680 // target type is one of from's superclasses
1681 return abc_coerce2(c, &m);
1684 while(supertype->interfaces[t]) {
1685 if(supertype->interfaces[t]==to) {
1686 // target type is one of from's interfaces
1687 return abc_coerce2(c, &m);
1691 supertype = supertype->superclass;
1693 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1695 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1697 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1700 as3_error("can't convert type %s%s%s to %s%s%s",
1701 from->package, from->package?".":"", from->name,
1702 to->package, to->package?".":"", to->name);
1706 code_t*defaultvalue(code_t*c, classinfo_t*type)
1708 if(TYPE_IS_INT(type)) {
1709 c = abc_pushbyte(c, 0);
1710 } else if(TYPE_IS_UINT(type)) {
1711 c = abc_pushuint(c, 0);
1712 } else if(TYPE_IS_FLOAT(type)) {
1714 } else if(TYPE_IS_BOOLEAN(type)) {
1715 c = abc_pushfalse(c);
1717 //c = abc_pushundefined(c);
1719 c = abc_pushnull(c);
1721 c = abc_coerce2(c, &m);
1726 char is_pushundefined(code_t*c)
1728 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1731 static const char* get_package_from_name(const char*name)
1733 /* try explicit imports */
1734 dictentry_t* e = dict_get_slot(state->imports, name);
1736 if(!strcmp(e->key, name)) {
1737 slotinfo_t*c = (slotinfo_t*)e->data;
1738 if(c) return c->package;
1744 static namespace_list_t*get_current_imports()
1746 namespace_list_t*searchlist = 0;
1748 list_append(searchlist, namespace_new_package(state->package));
1750 import_list_t*l = state->wildcard_imports;
1752 namespace_t*ns = namespace_new_package(l->import->package);
1753 list_append(searchlist, ns);
1756 list_append(searchlist, namespace_new_package(""));
1757 list_append(searchlist, namespace_new_package(internal_filename_package));
1761 static slotinfo_t* find_class(const char*name)
1765 c = registry_find(state->package, name);
1768 /* try explicit imports */
1769 dictentry_t* e = dict_get_slot(state->imports, name);
1772 if(!strcmp(e->key, name)) {
1773 c = (slotinfo_t*)e->data;
1779 /* try package.* imports */
1780 import_list_t*l = state->wildcard_imports;
1782 //printf("does package %s contain a class %s?\n", l->import->package, name);
1783 c = registry_find(l->import->package, name);
1788 /* try global package */
1789 c = registry_find("", name);
1792 /* try local "filename" package */
1793 c = registry_find(internal_filename_package, name);
1798 typedcode_t push_class(slotinfo_t*a)
1803 if(a->access == ACCESS_PACKAGEINTERNAL &&
1804 strcmp(a->package, state->package) &&
1805 strcmp(a->package, internal_filename_package)
1807 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1808 infotypename(a), a->name, a->package, state->package);
1811 if(a->kind != INFOTYPE_CLASS) {
1813 x.c = abc_findpropstrict2(x.c, &m);
1814 x.c = abc_getproperty2(x.c, &m);
1815 if(a->kind == INFOTYPE_METHOD) {
1816 methodinfo_t*f = (methodinfo_t*)a;
1817 x.t = TYPE_FUNCTION(f);
1819 varinfo_t*v = (varinfo_t*)a;
1823 classinfo_t*c = (classinfo_t*)a;
1825 x.c = abc_getglobalscope(x.c);
1826 x.c = abc_getslot(x.c, c->slot);
1829 x.c = abc_getlex2(x.c, &m);
1831 x.t = TYPE_CLASS(c);
1836 static char is_getlocal(code_t*c)
1838 if(!c || c->prev || c->next)
1840 return(c->opcode == OPCODE_GETLOCAL
1841 || c->opcode == OPCODE_GETLOCAL_0
1842 || c->opcode == OPCODE_GETLOCAL_1
1843 || c->opcode == OPCODE_GETLOCAL_2
1844 || c->opcode == OPCODE_GETLOCAL_3);
1846 static int getlocalnr(code_t*c)
1848 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1849 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1850 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1851 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1852 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1853 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1857 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1861 [prefix code] [read instruction]
1865 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1867 if(in && in->opcode == OPCODE_COERCE_A) {
1868 in = code_cutlast(in);
1871 syntaxerror("internal error");
1873 /* chop off read instruction */
1877 prefix = r->prev;r->prev = 0;
1883 char use_temp_var = readbefore;
1885 /* generate the write instruction, and maybe append a dup to the prefix code */
1886 code_t* write = abc_nop(0);
1887 if(r->opcode == OPCODE_GETPROPERTY) {
1888 write->opcode = OPCODE_SETPROPERTY;
1889 multiname_t*m = (multiname_t*)r->data[0];
1890 write->data[0] = multiname_clone(m);
1891 if(m->type == QNAME || m->type == MULTINAME) {
1893 prefix = abc_dup(prefix); // we need the object, too
1896 } else if(m->type == MULTINAMEL) {
1898 /* dupping two values on the stack requires 5 operations and one register-
1899 couldn't adobe just have given us a dup2? */
1900 int temp = gettempvar();
1901 prefix = abc_setlocal(prefix, temp);
1902 prefix = abc_dup(prefix);
1903 prefix = abc_getlocal(prefix, temp);
1904 prefix = abc_swap(prefix);
1905 prefix = abc_getlocal(prefix, temp);
1907 prefix = abc_kill(prefix, temp);
1911 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1913 } else if(r->opcode == OPCODE_GETSLOT) {
1914 write->opcode = OPCODE_SETSLOT;
1915 write->data[0] = r->data[0];
1917 prefix = abc_dup(prefix); // we need the object, too
1920 } else if(r->opcode == OPCODE_GETLOCAL) {
1921 write->opcode = OPCODE_SETLOCAL;
1922 write->data[0] = r->data[0];
1923 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1924 write->opcode = OPCODE_SETLOCAL_0;
1925 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1926 write->opcode = OPCODE_SETLOCAL_1;
1927 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1928 write->opcode = OPCODE_SETLOCAL_2;
1929 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1930 write->opcode = OPCODE_SETLOCAL_3;
1931 } else if(r->opcode == OPCODE_GETSUPER) {
1932 write->opcode = OPCODE_SETSUPER;
1933 multiname_t*m = (multiname_t*)r->data[0];
1934 write->data[0] = multiname_clone(m);
1937 syntaxerror("illegal lvalue: can't assign a value to this expression");
1944 /* with getproperty/getslot, we have to be extra careful not
1945 to execute the read code twice, as it might have side-effects
1946 (e.g. if the property is in fact a setter/getter combination)
1948 So read the value, modify it, and write it again,
1949 using prefix only once and making sure (by using a temporary
1950 register) that the return value is what we just wrote */
1951 temp = gettempvar();
1952 c = code_append(c, prefix);
1953 c = code_append(c, r);
1956 c = abc_setlocal(c, temp);
1958 c = code_append(c, middlepart);
1961 c = abc_setlocal(c, temp);
1963 c = code_append(c, write);
1964 c = abc_getlocal(c, temp);
1965 c = abc_kill(c, temp);
1967 /* if we're allowed to execute the read code twice *and*
1968 the middlepart doesn't modify the code, things are easier.
1970 code_t* r2 = code_dup(r);
1971 //c = code_append(c, prefix);
1972 parserassert(!prefix);
1973 c = code_append(c, r);
1974 c = code_append(c, middlepart);
1975 c = code_append(c, write);
1976 c = code_append(c, r2);
1979 /* even smaller version: overwrite the value without reading
1983 c = code_append(c, prefix);
1986 c = code_append(c, middlepart);
1987 c = code_append(c, write);
1988 c = code_append(c, r);
1991 temp = gettempvar();
1993 c = code_append(c, prefix);
1995 c = code_append(c, middlepart);
1997 c = abc_setlocal(c, temp);
1998 c = code_append(c, write);
1999 c = abc_getlocal(c, temp);
2000 c = abc_kill(c, temp);
2006 char is_break_or_jump(code_t*c)
2010 if(c->opcode == OPCODE_JUMP ||
2011 c->opcode == OPCODE___BREAK__ ||
2012 c->opcode == OPCODE___CONTINUE__ ||
2013 c->opcode == OPCODE_THROW ||
2014 c->opcode == OPCODE_RETURNVOID ||
2015 c->opcode == OPCODE_RETURNVALUE) {
2021 #define IS_FINALLY_TARGET(op) \
2022 ((op) == OPCODE___CONTINUE__ || \
2023 (op) == OPCODE___BREAK__ || \
2024 (op) == OPCODE_RETURNVOID || \
2025 (op) == OPCODE_RETURNVALUE || \
2026 (op) == OPCODE___RETHROW__)
2028 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
2030 #define NEED_EXTRA_STACK_ARG
2031 code_t*finally_label = abc_nop(0);
2032 NEW(lookupswitch_t, l);
2038 code_t*prev = i->prev;
2039 if(IS_FINALLY_TARGET(i->opcode)) {
2042 if(i->opcode == OPCODE___RETHROW__ ||
2043 i->opcode == OPCODE_RETURNVALUE) {
2044 if(i->opcode == OPCODE___RETHROW__)
2045 i->opcode = OPCODE_THROW;
2047 p = abc_coerce_a(p);
2048 p = abc_setlocal(p, tempvar);
2050 p = abc_pushbyte(p, count++);
2051 p = abc_jump(p, finally_label);
2052 code_t*target = p = abc_label(p);
2053 #ifdef NEED_EXTRA_STACK_ARG
2057 p = abc_getlocal(p, tempvar);
2060 p->next = i;i->prev = p;
2061 list_append(l->targets, target);
2067 c = abc_pushbyte(c, -1);
2068 c = code_append(c, finally_label);
2069 c = code_append(c, finally);
2071 #ifdef NEED_EXTRA_STACK_ARG
2074 c = abc_lookupswitch(c, l);
2075 c = l->def = abc_label(c);
2076 #ifdef NEED_EXTRA_STACK_ARG
2083 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
2087 code_t*prev = i->prev;
2088 if(IS_FINALLY_TARGET(i->opcode)) {
2089 if(i->opcode == OPCODE___RETHROW__)
2090 i->opcode = OPCODE_THROW;
2091 code_t*end = code_dup(finally);
2092 code_t*start = code_start(end);
2093 if(prev) prev->next = start;
2100 return code_append(c, finally);
2103 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
2109 int num_insertion_points=0;
2111 if(IS_FINALLY_TARGET(i->opcode))
2112 num_insertion_points++;
2119 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2124 int simple_version_cost = (1+num_insertion_points)*code_size;
2125 int lookup_version_cost = 4*num_insertion_points + 5;
2127 if(cantdup || simple_version_cost > lookup_version_cost) {
2128 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
2129 return insert_finally_lookup(c, finally, tempvar);
2131 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
2132 return insert_finally_simple(c, finally, tempvar);
2136 #define PASS1 }} if(as3_pass == 1) {{
2137 #define PASS1END }} if(as3_pass == 2) {{
2138 #define PASS2 }} if(as3_pass == 2) {{
2139 #define PASS12 }} {{
2140 #define PASS12END }} if(as3_pass == 2) {{
2144 /* Line 273 of skeleton.m4 */
2145 #line 2146 "parser.tab.c"
2152 typedef YYTYPE_UINT8 yytype_uint8;
2154 typedef unsigned char yytype_uint8;
2158 typedef YYTYPE_INT8 yytype_int8;
2159 #elif (defined __STDC__ || defined __C99__FUNC__ \
2160 || defined __cplusplus || defined _MSC_VER)
2161 typedef signed char yytype_int8;
2163 typedef short int yytype_int8;
2166 #ifdef YYTYPE_UINT16
2167 typedef YYTYPE_UINT16 yytype_uint16;
2169 typedef unsigned short int yytype_uint16;
2173 typedef YYTYPE_INT16 yytype_int16;
2175 typedef short int yytype_int16;
2179 # ifdef __SIZE_TYPE__
2180 # define YYSIZE_T __SIZE_TYPE__
2181 # elif defined size_t
2182 # define YYSIZE_T size_t
2183 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2184 || defined __cplusplus || defined _MSC_VER)
2185 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2186 # define YYSIZE_T size_t
2188 # define YYSIZE_T unsigned int
2192 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2197 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2198 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2202 # define YY_(msgid) msgid
2206 /* Suppress unused-variable warnings by "using" E. */
2207 #if ! defined lint || defined __GNUC__
2208 # define YYUSE(e) ((void) (e))
2210 # define YYUSE(e) /* empty */
2213 /* Identity function, used to suppress warnings about constant conditions. */
2215 # define YYID(n) (n)
2217 #if (defined __STDC__ || defined __C99__FUNC__ \
2218 || defined __cplusplus || defined _MSC_VER)
2231 #if ! defined yyoverflow || YYERROR_VERBOSE
2233 /* The parser invokes alloca or malloc; define the necessary symbols. */
2235 # ifdef YYSTACK_USE_ALLOCA
2236 # if YYSTACK_USE_ALLOCA
2238 # define YYSTACK_ALLOC __builtin_alloca
2239 # elif defined __BUILTIN_VA_ARG_INCR
2240 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2242 # define YYSTACK_ALLOC __alloca
2243 # elif defined _MSC_VER
2244 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2245 # define alloca _alloca
2247 # define YYSTACK_ALLOC alloca
2248 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2249 || defined __cplusplus || defined _MSC_VER)
2250 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2252 # define _STDLIB_H 1
2259 # ifdef YYSTACK_ALLOC
2260 /* Pacify GCC's `empty if-body' warning. */
2261 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2262 # ifndef YYSTACK_ALLOC_MAXIMUM
2263 /* The OS might guarantee only one guard page at the bottom of the stack,
2264 and a page size can be as small as 4096 bytes. So we cannot safely
2265 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2266 to allow for a few compiler-allocated temporary stack slots. */
2267 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2270 # define YYSTACK_ALLOC YYMALLOC
2271 # define YYSTACK_FREE YYFREE
2272 # ifndef YYSTACK_ALLOC_MAXIMUM
2273 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2275 # if (defined __cplusplus && ! defined _STDLIB_H \
2276 && ! ((defined YYMALLOC || defined malloc) \
2277 && (defined YYFREE || defined free)))
2278 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2280 # define _STDLIB_H 1
2284 # define YYMALLOC malloc
2285 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2286 || defined __cplusplus || defined _MSC_VER)
2287 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2291 # define YYFREE free
2292 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2293 || defined __cplusplus || defined _MSC_VER)
2294 void free (void *); /* INFRINGES ON USER NAME SPACE */
2298 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2301 #if (! defined yyoverflow \
2302 && (! defined __cplusplus \
2303 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2305 /* A type that is properly aligned for any stack member. */
2308 yytype_int16 yyss_alloc;
2312 /* The size of the maximum gap between one aligned stack and the next. */
2313 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2315 /* The size of an array large to enough to hold all stacks, each with
2317 # define YYSTACK_BYTES(N) \
2318 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2319 + YYSTACK_GAP_MAXIMUM)
2321 /* Copy COUNT objects from FROM to TO. The source and destination do
2324 # if defined __GNUC__ && 1 < __GNUC__
2325 # define YYCOPY(To, From, Count) \
2326 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2328 # define YYCOPY(To, From, Count) \
2332 for (yyi = 0; yyi < (Count); yyi++) \
2333 (To)[yyi] = (From)[yyi]; \
2339 /* Relocate STACK from its old location to the new one. The
2340 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2341 elements in the stack, and YYPTR gives the new location of the
2342 stack. Advance YYPTR to a properly aligned location for the next
2344 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2347 YYSIZE_T yynewbytes; \
2348 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2349 Stack = &yyptr->Stack_alloc; \
2350 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2351 yyptr += yynewbytes / sizeof (*yyptr); \
2357 /* YYFINAL -- State number of the termination state. */
2359 /* YYLAST -- Last index in YYTABLE. */
2362 /* YYNTOKENS -- Number of terminals. */
2363 #define YYNTOKENS 134
2364 /* YYNNTS -- Number of nonterminals. */
2366 /* YYNRULES -- Number of rules. */
2367 #define YYNRULES 309
2368 /* YYNRULES -- Number of states. */
2369 #define YYNSTATES 521
2371 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2372 #define YYUNDEFTOK 2
2373 #define YYMAXUTOK 363
2375 #define YYTRANSLATE(YYX) \
2376 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2378 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2379 static const yytype_uint8 yytranslate[] =
2381 0, 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, 118, 2, 2, 2, 116, 108, 2,
2385 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2386 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2387 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2388 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2389 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2390 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2391 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2392 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2393 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2394 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2395 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2396 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2397 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2398 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2399 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2400 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2401 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2402 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2403 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2404 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2405 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2406 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2407 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2408 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2409 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2410 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2411 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2412 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2413 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2414 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2415 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2416 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2421 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2423 static const yytype_uint16 yyprhs[] =
2425 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2426 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2427 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2428 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2429 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2430 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2431 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2432 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2433 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2434 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2435 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2436 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2437 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2438 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2439 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2440 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2441 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2442 468, 470, 472, 474, 476, 478, 480, 482, 484, 485,
2443 487, 490, 495, 499, 501, 506, 509, 511, 513, 514,
2444 515, 528, 530, 531, 532, 543, 545, 549, 551, 553,
2445 555, 559, 561, 563, 565, 568, 569, 570, 574, 575,
2446 577, 579, 581, 584, 587, 588, 593, 598, 603, 606,
2447 608, 611, 613, 615, 619, 621, 623, 625, 627, 629,
2448 631, 633, 635, 637, 639, 641, 643, 645, 647, 649,
2449 651, 653, 655, 659, 663, 667, 671, 675, 679, 683,
2450 687, 691, 695, 698, 701, 705, 709, 713, 717, 721,
2451 725, 729, 733, 737, 741, 745, 749, 753, 757, 761,
2452 766, 769, 771, 775, 778, 783, 787, 788, 790, 794,
2453 800, 804, 808, 812, 816, 820, 824, 828, 832, 836,
2454 840, 844, 848, 854, 857, 860, 863, 866, 870, 873,
2455 878, 884, 888, 894, 898, 900, 903, 908, 913, 916
2458 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2459 static const yytype_int16 yyrhs[] =
2461 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2462 137, 138, -1, 186, -1, 198, -1, 196, -1, 217,
2463 -1, 207, -1, 147, -1, 148, 126, 136, 132, -1,
2464 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2465 198, -1, 196, -1, 217, -1, 207, -1, 147, -1,
2466 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2467 143, 145, -1, 145, -1, 189, -1, 159, -1, 160,
2468 -1, 161, -1, 163, -1, 171, -1, 154, -1, 183,
2469 -1, 179, -1, 239, -1, 247, -1, 246, -1, 126,
2470 143, 132, -1, 126, 132, -1, 99, -1, 144, -1,
2471 150, -1, 165, -1, 166, -1, 236, -1, 181, -1,
2472 148, 126, 143, 132, -1, 145, 99, -1, 145, -1,
2473 144, -1, 3, 89, 3, -1, 102, 237, -1, -1,
2474 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2475 152, -1, 3, 227, 149, -1, -1, 65, 146, -1,
2476 -1, 64, 122, 155, 238, 133, 146, 153, -1, -1,
2477 150, -1, 239, -1, 46, 3, 227, -1, 3, -1,
2478 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2479 238, 99, 239, 133, 146, -1, 158, 157, 68, 238,
2480 133, 146, -1, -1, 14, 122, 162, 238, 133, 146,
2481 -1, -1, 15, 164, 146, 14, 122, 238, 133, -1,
2482 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2483 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2484 168, 169, -1, 34, 240, 105, 142, -1, 62, 105,
2485 142, -1, -1, 16, 122, 172, 240, 133, 126, 167,
2486 132, -1, -1, 33, 122, 3, 227, 133, 174, 126,
2487 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2488 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2489 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2490 37, 238, -1, 37, -1, 39, 122, 238, 133, -1,
2491 182, 146, -1, 3, -1, 19, -1, 4, -1, 185,
2492 127, 184, -1, 184, -1, -1, 19, 185, 126, 187,
2493 139, 132, -1, -1, 19, 126, 188, 139, 132, -1,
2494 41, 223, -1, 41, 185, 127, 115, -1, -1, 191,
2495 -1, 192, -1, 191, 192, -1, 21, -1, 22, -1,
2496 20, -1, 38, -1, 47, -1, 49, -1, 48, -1,
2497 26, -1, 24, -1, 4, -1, -1, 54, 224, -1,
2498 -1, 54, 225, -1, -1, 17, 225, -1, -1, 190,
2499 31, 3, 193, 195, 126, 197, 200, 132, -1, -1,
2500 190, 44, 3, 194, 126, 199, 203, 132, -1, -1,
2501 201, -1, 202, -1, 201, 202, -1, 99, -1, 148,
2502 126, 200, 132, -1, 207, -1, 217, -1, 144, -1,
2503 -1, 204, -1, 205, -1, 204, 205, -1, 99, -1,
2504 46, 3, -1, 190, 27, 216, 3, 122, 213, 133,
2505 227, -1, 46, -1, 32, -1, -1, 190, 206, 208,
2506 209, -1, 210, -1, 209, 100, 210, -1, 3, 227,
2507 149, -1, -1, 102, 212, -1, 10, -1, 8, -1,
2508 9, -1, 12, -1, 5, -1, 56, -1, 55, -1,
2509 45, -1, 3, -1, -1, 214, -1, 93, 215, -1,
2510 214, 100, 93, 215, -1, 214, 100, 215, -1, 215,
2511 -1, 3, 105, 226, 211, -1, 3, 211, -1, 51,
2512 -1, 35, -1, -1, -1, 190, 27, 216, 3, 122,
2513 213, 133, 227, 126, 218, 142, 132, -1, 3, -1,
2514 -1, -1, 27, 219, 122, 213, 133, 227, 126, 221,
2515 142, 132, -1, 184, -1, 185, 127, 184, -1, 223,
2516 -1, 222, -1, 224, -1, 225, 100, 224, -1, 224,
2517 -1, 115, -1, 36, -1, 105, 226, -1, -1, -1,
2518 122, 229, 133, -1, -1, 230, -1, 231, -1, 237,
2519 -1, 230, 100, -1, 231, 237, -1, -1, 25, 240,
2520 232, 228, -1, 240, 122, 229, 133, -1, 53, 122,
2521 229, 133, -1, 63, 240, -1, 42, -1, 42, 238,
2522 -1, 240, -1, 240, -1, 238, 100, 240, -1, 238,
2523 -1, 220, -1, 241, -1, 244, -1, 233, -1, 235,
2524 -1, 234, -1, 6, -1, 10, -1, 11, -1, 8,
2525 -1, 9, -1, 12, -1, 5, -1, 29, -1, 56,
2526 -1, 55, -1, 45, -1, 240, 109, 240, -1, 240,
2527 110, 240, -1, 240, 75, 240, -1, 240, 76, 240,
2528 -1, 240, 71, 240, -1, 240, 72, 240, -1, 240,
2529 74, 240, -1, 240, 73, 240, -1, 240, 87, 240,
2530 -1, 240, 88, 240, -1, 118, 240, -1, 117, 240,
2531 -1, 240, 108, 240, -1, 240, 107, 240, -1, 240,
2532 106, 240, -1, 240, 96, 240, -1, 240, 95, 240,
2533 -1, 240, 94, 240, -1, 240, 114, 240, -1, 240,
2534 116, 240, -1, 240, 113, 240, -1, 240, 112, 240,
2535 -1, 240, 115, 240, -1, 240, 68, 240, -1, 240,
2536 69, 240, -1, 240, 40, 240, -1, 240, 67, 240,
2537 -1, 43, 122, 240, 133, -1, 36, 240, -1, 36,
2538 -1, 122, 238, 133, -1, 112, 240, -1, 240, 124,
2539 240, 125, -1, 124, 229, 125, -1, -1, 243, -1,
2540 237, 105, 237, -1, 243, 100, 237, 105, 237, -1,
2541 70, 242, 132, -1, 240, 80, 240, -1, 240, 79,
2542 240, -1, 240, 85, 240, -1, 240, 84, 240, -1,
2543 240, 86, 240, -1, 240, 78, 240, -1, 240, 77,
2544 240, -1, 240, 83, 240, -1, 240, 81, 240, -1,
2545 240, 82, 240, -1, 240, 102, 240, -1, 240, 104,
2546 240, 105, 240, -1, 240, 91, -1, 240, 90, -1,
2547 91, 240, -1, 90, 240, -1, 53, 127, 3, -1,
2548 128, 3, -1, 240, 127, 128, 3, -1, 240, 127,
2549 3, 89, 3, -1, 240, 92, 3, -1, 240, 127,
2550 122, 240, 133, -1, 240, 127, 3, -1, 3, -1,
2551 18, 3, -1, 18, 3, 102, 3, -1, 18, 3,
2552 102, 5, -1, 190, 245, -1, 23, 18, 224, -1
2555 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2556 static const yytype_uint16 yyrline[] =
2558 0, 2124, 2124, 2126, 2126, 2127, 2128, 2130, 2131, 2132,
2559 2133, 2134, 2135, 2136, 2137, 2139, 2139, 2140, 2141, 2143,
2560 2144, 2145, 2146, 2147, 2148, 2149, 2151, 2152, 2154, 2155,
2561 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167,
2562 2168, 2169, 2170, 2171, 2174, 2175, 2176, 2177, 2178, 2179,
2563 2180, 2181, 2185, 2186, 2190, 2197, 2201, 2202, 2206, 2207,
2564 2209, 2210, 2212, 2273, 2274, 2277, 2277, 2296, 2297, 2298,
2565 2303, 2307, 2312, 2313, 2315, 2335, 2383, 2383, 2402, 2402,
2566 2417, 2420, 2423, 2426, 2430, 2431, 2432, 2433, 2434, 2435,
2567 2437, 2448, 2451, 2451, 2482, 2482, 2507, 2507, 2523, 2524,
2568 2525, 2526, 2534, 2543, 2543, 2592, 2596, 2607, 2617, 2634,
2569 2635, 2636, 2638, 2639, 2641, 2641, 2643, 2643, 2646, 2660,
2570 2676, 2677, 2678, 2679, 2686, 2687, 2688, 2689, 2690, 2691,
2571 2692, 2693, 2694, 2695, 2699, 2700, 2702, 2703, 2705, 2706,
2572 2710, 2708, 2716, 2714, 2723, 2724, 2725, 2726, 2727, 2728,
2573 2729, 2730, 2732, 2738, 2739, 2740, 2741, 2742, 2743, 2746,
2574 2759, 2759, 2761, 2761, 2763, 2764, 2766, 2841, 2842, 2844,
2575 2845, 2846, 2847, 2848, 2850, 2851, 2852, 2853, 2865, 2869,
2576 2875, 2881, 2889, 2894, 2900, 2908, 2916, 2917, 2918, 2921,
2577 2920, 2937, 2938, 2940, 2939, 2963, 2982, 2996, 2997, 2999,
2578 3000, 3002, 3003, 3004, 3013, 3014, 3018, 3019, 3021, 3022,
2579 3023, 3025, 3029, 3030, 3035, 3036, 3072, 3118, 3139, 3160,
2580 3163, 3170, 3171, 3172, 3178, 3184, 3186, 3188, 3190, 3192,
2581 3194, 3196, 3213, 3218, 3221, 3224, 3227, 3230, 3233, 3236,
2582 3239, 3242, 3246, 3249, 3252, 3255, 3258, 3261, 3264, 3267,
2583 3271, 3282, 3300, 3305, 3310, 3315, 3320, 3325, 3329, 3333,
2584 3338, 3342, 3346, 3355, 3364, 3374, 3379, 3391, 3397, 3402,
2585 3408, 3414, 3418, 3420, 3431, 3440, 3447, 3448, 3450, 3456,
2586 3465, 3472, 3484, 3490, 3496, 3502, 3508, 3514, 3520, 3526,
2587 3539, 3550, 3557, 3570, 3597, 3611, 3625, 3639, 3654, 3661,
2588 3668, 3675, 3682, 3693, 3745, 3854, 3861, 3868, 3875, 3890
2592 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2593 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2594 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2595 static const char *const yytname[] =
2597 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2598 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2599 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2600 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2601 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2602 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2603 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2604 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2605 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2606 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2607 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2608 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2609 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2610 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2611 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2612 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2613 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2614 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2615 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2616 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2617 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2618 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2619 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2620 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2621 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2622 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2623 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2624 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2625 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2626 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2627 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2628 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2629 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH_HEAD",
2630 "WITH", "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9",
2631 "IMPORT", "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2632 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2633 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2634 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2635 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2636 "ONE_SLOT", "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2637 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2638 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2639 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2640 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2641 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2642 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2643 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2644 "NAMESPACE_ID", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2649 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2651 static const yytype_uint16 yytoknum[] =
2653 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2654 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2655 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2656 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2657 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2658 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2659 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2660 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2661 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2662 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2663 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2664 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2665 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2670 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2671 static const yytype_uint8 yyr1[] =
2673 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2674 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2675 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2676 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2677 144, 144, 144, 144, 145, 145, 145, 145, 145, 145,
2678 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2679 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2680 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2681 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2682 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2683 178, 178, 178, 180, 179, 181, 181, 182, 183, 184,
2684 184, 184, 185, 185, 187, 186, 188, 186, 189, 189,
2685 190, 190, 191, 191, 192, 192, 192, 192, 192, 192,
2686 192, 192, 192, 192, 193, 193, 194, 194, 195, 195,
2687 197, 196, 199, 198, 200, 200, 201, 201, 202, 202,
2688 202, 202, 202, 203, 203, 204, 204, 205, 205, 205,
2689 206, 206, 208, 207, 209, 209, 210, 211, 211, 212,
2690 212, 212, 212, 212, 212, 212, 212, 212, 213, 213,
2691 213, 213, 214, 214, 215, 215, 216, 216, 216, 218,
2692 217, 219, 219, 221, 220, 222, 223, 224, 224, 225,
2693 225, 226, 226, 226, 227, 227, 228, 228, 229, 229,
2694 229, 230, 231, 230, 232, 233, 234, 234, 235, 236,
2695 236, 237, 238, 238, 239, 240, 240, 240, 240, 240,
2696 240, 240, 241, 241, 241, 241, 241, 241, 241, 241,
2697 241, 241, 240, 240, 240, 240, 240, 240, 240, 240,
2698 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2699 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2700 240, 240, 240, 240, 240, 240, 242, 242, 243, 243,
2701 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2702 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2703 240, 240, 240, 240, 244, 245, 245, 245, 246, 247
2706 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2707 static const yytype_uint8 yyr2[] =
2709 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2710 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2711 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2712 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2713 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2714 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2715 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2716 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2717 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2718 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2719 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2720 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2721 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2722 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2723 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2724 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2725 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2726 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
2727 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2728 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2729 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2730 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2731 2, 1, 1, 3, 1, 1, 1, 1, 1, 1,
2732 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2733 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
2734 3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
2735 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
2736 2, 1, 3, 2, 4, 3, 0, 1, 3, 5,
2737 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2738 3, 3, 5, 2, 2, 2, 2, 3, 2, 4,
2739 5, 3, 5, 3, 1, 2, 4, 4, 2, 3
2742 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2743 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2744 means the default is an error. */
2745 static const yytype_uint16 yydefact[] =
2747 120, 304, 133, 237, 231, 234, 235, 232, 233, 236,
2748 0, 0, 78, 0, 0, 126, 124, 125, 0, 132,
2749 0, 131, 192, 238, 271, 127, 0, 0, 0, 241,
2750 128, 130, 129, 0, 0, 240, 239, 0, 0, 276,
2751 0, 0, 14, 0, 0, 0, 0, 208, 120, 0,
2752 0, 2, 120, 5, 54, 12, 0, 36, 67, 31,
2753 32, 33, 34, 35, 38, 120, 37, 7, 30, 0,
2754 121, 122, 9, 8, 11, 10, 225, 228, 230, 229,
2755 224, 39, 222, 226, 227, 41, 40, 0, 0, 72,
2756 76, 120, 92, 109, 111, 110, 116, 113, 0, 0,
2757 304, 214, 191, 0, 270, 0, 0, 118, 0, 103,
2758 208, 0, 218, 65, 0, 221, 0, 277, 296, 295,
2759 273, 253, 252, 0, 0, 209, 210, 211, 82, 0,
2760 106, 219, 0, 80, 44, 43, 120, 45, 29, 0,
2761 46, 47, 48, 50, 0, 49, 298, 1, 6, 120,
2762 304, 0, 68, 0, 0, 69, 53, 108, 0, 188,
2763 0, 161, 0, 160, 162, 308, 123, 0, 0, 0,
2764 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2766 294, 293, 0, 0, 0, 0, 0, 0, 0, 0,
2767 0, 0, 0, 0, 0, 0, 0, 0, 208, 0,
2768 0, 55, 73, 0, 0, 0, 120, 114, 0, 195,
2769 0, 198, 197, 309, 206, 178, 0, 0, 0, 27,
2770 0, 297, 0, 0, 280, 0, 272, 275, 212, 213,
2771 83, 205, 59, 60, 105, 220, 58, 81, 42, 28,
2772 120, 0, 205, 0, 0, 52, 305, 187, 186, 0,
2773 134, 136, 0, 223, 267, 268, 265, 266, 246, 247,
2774 249, 248, 244, 245, 287, 286, 282, 281, 289, 290,
2775 288, 284, 283, 285, 250, 251, 301, 259, 258, 257,
2776 291, 0, 256, 255, 254, 242, 243, 263, 262, 260,
2777 264, 261, 0, 0, 303, 0, 0, 0, 0, 0,
2778 25, 0, 120, 17, 23, 0, 20, 19, 22, 21,
2779 120, 112, 0, 208, 215, 167, 0, 0, 179, 183,
2780 107, 119, 196, 269, 0, 26, 217, 0, 278, 0,
2781 0, 57, 0, 120, 13, 57, 0, 0, 0, 0,
2782 0, 138, 0, 0, 205, 163, 164, 0, 216, 274,
2783 0, 0, 299, 120, 0, 0, 117, 18, 120, 0,
2784 0, 0, 0, 185, 180, 205, 0, 0, 120, 0,
2785 203, 202, 201, 204, 0, 62, 61, 51, 0, 120,
2786 306, 307, 178, 135, 0, 0, 199, 137, 142, 57,
2787 0, 292, 300, 302, 77, 0, 84, 0, 115, 207,
2788 177, 173, 170, 171, 169, 172, 176, 175, 174, 168,
2789 167, 0, 0, 182, 0, 0, 98, 102, 100, 104,
2790 63, 279, 56, 0, 75, 0, 139, 140, 0, 120,
2791 166, 165, 79, 0, 0, 0, 85, 88, 86, 24,
2792 184, 193, 181, 96, 0, 99, 101, 120, 66, 120,
2793 205, 120, 200, 0, 157, 0, 0, 120, 155, 0,
2794 27, 93, 89, 87, 27, 27, 205, 64, 74, 0,
2795 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2796 188, 143, 156, 27, 91, 0, 0, 0, 189, 120,
2797 141, 147, 0, 90, 194, 97, 94, 27, 0, 0,
2798 0, 0, 149, 178, 27, 190, 0, 0, 205, 95,
2802 /* YYDEFGOTO[NTERM-NUM]. */
2803 static const yytype_int16 yydefgoto[] =
2805 -1, 50, 51, 52, 53, 311, 312, 313, 334, 335,
2806 137, 138, 157, 314, 139, 385, 140, 246, 243, 458,
2807 57, 232, 153, 154, 58, 59, 60, 61, 213, 62,
2808 91, 141, 142, 445, 446, 447, 448, 63, 215, 426,
2809 510, 427, 475, 428, 429, 64, 229, 143, 65, 66,
2810 219, 220, 67, 320, 216, 68, 144, 70, 71, 351,
2811 353, 395, 316, 461, 317, 439, 484, 485, 486, 466,
2812 467, 468, 164, 318, 262, 355, 356, 373, 419, 327,
2813 328, 329, 259, 319, 507, 103, 76, 474, 221, 222,
2814 382, 397, 383, 341, 324, 124, 125, 126, 224, 77,
2815 78, 79, 145, 127, 80, 81, 82, 83, 116, 117,
2819 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2821 #define YYPACT_NINF -403
2822 static const yytype_int16 yypact[] =
2824 1674, -70, -403, -403, -403, -403, -403, -403, -403, -403,
2825 -15, -72, -403, -52, 19, -403, -403, -403, 80, -403,
2826 2094, -403, 99, -403, 2164, -403, -16, 42, -5, -403,
2827 -403, -403, -403, -1, 5, -403, -403, 2094, 13, 2094,
2828 2094, 2094, -403, 2094, 2094, 2094, 2094, 2094, 634, 123,
2829 128, -403, 504, -403, -403, -403, 8, -403, 2024, -403,
2830 -403, -403, -403, -403, -403, 1926, -403, -403, -403, 240,
2831 361, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2832 38, -403, 2569, -403, -403, -403, -403, 137, 20, -403,
2833 -403, 1926, -403, -403, -403, -403, -403, -403, -87, 42,
2834 -403, -67, -403, 21, -48, 2094, 79, -403, 2094, -403,
2835 2094, 138, -48, -403, 43, 2569, 76, 107, -48, -48,
2836 604, -48, -48, -29, 84, 110, 2094, -403, 210, 211,
2837 2094, 2094, 211, 212, -403, -403, 764, -403, -403, 85,
2838 -403, -403, -403, -403, 209, -403, -403, -403, -403, 1024,
2839 158, 232, -403, 139, 171, -403, 141, -403, 238, 12,
2840 239, -403, 247, -403, -403, -403, -403, 2094, 2094, 2094,
2841 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2842 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2843 -403, -403, 249, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2844 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2845 11, -403, -403, 2094, 229, 2094, 1154, -403, 42, 133,
2846 135, -403, -403, -403, 142, 15, -10, 90, 2189, 1800,
2847 130, -403, 2094, 2094, -403, 2094, -403, -403, -403, -403,
2848 -403, 161, 169, -403, 38, 38, 169, -403, -403, -403,
2849 1926, 149, 161, 2094, 2094, -403, 168, -403, -403, 280,
2850 231, 233, 286, 2569, 1016, 496, 496, 496, 322, 322,
2851 322, 322, 1016, 1016, 2569, 2569, 2569, 2569, 2569, 2569,
2852 2569, 2569, 2569, 2569, 2630, 2691, -403, 368, 368, 368,
2853 2569, 2386, 2752, 2813, 2874, 1016, 1016, 604, 604, -48,
2854 -48, -48, 157, 2447, 202, 2094, 291, 14, 173, 2260,
2855 -403, 165, 1284, -403, -403, 172, -403, -403, -403, -403,
2856 1154, -403, 42, 2094, -403, -43, 296, 167, 201, -403,
2857 -403, -403, 175, -403, 174, 1800, -403, 44, -403, 200,
2858 63, 207, 211, 894, -403, -27, -11, 46, 113, 189,
2859 42, 298, 42, 190, 161, 217, -403, 2094, -403, -403,
2860 315, 2323, -403, 1926, 2094, 193, -403, -403, 1154, 192,
2861 194, 75, 63, -403, -403, 161, 26, 96, 1926, 2094,
2862 -403, -403, -403, -403, 2094, -403, -403, -403, 2094, 1926,
2863 -403, -403, 15, -403, 42, 199, -403, 230, -403, 207,
2864 286, 2569, -403, -403, -403, 103, 24, 197, -403, -403,
2865 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2866 234, 205, 296, -403, 206, 213, -403, -403, 96, -403,
2867 268, -403, -403, 204, -403, 215, 230, -403, 42, 208,
2868 -403, -403, -403, 2094, 236, 214, 24, -403, -403, -403,
2869 -403, -403, -403, -403, 335, -403, -403, 1926, -403, 1926,
2870 161, 1414, -403, 339, -403, 316, 219, 227, -403, 2508,
2871 1800, -403, -403, -403, 1800, 1800, 161, -403, -403, 223,
2872 -403, -403, 226, 250, 221, 1544, -403, -403, -403, -403,
2873 12, -403, -403, 1800, -403, 222, 224, 225, -403, 1414,
2874 -403, -403, 354, -403, -403, -403, -403, 1800, 228, 241,
2875 235, 243, -403, 15, 1800, -403, 244, 246, 161, -403,
2879 /* YYPGOTO[NTERM-NUM]. */
2880 static const yytype_int16 yypgoto[] =
2882 -403, -403, 218, -403, 312, -299, -403, 61, -402, -31,
2883 1, -55, -85, 48, 2, -23, 321, 251, 58, -403,
2884 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2885 -403, -403, -403, -403, -403, -62, -60, -403, -403, -40,
2886 -403, -36, -403, -403, -403, -403, -403, -403, -403, -403,
2887 6, 50, -403, -403, -403, -403, 0, -403, 331, -403,
2888 -403, -403, 49, -403, 51, -403, -96, -403, -80, -403,
2889 -403, -61, -403, 3, -403, -403, 7, 9, -403, -376,
2890 -403, -311, -79, 4, -403, -403, -403, -403, -403, 388,
2891 -91, 25, 52, -239, -403, -98, -403, -403, -403, -403,
2892 -403, -403, -403, -34, -9, -49, -13, -403, -403, -403,
2893 -403, -403, -403, -403
2896 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2897 positive, shift that token. If negative, reduce the rule which
2898 number is the opposite. If zero, do what YYDEFACT says.
2899 If YYTABLE_NINF, syntax error. */
2900 #define YYTABLE_NINF -155
2901 static const yytype_int16 yytable[] =
2903 69, 54, 56, 74, 75, 114, 214, 101, 223, 155,
2904 156, 104, 230, 345, 304, 374, 435, 136, 325, 87,
2905 97, 369, 93, 94, 112, 192, 115, 118, 119, 325,
2906 120, 121, 122, 97, 115, 88, 156, 123, 95, 217,
2907 218, -70, 190, 191, 192, 93, 94, 257, 55, 72,
2908 90, 73, 69, 54, 56, 74, 75, 209, 443, 371,
2909 210, 95, 372, 258, 98, 423, 93, 94, 494, 407,
2910 92, 167, 495, 496, 208, 384, 209, 106, 410, 210,
2911 411, 249, 95, 412, 413, 414, 444, 415, 388, 167,
2912 167, 503, 239, 93, 94, 228, 226, 115, 99, 380,
2913 55, 72, 102, 73, 236, 511, 105, 89, 326, 95,
2914 302, 452, 517, 115, 167, 399, 390, 108, 391, 422,
2915 416, 244, 245, 330, 424, 109, 146, 110, 147, 425,
2916 417, 418, 111, 305, 149, 113, 421, 516, 167, 306,
2917 211, 231, 212, 225, 167, 96, 167, 363, 233, 69,
2918 54, 56, 74, 75, 263, 264, 265, 266, 267, 268,
2919 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
2920 279, 280, 281, 282, 283, 284, 285, 378, 381, 389,
2921 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
2922 297, 298, 299, 300, 301, 115, 303, 55, 72, 338,
2923 73, 339, 309, 167, 307, 331, 227, 235, 234, 237,
2924 238, 250, 2, 240, 241, 247, 69, 54, 315, 343,
2925 115, 479, 115, 337, 321, 370, -71, 158, 15, 16,
2926 17, 2, 19, 332, 21, 252, 442, 497, 253, 254,
2927 255, 256, 260, 308, 346, 347, 25, 15, 16, 17,
2928 261, 19, 286, 21, 463, 30, 31, 32, 158, 393,
2929 -113, 396, 322, 336, 323, 25, 340, 159, 158, 342,
2930 348, 160, 161, 463, 30, 31, 32, 159, 404, 520,
2931 249, 344, 161, 349, 162, 350, 163, 352, 249, 354,
2932 358, 360, 361, 430, 362, 364, 163, 366, 368, 325,
2933 375, 376, -112, 396, 434, 379, 377, 464, 156, 384,
2934 115, 392, 69, 54, 315, 394, 398, 400, 402, 406,
2935 69, 54, 315, 156, 408, 437, 464, 409, 332, 449,
2936 438, 451, 453, 457, 156, 454, 371, 459, 476, 433,
2937 -153, 470, 489, 490, 401, 431, 471, 462, 460, 498,
2938 432, 491, 499, 500, 504, 405, 505, 509, 506, -154,
2939 512, 514, 168, 513, 148, 2, 115, 251, 69, 54,
2940 315, 115, 477, 367, 478, 515, 440, 518, 519, 152,
2941 242, 15, 16, 17, 472, 19, 473, 21, 455, 169,
2942 170, 171, 456, -155, -155, -155, -155, 176, 177, 25,
2943 386, 166, 156, 508, 156, 501, 492, 441, 30, 31,
2944 32, 502, 190, 191, 192, 107, 193, 194, 195, 436,
2945 0, 0, 0, 0, 420, 0, 0, 0, 0, 450,
2946 469, 201, 202, 0, 203, 204, 205, 206, 207, 465,
2947 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
2948 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
2949 192, 483, 481, 482, 487, 488, 0, 465, 0, 0,
2950 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2951 203, 204, 205, 206, 207, 483, 481, 482, 487, 488,
2952 208, 0, 209, 0, 0, 210, 0, 0, 0, 483,
2953 481, 482, 487, 488, -4, 0, 0, 1, 2, 3,
2954 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2955 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2956 21, 0, 0, 23, 0, 0, 168, 0, 0, 0,
2957 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2958 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2959 36, 0, 0, -155, -155, -155, 0, 37, 38, 0,
2960 0, 176, 177, 0, 39, 0, 0, 0, 0, 0,
2961 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2962 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2963 0, 0, 0, 42, 0, 201, 202, 0, 203, 204,
2964 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2965 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2966 48, 0, 49, 0, 0, 0, -4, 1, 2, 3,
2967 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2968 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2969 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2970 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2971 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2972 36, 0, 0, 0, 190, 191, 192, 37, 38, 0,
2973 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2974 0, 0, 0, 0, 0, 0, 0, 0, 205, 206,
2975 207, 0, 0, 0, 40, 41, 208, 0, 209, 0,
2976 0, 210, 0, 134, 0, 0, 0, 0, 0, 0,
2977 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2978 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2979 48, 0, 49, 0, 0, 0, 135, 1, 2, 3,
2980 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2981 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2982 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2983 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2984 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2985 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2986 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2987 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2988 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2989 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2990 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2991 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2992 48, 0, 49, 0, 0, 0, 248, 1, 2, 3,
2993 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2994 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2995 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2996 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2997 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2998 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2999 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3000 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3001 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3002 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
3003 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3004 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3005 48, 0, 49, 0, 0, 0, 387, 1, 2, 3,
3006 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3007 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3008 21, 0, 0, 23, 0, 0, -155, 0, 0, 0,
3009 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3010 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3011 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3012 0, -155, -155, 0, 39, 0, 0, 0, 0, 0,
3013 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
3014 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
3015 0, 0, 0, 42, 0, -155, -155, 0, 203, 204,
3016 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
3017 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
3018 48, 0, 49, 0, 0, 0, -3, 1, 2, 3,
3019 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3020 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3021 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3022 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3023 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3024 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3025 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3026 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3027 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3028 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3029 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3030 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3031 48, 0, 49, 0, 0, 0, -15, 1, 2, 3,
3032 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3033 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3034 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3035 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3036 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3037 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3038 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3040 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3041 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3042 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3043 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3044 48, 0, 49, 0, 0, 0, -16, 1, 2, 3,
3045 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3046 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3047 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3048 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3049 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3050 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3051 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3052 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3053 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3054 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3055 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3056 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3057 48, 0, 49, 0, 0, 0, -144, 1, 2, 3,
3058 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3059 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3060 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3061 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3062 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3063 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3064 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3066 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3067 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3068 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3069 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3070 48, 0, 49, 0, -3, 0, -145, 1, 2, 3,
3071 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3072 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3073 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3074 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3075 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3076 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3077 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3078 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3079 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3080 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
3081 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3082 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3083 48, 0, 49, 1, 2, 3, 4, 0, 5, 6,
3084 7, 8, 9, 10, 11, 12, 13, 0, -120, 0,
3085 15, 16, 17, 18, 19, 20, 21, 22, 0, 23,
3086 128, 0, 129, 0, 0, 0, 24, 130, 25, 26,
3087 0, 27, 131, 28, 0, 29, 132, 30, 31, 32,
3088 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3089 0, 0, 0, 37, 38, 0, 133, 0, 0, 0,
3090 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3091 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3092 40, 41, 0, 0, 0, 0, 0, 0, 0, 134,
3093 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3094 0, 0, 43, 0, 0, 0, 0, 44, 45, 0,
3095 0, 0, 46, 0, 47, 0, 48, 0, 49, 1,
3096 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3097 11, 12, 13, 0, 0, 0, 15, 16, 17, 18,
3098 19, 20, 21, 22, 0, 23, 128, 0, 129, 0,
3099 0, 0, 24, 130, 25, 26, 0, 27, 131, 28,
3100 0, 29, 132, 30, 31, 32, 0, 0, 33, 34,
3101 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3102 38, 0, 133, 0, 0, 0, 39, 0, 0, 0,
3103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3104 0, 0, 0, 0, 0, 0, 40, 41, 0, 0,
3105 0, 0, 0, 0, 0, 134, 0, 150, 0, 3,
3106 4, 0, 5, 6, 7, 8, 9, 0, 43, 0,
3107 0, 0, 0, 44, 45, 0, 0, 0, 46, 20,
3108 47, 22, 48, 23, 49, 0, 129, 0, 0, 0,
3109 24, 0, 0, 0, 0, 0, 0, 28, 0, 29,
3110 151, 0, 0, 0, 0, 0, 0, 34, 0, 35,
3111 36, 0, 0, 0, 0, 0, 0, 37, 0, 0,
3112 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3113 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3114 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3115 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3116 24, 0, 0, 0, 0, 0, 43, 28, 0, 29,
3117 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3118 36, 0, 49, 0, 0, 0, 0, 37, 0, 0,
3119 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3120 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3121 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3122 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3123 0, 0, 0, 0, 0, 0, 43, 0, 0, 29,
3124 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3125 36, 0, 49, 0, 0, 0, 0, 0, 0, 168,
3126 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3128 0, 0, 0, 0, 40, 41, 169, 170, 171, 0,
3129 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3130 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3131 191, 192, 0, 193, 194, 195, 46, 0, 47, 0,
3132 0, 196, 49, 197, 0, 198, 199, 200, 201, 202,
3133 168, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3134 0, 208, 0, 209, 0, 0, 210, 0, 0, 0,
3135 0, 0, 333, 0, 0, 0, 0, 169, 170, 171,
3136 0, 172, 173, 174, 175, 176, 177, 178, 179, 180,
3137 181, 182, 183, 184, 185, 186, 187, 188, 189, 0,
3138 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3139 0, 0, 196, 168, 197, 0, 198, 199, 200, 201,
3140 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3141 0, 0, 208, 0, 209, 0, 0, 210, 0, 0,
3142 169, 170, 171, 365, 172, 173, 174, 175, 176, 177,
3143 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
3144 188, 189, 0, 190, 191, 192, 0, 193, 194, 195,
3145 0, 0, 0, 0, 0, 196, 168, 197, 0, 198,
3146 199, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3147 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3148 210, 0, 0, 169, 170, 171, 403, 172, 173, 174,
3149 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
3150 185, 186, 187, 188, 189, 0, 190, 191, 192, 0,
3151 193, 194, 195, 0, 0, 0, 0, 168, 196, 0,
3152 197, 357, 198, 199, 200, 201, 202, 0, 203, 204,
3153 205, 206, 207, 0, 0, 0, 0, 0, 208, 0,
3154 209, 0, 0, 210, 169, 170, 171, 0, 172, 173,
3155 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
3156 184, 185, 186, 187, 188, 189, 0, 190, 191, 192,
3157 0, 193, 194, 195, 0, 0, 0, 0, 168, 196,
3158 0, 197, 0, 198, 199, 200, 201, 202, 0, 203,
3159 204, 205, 206, 207, 0, 0, 0, 0, 0, 208,
3160 0, 209, 359, 0, 210, 169, 170, 171, 0, 172,
3161 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3162 183, 184, 185, 186, 187, 188, 189, 0, 190, 191,
3163 192, 0, 193, 194, 195, 0, 0, 0, 0, 168,
3164 196, 0, 197, 493, 198, 199, 200, 201, 202, 0,
3165 203, 204, 205, 206, 207, 0, 0, 0, 0, 0,
3166 208, 0, 209, 0, 0, 210, 169, 170, 171, 0,
3167 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3168 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3169 191, 192, 0, 193, 194, 195, 0, 0, 0, 0,
3170 168, 196, 0, 197, 0, 198, 199, 200, 201, 202,
3171 0, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3172 0, 208, 0, 209, 0, 0, 210, 169, 170, 171,
3173 0, 172, 173, 174, 175, 176, 177, 0, 0, 0,
3174 0, 0, 0, 0, 0, 0, 0, 0, 189, 0,
3175 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3176 0, 168, 0, 0, 0, 0, 198, 199, 200, 201,
3177 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3178 0, 0, 208, 0, 209, 0, 0, 210, 169, 170,
3179 171, 0, 172, 173, 174, 175, 176, 177, 0, 0,
3180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3181 0, 190, 191, 192, 0, 193, 194, 195, 0, 0,
3182 0, 0, 168, 0, 0, 0, 0, 198, 199, 200,
3183 201, 202, 0, 203, 204, 205, 206, 207, 0, 0,
3184 0, 0, 0, 208, 0, 209, 0, 0, 210, 169,
3185 170, 171, 0, 172, 173, 174, 175, 176, 177, 0,
3186 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3187 0, 0, 190, 191, 192, 0, 193, 194, 195, 0,
3188 0, 0, 0, 168, 0, 0, 0, 0, 0, 199,
3189 200, 201, 202, 0, 203, 204, 205, 206, 207, 0,
3190 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
3191 169, 170, 171, 0, 172, 173, 174, 175, 176, 177,
3192 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3193 0, 0, 0, 190, 191, 192, 0, 193, 194, 195,
3194 0, 0, 0, 0, 168, 0, 0, 0, 0, 0,
3195 0, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3196 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3197 210, 169, 170, 171, 0, 172, 173, 174, 175, 176,
3198 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3199 0, 0, 0, 0, 190, 191, 192, 0, 193, 194,
3200 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3201 0, 0, -155, 201, 202, 0, 203, 204, 205, 206,
3202 207, 0, 0, 0, 0, 0, 208, 0, 209, 0,
3206 static const yytype_int16 yycheck[] =
3208 0, 0, 0, 0, 0, 39, 91, 20, 99, 58,
3209 65, 24, 110, 252, 3, 326, 392, 48, 3, 89,
3210 14, 320, 3, 4, 37, 92, 39, 40, 41, 3,
3211 43, 44, 45, 27, 47, 50, 91, 46, 19, 126,
3212 127, 68, 90, 91, 92, 3, 4, 35, 0, 0,
3213 122, 0, 52, 52, 52, 52, 52, 124, 34, 102,
3214 127, 19, 105, 51, 14, 376, 3, 4, 470, 368,
3215 122, 100, 474, 475, 122, 102, 124, 27, 3, 127,
3216 5, 136, 19, 8, 9, 10, 62, 12, 99, 100,
3217 100, 493, 126, 3, 4, 108, 105, 110, 18, 36,
3218 52, 52, 3, 52, 133, 507, 122, 122, 93, 19,
3219 208, 422, 514, 126, 100, 354, 3, 122, 5, 93,
3220 45, 130, 131, 133, 28, 126, 3, 122, 0, 33,
3221 55, 56, 127, 122, 126, 122, 375, 513, 100, 128,
3222 3, 3, 122, 122, 100, 126, 100, 133, 105, 149,
3223 149, 149, 149, 149, 167, 168, 169, 170, 171, 172,
3224 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3225 183, 184, 185, 186, 187, 188, 189, 133, 115, 133,
3226 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3227 203, 204, 205, 206, 207, 208, 209, 149, 149, 233,
3228 149, 235, 215, 100, 213, 115, 127, 100, 132, 125,
3229 100, 126, 4, 3, 3, 3, 216, 216, 216, 250,
3230 233, 460, 235, 232, 218, 323, 68, 18, 20, 21,
3231 22, 4, 24, 227, 26, 3, 133, 476, 99, 68,
3232 99, 3, 3, 14, 253, 254, 38, 20, 21, 22,
3233 3, 24, 3, 26, 46, 47, 48, 49, 18, 350,
3234 127, 352, 127, 133, 122, 38, 105, 27, 18, 100,
3235 102, 31, 32, 46, 47, 48, 49, 27, 363, 518,
3236 335, 132, 32, 3, 44, 54, 46, 54, 343, 3,
3237 133, 89, 305, 378, 3, 122, 46, 132, 126, 3,
3238 133, 100, 127, 394, 389, 105, 132, 99, 363, 102,
3239 323, 122, 312, 312, 312, 17, 126, 100, 3, 126,
3240 320, 320, 320, 378, 132, 126, 99, 133, 322, 132,
3241 100, 126, 126, 65, 389, 122, 102, 133, 3, 388,
3242 132, 105, 3, 27, 357, 379, 132, 438, 133, 126,
3243 384, 132, 126, 132, 132, 364, 132, 3, 133, 132,
3244 132, 126, 40, 122, 52, 4, 379, 149, 368, 368,
3245 368, 384, 457, 312, 459, 132, 399, 133, 132, 58,
3246 129, 20, 21, 22, 446, 24, 446, 26, 428, 67,
3247 68, 69, 428, 71, 72, 73, 74, 75, 76, 38,
3248 342, 70, 457, 499, 459, 485, 467, 400, 47, 48,
3249 49, 490, 90, 91, 92, 27, 94, 95, 96, 394,
3250 -1, -1, -1, -1, 372, -1, -1, -1, -1, 420,
3251 443, 109, 110, -1, 112, 113, 114, 115, 116, 439,
3252 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3253 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3254 92, 461, 461, 461, 461, 461, -1, 467, -1, -1,
3255 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3256 112, 113, 114, 115, 116, 485, 485, 485, 485, 485,
3257 122, -1, 124, -1, -1, 127, -1, -1, -1, 499,
3258 499, 499, 499, 499, 0, -1, -1, 3, 4, 5,
3259 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3260 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3261 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3262 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3263 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3264 56, -1, -1, 67, 68, 69, -1, 63, 64, -1,
3265 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3266 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3267 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3268 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3269 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3270 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3271 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3272 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3273 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3274 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3275 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3276 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3277 56, -1, -1, -1, 90, 91, 92, 63, 64, -1,
3278 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3279 -1, -1, -1, -1, -1, -1, -1, -1, 114, 115,
3280 116, -1, -1, -1, 90, 91, 122, -1, 124, -1,
3281 -1, 127, -1, 99, -1, -1, -1, -1, -1, -1,
3282 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3283 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3284 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3285 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3286 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3287 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3288 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3289 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3290 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3291 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3292 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3293 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3294 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3295 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3296 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3297 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3298 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3299 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3300 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3301 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3302 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3303 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3304 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3305 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3306 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3307 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3308 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3309 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3310 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3311 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3312 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3313 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3314 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3315 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3316 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3317 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3318 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3319 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3320 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3321 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3322 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3323 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3324 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3325 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3326 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3327 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3328 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3329 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3330 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3332 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3333 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3334 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3335 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3336 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3337 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3338 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3339 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3340 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3341 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3342 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3343 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3344 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3345 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3346 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3347 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3348 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3349 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3350 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3351 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3352 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3353 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3354 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3355 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3356 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3357 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3358 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3359 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3360 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3361 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3362 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3363 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3364 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3365 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3366 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3367 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3368 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3369 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3370 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3371 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3372 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3373 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3374 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3375 126, -1, 128, -1, 0, -1, 132, 3, 4, 5,
3376 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3377 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3378 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3379 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3380 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3381 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3382 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3383 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3384 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3385 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3386 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3387 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3388 126, -1, 128, 3, 4, 5, 6, -1, 8, 9,
3389 10, 11, 12, 13, 14, 15, 16, -1, 18, -1,
3390 20, 21, 22, 23, 24, 25, 26, 27, -1, 29,
3391 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3392 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3393 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3394 -1, -1, -1, 63, 64, -1, 66, -1, -1, -1,
3395 70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3396 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3397 90, 91, -1, -1, -1, -1, -1, -1, -1, 99,
3398 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3399 -1, -1, 112, -1, -1, -1, -1, 117, 118, -1,
3400 -1, -1, 122, -1, 124, -1, 126, -1, 128, 3,
3401 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3402 14, 15, 16, -1, -1, -1, 20, 21, 22, 23,
3403 24, 25, 26, 27, -1, 29, 30, -1, 32, -1,
3404 -1, -1, 36, 37, 38, 39, -1, 41, 42, 43,
3405 -1, 45, 46, 47, 48, 49, -1, -1, 52, 53,
3406 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3407 64, -1, 66, -1, -1, -1, 70, -1, -1, -1,
3408 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3409 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
3410 -1, -1, -1, -1, -1, 99, -1, 3, -1, 5,
3411 6, -1, 8, 9, 10, 11, 12, -1, 112, -1,
3412 -1, -1, -1, 117, 118, -1, -1, -1, 122, 25,
3413 124, 27, 126, 29, 128, -1, 32, -1, -1, -1,
3414 36, -1, -1, -1, -1, -1, -1, 43, -1, 45,
3415 46, -1, -1, -1, -1, -1, -1, 53, -1, 55,
3416 56, -1, -1, -1, -1, -1, -1, 63, -1, -1,
3417 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3418 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3419 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3420 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3421 36, -1, -1, -1, -1, -1, 112, 43, -1, 45,
3422 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3423 56, -1, 128, -1, -1, -1, -1, 63, -1, -1,
3424 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3425 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3426 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3427 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3428 -1, -1, -1, -1, -1, -1, 112, -1, -1, 45,
3429 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3430 56, -1, 128, -1, -1, -1, -1, -1, -1, 40,
3431 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3432 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3433 -1, -1, -1, -1, 90, 91, 67, 68, 69, -1,
3434 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3435 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3436 91, 92, -1, 94, 95, 96, 122, -1, 124, -1,
3437 -1, 102, 128, 104, -1, 106, 107, 108, 109, 110,
3438 40, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3439 -1, 122, -1, 124, -1, -1, 127, -1, -1, -1,
3440 -1, -1, 133, -1, -1, -1, -1, 67, 68, 69,
3441 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
3442 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
3443 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3444 -1, -1, 102, 40, 104, -1, 106, 107, 108, 109,
3445 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3446 -1, -1, 122, -1, 124, -1, -1, 127, -1, -1,
3447 67, 68, 69, 133, 71, 72, 73, 74, 75, 76,
3448 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3449 87, 88, -1, 90, 91, 92, -1, 94, 95, 96,
3450 -1, -1, -1, -1, -1, 102, 40, 104, -1, 106,
3451 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3452 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3453 127, -1, -1, 67, 68, 69, 133, 71, 72, 73,
3454 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3455 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3456 94, 95, 96, -1, -1, -1, -1, 40, 102, -1,
3457 104, 105, 106, 107, 108, 109, 110, -1, 112, 113,
3458 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3459 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3460 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3461 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3462 -1, 94, 95, 96, -1, -1, -1, -1, 40, 102,
3463 -1, 104, -1, 106, 107, 108, 109, 110, -1, 112,
3464 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3465 -1, 124, 125, -1, 127, 67, 68, 69, -1, 71,
3466 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3467 82, 83, 84, 85, 86, 87, 88, -1, 90, 91,
3468 92, -1, 94, 95, 96, -1, -1, -1, -1, 40,
3469 102, -1, 104, 105, 106, 107, 108, 109, 110, -1,
3470 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3471 122, -1, 124, -1, -1, 127, 67, 68, 69, -1,
3472 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3473 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3474 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3475 40, 102, -1, 104, -1, 106, 107, 108, 109, 110,
3476 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3477 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3478 -1, 71, 72, 73, 74, 75, 76, -1, -1, -1,
3479 -1, -1, -1, -1, -1, -1, -1, -1, 88, -1,
3480 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3481 -1, 40, -1, -1, -1, -1, 106, 107, 108, 109,
3482 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3483 -1, -1, 122, -1, 124, -1, -1, 127, 67, 68,
3484 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3485 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3486 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3487 -1, -1, 40, -1, -1, -1, -1, 106, 107, 108,
3488 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3489 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3490 68, 69, -1, 71, 72, 73, 74, 75, 76, -1,
3491 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3492 -1, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3493 -1, -1, -1, 40, -1, -1, -1, -1, -1, 107,
3494 108, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3495 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3496 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3497 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3498 -1, -1, -1, 90, 91, 92, -1, 94, 95, 96,
3499 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
3500 -1, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3501 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3502 127, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3503 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3504 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3505 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3506 -1, -1, 108, 109, 110, -1, 112, 113, 114, 115,
3507 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3511 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3512 symbol of state STATE-NUM. */
3513 static const yytype_uint8 yystos[] =
3515 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3516 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3517 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3518 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3519 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3520 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3521 160, 161, 163, 171, 179, 182, 183, 186, 189, 190,
3522 191, 192, 196, 198, 207, 217, 220, 233, 234, 235,
3523 238, 239, 240, 241, 244, 246, 247, 89, 50, 122,
3524 122, 164, 122, 3, 4, 19, 126, 184, 185, 18,
3525 3, 240, 3, 219, 240, 122, 185, 223, 122, 126,
3526 122, 127, 240, 122, 237, 240, 242, 243, 240, 240,
3527 240, 240, 240, 238, 229, 230, 231, 237, 30, 32,
3528 37, 42, 46, 66, 99, 132, 143, 144, 145, 148,
3529 150, 165, 166, 181, 190, 236, 3, 0, 138, 126,
3530 3, 46, 150, 156, 157, 239, 145, 146, 18, 27,
3531 31, 32, 44, 46, 206, 245, 192, 100, 40, 67,
3532 68, 69, 71, 72, 73, 74, 75, 76, 77, 78,
3533 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3534 90, 91, 92, 94, 95, 96, 102, 104, 106, 107,
3535 108, 109, 110, 112, 113, 114, 115, 116, 122, 124,
3536 127, 3, 122, 162, 146, 172, 188, 126, 127, 184,
3537 185, 222, 223, 224, 232, 122, 238, 127, 240, 180,
3538 229, 3, 155, 105, 132, 100, 133, 125, 100, 237,
3539 3, 3, 151, 152, 238, 238, 151, 3, 132, 145,
3540 126, 136, 3, 99, 68, 99, 3, 35, 51, 216,
3541 3, 3, 208, 240, 240, 240, 240, 240, 240, 240,
3542 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3543 240, 240, 240, 240, 240, 240, 3, 240, 240, 240,
3544 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3545 240, 240, 229, 240, 3, 122, 128, 238, 14, 240,
3546 99, 139, 140, 141, 147, 148, 196, 198, 207, 217,
3547 187, 184, 127, 122, 228, 3, 93, 213, 214, 215,
3548 133, 115, 184, 133, 142, 143, 133, 238, 237, 237,
3549 105, 227, 100, 143, 132, 227, 238, 238, 102, 3,
3550 54, 193, 54, 194, 3, 209, 210, 105, 133, 125,
3551 89, 240, 3, 133, 122, 133, 132, 141, 126, 139,
3552 229, 102, 105, 211, 215, 133, 100, 132, 133, 105,
3553 36, 115, 224, 226, 102, 149, 152, 132, 99, 133,
3554 3, 5, 122, 224, 17, 195, 224, 225, 126, 227,
3555 100, 240, 3, 133, 146, 238, 126, 139, 132, 133,
3556 3, 5, 8, 9, 10, 12, 45, 55, 56, 212,
3557 226, 227, 93, 215, 28, 33, 173, 175, 177, 178,
3558 146, 237, 237, 239, 146, 213, 225, 126, 100, 199,
3559 149, 210, 133, 34, 62, 167, 168, 169, 170, 132,
3560 211, 126, 215, 126, 122, 173, 175, 65, 153, 133,
3561 133, 197, 224, 46, 99, 190, 203, 204, 205, 240,
3562 105, 132, 169, 170, 221, 176, 3, 146, 146, 227,
3563 99, 144, 148, 190, 200, 201, 202, 207, 217, 3,
3564 27, 132, 205, 105, 142, 142, 142, 227, 126, 126,
3565 132, 202, 216, 142, 132, 132, 133, 218, 200, 3,
3566 174, 142, 132, 122, 126, 132, 213, 142, 133, 132,
3570 #define yyerrok (yyerrstatus = 0)
3571 #define yyclearin (yychar = YYEMPTY)
3572 #define YYEMPTY (-2)
3575 #define YYACCEPT goto yyacceptlab
3576 #define YYABORT goto yyabortlab
3577 #define YYERROR goto yyerrorlab
3580 /* Like YYERROR except do call yyerror. This remains here temporarily
3581 to ease the transition to the new meaning of YYERROR, for GCC.
3582 Once GCC version 2 has supplanted version 1, this can go. */
3584 #define YYFAIL goto yyerrlab
3586 #define YYRECOVERING() (!!yyerrstatus)
3588 #define YYBACKUP(Token, Value) \
3590 if (yychar == YYEMPTY && yylen == 1) \
3594 yytoken = YYTRANSLATE (yychar); \
3600 yyerror (YY_("syntax error: cannot back up")); \
3607 #define YYERRCODE 256
3610 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3611 If N is 0, then set CURRENT to the empty location which ends
3612 the previous symbol: RHS[0] (always defined). */
3614 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3615 #ifndef YYLLOC_DEFAULT
3616 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3620 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3621 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3622 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3623 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3627 (Current).first_line = (Current).last_line = \
3628 YYRHSLOC (Rhs, 0).last_line; \
3629 (Current).first_column = (Current).last_column = \
3630 YYRHSLOC (Rhs, 0).last_column; \
3636 /* YY_LOCATION_PRINT -- Print the location on the stream.
3637 This macro was not mandated originally: define only if we know
3638 we won't break user code: when these are the locations we know. */
3640 #ifndef YY_LOCATION_PRINT
3641 # if YYLTYPE_IS_TRIVIAL
3642 # define YY_LOCATION_PRINT(File, Loc) \
3643 fprintf (File, "%d.%d-%d.%d", \
3644 (Loc).first_line, (Loc).first_column, \
3645 (Loc).last_line, (Loc).last_column)
3647 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3652 /* YYLEX -- calling `yylex' with the right arguments. */
3655 # define YYLEX yylex (YYLEX_PARAM)
3657 # define YYLEX yylex ()
3660 /* Enable debugging if requested. */
3664 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3665 # define YYFPRINTF fprintf
3668 # define YYDPRINTF(Args) \
3674 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3678 YYFPRINTF (stderr, "%s ", Title); \
3679 yy_symbol_print (stderr, \
3681 YYFPRINTF (stderr, "\n"); \
3686 /*--------------------------------.
3687 | Print this symbol on YYOUTPUT. |
3688 `--------------------------------*/
3691 #if (defined __STDC__ || defined __C99__FUNC__ \
3692 || defined __cplusplus || defined _MSC_VER)
3694 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3697 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3700 YYSTYPE const * const yyvaluep;
3706 if (yytype < YYNTOKENS)
3707 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3719 /*--------------------------------.
3720 | Print this symbol on YYOUTPUT. |
3721 `--------------------------------*/
3723 #if (defined __STDC__ || defined __C99__FUNC__ \
3724 || defined __cplusplus || defined _MSC_VER)
3726 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3729 yy_symbol_print (yyoutput, yytype, yyvaluep)
3732 YYSTYPE const * const yyvaluep;
3735 if (yytype < YYNTOKENS)
3736 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3738 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3740 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3741 YYFPRINTF (yyoutput, ")");
3744 /*------------------------------------------------------------------.
3745 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3747 `------------------------------------------------------------------*/
3749 #if (defined __STDC__ || defined __C99__FUNC__ \
3750 || defined __cplusplus || defined _MSC_VER)
3752 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3755 yy_stack_print (yybottom, yytop)
3756 yytype_int16 *yybottom;
3757 yytype_int16 *yytop;
3760 YYFPRINTF (stderr, "Stack now");
3761 for (; yybottom <= yytop; yybottom++)
3763 int yybot = *yybottom;
3764 YYFPRINTF (stderr, " %d", yybot);
3766 YYFPRINTF (stderr, "\n");
3769 # define YY_STACK_PRINT(Bottom, Top) \
3772 yy_stack_print ((Bottom), (Top)); \
3776 /*------------------------------------------------.
3777 | Report that the YYRULE is going to be reduced. |
3778 `------------------------------------------------*/
3780 #if (defined __STDC__ || defined __C99__FUNC__ \
3781 || defined __cplusplus || defined _MSC_VER)
3783 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3786 yy_reduce_print (yyvsp, yyrule)
3791 int yynrhs = yyr2[yyrule];
3793 unsigned long int yylno = yyrline[yyrule];
3794 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3796 /* The symbols being reduced. */
3797 for (yyi = 0; yyi < yynrhs; yyi++)
3799 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3800 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3801 &(yyvsp[(yyi + 1) - (yynrhs)])
3803 YYFPRINTF (stderr, "\n");
3807 # define YY_REDUCE_PRINT(Rule) \
3810 yy_reduce_print (yyvsp, Rule); \
3813 /* Nonzero means print parse trace. It is left uninitialized so that
3814 multiple parsers can coexist. */
3816 #else /* !YYDEBUG */
3817 # define YYDPRINTF(Args)
3818 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3819 # define YY_STACK_PRINT(Bottom, Top)
3820 # define YY_REDUCE_PRINT(Rule)
3821 #endif /* !YYDEBUG */
3824 /* YYINITDEPTH -- initial size of the parser's stacks. */
3826 # define YYINITDEPTH 200
3829 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3830 if the built-in stack extension method is used).
3832 Do not make this value too large; the results are undefined if
3833 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3834 evaluated with infinite-precision integer arithmetic. */
3837 # define YYMAXDEPTH 10000
3845 # if defined __GLIBC__ && defined _STRING_H
3846 # define yystrlen strlen
3848 /* Return the length of YYSTR. */
3849 #if (defined __STDC__ || defined __C99__FUNC__ \
3850 || defined __cplusplus || defined _MSC_VER)
3852 yystrlen (const char *yystr)
3860 for (yylen = 0; yystr[yylen]; yylen++)
3868 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3869 # define yystpcpy stpcpy
3871 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3873 #if (defined __STDC__ || defined __C99__FUNC__ \
3874 || defined __cplusplus || defined _MSC_VER)
3876 yystpcpy (char *yydest, const char *yysrc)
3879 yystpcpy (yydest, yysrc)
3885 const char *yys = yysrc;
3887 while ((*yyd++ = *yys++) != '\0')
3896 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3897 quotes and backslashes, so that it's suitable for yyerror. The
3898 heuristic is that double-quoting is unnecessary unless the string
3899 contains an apostrophe, a comma, or backslash (other than
3900 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3901 null, do not copy; instead, return the length of what the result
3904 yytnamerr (char *yyres, const char *yystr)
3909 char const *yyp = yystr;
3916 goto do_not_strip_quotes;
3920 goto do_not_strip_quotes;
3933 do_not_strip_quotes: ;
3937 return yystrlen (yystr);
3939 return yystpcpy (yyres, yystr) - yyres;
3943 /* Copy into YYRESULT an error message about the unexpected token
3944 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3945 including the terminating null byte. If YYRESULT is null, do not
3946 copy anything; just return the number of bytes that would be
3947 copied. As a special case, return 0 if an ordinary "syntax error"
3948 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3949 size calculation. */
3951 yysyntax_error (char *yyresult, int yystate, int yychar)
3953 int yyn = yypact[yystate];
3955 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3959 int yytype = YYTRANSLATE (yychar);
3960 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3961 YYSIZE_T yysize = yysize0;
3963 int yysize_overflow = 0;
3964 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3965 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3969 /* This is so xgettext sees the translatable formats that are
3970 constructed on the fly. */
3971 YY_("syntax error, unexpected %s");
3972 YY_("syntax error, unexpected %s, expecting %s");
3973 YY_("syntax error, unexpected %s, expecting %s or %s");
3974 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3975 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3979 static char const yyunexpected[] = "syntax error, unexpected %s";
3980 static char const yyexpecting[] = ", expecting %s";
3981 static char const yyor[] = " or %s";
3982 char yyformat[sizeof yyunexpected
3983 + sizeof yyexpecting - 1
3984 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3985 * (sizeof yyor - 1))];
3986 char const *yyprefix = yyexpecting;
3988 /* Start YYX at -YYN if negative to avoid negative indexes in
3990 int yyxbegin = yyn < 0 ? -yyn : 0;
3992 /* Stay within bounds of both yycheck and yytname. */
3993 int yychecklim = YYLAST - yyn + 1;
3994 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3997 yyarg[0] = yytname[yytype];
3998 yyfmt = yystpcpy (yyformat, yyunexpected);
4000 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4001 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4003 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4007 yyformat[sizeof yyunexpected - 1] = '\0';
4010 yyarg[yycount++] = yytname[yyx];
4011 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4012 yysize_overflow |= (yysize1 < yysize);
4014 yyfmt = yystpcpy (yyfmt, yyprefix);
4018 yyf = YY_(yyformat);
4019 yysize1 = yysize + yystrlen (yyf);
4020 yysize_overflow |= (yysize1 < yysize);
4023 if (yysize_overflow)
4024 return YYSIZE_MAXIMUM;
4028 /* Avoid sprintf, as that infringes on the user's name space.
4029 Don't have undefined behavior even if the translation
4030 produced a string with the wrong number of "%s"s. */
4031 char *yyp = yyresult;
4033 while ((*yyp = *yyf) != '\0')
4035 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4037 yyp += yytnamerr (yyp, yyarg[yyi++]);
4050 #endif /* YYERROR_VERBOSE */
4053 /*-----------------------------------------------.
4054 | Release the memory associated to this symbol. |
4055 `-----------------------------------------------*/
4058 #if (defined __STDC__ || defined __C99__FUNC__ \
4059 || defined __cplusplus || defined _MSC_VER)
4061 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4064 yydestruct (yymsg, yytype, yyvaluep)
4074 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4084 /* Prevent warnings from -Wmissing-prototypes. */
4085 #ifdef YYPARSE_PARAM
4086 #if defined __STDC__ || defined __cplusplus
4087 int yyparse (void *YYPARSE_PARAM);
4091 #else /* ! YYPARSE_PARAM */
4092 #if defined __STDC__ || defined __cplusplus
4097 #endif /* ! YYPARSE_PARAM */
4100 /* The lookahead symbol. */
4103 /* The semantic value of the lookahead symbol. */
4106 /* Number of syntax errors so far. */
4111 /*-------------------------.
4112 | yyparse or yypush_parse. |
4113 `-------------------------*/
4115 #ifdef YYPARSE_PARAM
4116 #if (defined __STDC__ || defined __C99__FUNC__ \
4117 || defined __cplusplus || defined _MSC_VER)
4119 yyparse (void *YYPARSE_PARAM)
4122 yyparse (YYPARSE_PARAM)
4123 void *YYPARSE_PARAM;
4125 #else /* ! YYPARSE_PARAM */
4126 #if (defined __STDC__ || defined __C99__FUNC__ \
4127 || defined __cplusplus || defined _MSC_VER)
4140 /* Number of tokens to shift before error messages enabled. */
4143 /* The stacks and their tools:
4144 `yyss': related to states.
4145 `yyvs': related to semantic values.
4147 Refer to the stacks thru separate pointers, to allow yyoverflow
4148 to reallocate them elsewhere. */
4150 /* The state stack. */
4151 yytype_int16 yyssa[YYINITDEPTH];
4153 yytype_int16 *yyssp;
4155 /* The semantic value stack. */
4156 YYSTYPE yyvsa[YYINITDEPTH];
4160 YYSIZE_T yystacksize;
4164 /* Lookahead token as an internal (translated) token number. */
4166 /* The variables used to return semantic value and location from the
4171 /* Buffer for error messages, and its allocated size. */
4173 char *yymsg = yymsgbuf;
4174 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4177 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4179 /* The number of symbols on the RHS of the reduced rule.
4180 Keep to zero when no symbol should be popped. */
4186 yystacksize = YYINITDEPTH;
4188 YYDPRINTF ((stderr, "Starting parse\n"));
4193 yychar = YYEMPTY; /* Cause a token to be read. */
4195 /* Initialize stack pointers.
4196 Waste one element of value and location stack
4197 so that they stay on the same level as the state stack.
4198 The wasted elements are never initialized. */
4204 /*------------------------------------------------------------.
4205 | yynewstate -- Push a new state, which is found in yystate. |
4206 `------------------------------------------------------------*/
4208 /* In all cases, when you get here, the value and location stacks
4209 have just been pushed. So pushing a state here evens the stacks. */
4215 if (yyss + yystacksize - 1 <= yyssp)
4217 /* Get the current used size of the three stacks, in elements. */
4218 YYSIZE_T yysize = yyssp - yyss + 1;
4222 /* Give user a chance to reallocate the stack. Use copies of
4223 these so that the &'s don't force the real ones into
4225 YYSTYPE *yyvs1 = yyvs;
4226 yytype_int16 *yyss1 = yyss;
4228 /* Each stack pointer address is followed by the size of the
4229 data in use in that stack, in bytes. This used to be a
4230 conditional around just the two extra args, but that might
4231 be undefined if yyoverflow is a macro. */
4232 yyoverflow (YY_("memory exhausted"),
4233 &yyss1, yysize * sizeof (*yyssp),
4234 &yyvs1, yysize * sizeof (*yyvsp),
4240 #else /* no yyoverflow */
4241 # ifndef YYSTACK_RELOCATE
4242 goto yyexhaustedlab;
4244 /* Extend the stack our own way. */
4245 if (YYMAXDEPTH <= yystacksize)
4246 goto yyexhaustedlab;
4248 if (YYMAXDEPTH < yystacksize)
4249 yystacksize = YYMAXDEPTH;
4252 yytype_int16 *yyss1 = yyss;
4253 union yyalloc *yyptr =
4254 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4256 goto yyexhaustedlab;
4257 YYSTACK_RELOCATE (yyss_alloc, yyss);
4258 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4259 # undef YYSTACK_RELOCATE
4261 YYSTACK_FREE (yyss1);
4264 #endif /* no yyoverflow */
4266 yyssp = yyss + yysize - 1;
4267 yyvsp = yyvs + yysize - 1;
4269 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4270 (unsigned long int) yystacksize));
4272 if (yyss + yystacksize - 1 <= yyssp)
4276 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4278 if (yystate == YYFINAL)
4288 /* Do appropriate processing given the current state. Read a
4289 lookahead token if we need one and don't already have one. */
4291 /* First try to decide what to do without reference to lookahead token. */
4292 yyn = yypact[yystate];
4293 if (yyn == YYPACT_NINF)
4296 /* Not known => get a lookahead token if don't already have one. */
4298 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4299 if (yychar == YYEMPTY)
4301 YYDPRINTF ((stderr, "Reading a token: "));
4305 if (yychar <= YYEOF)
4307 yychar = yytoken = YYEOF;
4308 YYDPRINTF ((stderr, "Now at end of input.\n"));
4312 yytoken = YYTRANSLATE (yychar);
4313 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4316 /* If the proper action on seeing token YYTOKEN is to reduce or to
4317 detect an error, take that action. */
4319 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4324 if (yyn == 0 || yyn == YYTABLE_NINF)
4330 /* Count tokens shifted since error; after three, turn off error
4335 /* Shift the lookahead token. */
4336 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4338 /* Discard the shifted token. */
4347 /*-----------------------------------------------------------.
4348 | yydefault -- do the default action for the current state. |
4349 `-----------------------------------------------------------*/
4351 yyn = yydefact[yystate];
4357 /*-----------------------------.
4358 | yyreduce -- Do a reduction. |
4359 `-----------------------------*/
4361 /* yyn is the number of a rule to reduce with. */
4364 /* If YYLEN is nonzero, implement the default value of the action:
4367 Otherwise, the following line sets YYVAL to garbage.
4368 This behavior is undocumented and Bison
4369 users should not rely upon it. Assigning to YYVAL
4370 unconditionally makes the parser a bit smaller, and it avoids a
4371 GCC warning that YYVAL may be used uninitialized. */
4372 yyval = yyvsp[1-yylen];
4375 YY_REDUCE_PRINT (yyn);
4382 /* Line 1464 of skeleton.m4 */
4383 #line 2151 "parser.y"
4384 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4393 /* Line 1464 of skeleton.m4 */
4394 #line 2152 "parser.y"
4395 {(yyval.code)=code_new();}
4404 /* Line 1464 of skeleton.m4 */
4405 #line 2154 "parser.y"
4406 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4415 /* Line 1464 of skeleton.m4 */
4416 #line 2155 "parser.y"
4417 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4426 /* Line 1464 of skeleton.m4 */
4427 #line 2170 "parser.y"
4428 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4437 /* Line 1464 of skeleton.m4 */
4438 #line 2171 "parser.y"
4448 /* Line 1464 of skeleton.m4 */
4449 #line 2174 "parser.y"
4459 /* Line 1464 of skeleton.m4 */
4460 #line 2181 "parser.y"
4461 {(yyval.code)=(yyvsp[(3) - (4)].code);}
4470 /* Line 1464 of skeleton.m4 */
4471 #line 2185 "parser.y"
4472 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4481 /* Line 1464 of skeleton.m4 */
4482 #line 2186 "parser.y"
4483 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4492 /* Line 1464 of skeleton.m4 */
4493 #line 2190 "parser.y"
4495 code_t**cc = &global->init->method->body->code;
4496 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4506 /* Line 1464 of skeleton.m4 */
4507 #line 2201 "parser.y"
4508 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4517 /* Line 1464 of skeleton.m4 */
4518 #line 2202 "parser.y"
4519 {(yyval.value).c=abc_pushundefined(0);
4520 (yyval.value).t=TYPE_ANY;
4530 /* Line 1464 of skeleton.m4 */
4531 #line 2206 "parser.y"
4532 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4541 /* Line 1464 of skeleton.m4 */
4542 #line 2207 "parser.y"
4543 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4552 /* Line 1464 of skeleton.m4 */
4553 #line 2209 "parser.y"
4554 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4563 /* Line 1464 of skeleton.m4 */
4564 #line 2210 "parser.y"
4565 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4574 /* Line 1464 of skeleton.m4 */
4575 #line 2213 "parser.y"
4578 if(variable_exists((yyvsp[(1) - (3)].id)))
4579 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4581 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4584 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4585 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4586 (yyvsp[(2) - (3)].classinfo)->name);
4591 if(state->method->uses_slots) {
4592 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4594 // this variable is stored in a slot
4596 v->type = (yyvsp[(2) - (3)].classinfo);
4602 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4605 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4607 if((yyvsp[(2) - (3)].classinfo)) {
4608 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4609 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4610 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4612 code_free((yyvsp[(3) - (3)].value).c);
4613 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4616 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4617 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4618 (yyval.code) = abc_coerce_a((yyval.code));
4620 // don't do anything
4621 code_free((yyvsp[(3) - (3)].value).c);
4622 code_free((yyval.code));
4628 (yyval.code) = abc_setslot((yyval.code), index);
4630 (yyval.code) = abc_setlocal((yyval.code), index);
4641 /* Line 1464 of skeleton.m4 */
4642 #line 2273 "parser.y"
4643 {(yyval.code) = code_new();}
4652 /* Line 1464 of skeleton.m4 */
4653 #line 2274 "parser.y"
4654 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4663 /* Line 1464 of skeleton.m4 */
4664 #line 2277 "parser.y"
4665 {PASS12 new_state();}
4674 /* Line 1464 of skeleton.m4 */
4675 #line 2277 "parser.y"
4678 (yyval.code) = code_new();
4679 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4680 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4682 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4683 if((yyvsp[(7) - (7)].code)) {
4684 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4686 myif->branch = (yyval.code) = abc_nop((yyval.code));
4687 if((yyvsp[(7) - (7)].code)) {
4688 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4689 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4691 (yyval.code) = var_block((yyval.code));
4702 /* Line 1464 of skeleton.m4 */
4703 #line 2296 "parser.y"
4704 {(yyval.code)=code_new();}
4713 /* Line 1464 of skeleton.m4 */
4714 #line 2303 "parser.y"
4716 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4717 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4727 /* Line 1464 of skeleton.m4 */
4728 #line 2307 "parser.y"
4731 (yyval.id)=(yyvsp[(1) - (1)].id);
4741 /* Line 1464 of skeleton.m4 */
4742 #line 2312 "parser.y"
4743 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4752 /* Line 1464 of skeleton.m4 */
4753 #line 2313 "parser.y"
4754 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4763 /* Line 1464 of skeleton.m4 */
4764 #line 2315 "parser.y"
4766 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4767 (yyval.code) = code_new();
4768 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4769 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4770 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4771 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4772 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4773 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4774 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4775 (yyval.code) = abc_jump((yyval.code), loopstart);
4776 code_t*out = (yyval.code) = abc_nop((yyval.code));
4777 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4778 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4781 (yyval.code) = var_block((yyval.code));
4792 /* Line 1464 of skeleton.m4 */
4793 #line 2335 "parser.y"
4795 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4797 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4800 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4801 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4802 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4803 int array = new_variable(tmp1name, 0, 0, 0);
4805 (yyval.code) = code_new();
4806 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4807 (yyval.code) = abc_coerce_a((yyval.code));
4808 (yyval.code) = abc_setlocal((yyval.code), array);
4809 (yyval.code) = abc_pushbyte((yyval.code), 0);
4810 (yyval.code) = abc_setlocal((yyval.code), it);
4812 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4814 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4815 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4816 (yyval.code) = abc_getlocal((yyval.code), array);
4817 (yyval.code) = abc_getlocal((yyval.code), it);
4818 if(!(yyvsp[(1) - (6)].for_start).each)
4819 (yyval.code) = abc_nextname((yyval.code));
4821 (yyval.code) = abc_nextvalue((yyval.code));
4822 (yyval.code) = converttype((yyval.code), 0, var->type);
4823 (yyval.code) = abc_setlocal((yyval.code), var->index);
4825 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4826 (yyval.code) = abc_jump((yyval.code), loopstart);
4828 code_t*out = (yyval.code) = abc_nop((yyval.code));
4829 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4830 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4834 (yyval.code) = var_block((yyval.code));
4849 /* Line 1464 of skeleton.m4 */
4850 #line 2383 "parser.y"
4851 {PASS12 new_state();}
4860 /* Line 1464 of skeleton.m4 */
4861 #line 2383 "parser.y"
4864 (yyval.code) = code_new();
4866 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4867 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4868 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4869 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4870 myjmp->branch = cont;
4871 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4872 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4873 code_t*out = (yyval.code) = abc_nop((yyval.code));
4874 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4875 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4877 (yyval.code) = var_block((yyval.code));
4888 /* Line 1464 of skeleton.m4 */
4889 #line 2402 "parser.y"
4890 {PASS12 new_state();}
4899 /* Line 1464 of skeleton.m4 */
4900 #line 2402 "parser.y"
4902 (yyval.code) = code_new();
4903 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4904 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4905 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4906 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4907 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4908 code_t*out = (yyval.code) = abc_nop((yyval.code));
4909 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4910 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4912 (yyval.code) = var_block((yyval.code));
4923 /* Line 1464 of skeleton.m4 */
4924 #line 2417 "parser.y"
4926 (yyval.code) = abc___break__(0, "");
4936 /* Line 1464 of skeleton.m4 */
4937 #line 2420 "parser.y"
4939 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4949 /* Line 1464 of skeleton.m4 */
4950 #line 2423 "parser.y"
4952 (yyval.code) = abc___continue__(0, "");
4962 /* Line 1464 of skeleton.m4 */
4963 #line 2426 "parser.y"
4965 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4975 /* Line 1464 of skeleton.m4 */
4976 #line 2430 "parser.y"
4986 /* Line 1464 of skeleton.m4 */
4987 #line 2431 "parser.y"
4988 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4997 /* Line 1464 of skeleton.m4 */
4998 #line 2432 "parser.y"
4999 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5008 /* Line 1464 of skeleton.m4 */
5009 #line 2433 "parser.y"
5010 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5019 /* Line 1464 of skeleton.m4 */
5020 #line 2434 "parser.y"
5021 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5030 /* Line 1464 of skeleton.m4 */
5031 #line 2435 "parser.y"
5032 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5041 /* Line 1464 of skeleton.m4 */
5042 #line 2437 "parser.y"
5044 (yyval.code) = abc_getlocal(0, state->switch_var);
5045 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
5046 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5047 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5048 if((yyval.code)->opcode != OPCODE___BREAK__) {
5049 (yyval.code) = abc___fallthrough__((yyval.code), "");
5051 code_t*e = (yyval.code) = abc_nop((yyval.code));
5062 /* Line 1464 of skeleton.m4 */
5063 #line 2448 "parser.y"
5065 (yyval.code) = (yyvsp[(3) - (3)].code);
5075 /* Line 1464 of skeleton.m4 */
5076 #line 2451 "parser.y"
5077 {PASS12 new_state();state->switch_var=alloc_local();}
5086 /* Line 1464 of skeleton.m4 */
5087 #line 2451 "parser.y"
5089 (yyval.code)=(yyvsp[(4) - (8)].value).c;
5090 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5091 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5093 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5094 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5096 code_t*c = (yyval.code),*lastblock=0;
5098 if(c->opcode == OPCODE_IFNE) {
5099 if(!c->next) syntaxerror("internal error in fallthrough handling");
5101 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5103 c->opcode = OPCODE_JUMP;
5104 c->branch = lastblock;
5106 /* fall through end of switch */
5107 c->opcode = OPCODE_NOP;
5113 (yyval.code) = var_block((yyval.code));
5124 /* Line 1464 of skeleton.m4 */
5125 #line 2482 "parser.y"
5126 {PASS12 new_state();
5127 state->exception_name=(yyvsp[(3) - (5)].id);
5128 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5129 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5139 /* Line 1464 of skeleton.m4 */
5140 #line 2487 "parser.y"
5142 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5143 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5145 NEW(abc_exception_t, e)
5146 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5147 e->var_name = multiname_clone(&name);
5148 (yyval.exception) = e;
5151 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5152 e->target = c = abc_nop(0);
5153 c = abc_setlocal(c, i);
5154 c = code_append(c, code_dup(state->method->scope_code));
5155 c = code_append(c, (yyvsp[(8) - (9)].code));
5169 /* Line 1464 of skeleton.m4 */
5170 #line 2507 "parser.y"
5171 {PASS12 new_state();state->exception_name=0;}
5180 /* Line 1464 of skeleton.m4 */
5181 #line 2507 "parser.y"
5183 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5184 if(!(yyvsp[(4) - (5)].code)) {
5185 (yyval.exception)=0;
5187 NEW(abc_exception_t, e)
5188 e->exc_type = 0; //all exceptions
5189 e->var_name = 0; //no name
5192 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5193 (yyval.exception) = e;
5205 /* Line 1464 of skeleton.m4 */
5206 #line 2523 "parser.y"
5207 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5216 /* Line 1464 of skeleton.m4 */
5217 #line 2524 "parser.y"
5218 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5227 /* Line 1464 of skeleton.m4 */
5228 #line 2525 "parser.y"
5229 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5238 /* Line 1464 of skeleton.m4 */
5239 #line 2526 "parser.y"
5241 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5242 (yyval.catch_list).finally = 0;
5243 if((yyvsp[(2) - (2)].exception)) {
5244 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5245 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5256 /* Line 1464 of skeleton.m4 */
5257 #line 2534 "parser.y"
5259 (yyval.catch_list).l=list_new();
5260 (yyval.catch_list).finally = 0;
5261 if((yyvsp[(1) - (1)].exception)) {
5262 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5263 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5274 /* Line 1464 of skeleton.m4 */
5275 #line 2543 "parser.y"
5276 {PASS12 new_state();
5277 state->method->has_exceptions=1;
5278 state->method->late_binding=1;//for invariant scope_code
5288 /* Line 1464 of skeleton.m4 */
5289 #line 2546 "parser.y"
5291 code_t*out = abc_nop(0);
5293 code_t*start = abc_nop(0);
5294 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5295 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5296 (yyval.code) = abc_jump((yyval.code), out);
5298 code_t*end = (yyval.code) = abc_nop((yyval.code));
5301 if((yyvsp[(6) - (6)].catch_list).finally)
5302 tmp = new_variable("__finally__", 0, 0, 0);
5304 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5307 abc_exception_t*e = l->abc_exception;
5309 (yyval.code) = code_append((yyval.code), e->target);
5310 (yyval.code) = abc_jump((yyval.code), out);
5312 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5314 e->target = (yyval.code) = abc_nop((yyval.code));
5315 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5316 (yyval.code) = abc___rethrow__((yyval.code));
5324 (yyval.code) = code_append((yyval.code), out);
5326 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5328 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5330 (yyval.code) = var_block((yyval.code));
5341 /* Line 1464 of skeleton.m4 */
5342 #line 2592 "parser.y"
5344 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5345 (yyval.code)=abc_throw((yyval.code));
5355 /* Line 1464 of skeleton.m4 */
5356 #line 2596 "parser.y"
5358 if(!state->exception_name)
5359 syntaxerror("re-throw only possible within a catch block");
5360 variable_t*v = find_variable(state, state->exception_name);
5361 (yyval.code)=code_new();
5362 (yyval.code)=abc_getlocal((yyval.code), v->index);
5363 (yyval.code)=abc_throw((yyval.code));
5373 /* Line 1464 of skeleton.m4 */
5374 #line 2607 "parser.y"
5377 if(state->method->has_exceptions) {
5378 int v = alloc_local();
5379 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5380 state->method->scope_code = abc_pushwith(state->method->scope_code);
5381 (yyval.value_list).number = v;
5383 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5393 /* Line 1464 of skeleton.m4 */
5394 #line 2617 "parser.y"
5396 /* remove getlocal;pushwith from scope code again */
5397 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5399 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5400 if(state->method->has_exceptions) {
5401 (yyval.code) = abc_dup((yyval.code));
5402 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5404 (yyval.code) = abc_pushwith((yyval.code));
5405 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5406 (yyval.code) = abc_popscope((yyval.code));
5417 /* Line 1464 of skeleton.m4 */
5418 #line 2635 "parser.y"
5419 {PASS12 (yyval.id)="package";}
5428 /* Line 1464 of skeleton.m4 */
5429 #line 2636 "parser.y"
5430 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5439 /* Line 1464 of skeleton.m4 */
5440 #line 2638 "parser.y"
5441 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5450 /* Line 1464 of skeleton.m4 */
5451 #line 2639 "parser.y"
5452 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5461 /* Line 1464 of skeleton.m4 */
5462 #line 2641 "parser.y"
5463 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5472 /* Line 1464 of skeleton.m4 */
5473 #line 2642 "parser.y"
5474 {PASS12 endpackage();(yyval.code)=0;}
5483 /* Line 1464 of skeleton.m4 */
5484 #line 2643 "parser.y"
5485 {PASS12 startpackage("");}
5494 /* Line 1464 of skeleton.m4 */
5495 #line 2644 "parser.y"
5496 {PASS12 endpackage();(yyval.code)=0;}
5505 /* Line 1464 of skeleton.m4 */
5506 #line 2646 "parser.y"
5509 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5510 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5511 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5513 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5515 syntaxerror("Couldn't import class\n");
5516 state_has_imports();
5517 dict_put(state->imports, c->name, c);
5518 import_toplevel(c->package);
5529 /* Line 1464 of skeleton.m4 */
5530 #line 2660 "parser.y"
5533 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5534 as3_schedule_package((yyvsp[(2) - (4)].id));
5538 i->package = (yyvsp[(2) - (4)].id);
5539 state_has_imports();
5540 list_append(state->wildcard_imports, i);
5541 import_toplevel(i->package);
5552 /* Line 1464 of skeleton.m4 */
5553 #line 2676 "parser.y"
5554 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5563 /* Line 1464 of skeleton.m4 */
5564 #line 2677 "parser.y"
5565 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5574 /* Line 1464 of skeleton.m4 */
5575 #line 2678 "parser.y"
5576 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5585 /* Line 1464 of skeleton.m4 */
5586 #line 2679 "parser.y"
5589 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5590 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5591 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5602 /* Line 1464 of skeleton.m4 */
5603 #line 2686 "parser.y"
5604 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5613 /* Line 1464 of skeleton.m4 */
5614 #line 2687 "parser.y"
5615 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5624 /* Line 1464 of skeleton.m4 */
5625 #line 2688 "parser.y"
5626 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5635 /* Line 1464 of skeleton.m4 */
5636 #line 2689 "parser.y"
5637 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5646 /* Line 1464 of skeleton.m4 */
5647 #line 2690 "parser.y"
5648 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5657 /* Line 1464 of skeleton.m4 */
5658 #line 2691 "parser.y"
5659 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5668 /* Line 1464 of skeleton.m4 */
5669 #line 2692 "parser.y"
5670 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5679 /* Line 1464 of skeleton.m4 */
5680 #line 2693 "parser.y"
5681 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5690 /* Line 1464 of skeleton.m4 */
5691 #line 2694 "parser.y"
5692 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5701 /* Line 1464 of skeleton.m4 */
5702 #line 2695 "parser.y"
5703 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5704 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5714 /* Line 1464 of skeleton.m4 */
5715 #line 2699 "parser.y"
5716 {PASS12 (yyval.classinfo)=0;}
5725 /* Line 1464 of skeleton.m4 */
5726 #line 2700 "parser.y"
5727 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5736 /* Line 1464 of skeleton.m4 */
5737 #line 2702 "parser.y"
5738 {PASS12 (yyval.classinfo_list)=list_new();}
5747 /* Line 1464 of skeleton.m4 */
5748 #line 2703 "parser.y"
5749 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5758 /* Line 1464 of skeleton.m4 */
5759 #line 2705 "parser.y"
5760 {PASS12 (yyval.classinfo_list)=list_new();}
5769 /* Line 1464 of skeleton.m4 */
5770 #line 2706 "parser.y"
5771 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5780 /* Line 1464 of skeleton.m4 */
5781 #line 2710 "parser.y"
5782 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5791 /* Line 1464 of skeleton.m4 */
5792 #line 2712 "parser.y"
5793 {PASS12 endclass();(yyval.code)=0;}
5802 /* Line 1464 of skeleton.m4 */
5803 #line 2716 "parser.y"
5804 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5805 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5814 /* Line 1464 of skeleton.m4 */
5815 #line 2719 "parser.y"
5816 {PASS12 endclass();(yyval.code)=0;}
5825 /* Line 1464 of skeleton.m4 */
5826 #line 2732 "parser.y"
5828 code_t*c = state->cls->static_init->header;
5829 c = code_append(c, (yyvsp[(1) - (1)].code));
5830 state->cls->static_init->header = c;
5840 /* Line 1464 of skeleton.m4 */
5841 #line 2743 "parser.y"
5843 syntaxerror("variable declarations not allowed in interfaces");
5853 /* Line 1464 of skeleton.m4 */
5854 #line 2746 "parser.y"
5857 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5858 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5859 syntaxerror("invalid method modifiers: interface methods always need to be public");
5861 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5862 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5863 list_deep_free((yyvsp[(6) - (8)].params).list);
5873 /* Line 1464 of skeleton.m4 */
5874 #line 2761 "parser.y"
5875 {setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5884 /* Line 1464 of skeleton.m4 */
5885 #line 2761 "parser.y"
5886 {(yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5895 /* Line 1464 of skeleton.m4 */
5896 #line 2763 "parser.y"
5897 {(yyval.code) = (yyvsp[(1) - (1)].code);}
5906 /* Line 1464 of skeleton.m4 */
5907 #line 2764 "parser.y"
5908 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
5917 /* Line 1464 of skeleton.m4 */
5918 #line 2767 "parser.y"
5920 int flags = slotstate_flags->flags;
5921 namespace_t ns = modifiers2access(slotstate_flags);
5923 varinfo_t* info = 0;
5925 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
5927 check_override(i, flags);
5929 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
5931 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
5933 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
5935 if(ns.name && ns.name[0]) {
5936 syntaxerror("namespaces not allowed on package-level variables");
5938 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
5941 info->type = (yyvsp[(2) - (3)].classinfo);
5942 info->flags = flags;
5945 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
5947 trait_list_t**traits;
5951 ns.name = state->package;
5952 traits = &global->init->traits;
5953 code = &global->init->method->body->code;
5954 } else if(flags&FLAG_STATIC) {
5956 traits = &state->cls->abc->static_traits;
5957 code = &state->cls->static_init->header;
5959 // instance variable
5960 traits = &state->cls->abc->traits;
5961 code = &state->cls->init->header;
5965 if((yyvsp[(2) - (3)].classinfo)) {
5966 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
5967 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5969 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5971 info->slot = t->slot_id;
5973 /* initalization code (if needed) */
5975 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
5976 c = abc_getlocal_0(c);
5977 c = code_append(c, (yyvsp[(3) - (3)].value).c);
5978 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
5979 c = abc_setslot(c, t->slot_id);
5982 *code = code_append(*code, c);
5984 if(slotstate_varconst==KW_CONST) {
5985 t->kind= TRAIT_CONST;
5998 /* Line 1464 of skeleton.m4 */
5999 #line 2841 "parser.y"
6000 {(yyval.constant)=0;}
6009 /* Line 1464 of skeleton.m4 */
6010 #line 2842 "parser.y"
6011 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
6020 /* Line 1464 of skeleton.m4 */
6021 #line 2844 "parser.y"
6022 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
6031 /* Line 1464 of skeleton.m4 */
6032 #line 2845 "parser.y"
6033 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6042 /* Line 1464 of skeleton.m4 */
6043 #line 2846 "parser.y"
6044 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
6053 /* Line 1464 of skeleton.m4 */
6054 #line 2847 "parser.y"
6055 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6064 /* Line 1464 of skeleton.m4 */
6065 #line 2848 "parser.y"
6066 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6075 /* Line 1464 of skeleton.m4 */
6076 #line 2850 "parser.y"
6077 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6086 /* Line 1464 of skeleton.m4 */
6087 #line 2851 "parser.y"
6088 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6097 /* Line 1464 of skeleton.m4 */
6098 #line 2852 "parser.y"
6099 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6108 /* Line 1464 of skeleton.m4 */
6109 #line 2853 "parser.y"
6111 if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) {
6112 (yyval.constant) = constant_new_float(__builtin_nan(""));
6114 as3_warning("Couldn't evaluate constant value of %s", (yyvsp[(1) - (1)].id));
6115 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
6126 /* Line 1464 of skeleton.m4 */
6127 #line 2865 "parser.y"
6130 memset(&(yyval.params),0,sizeof((yyval.params)));
6140 /* Line 1464 of skeleton.m4 */
6141 #line 2869 "parser.y"
6144 (yyval.params)=(yyvsp[(1) - (1)].params);
6154 /* Line 1464 of skeleton.m4 */
6155 #line 2875 "parser.y"
6158 memset(&(yyval.params),0,sizeof((yyval.params)));
6159 (yyval.params).varargs=1;
6160 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6170 /* Line 1464 of skeleton.m4 */
6171 #line 2881 "parser.y"
6174 (yyval.params) =(yyvsp[(1) - (4)].params);
6175 (yyval.params).varargs=1;
6176 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6186 /* Line 1464 of skeleton.m4 */
6187 #line 2889 "parser.y"
6190 (yyval.params) = (yyvsp[(1) - (3)].params);
6191 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6201 /* Line 1464 of skeleton.m4 */
6202 #line 2894 "parser.y"
6205 memset(&(yyval.params),0,sizeof((yyval.params)));
6206 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6216 /* Line 1464 of skeleton.m4 */
6217 #line 2900 "parser.y"
6220 (yyval.param) = rfx_calloc(sizeof(param_t));
6221 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6222 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6224 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6234 /* Line 1464 of skeleton.m4 */
6235 #line 2908 "parser.y"
6238 (yyval.param) = rfx_calloc(sizeof(param_t));
6239 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6240 (yyval.param)->type = TYPE_ANY;
6242 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6252 /* Line 1464 of skeleton.m4 */
6253 #line 2918 "parser.y"
6254 {PASS12 (yyval.token)=0;}
6263 /* Line 1464 of skeleton.m4 */
6264 #line 2921 "parser.y"
6265 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6274 /* Line 1464 of skeleton.m4 */
6275 #line 2922 "parser.y"
6278 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6280 if(!state->method->info) syntaxerror("internal error");
6282 code_t*c = method_header(state->method);
6283 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6285 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6287 list_deep_free((yyvsp[(6) - (12)].params).list);
6298 /* Line 1464 of skeleton.m4 */
6299 #line 2938 "parser.y"
6300 {PASS12 (yyval.id)=0;}
6309 /* Line 1464 of skeleton.m4 */
6310 #line 2940 "parser.y"
6311 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6320 /* Line 1464 of skeleton.m4 */
6321 #line 2941 "parser.y"
6324 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6326 methodinfo_t*f = state->method->info;
6327 if(!f || !f->kind) syntaxerror("internal error");
6329 code_t*c = method_header(state->method);
6330 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6332 int index = state->method->var_index;
6333 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6335 (yyval.value).c = abc_getlocal(0, index);
6336 (yyval.value).t = TYPE_FUNCTION(f);
6338 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6348 /* Line 1464 of skeleton.m4 */
6349 #line 2963 "parser.y"
6351 PASS1 NEW(unresolvedinfo_t,c);
6352 memset(c, 0, sizeof(*c));
6353 c->kind = INFOTYPE_UNRESOLVED;
6354 c->name = (yyvsp[(1) - (1)].id);
6355 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6357 c->nsset = get_current_imports();
6358 /* make the compiler look for this class in the current directory,
6360 //as3_schedule_class_noerror(state->package, $1);
6362 (yyval.classinfo) = (classinfo_t*)c;
6364 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6365 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6366 (yyval.classinfo) = (classinfo_t*)s;
6376 /* Line 1464 of skeleton.m4 */
6377 #line 2982 "parser.y"
6379 PASS1 NEW(unresolvedinfo_t,c);
6380 memset(c, 0, sizeof(*c));
6381 c->kind = INFOTYPE_UNRESOLVED;
6382 c->package = (yyvsp[(1) - (3)].id);
6383 c->name = (yyvsp[(3) - (3)].id);
6384 (yyval.classinfo) = (classinfo_t*)c;
6386 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6387 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6388 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6389 (yyval.classinfo) = (classinfo_t*)s;
6399 /* Line 1464 of skeleton.m4 */
6400 #line 2999 "parser.y"
6401 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6410 /* Line 1464 of skeleton.m4 */
6411 #line 3000 "parser.y"
6412 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6421 /* Line 1464 of skeleton.m4 */
6422 #line 3002 "parser.y"
6423 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6432 /* Line 1464 of skeleton.m4 */
6433 #line 3003 "parser.y"
6434 {PASS12 (yyval.classinfo)=registry_getanytype();}
6443 /* Line 1464 of skeleton.m4 */
6444 #line 3004 "parser.y"
6445 {PASS12 (yyval.classinfo)=registry_getanytype();}
6454 /* Line 1464 of skeleton.m4 */
6455 #line 3013 "parser.y"
6456 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6465 /* Line 1464 of skeleton.m4 */
6466 #line 3014 "parser.y"
6467 {PASS12 (yyval.classinfo)=0;}
6476 /* Line 1464 of skeleton.m4 */
6477 #line 3018 "parser.y"
6478 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6487 /* Line 1464 of skeleton.m4 */
6488 #line 3019 "parser.y"
6489 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6498 /* Line 1464 of skeleton.m4 */
6499 #line 3021 "parser.y"
6500 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6509 /* Line 1464 of skeleton.m4 */
6510 #line 3025 "parser.y"
6511 {(yyval.value_list).number=1;
6512 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6522 /* Line 1464 of skeleton.m4 */
6523 #line 3029 "parser.y"
6524 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6533 /* Line 1464 of skeleton.m4 */
6534 #line 3030 "parser.y"
6536 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6537 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6547 /* Line 1464 of skeleton.m4 */
6548 #line 3036 "parser.y"
6550 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6551 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6553 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6554 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6555 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6556 (yyval.value).c = code_cutlast((yyval.value).c);
6557 (yyval.value).c = code_append((yyval.value).c, paramcode);
6558 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6559 multiname_destroy(name);
6560 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6561 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6562 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6563 multiname_t*name = t->name;
6564 (yyval.value).c = code_cutlast((yyval.value).c);
6565 (yyval.value).c = code_append((yyval.value).c, paramcode);
6566 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6568 (yyval.value).c = code_append((yyval.value).c, paramcode);
6569 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6572 (yyval.value).t = TYPE_ANY;
6573 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6574 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6576 (yyval.value).c = abc_coerce_a((yyval.value).c);
6577 (yyval.value).t = TYPE_ANY;
6588 /* Line 1464 of skeleton.m4 */
6589 #line 3072 "parser.y"
6592 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6593 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6594 (yyval.value).c = code_cutlast((yyval.value).c);
6596 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6598 (yyval.value).t = TYPE_ANY;
6599 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6600 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6601 (yyval.value).c = code_cutlast((yyval.value).c);
6602 (yyval.value).c = code_append((yyval.value).c, paramcode);
6603 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6604 multiname_destroy(name);
6605 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6606 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6607 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6608 if(t->kind!=TRAIT_METHOD) {
6609 //ok: flash allows to assign closures to members.
6611 multiname_t*name = t->name;
6612 (yyval.value).c = code_cutlast((yyval.value).c);
6613 (yyval.value).c = code_append((yyval.value).c, paramcode);
6614 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6615 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6616 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6617 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6618 (yyval.value).c = code_cutlast((yyval.value).c);
6619 (yyval.value).c = code_append((yyval.value).c, paramcode);
6620 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6621 multiname_destroy(name);
6623 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6624 (yyval.value).c = code_append((yyval.value).c, paramcode);
6625 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6628 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6629 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6631 (yyval.value).c = abc_coerce_a((yyval.value).c);
6632 (yyval.value).t = TYPE_ANY;
6643 /* Line 1464 of skeleton.m4 */
6644 #line 3118 "parser.y"
6646 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6647 if(!state->method) syntaxerror("super() not allowed outside of a function");
6648 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6650 (yyval.value).c = code_new();
6651 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6653 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6655 this is dependent on the control path, check this somewhere else
6656 if(state->method->has_super)
6657 syntaxerror("constructor may call super() only once");
6659 state->method->has_super = 1;
6661 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6662 (yyval.value).c = abc_pushundefined((yyval.value).c);
6663 (yyval.value).t = TYPE_ANY;
6673 /* Line 1464 of skeleton.m4 */
6674 #line 3139 "parser.y"
6676 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6677 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6678 (yyval.value).c = code_cutlast((yyval.value).c);
6680 multiname_t*name = 0;
6681 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6682 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6683 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6684 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6685 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6686 (yyval.value).c = code_cutlast((yyval.value).c);
6687 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6689 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6690 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6691 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6693 (yyval.value).t = TYPE_BOOLEAN;
6703 /* Line 1464 of skeleton.m4 */
6704 #line 3160 "parser.y"
6706 (yyval.code) = abc_returnvoid(0);
6716 /* Line 1464 of skeleton.m4 */
6717 #line 3163 "parser.y"
6719 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6720 (yyval.code) = abc_returnvalue((yyval.code));
6730 /* Line 1464 of skeleton.m4 */
6731 #line 3170 "parser.y"
6732 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6741 /* Line 1464 of skeleton.m4 */
6742 #line 3171 "parser.y"
6743 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6752 /* Line 1464 of skeleton.m4 */
6753 #line 3172 "parser.y"
6755 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6756 (yyval.value).c = cut_last_push((yyval.value).c);
6757 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6758 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6768 /* Line 1464 of skeleton.m4 */
6769 #line 3178 "parser.y"
6771 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6781 /* Line 1464 of skeleton.m4 */
6782 #line 3184 "parser.y"
6783 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6792 /* Line 1464 of skeleton.m4 */
6793 #line 3188 "parser.y"
6794 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6803 /* Line 1464 of skeleton.m4 */
6804 #line 3190 "parser.y"
6805 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6814 /* Line 1464 of skeleton.m4 */
6815 #line 3192 "parser.y"
6816 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6825 /* Line 1464 of skeleton.m4 */
6826 #line 3196 "parser.y"
6828 (yyval.value).c = 0;
6829 namespace_t ns = {ACCESS_PACKAGE, ""};
6830 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6831 if(!(yyvsp[(1) - (1)].regexp).options) {
6832 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6833 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6834 (yyval.value).c = abc_construct((yyval.value).c, 1);
6836 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6837 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6838 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6839 (yyval.value).c = abc_construct((yyval.value).c, 2);
6841 (yyval.value).t = TYPE_REGEXP;
6851 /* Line 1464 of skeleton.m4 */
6852 #line 3213 "parser.y"
6853 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6854 //MULTINAME(m, registry_getintclass());
6855 //$$.c = abc_coerce2($$.c, &m); // FIXME
6856 (yyval.value).t = TYPE_INT;
6866 /* Line 1464 of skeleton.m4 */
6867 #line 3218 "parser.y"
6868 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6869 (yyval.value).t = TYPE_INT;
6879 /* Line 1464 of skeleton.m4 */
6880 #line 3221 "parser.y"
6881 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6882 (yyval.value).t = TYPE_INT;
6892 /* Line 1464 of skeleton.m4 */
6893 #line 3224 "parser.y"
6894 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6895 (yyval.value).t = TYPE_UINT;
6905 /* Line 1464 of skeleton.m4 */
6906 #line 3227 "parser.y"
6907 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6908 (yyval.value).t = TYPE_FLOAT;
6918 /* Line 1464 of skeleton.m4 */
6919 #line 3230 "parser.y"
6920 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6921 (yyval.value).t = TYPE_STRING;
6931 /* Line 1464 of skeleton.m4 */
6932 #line 3233 "parser.y"
6933 {(yyval.value).c = abc_pushundefined(0);
6934 (yyval.value).t = TYPE_ANY;
6944 /* Line 1464 of skeleton.m4 */
6945 #line 3236 "parser.y"
6946 {(yyval.value).c = abc_pushtrue(0);
6947 (yyval.value).t = TYPE_BOOLEAN;
6957 /* Line 1464 of skeleton.m4 */
6958 #line 3239 "parser.y"
6959 {(yyval.value).c = abc_pushfalse(0);
6960 (yyval.value).t = TYPE_BOOLEAN;
6970 /* Line 1464 of skeleton.m4 */
6971 #line 3242 "parser.y"
6972 {(yyval.value).c = abc_pushnull(0);
6973 (yyval.value).t = TYPE_NULL;
6983 /* Line 1464 of skeleton.m4 */
6984 #line 3246 "parser.y"
6985 {(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);
6986 (yyval.value).t = TYPE_BOOLEAN;
6996 /* Line 1464 of skeleton.m4 */
6997 #line 3249 "parser.y"
6998 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6999 (yyval.value).t = TYPE_BOOLEAN;
7009 /* Line 1464 of skeleton.m4 */
7010 #line 3252 "parser.y"
7011 {(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);
7012 (yyval.value).t = TYPE_BOOLEAN;
7022 /* Line 1464 of skeleton.m4 */
7023 #line 3255 "parser.y"
7024 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
7025 (yyval.value).t = TYPE_BOOLEAN;
7035 /* Line 1464 of skeleton.m4 */
7036 #line 3258 "parser.y"
7037 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
7038 (yyval.value).t = TYPE_BOOLEAN;
7048 /* Line 1464 of skeleton.m4 */
7049 #line 3261 "parser.y"
7050 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
7051 (yyval.value).t = TYPE_BOOLEAN;
7061 /* Line 1464 of skeleton.m4 */
7062 #line 3264 "parser.y"
7063 {(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);
7064 (yyval.value).t = TYPE_BOOLEAN;
7074 /* Line 1464 of skeleton.m4 */
7075 #line 3267 "parser.y"
7076 {(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);
7077 (yyval.value).t = TYPE_BOOLEAN;
7087 /* Line 1464 of skeleton.m4 */
7088 #line 3271 "parser.y"
7089 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
7090 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7091 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7092 (yyval.value).c = abc_dup((yyval.value).c);
7093 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
7094 (yyval.value).c = cut_last_push((yyval.value).c);
7095 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7096 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7097 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7098 jmp->branch = label;
7108 /* Line 1464 of skeleton.m4 */
7109 #line 3282 "parser.y"
7111 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
7112 /*printf("%08x:\n",$1.t);
7113 code_dump($1.c, 0, 0, "", stdout);
7114 printf("%08x:\n",$3.t);
7115 code_dump($3.c, 0, 0, "", stdout);
7116 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
7117 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7118 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7119 (yyval.value).c = abc_dup((yyval.value).c);
7120 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7121 (yyval.value).c = cut_last_push((yyval.value).c);
7122 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7123 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7124 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7125 jmp->branch = label;
7135 /* Line 1464 of skeleton.m4 */
7136 #line 3300 "parser.y"
7137 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7138 (yyval.value).c = abc_not((yyval.value).c);
7139 (yyval.value).t = TYPE_BOOLEAN;
7149 /* Line 1464 of skeleton.m4 */
7150 #line 3305 "parser.y"
7151 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7152 (yyval.value).c = abc_bitnot((yyval.value).c);
7153 (yyval.value).t = TYPE_INT;
7163 /* Line 1464 of skeleton.m4 */
7164 #line 3310 "parser.y"
7165 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7166 (yyval.value).c = abc_bitand((yyval.value).c);
7167 (yyval.value).t = TYPE_INT;
7177 /* Line 1464 of skeleton.m4 */
7178 #line 3315 "parser.y"
7179 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7180 (yyval.value).c = abc_bitxor((yyval.value).c);
7181 (yyval.value).t = TYPE_INT;
7191 /* Line 1464 of skeleton.m4 */
7192 #line 3320 "parser.y"
7193 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7194 (yyval.value).c = abc_bitor((yyval.value).c);
7195 (yyval.value).t = TYPE_INT;
7205 /* Line 1464 of skeleton.m4 */
7206 #line 3325 "parser.y"
7207 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7208 (yyval.value).c = abc_rshift((yyval.value).c);
7209 (yyval.value).t = TYPE_INT;
7219 /* Line 1464 of skeleton.m4 */
7220 #line 3329 "parser.y"
7221 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7222 (yyval.value).c = abc_urshift((yyval.value).c);
7223 (yyval.value).t = TYPE_INT;
7233 /* Line 1464 of skeleton.m4 */
7234 #line 3333 "parser.y"
7235 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7236 (yyval.value).c = abc_lshift((yyval.value).c);
7237 (yyval.value).t = TYPE_INT;
7247 /* Line 1464 of skeleton.m4 */
7248 #line 3338 "parser.y"
7249 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7250 (yyval.value).c = abc_divide((yyval.value).c);
7251 (yyval.value).t = TYPE_NUMBER;
7261 /* Line 1464 of skeleton.m4 */
7262 #line 3342 "parser.y"
7263 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7264 (yyval.value).c = abc_modulo((yyval.value).c);
7265 (yyval.value).t = TYPE_NUMBER;
7275 /* Line 1464 of skeleton.m4 */
7276 #line 3346 "parser.y"
7277 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7278 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7279 (yyval.value).c = abc_add_i((yyval.value).c);
7280 (yyval.value).t = TYPE_INT;
7282 (yyval.value).c = abc_add((yyval.value).c);
7283 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7294 /* Line 1464 of skeleton.m4 */
7295 #line 3355 "parser.y"
7296 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7297 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7298 (yyval.value).c = abc_subtract_i((yyval.value).c);
7299 (yyval.value).t = TYPE_INT;
7301 (yyval.value).c = abc_subtract((yyval.value).c);
7302 (yyval.value).t = TYPE_NUMBER;
7313 /* Line 1464 of skeleton.m4 */
7314 #line 3364 "parser.y"
7315 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7316 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7317 (yyval.value).c = abc_multiply_i((yyval.value).c);
7318 (yyval.value).t = TYPE_INT;
7320 (yyval.value).c = abc_multiply((yyval.value).c);
7321 (yyval.value).t = TYPE_NUMBER;
7332 /* Line 1464 of skeleton.m4 */
7333 #line 3374 "parser.y"
7334 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7335 (yyval.value).c = abc_in((yyval.value).c);
7336 (yyval.value).t = TYPE_BOOLEAN;
7346 /* Line 1464 of skeleton.m4 */
7347 #line 3379 "parser.y"
7348 {char use_astype=0; // flash player's astype works differently than astypelate
7349 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7350 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7351 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7352 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7354 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7355 (yyval.value).c = abc_astypelate((yyval.value).c);
7356 (yyval.value).t = TYPE_ANY;
7367 /* Line 1464 of skeleton.m4 */
7368 #line 3392 "parser.y"
7369 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7370 (yyval.value).c = abc_instanceof((yyval.value).c);
7371 (yyval.value).t = TYPE_BOOLEAN;
7381 /* Line 1464 of skeleton.m4 */
7382 #line 3397 "parser.y"
7383 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7384 (yyval.value).c = abc_istypelate((yyval.value).c);
7385 (yyval.value).t = TYPE_BOOLEAN;
7395 /* Line 1464 of skeleton.m4 */
7396 #line 3402 "parser.y"
7398 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7399 (yyval.value).c = abc_typeof((yyval.value).c);
7400 (yyval.value).t = TYPE_STRING;
7410 /* Line 1464 of skeleton.m4 */
7411 #line 3408 "parser.y"
7413 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7414 (yyval.value).c = abc_pushundefined((yyval.value).c);
7415 (yyval.value).t = TYPE_ANY;
7425 /* Line 1464 of skeleton.m4 */
7426 #line 3414 "parser.y"
7427 { (yyval.value).c = abc_pushundefined(0);
7428 (yyval.value).t = TYPE_ANY;
7438 /* Line 1464 of skeleton.m4 */
7439 #line 3418 "parser.y"
7440 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7449 /* Line 1464 of skeleton.m4 */
7450 #line 3420 "parser.y"
7452 (yyval.value)=(yyvsp[(2) - (2)].value);
7453 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7454 (yyval.value).c=abc_negate_i((yyval.value).c);
7455 (yyval.value).t = TYPE_INT;
7457 (yyval.value).c=abc_negate((yyval.value).c);
7458 (yyval.value).t = TYPE_NUMBER;
7469 /* Line 1464 of skeleton.m4 */
7470 #line 3431 "parser.y"
7472 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7473 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7475 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7476 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7477 (yyval.value).t = 0; // array elements have unknown type
7487 /* Line 1464 of skeleton.m4 */
7488 #line 3440 "parser.y"
7490 (yyval.value).c = code_new();
7491 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7492 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).number);
7493 (yyval.value).t = registry_getarrayclass();
7503 /* Line 1464 of skeleton.m4 */
7504 #line 3447 "parser.y"
7505 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7514 /* Line 1464 of skeleton.m4 */
7515 #line 3448 "parser.y"
7516 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7525 /* Line 1464 of skeleton.m4 */
7526 #line 3450 "parser.y"
7528 (yyval.value_list).cc = 0;
7529 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7530 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7531 (yyval.value_list).number = 2;
7541 /* Line 1464 of skeleton.m4 */
7542 #line 3456 "parser.y"
7544 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7545 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7546 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7547 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7557 /* Line 1464 of skeleton.m4 */
7558 #line 3465 "parser.y"
7560 (yyval.value).c = code_new();
7561 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7562 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).number/2);
7563 (yyval.value).t = registry_getobjectclass();
7573 /* Line 1464 of skeleton.m4 */
7574 #line 3472 "parser.y"
7576 code_t*c = (yyvsp[(3) - (3)].value).c;
7577 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7578 c=abc_multiply_i(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 3484 "parser.y"
7597 code_t*c = abc_modulo((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 3490 "parser.y"
7613 code_t*c = abc_lshift((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 3496 "parser.y"
7629 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7630 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (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 3502 "parser.y"
7645 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7646 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (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 3508 "parser.y"
7661 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7662 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (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 3514 "parser.y"
7677 code_t*c = abc_bitor((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 3520 "parser.y"
7693 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7694 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7695 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7696 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7706 /* Line 1464 of skeleton.m4 */
7707 #line 3526 "parser.y"
7709 code_t*c = (yyvsp[(3) - (3)].value).c;
7711 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7715 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7718 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7719 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7729 /* Line 1464 of skeleton.m4 */
7730 #line 3539 "parser.y"
7731 { code_t*c = (yyvsp[(3) - (3)].value).c;
7732 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7733 c=abc_subtract_i(c);
7736 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7739 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7740 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7750 /* Line 1464 of skeleton.m4 */
7751 #line 3550 "parser.y"
7753 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7754 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7755 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7756 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7766 /* Line 1464 of skeleton.m4 */
7767 #line 3557 "parser.y"
7769 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7770 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7771 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7772 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7773 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7774 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7775 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7776 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7777 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7778 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7788 /* Line 1464 of skeleton.m4 */
7789 #line 3570 "parser.y"
7791 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7792 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7793 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7794 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7795 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7796 (yyval.value).c = abc_getlocal(0, nr);
7797 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7798 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7799 (yyval.value).c = abc_getlocal(0, nr);
7800 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7801 } else syntaxerror("internal error");
7803 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7804 c=abc_increment_i(c);
7810 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7811 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7812 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7823 /* Line 1464 of skeleton.m4 */
7824 #line 3597 "parser.y"
7826 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7827 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7828 c=abc_decrement_i(c);
7834 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7835 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7836 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7846 /* Line 1464 of skeleton.m4 */
7847 #line 3611 "parser.y"
7849 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7850 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7851 c=abc_increment_i(c);
7857 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7858 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7859 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7869 /* Line 1464 of skeleton.m4 */
7870 #line 3625 "parser.y"
7872 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7873 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7874 c=abc_decrement_i(c);
7880 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7881 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7882 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7892 /* Line 1464 of skeleton.m4 */
7893 #line 3640 "parser.y"
7894 { if(!state->cls->info)
7895 syntaxerror("super keyword not allowed outside a class");
7896 classinfo_t*t = state->cls->info->superclass;
7897 if(!t) t = TYPE_OBJECT;
7899 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7901 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7902 (yyval.value).c = 0;
7903 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7904 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7905 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7915 /* Line 1464 of skeleton.m4 */
7916 #line 3654 "parser.y"
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 3661 "parser.y"
7934 // child attribute 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 3668 "parser.y"
7950 // namespace declaration TODO
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 3675 "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 3682 "parser.y"
7983 (yyval.value).c = abc_pushundefined(0);
7984 (yyval.value).t = 0;
7985 as3_warning("ignored .() operator");
7995 /* Line 1464 of skeleton.m4 */
7996 #line 3693 "parser.y"
7998 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7999 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
8001 if(TYPE_IS_CLASS(t) && t->data) {
8006 if(t->subtype==INFOTYPE_UNRESOLVED) {
8007 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
8009 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
8011 if(f && !is_static != !(f->flags&FLAG_STATIC))
8013 if(f && f->slot && !noslot) {
8014 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8016 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
8017 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8019 /* determine type */
8020 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
8021 if(!(yyval.value).t)
8022 (yyval.value).c = abc_coerce_a((yyval.value).c);
8023 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
8024 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
8025 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8027 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8029 (yyval.value) = push_class(a);
8030 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8031 registry_ispackage(package2)) {
8032 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
8033 (yyval.value).c->data[0] = string_new4(package2);
8034 (yyval.value).t = 0;
8036 syntaxerror("couldn't resolve %s", package2);
8039 /* when resolving a property on an unknown type, we do know the
8040 name of the property (and don't seem to need the package), but
8041 we need to make avm2 try out all access modes */
8042 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8043 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8044 (yyval.value).c = abc_coerce_a((yyval.value).c);
8045 (yyval.value).t = registry_getanytype();
8056 /* Line 1464 of skeleton.m4 */
8057 #line 3745 "parser.y"
8060 /* Queue unresolved identifiers for checking against the parent
8061 function's variables.
8062 We consider everything which is not a local variable "unresolved".
8063 This encompasses class names, members of the surrounding class
8064 etc. which is *correct* because local variables of the parent function
8067 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
8068 unknown_variable((yyvsp[(1) - (1)].id));
8071 /* let the compiler know that it might want to check the current directory/package
8072 for this identifier- maybe there's a file $1.as defining $1. */
8073 //as3_schedule_class_noerror(state->package, $1);
8076 (yyval.value).t = 0;
8077 (yyval.value).c = 0;
8082 /* look at variables */
8083 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
8084 // $1 is a local variable
8085 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
8086 (yyval.value).t = v->type;
8089 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
8090 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
8091 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
8092 (yyval.value).t = v->type;
8096 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
8098 /* look at current class' members */
8099 if(!state->method->inner &&
8101 (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
8102 (f->flags&FLAG_STATIC) >= i_am_static)
8104 // $1 is a function in this class
8105 int var_is_static = (f->flags&FLAG_STATIC);
8107 if(f->kind == INFOTYPE_METHOD) {
8108 (yyval.value).t = TYPE_FUNCTION(f);
8110 (yyval.value).t = f->type;
8112 if(var_is_static && !i_am_static) {
8113 /* access to a static member from a non-static location.
8114 do this via findpropstrict:
8115 there doesn't seem to be any non-lookup way to access
8116 static properties of a class */
8117 state->method->late_binding = 1;
8118 (yyval.value).t = f->type;
8119 namespace_t ns = {f->access, ""};
8120 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8121 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8122 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8124 } else if(f->slot>0) {
8125 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8126 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8129 namespace_t ns = {f->access, ""};
8130 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8131 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8132 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8137 /* look at actual classes, in the current package and imported */
8138 if((a = find_class((yyvsp[(1) - (1)].id)))) {
8139 (yyval.value) = push_class(a);
8143 /* look through package prefixes */
8144 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) ||
8145 registry_ispackage((yyvsp[(1) - (1)].id))) {
8146 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
8147 (yyval.value).t = 0;
8151 /* unknown object, let the avm2 resolve it */
8153 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
8154 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
8155 state->method->late_binding = 1;
8157 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
8159 (yyval.value).t = 0;
8160 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8161 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8172 /* Line 1464 of skeleton.m4 */
8173 #line 3854 "parser.y"
8176 NEW(namespace_decl_t,n);
8177 n->name = (yyvsp[(2) - (2)].id);
8178 n->url = (yyvsp[(2) - (2)].id);
8179 (yyval.namespace_decl)=n;
8189 /* Line 1464 of skeleton.m4 */
8190 #line 3861 "parser.y"
8193 NEW(namespace_decl_t,n);
8194 n->name = (yyvsp[(2) - (4)].id);
8195 n->url = (yyvsp[(4) - (4)].id);
8196 (yyval.namespace_decl)=n;
8206 /* Line 1464 of skeleton.m4 */
8207 #line 3868 "parser.y"
8210 NEW(namespace_decl_t,n);
8211 n->name = (yyvsp[(2) - (4)].id);
8212 n->url = (yyvsp[(4) - (4)].str).str;
8213 (yyval.namespace_decl)=n;
8223 /* Line 1464 of skeleton.m4 */
8224 #line 3875 "parser.y"
8227 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8229 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8230 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8231 var->type = TYPE_NAMESPACE;
8233 ns.access = ACCESS_NAMESPACE;
8234 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8235 var->value = constant_new_namespace(&ns);
8247 /* Line 1464 of skeleton.m4 */
8248 #line 3890 "parser.y"
8251 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8252 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8253 if(!s || s->kind != INFOTYPE_SLOT)
8254 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8255 if(!s->value || !NS_TYPE(s->value->type))
8256 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8257 url = s->value->ns->name;
8259 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8260 add_active_url(url);
8269 /* Line 1464 of skeleton.m4 */
8270 #line 8271 "parser.tab.c"
8273 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8277 YY_STACK_PRINT (yyss, yyssp);
8281 /* Now `shift' the result of the reduction. Determine what state
8282 that goes to, based on the state we popped back to and the rule
8283 number reduced by. */
8287 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8288 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8289 yystate = yytable[yystate];
8291 yystate = yydefgoto[yyn - YYNTOKENS];
8296 /*------------------------------------.
8297 | yyerrlab -- here on detecting error |
8298 `------------------------------------*/
8300 /* If not already recovering from an error, report this error. */
8304 #if ! YYERROR_VERBOSE
8305 yyerror (YY_("syntax error"));
8308 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8309 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8311 YYSIZE_T yyalloc = 2 * yysize;
8312 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8313 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8314 if (yymsg != yymsgbuf)
8315 YYSTACK_FREE (yymsg);
8316 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8318 yymsg_alloc = yyalloc;
8322 yymsg_alloc = sizeof yymsgbuf;
8326 if (0 < yysize && yysize <= yymsg_alloc)
8328 (void) yysyntax_error (yymsg, yystate, yychar);
8333 yyerror (YY_("syntax error"));
8335 goto yyexhaustedlab;
8343 if (yyerrstatus == 3)
8345 /* If just tried and failed to reuse lookahead token after an
8346 error, discard it. */
8348 if (yychar <= YYEOF)
8350 /* Return failure if at end of input. */
8351 if (yychar == YYEOF)
8356 yydestruct ("Error: discarding",
8362 /* Else will try to reuse lookahead token after shifting the error
8367 /*---------------------------------------------------.
8368 | yyerrorlab -- error raised explicitly by YYERROR. |
8369 `---------------------------------------------------*/
8372 /* Pacify compilers like GCC when the user code never invokes
8373 YYERROR and the label yyerrorlab therefore never appears in user
8375 if (/*CONSTCOND*/ 0)
8378 /* Do not reclaim the symbols of the rule which action triggered
8382 YY_STACK_PRINT (yyss, yyssp);
8387 /*-------------------------------------------------------------.
8388 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8389 `-------------------------------------------------------------*/
8391 yyerrstatus = 3; /* Each real token shifted decrements this. */
8395 yyn = yypact[yystate];
8396 if (yyn != YYPACT_NINF)
8399 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8407 /* Pop the current state because it cannot handle the error token. */
8412 yydestruct ("Error: popping",
8413 yystos[yystate], yyvsp);
8416 YY_STACK_PRINT (yyss, yyssp);
8422 /* Shift the error token. */
8423 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8429 /*-------------------------------------.
8430 | yyacceptlab -- YYACCEPT comes here. |
8431 `-------------------------------------*/
8436 /*-----------------------------------.
8437 | yyabortlab -- YYABORT comes here. |
8438 `-----------------------------------*/
8443 #if !defined(yyoverflow) || YYERROR_VERBOSE
8444 /*-------------------------------------------------.
8445 | yyexhaustedlab -- memory exhaustion comes here. |
8446 `-------------------------------------------------*/
8448 yyerror (YY_("memory exhausted"));
8454 if (yychar != YYEMPTY)
8455 yydestruct ("Cleanup: discarding lookahead",
8457 /* Do not reclaim the symbols of the rule which action triggered
8458 this YYABORT or YYACCEPT. */
8460 YY_STACK_PRINT (yyss, yyssp);
8461 while (yyssp != yyss)
8463 yydestruct ("Cleanup: popping",
8464 yystos[*yyssp], yyvsp);
8469 YYSTACK_FREE (yyss);
8472 if (yymsg != yymsgbuf)
8473 YYSTACK_FREE (yymsg);
8475 /* Make sure YYID is used. */
8476 return YYID (yyresult);