2 /* A Bison parser, made by GNU Bison 2.4. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4"
52 #define YYSKELETON_NAME "./skeleton.m4"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse a3_parse
69 #define yyerror a3_error
70 #define yylval a3_lval
71 #define yychar a3_char
72 #define yydebug a3_debug
73 #define yynerrs a3_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 198 of skeleton.m4 */
88 #include "tokenizer.h"
99 /* Line 198 of skeleton.m4 */
100 #line 101 "parser.tab.c"
102 /* Enabling traces. */
107 /* Enabling verbose error messages. */
108 #ifdef YYERROR_VERBOSE
109 # undef YYERROR_VERBOSE
110 # define YYERROR_VERBOSE 1
112 # define YYERROR_VERBOSE 1
115 /* Enabling the token table. */
116 #ifndef YYTOKEN_TABLE
117 # define YYTOKEN_TABLE 0
124 /* Put the tokens into the symbol table, so that GDB and other debuggers
221 below_semicolon = 352,
222 below_assignment = 353,
224 minusminus_prefix = 356,
225 plusplus_prefix = 357,
228 above_identifier = 360,
236 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
238 /* Line 223 of skeleton.m4 */
243 /* Line 223 of skeleton.m4 */
246 enum yytokentype token;
248 classinfo_t*classinfo;
249 classinfo_list_t*classinfo_list;
251 slotinfo_list_t*slotinfo_list;
254 unsigned int number_uint;
258 //typedcode_list_t*value_list;
259 codeandnumber_t value_list;
265 for_start_t for_start;
266 abc_exception_t *exception;
269 namespace_decl_t* namespace_decl;
271 abc_exception_list_t *l;
277 /* Line 223 of skeleton.m4 */
278 #line 279 "parser.tab.c"
280 # define YYSTYPE_IS_TRIVIAL 1
281 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
282 # define YYSTYPE_IS_DECLARED 1
286 /* Copy the second part of user declarations. */
288 /* Line 273 of skeleton.m4 */
292 static int a3_error(char*s)
294 syntaxerror("%s", s);
295 return 0; //make gcc happy
298 static void parsererror(const char*file, int line, const char*f)
300 syntaxerror("internal error in %s, %s:%d", f, file, line);
303 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
306 static char* concat2(const char* t1, const char* t2)
310 char*text = malloc(l1+l2+1);
311 memcpy(text , t1, l1);
312 memcpy(text+l1, t2, l2);
316 static char* concat3(const char* t1, const char* t2, const char* t3)
321 char*text = malloc(l1+l2+l3+1);
322 memcpy(text , t1, l1);
323 memcpy(text+l1, t2, l2);
324 memcpy(text+l1+l2, t3, l3);
329 typedef struct _import {
332 DECLARE_LIST(import);
334 DECLARE(methodstate);
335 DECLARE_LIST(methodstate);
337 typedef struct _classstate {
343 methodstate_t*static_init;
345 //code_t*static_init;
347 char has_constructor;
350 struct _methodstate {
360 dict_t*unresolved_variables;
363 char uses_parent_function;
369 int var_index; // for inner methods
370 int slot_index; // for inner methods
371 char is_a_slot; // for inner methods
376 abc_exception_list_t*exceptions;
378 methodstate_list_t*innerfunctions;
381 typedef struct _state {
386 import_list_t*wildcard_imports;
387 dict_t*import_toplevel_packages;
390 namespace_list_t*active_namespace_urls;
392 char has_own_imports;
393 char new_vars; // e.g. transition between two functions
396 methodstate_t*method;
405 typedef struct _global {
409 dict_t*file2token2info;
412 static global_t*global = 0;
413 static state_t* state = 0;
417 #define MULTINAME(m,x) \
421 registry_fill_multiname(&m, &m##_ns, (slotinfo_t*)(x));
423 #define MEMBER_MULTINAME(m,f,n) \
427 if((m##_ns.access = ((slotinfo_t*)(f))->access)==ACCESS_NAMESPACE) \
428 m##_ns.name = ((slotinfo_t*)(f))->package; \
433 m.namespace_set = 0; \
434 m.name = ((slotinfo_t*)(f))->name; \
436 m.type = MULTINAME; \
438 m.namespace_set = &nopackage_namespace_set; \
442 /* warning: list length of namespace set is undefined */
443 #define MULTINAME_LATE(m, access, package) \
444 namespace_t m##_ns = {access, package}; \
445 namespace_set_t m##_nsset; \
446 namespace_list_t m##_l;m##_l.next = 0; \
447 m##_nsset.namespaces = &m##_l; \
448 m##_nsset = m##_nsset; \
449 m##_l.namespace = &m##_ns; \
450 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
452 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
453 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
454 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
455 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
456 static namespace_list_t nl4 = {&ns4,0};
457 static namespace_list_t nl3 = {&ns3,&nl4};
458 static namespace_list_t nl2 = {&ns2,&nl3};
459 static namespace_list_t nl1 = {&ns1,&nl2};
460 static namespace_set_t nopackage_namespace_set = {&nl1};
462 static dict_t*definitions=0;
463 void as3_set_definition(const char*c)
466 definitions = dict_new();
467 if(!dict_contains(definitions,c))
468 dict_put(definitions,c,0);
471 static void new_state()
474 state_t*oldstate = state;
476 memcpy(s, state, sizeof(state_t)); //shallow copy
478 s->imports = dict_new();
480 if(!s->import_toplevel_packages) {
481 s->import_toplevel_packages = dict_new();
485 state->has_own_imports = 0;
486 state->vars = dict_new();
487 state->old = oldstate;
490 trie_remember(active_namespaces);
493 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
496 static void state_destroy(state_t*state)
498 if(state->has_own_imports) {
499 list_free(state->wildcard_imports);
500 dict_destroy(state->imports);state->imports=0;
502 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
503 dict_destroy(state->imports);state->imports=0;
507 for(t=0;t<state->vars->hashsize;t++) {
508 dictentry_t*e =state->vars->slots[t];
510 free(e->data);e->data=0;
514 dict_destroy(state->vars);state->vars=0;
517 list_free(state->active_namespace_urls)
518 state->active_namespace_urls = 0;
523 static void old_state()
525 trie_rollback(active_namespaces);
527 if(!state || !state->old)
528 syntaxerror("invalid nesting");
529 state_t*leaving = state;
533 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
534 free(leaving->method);
537 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
542 state_destroy(leaving);
545 static code_t* method_header(methodstate_t*m);
546 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
547 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0);
550 static char* internal_filename_package = 0;
551 void initialize_file(char*filename)
554 syntaxerror("invalid call to initialize_file during parsing of another file");
557 active_namespaces = trie_new();
560 state->package = internal_filename_package = strdup(filename);
562 global->token2info = dict_lookup(global->file2token2info,
563 current_filename // use long version
565 if(!global->token2info) {
566 global->token2info = dict_new2(&ptr_type);
567 dict_put(global->file2token2info, current_filename, global->token2info);
571 state->method = rfx_calloc(sizeof(methodstate_t));
572 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
573 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
575 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
576 function_initvars(state->method, 0, 0, 1);
577 global->init = abc_initscript(global->file);
583 if(!state || state->level!=1) {
584 syntaxerror("unexpected end of file in pass %d", as3_pass);
588 code_t*header = method_header(state->method);
589 code_t*c = wrap_function(header, 0, global->init->method->body->code);
590 global->init->method->body->code = c;
591 free(state->method);state->method=0;
594 //free(state->package);state->package=0; // used in registry
595 state_destroy(state);state=0;
598 void initialize_parser()
600 global = rfx_calloc(sizeof(global_t));
601 global->file = abc_file_new();
602 global->file->flags &= ~ABCFILE_LAZY;
603 global->file2token2info = dict_new();
604 global->token2info = 0;
607 void* finish_parser()
609 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
610 global->token2info=0;
614 typedef struct _variable {
619 methodstate_t*is_inner_method;
622 static variable_t* find_variable(state_t*s, char*name)
626 v = dict_lookup(s->vars, name);
628 if(s->new_vars) break;
633 static variable_t* find_slot(state_t*s, const char*name)
635 if(s->method && s->method->slots)
636 return dict_lookup(s->method->slots, name);
640 static variable_t* find_variable_safe(state_t*s, char*name)
642 variable_t* v = find_variable(s, name);
644 syntaxerror("undefined variable: %s", name);
648 static char variable_exists(char*name)
650 return dict_contains(state->vars, name);
653 static code_t*defaultvalue(code_t*c, classinfo_t*type)
655 if(TYPE_IS_INT(type)) {
656 c = abc_pushbyte(c, 0);
657 } else if(TYPE_IS_UINT(type)) {
658 c = abc_pushuint(c, 0);
659 } else if(TYPE_IS_FLOAT(type)) {
661 } else if(TYPE_IS_BOOLEAN(type)) {
662 c = abc_pushfalse(c);
664 //c = abc_pushundefined(c);
665 syntaxerror("internal error: can't generate default value for * type");
669 c = abc_coerce2(c, &m);
674 static int alloc_local()
676 return state->method->variable_count++;
679 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
682 variable_t*v = find_slot(state, name);
688 v->index = alloc_local();
693 dict_put(state->vars, name, v);
697 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
699 return new_variable2(name, type, init, maybeslot)->index;
702 #define TEMPVARNAME "__as3_temp__"
703 static int gettempvar()
705 variable_t*v = find_variable(state, TEMPVARNAME);
708 return new_variable(TEMPVARNAME, 0, 0, 0);
711 static code_t* var_block(code_t*body)
717 for(t=0;t<state->vars->hashsize;t++) {
718 dictentry_t*e = state->vars->slots[t];
720 variable_t*v = (variable_t*)e->data;
721 if(v->type && v->init) {
722 c = defaultvalue(c, v->type);
723 c = abc_setlocal(c, v->index);
724 k = abc_kill(k, v->index);
734 if(x->opcode== OPCODE___BREAK__ ||
735 x->opcode== OPCODE___CONTINUE__) {
736 /* link kill code before break/continue */
737 code_t*e = code_dup(k);
738 code_t*s = code_start(e);
750 c = code_append(c, body);
751 c = code_append(c, k);
755 static void unknown_variable(char*name)
757 if(!state->method->unresolved_variables)
758 state->method->unresolved_variables = dict_new();
759 if(!dict_contains(state->method->unresolved_variables, name))
760 dict_put(state->method->unresolved_variables, name, 0);
763 static code_t* add_scope_code(code_t*c, methodstate_t*m, char init)
765 if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope
766 c = abc_getlocal_0(c);
767 c = abc_pushscope(c);
770 /* FIXME: this alloc_local() causes variable indexes to be
771 different in pass2 than in pass1 */
772 if(!m->activation_var)
773 m->activation_var = alloc_local();
775 c = abc_newactivation(c);
777 c = abc_pushscope(c);
778 c = abc_setlocal(c, m->activation_var);
780 c = abc_getlocal(c, m->activation_var);
781 c = abc_pushscope(c);
787 static code_t* method_header(methodstate_t*m)
791 c = add_scope_code(c, m, 1);
793 methodstate_list_t*l = m->innerfunctions;
795 parserassert(l->methodstate->abc);
796 if(m->uses_slots && l->methodstate->is_a_slot) {
797 c = abc_getscopeobject(c, 1);
798 c = abc_newfunction(c, l->methodstate->abc);
800 c = abc_setlocal(c, l->methodstate->var_index);
801 c = abc_setslot(c, l->methodstate->slot_index);
803 c = abc_newfunction(c, l->methodstate->abc);
804 c = abc_setlocal(c, l->methodstate->var_index);
806 free(l->methodstate);l->methodstate=0;
810 c = code_append(c, m->header);
813 if(m->is_constructor && !m->has_super) {
814 // call default constructor
815 c = abc_getlocal_0(c);
816 c = abc_constructsuper(c, 0);
820 /* all parameters that are used by inner functions
821 need to be copied from local to slot */
822 parserassert(m->activation_var);
823 DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
824 if(v->is_parameter) {
825 c = abc_getlocal(c, m->activation_var);
826 c = abc_getlocal(c, v->index);
827 c = abc_setslot(c, v->index);
831 list_free(m->innerfunctions);
832 m->innerfunctions = 0;
837 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
839 c = code_append(c, header);
840 c = code_append(c, var_block(body));
841 /* append return if necessary */
842 if(!c || (c->opcode != OPCODE_RETURNVOID &&
843 c->opcode != OPCODE_RETURNVALUE)) {
844 c = abc_returnvoid(c);
849 static void startpackage(char*name)
852 state->package = strdup(name);
854 static void endpackage()
856 //used e.g. in classinfo_register:
857 //free(state->package);state->package=0;
861 #define FLAG_PUBLIC 256
862 #define FLAG_PROTECTED 512
863 #define FLAG_PRIVATE 1024
864 #define FLAG_PACKAGEINTERNAL 2048
865 #define FLAG_NAMESPACE 4096
867 static namespace_t modifiers2access(modifiers_t*mod)
872 if(mod->flags&FLAG_NAMESPACE) {
873 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
874 syntaxerror("invalid combination of access levels and namespaces");
875 ns.access = ACCESS_NAMESPACE;
877 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
879 /* shouldn't happen- the tokenizer only reports something as a namespace
880 if it was already registered */
881 trie_dump(active_namespaces);
882 syntaxerror("unknown namespace: %s", mod->ns);
885 } else if(mod->flags&FLAG_PUBLIC) {
886 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
887 syntaxerror("invalid combination of access levels");
888 ns.access = ACCESS_PACKAGE;
889 } else if(mod->flags&FLAG_PRIVATE) {
890 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
891 syntaxerror("invalid combination of access levels");
892 ns.access = ACCESS_PRIVATE;
893 } else if(mod->flags&FLAG_PROTECTED) {
894 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
895 syntaxerror("invalid combination of access levels");
896 ns.access = ACCESS_PROTECTED;
898 ns.access = ACCESS_PACKAGEINTERNAL;
902 static slotinfo_t* find_class(const char*name);
904 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
906 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
909 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
914 index = new_variable("this", 0, 0, 0);
915 else if(!m->is_global)
916 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
918 index = new_variable("globalscope", 0, 0, 0);
921 parserassert(!index);
925 /* as variables and slots share the same number, make sure
926 that those variable indices are reserved. It's up to the
927 optimizer to later shuffle the variables down to lower
929 m->variable_count = m->uses_slots;
934 for(p=params->list;p;p=p->next) {
935 variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
940 methodstate_list_t*l = m->innerfunctions;
942 methodstate_t*m = l->methodstate;
944 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
945 m->var_index = v->index;
946 m->slot_index = v->index;
947 v->is_inner_method = m;
953 m->scope_code = add_scope_code(m->scope_code, m, 0);
956 if(as3_pass==2 && m->slots) {
957 /* exchange unresolved identifiers with the actual objects */
958 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
959 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
960 classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
961 if(!type || type->kind != INFOTYPE_CLASS) {
962 syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
971 char*as3_globalclass=0;
972 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
975 syntaxerror("inner classes now allowed");
980 classinfo_list_t*mlist=0;
982 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
983 syntaxerror("invalid modifier(s)");
985 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
986 syntaxerror("public and internal not supported at the same time.");
988 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
989 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
990 // all classes extend object
991 extends = registry_getobjectclass();
994 /* create the class name, together with the proper attributes */
998 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
999 access = ACCESS_PRIVATE; package = internal_filename_package;
1000 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1001 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1002 } else if(state->package!=internal_filename_package) {
1003 access = ACCESS_PACKAGE; package = state->package;
1005 syntaxerror("public classes only allowed inside a package");
1009 state->cls = rfx_calloc(sizeof(classstate_t));
1010 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1011 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1012 /* notice: we make no effort to initialize the top variable (local0) here,
1013 even though it has special meaning. We just rely on the facat
1014 that pass 1 won't do anything with variables */
1016 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1018 /* set current method to constructor- all code within the class-level (except
1019 static variable initializations) will be executed during construction time */
1020 state->method = state->cls->init;
1022 if(registry_find(package, classname)) {
1023 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1025 /* build info struct */
1026 int num_interfaces = (list_length(implements));
1027 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1028 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1031 classinfo_list_t*l = implements;
1032 for(l=implements;l;l=l->next) {
1033 state->cls->info->interfaces[pos++] = l->classinfo;
1038 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1040 state->method = state->cls->init;
1041 parserassert(state->cls && state->cls->info);
1043 function_initvars(state->cls->init, 0, 0, 1);
1044 function_initvars(state->cls->static_init, 0, 0, 0);
1046 if(extends && (extends->flags & FLAG_FINAL))
1047 syntaxerror("Can't extend final class '%s'", extends->name);
1050 while(state->cls->info->interfaces[pos]) {
1051 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1052 syntaxerror("'%s' is not an interface",
1053 state->cls->info->interfaces[pos]->name);
1057 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
1058 state->cls->info->superclass = extends;
1060 /* generate the abc code for this class */
1061 MULTINAME(classname2,state->cls->info);
1062 multiname_t*extends2 = sig2mname(extends);
1064 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1065 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1066 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1067 if(state->cls->info->flags&FLAG_INTERFACE) {
1068 abc_class_interface(state->cls->abc);
1071 abc_class_protectedNS(state->cls->abc, classname);
1073 for(mlist=implements;mlist;mlist=mlist->next) {
1074 MULTINAME(m, mlist->classinfo);
1075 abc_class_add_interface(state->cls->abc, &m);
1078 /* write the construction code for this class to the global init
1080 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1082 abc_method_body_t*m = global->init->method->body;
1083 __ getglobalscope(m);
1084 classinfo_t*s = extends;
1089 //TODO: take a look at the current scope stack, maybe
1090 // we can re-use something
1095 multiname_t*s2 = sig2mname(s);
1097 multiname_destroy(s2);
1099 __ pushscope(m); count++;
1100 m->code = m->code->prev->prev; // invert
1102 /* continue appending after last op end */
1103 while(m->code && m->code->next) m->code = m->code->next;
1105 /* TODO: if this is one of *our* classes, we can also
1106 do a getglobalscope/getslot <nr> (which references
1107 the init function's slots) */
1109 __ getlex2(m, extends2);
1111 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1112 stack is not the superclass */
1113 __ pushscope(m);count++;
1116 /* notice: we get a verify error #1107 if the top element on the scope
1117 stack is not the global object */
1119 __ pushscope(m);count++;
1121 __ newclass(m,state->cls->abc);
1125 __ setslot(m, slotindex);
1126 multiname_destroy(extends2);
1128 /* flash.display.MovieClip handling */
1130 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1131 if(state->package && state->package[0]) {
1132 as3_globalclass = concat3(state->package, ".", classname);
1134 as3_globalclass = strdup(classname);
1140 static void endclass()
1143 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1145 c = abc_getlocal_0(c);
1146 c = abc_constructsuper(c, 0);
1147 state->cls->init->header = code_append(state->cls->init->header, c);
1148 state->cls->has_constructor=1;
1150 if(state->cls->init) {
1151 if(state->cls->info->flags&FLAG_INTERFACE) {
1152 if(state->cls->init->header)
1153 syntaxerror("interface can not have class-level code");
1155 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1156 code_t*c = method_header(state->cls->init);
1157 m->body->code = wrap_function(c, 0, m->body->code);
1160 if(state->cls->static_init) {
1161 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1162 code_t*c = method_header(state->cls->static_init);
1163 m->body->code = wrap_function(c, 0, m->body->code);
1170 void check_code_for_break(code_t*c)
1173 if(c->opcode == OPCODE___BREAK__) {
1174 char*name = string_cstr(c->data[0]);
1175 syntaxerror("Unresolved \"break %s\"", name);
1177 if(c->opcode == OPCODE___CONTINUE__) {
1178 char*name = string_cstr(c->data[0]);
1179 syntaxerror("Unresolved \"continue %s\"", name);
1181 if(c->opcode == OPCODE___RETHROW__) {
1182 syntaxerror("Unresolved \"rethrow\"");
1184 if(c->opcode == OPCODE___FALLTHROUGH__) {
1185 syntaxerror("Unresolved \"fallthrough\"");
1187 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1188 char*name = string_cstr(c->data[0]);
1189 syntaxerror("Can't reference a package (%s) as such", name);
1195 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1197 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1198 if(TYPE_IS_NUMBER(t)) {
1199 xassert(c->type == CONSTANT_FLOAT
1200 || c->type == CONSTANT_INT
1201 || c->type == CONSTANT_UINT);
1202 } else if(TYPE_IS_UINT(t)) {
1203 xassert(c->type == CONSTANT_UINT ||
1204 (c->type == CONSTANT_INT && c->i>=0));
1205 } else if(TYPE_IS_INT(t)) {
1206 xassert(c->type == CONSTANT_INT);
1207 } else if(TYPE_IS_BOOLEAN(t)) {
1208 xassert(c->type == CONSTANT_TRUE
1209 || c->type == CONSTANT_FALSE);
1213 static void check_override(memberinfo_t*m, int flags)
1217 if(m->parent == state->cls->info)
1218 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1220 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1221 if(m->access==ACCESS_PRIVATE)
1223 if(m->flags & FLAG_FINAL)
1224 syntaxerror("can't override final member %s", m->name);
1226 /* allow this. it's no issue.
1227 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1228 syntaxerror("can't override static member %s", m->name);*/
1230 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1231 syntaxerror("can't override non-static member %s with static declaration", m->name);
1233 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1234 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1235 if(m->kind == INFOTYPE_METHOD)
1236 syntaxerror("can't override without explicit 'override' declaration");
1238 syntaxerror("can't override '%s'", m->name);
1243 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1245 methodinfo_t*minfo = 0;
1246 namespace_t ns = modifiers2access(mod);
1249 minfo = methodinfo_register_global(ns.access, state->package, name);
1250 minfo->return_type = 0; // save this for pass 2
1251 } else if(getset != KW_GET && getset != KW_SET) {
1253 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1255 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1257 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1258 minfo->return_type = 0; // save this for pass 2
1259 // getslot on a member slot only returns "undefined", so no need
1260 // to actually store these
1261 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1263 //class getter/setter
1264 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1266 if(getset == KW_GET) {
1268 } else if(params->list && params->list->param && !params->list->next) {
1269 type = params->list->param->type;
1271 syntaxerror("setter function needs to take exactly one argument");
1272 // not sure wether to look into superclasses here, too
1273 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1275 if(minfo->kind!=INFOTYPE_SLOT)
1276 syntaxerror("class already contains a method called '%s'", name);
1277 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1278 syntaxerror("class already contains a field called '%s'", name);
1279 if(minfo->subtype & gs)
1280 syntaxerror("getter/setter for '%s' already defined", name);
1281 /* make a setter or getter into a getset */
1282 minfo->subtype |= gs;
1285 FIXME: this check needs to be done in pass 2
1287 if((!minfo->return_type != !type) ||
1288 (minfo->return_type && type &&
1289 !strcmp(minfo->return_type->name, type->name))) {
1290 syntaxerror("different type in getter and setter: %s and %s",
1291 minfo->return_type?minfo->return_type->name:"*",
1292 type?type->name:"*");
1295 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1296 minfo->kind = INFOTYPE_SLOT; //hack
1297 minfo->subtype = gs;
1298 minfo->return_type = 0;
1300 /* can't assign a slot as getter and setter might have different slots */
1301 //minfo->slot = slot;
1303 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1304 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1305 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1310 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1312 //parserassert(state->method && state->method->info);
1314 methodstate_t*parent_method = state->method;
1317 return_type = 0; // not valid in pass 1
1321 state->new_vars = 1;
1324 state->method = rfx_calloc(sizeof(methodstate_t));
1325 state->method->inner = 1;
1326 state->method->variable_count = 0;
1327 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1329 NEW(methodinfo_t,minfo);
1330 minfo->kind = INFOTYPE_METHOD;
1331 minfo->access = ACCESS_PACKAGEINTERNAL;
1333 state->method->info = minfo;
1336 list_append(parent_method->innerfunctions, state->method);
1338 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1340 function_initvars(state->method, params, 0, 1);
1344 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1345 state->method->variable_count = 0;
1346 parserassert(state->method);
1348 state->method->info->return_type = return_type;
1349 function_initvars(state->method, params, 0, 1);
1353 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1354 params_t*params, classinfo_t*return_type)
1356 if(state->method && state->method->info) {
1357 syntaxerror("not able to start another method scope");
1360 state->new_vars = 1;
1363 state->method = rfx_calloc(sizeof(methodstate_t));
1364 state->method->has_super = 0;
1367 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1369 state->method->is_global = 1;
1370 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1372 if(state->method->is_constructor)
1373 name = "__as3_constructor__";
1375 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1377 function_initvars(state->method, params, mod->flags, 1);
1379 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1383 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1384 state->method->variable_count = 0;
1385 parserassert(state->method);
1388 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1389 check_override(m, mod->flags);
1393 state->cls->has_constructor |= state->method->is_constructor;
1396 state->method->info->return_type = return_type;
1397 function_initvars(state->method, params, mod->flags, 1);
1401 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1402 params_t*params, classinfo_t*return_type, code_t*body)
1405 // store inner methods in variables
1406 function_initvars(state->method, 0, 0, 0);
1408 methodstate_list_t*ml = state->method->innerfunctions;
1410 dict_t*xvars = dict_new();
1413 methodstate_t*m = ml->methodstate;
1414 parserassert(m->inner);
1415 if(m->unresolved_variables) {
1416 dict_t*d = m->unresolved_variables;
1418 for(t=0;t<d->hashsize;t++) {
1419 dictentry_t*l = d->slots[t];
1421 /* check parent method's variables */
1423 if((v=find_variable(state, l->key))) {
1424 m->uses_parent_function = 1;
1425 state->method->uses_slots = 1;
1426 dict_put(xvars, l->key, 0);
1433 dict_destroy(m->unresolved_variables);
1434 m->unresolved_variables = 0;
1439 if(state->method->uses_slots) {
1440 state->method->slots = dict_new();
1442 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1443 if(!name) syntaxerror("internal error");
1444 if(v->index && dict_contains(xvars, name)) {
1447 if(v->is_inner_method) {
1448 v->is_inner_method->is_a_slot = 1;
1451 dict_put(state->method->slots, name, v);
1454 state->method->uses_slots = i;
1455 dict_destroy(state->vars);state->vars = 0;
1462 /*if(state->method->uses_parent_function){
1463 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1468 multiname_t*type2 = sig2mname(return_type);
1470 if(state->method->inner) {
1471 f = state->method->abc;
1472 abc_method_init(f, global->file, type2, 1);
1473 } else if(state->method->is_constructor) {
1474 f = abc_class_getconstructor(state->cls->abc, type2);
1475 } else if(!state->method->is_global) {
1476 namespace_t mname_ns = modifiers2access(mod);
1477 multiname_t mname = {QNAME, &mname_ns, 0, name};
1479 if(mod->flags&FLAG_STATIC)
1480 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1482 f = abc_class_method(state->cls->abc, type2, &mname);
1483 slot = f->trait->slot_id;
1485 namespace_t mname_ns = {state->method->info->access, state->package};
1486 multiname_t mname = {QNAME, &mname_ns, 0, name};
1488 f = abc_method_new(global->file, type2, 1);
1489 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1490 //abc_code_t*c = global->init->method->body->code;
1492 //flash doesn't seem to allow us to access function slots
1493 //state->method->info->slot = slot;
1495 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1496 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1497 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1498 if(params->varargs) f->flags |= METHOD_NEED_REST;
1502 for(p=params->list;p;p=p->next) {
1503 if(params->varargs && !p->next) {
1504 break; //varargs: omit last parameter in function signature
1506 multiname_t*m = sig2mname(p->param->type);
1507 list_append(f->parameters, m);
1508 if(p->param->value) {
1509 check_constant_against_type(p->param->type, p->param->value);
1510 opt=1;list_append(f->optional_parameters, p->param->value);
1512 syntaxerror("non-optional parameter not allowed after optional parameters");
1515 if(state->method->slots) {
1516 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1518 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1519 multiname_t*type = sig2mname(v->type);
1520 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1521 t->slot_id = v->index;
1526 check_code_for_break(body);
1528 /* Seems this works now.
1529 if(state->method->exceptions && state->method->uses_slots) {
1530 as3_warning("try/catch and activation not supported yet within the same method");
1534 f->body->code = body;
1535 f->body->exceptions = state->method->exceptions;
1536 } else { //interface
1538 syntaxerror("interface methods can't have a method body");
1548 void breakjumpsto(code_t*c, char*name, code_t*jump)
1551 if(c->opcode == OPCODE___BREAK__) {
1552 string_t*name2 = c->data[0];
1553 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1554 c->opcode = OPCODE_JUMP;
1561 void continuejumpsto(code_t*c, char*name, code_t*jump)
1564 if(c->opcode == OPCODE___CONTINUE__) {
1565 string_t*name2 = c->data[0];
1566 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1567 c->opcode = OPCODE_JUMP;
1575 /* TODO: move this to ast.c */
1576 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1577 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1578 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1579 static classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1581 if(!type1 || !type2)
1582 return registry_getanytype();
1583 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1584 return registry_getanytype();
1587 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1596 return registry_getanytype();
1598 static char is_getlocal(code_t*c)
1600 if(!c || c->prev || c->next)
1602 return(c->opcode == OPCODE_GETLOCAL
1603 || c->opcode == OPCODE_GETLOCAL_0
1604 || c->opcode == OPCODE_GETLOCAL_1
1605 || c->opcode == OPCODE_GETLOCAL_2
1606 || c->opcode == OPCODE_GETLOCAL_3);
1608 static int getlocalnr(code_t*c)
1610 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1611 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1612 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1613 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1614 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1615 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1618 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1623 return abc_coerce_a(c);
1627 // cast an "any" type to a specific type. subject to
1628 // runtime exceptions
1629 return abc_coerce2(c, &m);
1632 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1633 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1634 // allow conversion between number types
1635 if(TYPE_IS_UINT(to))
1636 return abc_convert_u(c);
1637 else if(TYPE_IS_INT(to))
1638 return abc_convert_i(c);
1639 else if(TYPE_IS_NUMBER(to))
1640 return abc_convert_d(c);
1641 return abc_coerce2(c, &m);
1644 if(TYPE_IS_BOOLEAN(to))
1645 return abc_convert_b(c);
1646 if(TYPE_IS_STRING(to))
1647 return abc_convert_s(c);
1648 if(TYPE_IS_OBJECT(to))
1649 return abc_convert_o(c);
1651 classinfo_t*supertype = from;
1653 if(supertype == to) {
1654 // target type is one of from's superclasses
1655 return abc_coerce2(c, &m);
1658 while(supertype->interfaces[t]) {
1659 if(supertype->interfaces[t]==to) {
1660 // target type is one of from's interfaces
1661 return abc_coerce2(c, &m);
1665 supertype = supertype->superclass;
1667 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1669 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1671 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1674 as3_error("can't convert type %s%s%s to %s%s%s",
1675 from->package, from->package[0]?".":"", from->name,
1676 to->package, to->package[0]?".":"", to->name);
1680 /* move to ast.c todo end */
1682 char is_pushundefined(code_t*c)
1684 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1687 static const char* get_package_from_name(const char*name)
1689 /* try explicit imports */
1690 dictentry_t* e = dict_get_slot(state->imports, name);
1692 if(!strcmp(e->key, name)) {
1693 slotinfo_t*c = (slotinfo_t*)e->data;
1694 if(c) return c->package;
1700 static namespace_list_t*get_current_imports()
1702 namespace_list_t*searchlist = 0;
1704 list_append(searchlist, namespace_new_package(state->package));
1706 import_list_t*l = state->wildcard_imports;
1708 namespace_t*ns = namespace_new_package(l->import->package);
1709 list_append(searchlist, ns);
1712 list_append(searchlist, namespace_new_package(""));
1713 list_append(searchlist, namespace_new_package(internal_filename_package));
1717 static slotinfo_t* find_class(const char*name)
1721 c = registry_find(state->package, name);
1724 /* try explicit imports */
1725 dictentry_t* e = dict_get_slot(state->imports, name);
1728 if(!strcmp(e->key, name)) {
1729 c = (slotinfo_t*)e->data;
1735 /* try package.* imports */
1736 import_list_t*l = state->wildcard_imports;
1738 //printf("does package %s contain a class %s?\n", l->import->package, name);
1739 c = registry_find(l->import->package, name);
1744 /* try global package */
1745 c = registry_find("", name);
1748 /* try local "filename" package */
1749 c = registry_find(internal_filename_package, name);
1754 typedcode_t push_class(slotinfo_t*a)
1759 if(a->access == ACCESS_PACKAGEINTERNAL &&
1760 strcmp(a->package, state->package) &&
1761 strcmp(a->package, internal_filename_package)
1763 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1764 infotypename(a), a->name, a->package, state->package);
1767 if(a->kind != INFOTYPE_CLASS) {
1769 x.c = abc_findpropstrict2(x.c, &m);
1770 x.c = abc_getproperty2(x.c, &m);
1771 if(a->kind == INFOTYPE_METHOD) {
1772 methodinfo_t*f = (methodinfo_t*)a;
1773 x.t = TYPE_FUNCTION(f);
1775 varinfo_t*v = (varinfo_t*)a;
1779 classinfo_t*c = (classinfo_t*)a;
1781 x.c = abc_getglobalscope(x.c);
1782 x.c = abc_getslot(x.c, c->slot);
1785 x.c = abc_getlex2(x.c, &m);
1787 x.t = TYPE_CLASS(c);
1793 code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore, char pushvalue)
1797 [prefix code] [read instruction]
1801 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1803 if(in && in->opcode == OPCODE_COERCE_A) {
1804 in = code_cutlast(in);
1807 syntaxerror("internal error");
1809 /* chop off read instruction */
1813 prefix = r->prev;r->prev = 0;
1819 char use_temp_var = readbefore;
1821 /* generate the write instruction, and maybe append a dup to the prefix code */
1822 code_t* write = abc_nop(0);
1823 if(r->opcode == OPCODE_GETPROPERTY) {
1824 write->opcode = OPCODE_SETPROPERTY;
1825 multiname_t*m = (multiname_t*)r->data[0];
1826 write->data[0] = multiname_clone(m);
1827 if(m->type == QNAME || m->type == MULTINAME) {
1829 prefix = abc_dup(prefix); // we need the object, too
1832 } else if(m->type == MULTINAMEL) {
1834 /* dupping two values on the stack requires 5 operations and one register-
1835 couldn't adobe just have given us a dup2? */
1836 int temp = gettempvar();
1837 prefix = abc_setlocal(prefix, temp);
1838 prefix = abc_dup(prefix);
1839 prefix = abc_getlocal(prefix, temp);
1840 prefix = abc_swap(prefix);
1841 prefix = abc_getlocal(prefix, temp);
1843 prefix = abc_kill(prefix, temp);
1847 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1849 } else if(r->opcode == OPCODE_GETSLOT) {
1850 write->opcode = OPCODE_SETSLOT;
1851 write->data[0] = r->data[0];
1853 prefix = abc_dup(prefix); // we need the object, too
1856 } else if(r->opcode == OPCODE_GETLOCAL) {
1857 write->opcode = OPCODE_SETLOCAL;
1858 write->data[0] = r->data[0];
1859 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1860 write->opcode = OPCODE_SETLOCAL_0;
1861 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1862 write->opcode = OPCODE_SETLOCAL_1;
1863 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1864 write->opcode = OPCODE_SETLOCAL_2;
1865 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1866 write->opcode = OPCODE_SETLOCAL_3;
1867 } else if(r->opcode == OPCODE_GETSUPER) {
1868 write->opcode = OPCODE_SETSUPER;
1869 multiname_t*m = (multiname_t*)r->data[0];
1870 write->data[0] = multiname_clone(m);
1873 syntaxerror("illegal lvalue: can't assign a value to this expression");
1880 /* with getproperty/getslot, we have to be extra careful not
1881 to execute the read code twice, as it might have side-effects
1882 (e.g. if the property is in fact a setter/getter combination)
1884 So read the value, modify it, and write it again,
1885 using prefix only once and making sure (by using a temporary
1886 register) that the return value is what we just wrote */
1887 temp = gettempvar();
1888 c = code_append(c, prefix);
1889 c = code_append(c, r);
1890 if(pushvalue && readbefore) {
1892 c = abc_setlocal(c, temp);
1894 c = code_append(c, middlepart);
1895 if(pushvalue && !readbefore) {
1897 c = abc_setlocal(c, temp);
1899 c = code_append(c, write);
1901 c = abc_getlocal(c, temp);
1902 c = abc_kill(c, temp);
1905 /* if we're allowed to execute the read code twice *and*
1906 the middlepart doesn't modify the code, things are easier.
1908 //c = code_append(c, prefix);
1909 parserassert(!prefix);
1914 c = code_append(c, r);
1915 c = code_append(c, middlepart);
1916 c = code_append(c, write);
1918 c = code_append(c, r2);
1922 /* even smaller version: overwrite the value without reading
1926 c = code_append(c, prefix);
1929 c = code_append(c, middlepart);
1930 c = code_append(c, write);
1932 c = code_append(c, r);
1936 temp = gettempvar();
1938 c = code_append(c, prefix);
1940 c = code_append(c, middlepart);
1943 c = abc_setlocal(c, temp);
1945 c = code_append(c, write);
1947 c = abc_getlocal(c, temp);
1948 c = abc_kill(c, temp);
1955 char is_break_or_jump(code_t*c)
1959 if(c->opcode == OPCODE_JUMP ||
1960 c->opcode == OPCODE___BREAK__ ||
1961 c->opcode == OPCODE___CONTINUE__ ||
1962 c->opcode == OPCODE_THROW ||
1963 c->opcode == OPCODE_RETURNVOID ||
1964 c->opcode == OPCODE_RETURNVALUE) {
1970 #define IS_FINALLY_TARGET(op) \
1971 ((op) == OPCODE___CONTINUE__ || \
1972 (op) == OPCODE___BREAK__ || \
1973 (op) == OPCODE_RETURNVOID || \
1974 (op) == OPCODE_RETURNVALUE || \
1975 (op) == OPCODE___RETHROW__)
1977 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1979 #define NEED_EXTRA_STACK_ARG
1980 code_t*finally_label = abc_nop(0);
1981 NEW(lookupswitch_t, l);
1987 code_t*prev = i->prev;
1988 if(IS_FINALLY_TARGET(i->opcode)) {
1991 if(i->opcode == OPCODE___RETHROW__ ||
1992 i->opcode == OPCODE_RETURNVALUE) {
1993 if(i->opcode == OPCODE___RETHROW__)
1994 i->opcode = OPCODE_THROW;
1996 p = abc_coerce_a(p);
1997 p = abc_setlocal(p, tempvar);
1999 p = abc_pushbyte(p, count++);
2000 p = abc_jump(p, finally_label);
2001 code_t*target = p = abc_label(p);
2002 #ifdef NEED_EXTRA_STACK_ARG
2006 p = abc_getlocal(p, tempvar);
2009 p->next = i;i->prev = p;
2010 list_append(l->targets, target);
2016 c = abc_pushbyte(c, -1);
2017 c = code_append(c, finally_label);
2018 c = code_append(c, finally);
2020 #ifdef NEED_EXTRA_STACK_ARG
2023 c = abc_lookupswitch(c, l);
2024 c = l->def = abc_label(c);
2025 #ifdef NEED_EXTRA_STACK_ARG
2032 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
2036 code_t*prev = i->prev;
2037 if(IS_FINALLY_TARGET(i->opcode)) {
2038 if(i->opcode == OPCODE___RETHROW__)
2039 i->opcode = OPCODE_THROW;
2040 code_t*end = code_dup(finally);
2041 code_t*start = code_start(end);
2042 if(prev) prev->next = start;
2049 return code_append(c, finally);
2052 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
2058 int num_insertion_points=0;
2060 if(IS_FINALLY_TARGET(i->opcode))
2061 num_insertion_points++;
2068 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2073 int simple_version_cost = (1+num_insertion_points)*code_size;
2074 int lookup_version_cost = 4*num_insertion_points + 5;
2076 if(cantdup || simple_version_cost > lookup_version_cost) {
2077 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
2078 return insert_finally_lookup(c, finally, tempvar);
2080 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
2081 return insert_finally_simple(c, finally, tempvar);
2085 #define PASS1 }} if(as3_pass == 1) {{
2086 #define PASS1END }} if(as3_pass == 2) {{
2087 #define PASS2 }} if(as3_pass == 2) {{
2088 #define PASS12 }} if(as3_pass == 1 || as3_pass == 2) {{
2089 #define PASS12END }} if(as3_pass == 2) {{
2090 #define PASS_ALWAYS }} {{
2094 /* Line 273 of skeleton.m4 */
2095 #line 2096 "parser.tab.c"
2096 /* Unqualified %code blocks. */
2098 /* Line 274 of skeleton.m4 */
2099 #line 2159 "parser.y"
2101 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
2107 /* Line 274 of skeleton.m4 */
2108 #line 2611 "parser.y"
2110 static void state_has_imports()
2112 state->wildcard_imports = list_clone(state->wildcard_imports);
2113 state->imports = dict_clone(state->imports);
2114 state->has_own_imports = 1;
2116 static void import_toplevel(const char*package)
2118 char* s = strdup(package);
2120 dict_put(state->import_toplevel_packages, s, 0);
2121 char*x = strrchr(s, '.');
2130 /* Line 274 of skeleton.m4 */
2131 #line 2744 "parser.y"
2133 static int slotstate_varconst = 0;
2134 static modifiers_t*slotstate_flags = 0;
2135 static void setslotstate(modifiers_t* flags, int varconst)
2137 slotstate_varconst = varconst;
2138 slotstate_flags = flags;
2140 if(flags && flags->flags&FLAG_STATIC) {
2141 state->method = state->cls->static_init;
2143 state->method = state->cls->init;
2146 parserassert(state->method);
2151 /* Line 274 of skeleton.m4 */
2152 #line 3885 "parser.y"
2154 void add_active_url(const char*url)
2158 list_append(state->active_namespace_urls, n);
2163 /* Line 274 of skeleton.m4 */
2164 #line 2165 "parser.tab.c"
2171 typedef YYTYPE_UINT8 yytype_uint8;
2173 typedef unsigned char yytype_uint8;
2177 typedef YYTYPE_INT8 yytype_int8;
2178 #elif (defined __STDC__ || defined __C99__FUNC__ \
2179 || defined __cplusplus || defined _MSC_VER)
2180 typedef signed char yytype_int8;
2182 typedef short int yytype_int8;
2185 #ifdef YYTYPE_UINT16
2186 typedef YYTYPE_UINT16 yytype_uint16;
2188 typedef unsigned short int yytype_uint16;
2192 typedef YYTYPE_INT16 yytype_int16;
2194 typedef short int yytype_int16;
2198 # ifdef __SIZE_TYPE__
2199 # define YYSIZE_T __SIZE_TYPE__
2200 # elif defined size_t
2201 # define YYSIZE_T size_t
2202 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2203 || defined __cplusplus || defined _MSC_VER)
2204 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2205 # define YYSIZE_T size_t
2207 # define YYSIZE_T unsigned int
2211 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2216 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2217 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2221 # define YY_(msgid) msgid
2225 /* Suppress unused-variable warnings by "using" E. */
2226 #if ! defined lint || defined __GNUC__
2227 # define YYUSE(e) ((void) (e))
2229 # define YYUSE(e) /* empty */
2232 /* Identity function, used to suppress warnings about constant conditions. */
2234 # define YYID(n) (n)
2236 #if (defined __STDC__ || defined __C99__FUNC__ \
2237 || defined __cplusplus || defined _MSC_VER)
2250 #if ! defined yyoverflow || YYERROR_VERBOSE
2252 /* The parser invokes alloca or malloc; define the necessary symbols. */
2254 # ifdef YYSTACK_USE_ALLOCA
2255 # if YYSTACK_USE_ALLOCA
2257 # define YYSTACK_ALLOC __builtin_alloca
2258 # elif defined __BUILTIN_VA_ARG_INCR
2259 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2261 # define YYSTACK_ALLOC __alloca
2262 # elif defined _MSC_VER
2263 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2264 # define alloca _alloca
2266 # define YYSTACK_ALLOC alloca
2267 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2268 || defined __cplusplus || defined _MSC_VER)
2269 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2271 # define _STDLIB_H 1
2278 # ifdef YYSTACK_ALLOC
2279 /* Pacify GCC's `empty if-body' warning. */
2280 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2281 # ifndef YYSTACK_ALLOC_MAXIMUM
2282 /* The OS might guarantee only one guard page at the bottom of the stack,
2283 and a page size can be as small as 4096 bytes. So we cannot safely
2284 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2285 to allow for a few compiler-allocated temporary stack slots. */
2286 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2289 # define YYSTACK_ALLOC YYMALLOC
2290 # define YYSTACK_FREE YYFREE
2291 # ifndef YYSTACK_ALLOC_MAXIMUM
2292 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2294 # if (defined __cplusplus && ! defined _STDLIB_H \
2295 && ! ((defined YYMALLOC || defined malloc) \
2296 && (defined YYFREE || defined free)))
2297 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2299 # define _STDLIB_H 1
2303 # define YYMALLOC malloc
2304 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2305 || defined __cplusplus || defined _MSC_VER)
2306 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2310 # define YYFREE free
2311 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2312 || defined __cplusplus || defined _MSC_VER)
2313 void free (void *); /* INFRINGES ON USER NAME SPACE */
2317 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2320 #if (! defined yyoverflow \
2321 && (! defined __cplusplus \
2322 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2324 /* A type that is properly aligned for any stack member. */
2327 yytype_int16 yyss_alloc;
2331 /* The size of the maximum gap between one aligned stack and the next. */
2332 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2334 /* The size of an array large to enough to hold all stacks, each with
2336 # define YYSTACK_BYTES(N) \
2337 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2338 + YYSTACK_GAP_MAXIMUM)
2340 /* Copy COUNT objects from FROM to TO. The source and destination do
2343 # if defined __GNUC__ && 1 < __GNUC__
2344 # define YYCOPY(To, From, Count) \
2345 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2347 # define YYCOPY(To, From, Count) \
2351 for (yyi = 0; yyi < (Count); yyi++) \
2352 (To)[yyi] = (From)[yyi]; \
2358 /* Relocate STACK from its old location to the new one. The
2359 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2360 elements in the stack, and YYPTR gives the new location of the
2361 stack. Advance YYPTR to a properly aligned location for the next
2363 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2366 YYSIZE_T yynewbytes; \
2367 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2368 Stack = &yyptr->Stack_alloc; \
2369 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2370 yyptr += yynewbytes / sizeof (*yyptr); \
2376 /* YYFINAL -- State number of the termination state. */
2378 /* YYLAST -- Last index in YYTABLE. */
2381 /* YYNTOKENS -- Number of terminals. */
2382 #define YYNTOKENS 133
2383 /* YYNNTS -- Number of nonterminals. */
2385 /* YYNRULES -- Number of rules. */
2386 #define YYNRULES 299
2387 /* YYNRULES -- Number of states. */
2388 #define YYNSTATES 511
2390 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2391 #define YYUNDEFTOK 2
2392 #define YYMAXUTOK 362
2394 #define YYTRANSLATE(YYX) \
2395 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2397 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2398 static const yytype_uint8 yytranslate[] =
2400 0, 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, 117, 2, 2, 2, 115, 107, 2,
2404 121, 132, 114, 112, 99, 111, 126, 113, 2, 2,
2405 2, 2, 2, 2, 2, 2, 2, 2, 104, 98,
2406 108, 101, 109, 103, 127, 2, 2, 2, 2, 2,
2407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2409 2, 123, 2, 124, 106, 2, 2, 2, 2, 2,
2410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2412 2, 2, 2, 125, 105, 131, 116, 2, 2, 2,
2413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2425 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2426 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2427 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2428 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2429 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2430 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2431 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2432 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2433 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2434 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2435 95, 96, 97, 100, 102, 110, 118, 119, 120, 122,
2440 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2442 static const yytype_uint16 yyprhs[] =
2444 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2445 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2446 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2447 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2448 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2449 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2450 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2451 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2452 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2453 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2454 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2455 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2456 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2457 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2458 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2459 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2460 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2461 468, 470, 472, 474, 476, 478, 480, 482, 484, 485,
2462 487, 490, 495, 499, 501, 506, 509, 511, 513, 514,
2463 515, 528, 530, 531, 532, 543, 545, 549, 551, 553,
2464 555, 559, 561, 563, 565, 568, 569, 570, 574, 575,
2465 577, 579, 581, 584, 587, 588, 593, 598, 603, 606,
2466 608, 611, 613, 615, 619, 621, 623, 625, 627, 629,
2467 631, 633, 635, 639, 643, 647, 651, 655, 659, 663,
2468 667, 671, 675, 678, 681, 685, 689, 693, 697, 701,
2469 705, 709, 713, 717, 721, 725, 729, 733, 737, 741,
2470 746, 749, 751, 755, 758, 763, 767, 768, 770, 774,
2471 780, 784, 788, 792, 796, 800, 804, 808, 812, 816,
2472 820, 824, 828, 834, 837, 840, 843, 846, 850, 853,
2473 858, 864, 868, 874, 878, 880, 883, 888, 893, 896
2476 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2477 static const yytype_int16 yyrhs[] =
2479 134, 0, -1, 135, -1, -1, 136, -1, 137, -1,
2480 136, 137, -1, 185, -1, 197, -1, 195, -1, 216,
2481 -1, 206, -1, 146, -1, 147, 125, 135, 131, -1,
2482 98, -1, -1, 139, -1, 140, -1, 139, 140, -1,
2483 197, -1, 195, -1, 216, -1, 206, -1, 146, -1,
2484 147, 125, 138, 131, -1, 98, -1, 142, -1, -1,
2485 142, 144, -1, 144, -1, 188, -1, 158, -1, 159,
2486 -1, 160, -1, 162, -1, 170, -1, 153, -1, 182,
2487 -1, 178, -1, 238, -1, 245, -1, 244, -1, 125,
2488 142, 131, -1, 125, 131, -1, 98, -1, 143, -1,
2489 149, -1, 164, -1, 165, -1, 235, -1, 180, -1,
2490 147, 125, 142, 131, -1, 144, 98, -1, 144, -1,
2491 143, -1, 3, 88, 3, -1, 101, 236, -1, -1,
2492 45, 150, -1, 31, 150, -1, 151, -1, 150, 99,
2493 151, -1, 3, 226, 148, -1, -1, 64, 145, -1,
2494 -1, 63, 121, 154, 237, 132, 145, 152, -1, -1,
2495 149, -1, 238, -1, 45, 3, 226, -1, 3, -1,
2496 11, 121, -1, 11, 49, 121, -1, 157, 155, 98,
2497 237, 98, 238, 132, 145, -1, 157, 156, 67, 237,
2498 132, 145, -1, -1, 12, 121, 161, 237, 132, 145,
2499 -1, -1, 13, 163, 145, 12, 121, 237, 132, -1,
2500 65, -1, 65, 3, -1, 29, -1, 29, 3, -1,
2501 -1, 167, -1, 169, -1, 167, 169, -1, 168, -1,
2502 167, 168, -1, 33, 239, 104, 141, -1, 61, 104,
2503 141, -1, -1, 14, 121, 171, 239, 132, 125, 166,
2504 131, -1, -1, 32, 121, 3, 226, 132, 173, 125,
2505 141, 131, -1, -1, 26, 125, 175, 141, 131, -1,
2506 172, -1, 176, 172, -1, 176, -1, 176, 174, -1,
2507 174, -1, -1, 51, 125, 179, 141, 131, 177, -1,
2508 36, 237, -1, 36, -1, 38, 121, 237, 132, -1,
2509 181, 145, -1, 3, -1, 17, -1, 4, -1, 184,
2510 126, 183, -1, 183, -1, -1, 17, 184, 125, 186,
2511 138, 131, -1, -1, 17, 125, 187, 138, 131, -1,
2512 40, 222, -1, 40, 184, 126, 114, -1, -1, 190,
2513 -1, 191, -1, 190, 191, -1, 19, -1, 20, -1,
2514 18, -1, 37, -1, 46, -1, 48, -1, 47, -1,
2515 24, -1, 22, -1, 4, -1, -1, 53, 223, -1,
2516 -1, 53, 224, -1, -1, 15, 224, -1, -1, 189,
2517 30, 3, 192, 194, 125, 196, 199, 131, -1, -1,
2518 189, 43, 3, 193, 125, 198, 202, 131, -1, -1,
2519 200, -1, 201, -1, 200, 201, -1, 98, -1, 147,
2520 125, 199, 131, -1, 206, -1, 216, -1, 143, -1,
2521 -1, 203, -1, 204, -1, 203, 204, -1, 98, -1,
2522 45, 3, -1, 189, 25, 215, 3, 121, 212, 132,
2523 226, -1, 45, -1, 31, -1, -1, 189, 205, 207,
2524 208, -1, 209, -1, 208, 99, 209, -1, 3, 226,
2525 148, -1, -1, 101, 211, -1, 8, -1, 9, -1,
2526 10, -1, 5, -1, 55, -1, 54, -1, 44, -1,
2527 27, -1, 28, -1, -1, 213, -1, 92, 214, -1,
2528 213, 99, 92, 214, -1, 213, 99, 214, -1, 214,
2529 -1, 3, 104, 225, 210, -1, 3, 210, -1, 50,
2530 -1, 34, -1, -1, -1, 189, 25, 215, 3, 121,
2531 212, 132, 226, 125, 217, 141, 131, -1, 3, -1,
2532 -1, -1, 25, 218, 121, 212, 132, 226, 125, 220,
2533 141, 131, -1, 183, -1, 184, 126, 183, -1, 222,
2534 -1, 221, -1, 223, -1, 224, 99, 223, -1, 223,
2535 -1, 114, -1, 35, -1, 104, 225, -1, -1, -1,
2536 121, 228, 132, -1, -1, 229, -1, 230, -1, 236,
2537 -1, 229, 99, -1, 230, 236, -1, -1, 23, 239,
2538 231, 227, -1, 239, 121, 228, 132, -1, 52, 121,
2539 228, 132, -1, 62, 239, -1, 41, -1, 41, 237,
2540 -1, 239, -1, 239, -1, 237, 99, 239, -1, 237,
2541 -1, 219, -1, 242, -1, 232, -1, 234, -1, 233,
2542 -1, 211, -1, 6, -1, 239, 108, 239, -1, 239,
2543 109, 239, -1, 239, 74, 239, -1, 239, 75, 239,
2544 -1, 239, 70, 239, -1, 239, 71, 239, -1, 239,
2545 73, 239, -1, 239, 72, 239, -1, 239, 86, 239,
2546 -1, 239, 87, 239, -1, 117, 239, -1, 116, 239,
2547 -1, 239, 107, 239, -1, 239, 106, 239, -1, 239,
2548 105, 239, -1, 239, 95, 239, -1, 239, 94, 239,
2549 -1, 239, 93, 239, -1, 239, 113, 239, -1, 239,
2550 115, 239, -1, 239, 112, 239, -1, 239, 111, 239,
2551 -1, 239, 114, 239, -1, 239, 67, 239, -1, 239,
2552 68, 239, -1, 239, 39, 239, -1, 239, 66, 239,
2553 -1, 42, 121, 239, 132, -1, 35, 239, -1, 35,
2554 -1, 121, 237, 132, -1, 111, 239, -1, 239, 123,
2555 239, 124, -1, 123, 228, 124, -1, -1, 241, -1,
2556 236, 104, 236, -1, 241, 99, 236, 104, 236, -1,
2557 69, 240, 131, -1, 239, 79, 239, -1, 239, 78,
2558 239, -1, 239, 84, 239, -1, 239, 83, 239, -1,
2559 239, 85, 239, -1, 239, 77, 239, -1, 239, 76,
2560 239, -1, 239, 82, 239, -1, 239, 80, 239, -1,
2561 239, 81, 239, -1, 239, 101, 239, -1, 239, 103,
2562 239, 104, 239, -1, 239, 90, -1, 239, 89, -1,
2563 90, 239, -1, 89, 239, -1, 52, 126, 3, -1,
2564 127, 3, -1, 239, 126, 127, 3, -1, 239, 126,
2565 3, 88, 3, -1, 239, 91, 3, -1, 239, 126,
2566 121, 239, 132, -1, 239, 126, 3, -1, 3, -1,
2567 16, 3, -1, 16, 3, 101, 3, -1, 16, 3,
2568 101, 5, -1, 189, 243, -1, 21, 16, 223, -1
2571 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2572 static const yytype_uint16 yyrline[] =
2574 0, 2074, 2074, 2076, 2076, 2077, 2078, 2080, 2081, 2082,
2575 2083, 2084, 2085, 2086, 2087, 2089, 2089, 2090, 2091, 2093,
2576 2094, 2095, 2096, 2097, 2098, 2099, 2101, 2102, 2104, 2105,
2577 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117,
2578 2118, 2119, 2120, 2121, 2124, 2125, 2126, 2127, 2128, 2129,
2579 2130, 2131, 2135, 2136, 2140, 2147, 2166, 2167, 2171, 2172,
2580 2174, 2175, 2177, 2238, 2239, 2242, 2242, 2261, 2262, 2263,
2581 2268, 2272, 2277, 2278, 2280, 2300, 2348, 2348, 2367, 2367,
2582 2382, 2385, 2388, 2391, 2395, 2396, 2397, 2398, 2399, 2400,
2583 2402, 2413, 2416, 2416, 2447, 2447, 2472, 2472, 2488, 2489,
2584 2490, 2491, 2499, 2508, 2508, 2557, 2561, 2572, 2582, 2599,
2585 2600, 2601, 2603, 2604, 2606, 2606, 2608, 2608, 2631, 2645,
2586 2661, 2662, 2663, 2664, 2671, 2672, 2673, 2674, 2675, 2676,
2587 2677, 2678, 2679, 2680, 2684, 2685, 2687, 2688, 2690, 2691,
2588 2695, 2693, 2701, 2699, 2708, 2709, 2710, 2711, 2712, 2713,
2589 2714, 2715, 2717, 2723, 2724, 2725, 2726, 2727, 2728, 2731,
2590 2763, 2763, 2765, 2765, 2767, 2768, 2770, 2855, 2856, 2859,
2591 2860, 2863, 2864, 2865, 2866, 2867, 2868, 2869, 2884, 2888,
2592 2894, 2900, 2908, 2913, 2919, 2927, 2935, 2936, 2937, 2940,
2593 2939, 2956, 2957, 2959, 2958, 2982, 3001, 3015, 3016, 3018,
2594 3019, 3021, 3022, 3023, 3032, 3033, 3037, 3038, 3040, 3041,
2595 3042, 3044, 3048, 3049, 3054, 3055, 3091, 3137, 3158, 3179,
2596 3182, 3189, 3190, 3191, 3197, 3203, 3204, 3205, 3206, 3208,
2597 3210, 3215, 3232, 3235, 3238, 3241, 3244, 3247, 3250, 3253,
2598 3257, 3268, 3286, 3291, 3296, 3301, 3306, 3311, 3315, 3319,
2599 3324, 3328, 3332, 3341, 3350, 3360, 3365, 3377, 3383, 3388,
2600 3394, 3400, 3404, 3406, 3417, 3426, 3433, 3434, 3436, 3442,
2601 3451, 3458, 3470, 3476, 3482, 3488, 3494, 3500, 3506, 3512,
2602 3525, 3536, 3543, 3556, 3583, 3597, 3611, 3625, 3640, 3647,
2603 3654, 3661, 3668, 3683, 3740, 3849, 3856, 3863, 3870, 3894
2607 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2608 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2609 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2610 static const char *const yytname[] =
2612 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2613 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT",
2614 "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"",
2615 "\"namespace\"", "\"package\"", "\"protected\"", "\"public\"",
2616 "\"private\"", "\"use\"", "\"internal\"", "\"new\"", "\"native\"",
2617 "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"",
2618 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2619 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2620 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2621 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2622 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2623 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2624 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2625 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2626 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2627 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2628 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2629 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2630 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2631 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2632 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2633 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2634 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2635 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2636 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2637 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2638 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2639 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2640 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2641 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2642 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2643 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2644 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH_HEAD",
2645 "WITH", "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9",
2646 "IMPORT", "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2647 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2648 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2649 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2650 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2651 "ONE_SLOT", "MAYBECONSTANT", "CONSTANT", "MAYBE_PARAM_LIST",
2652 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2653 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2654 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2655 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2656 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2657 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2658 "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ", "NAMESPACE_ID",
2659 "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2664 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2666 static const yytype_uint16 yytoknum[] =
2668 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2669 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2670 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2671 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2672 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2673 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2674 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2675 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2676 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2677 345, 346, 347, 348, 349, 350, 351, 352, 59, 44,
2678 353, 61, 354, 63, 58, 124, 94, 38, 60, 62,
2679 355, 45, 43, 47, 42, 37, 126, 33, 356, 357,
2680 358, 40, 359, 91, 93, 123, 46, 64, 360, 361,
2685 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2686 static const yytype_uint8 yyr1[] =
2688 0, 133, 134, 135, 135, 136, 136, 137, 137, 137,
2689 137, 137, 137, 137, 137, 138, 138, 139, 139, 140,
2690 140, 140, 140, 140, 140, 140, 141, 141, 142, 142,
2691 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
2692 143, 143, 143, 143, 144, 144, 144, 144, 144, 144,
2693 144, 144, 145, 145, 146, 147, 148, 148, 149, 149,
2694 150, 150, 151, 152, 152, 154, 153, 155, 155, 155,
2695 156, 156, 157, 157, 158, 159, 161, 160, 163, 162,
2696 164, 164, 165, 165, 166, 166, 166, 166, 167, 167,
2697 168, 169, 171, 170, 173, 172, 175, 174, 176, 176,
2698 177, 177, 177, 179, 178, 180, 180, 181, 182, 183,
2699 183, 183, 184, 184, 186, 185, 187, 185, 188, 188,
2700 189, 189, 190, 190, 191, 191, 191, 191, 191, 191,
2701 191, 191, 191, 191, 192, 192, 193, 193, 194, 194,
2702 196, 195, 198, 197, 199, 199, 200, 200, 201, 201,
2703 201, 201, 201, 202, 202, 203, 203, 204, 204, 204,
2704 205, 205, 207, 206, 208, 208, 209, 210, 210, 211,
2705 211, 211, 211, 211, 211, 211, 211, 211, 212, 212,
2706 212, 212, 213, 213, 214, 214, 215, 215, 215, 217,
2707 216, 218, 218, 220, 219, 221, 222, 223, 223, 224,
2708 224, 225, 225, 225, 226, 226, 227, 227, 228, 228,
2709 228, 229, 230, 229, 231, 232, 233, 233, 234, 235,
2710 235, 236, 237, 237, 238, 239, 239, 239, 239, 239,
2711 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2712 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2713 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2714 239, 239, 239, 239, 239, 239, 240, 240, 241, 241,
2715 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2716 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2717 239, 239, 239, 239, 242, 243, 243, 243, 244, 245
2720 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2721 static const yytype_uint8 yyr2[] =
2723 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2724 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2725 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2726 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2727 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2728 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2729 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2730 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2731 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2732 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2733 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2734 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2735 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2736 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2737 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2738 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2739 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2740 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
2741 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2742 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2743 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2744 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2745 2, 1, 1, 3, 1, 1, 1, 1, 1, 1,
2746 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
2747 3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
2748 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
2749 2, 1, 3, 2, 4, 3, 0, 1, 3, 5,
2750 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2751 3, 3, 5, 2, 2, 2, 2, 3, 2, 4,
2752 5, 3, 5, 3, 1, 2, 4, 4, 2, 3
2755 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2756 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2757 means the default is an error. */
2758 static const yytype_uint16 yydefact[] =
2760 120, 294, 133, 172, 231, 169, 170, 171, 0, 0,
2761 78, 0, 0, 126, 124, 125, 0, 132, 0, 131,
2762 192, 176, 177, 261, 127, 0, 0, 0, 175, 128,
2763 130, 129, 0, 0, 174, 173, 0, 0, 266, 0,
2764 0, 14, 0, 0, 0, 0, 208, 120, 0, 0,
2765 2, 120, 5, 54, 12, 0, 36, 67, 31, 32,
2766 33, 34, 35, 38, 120, 37, 7, 30, 0, 121,
2767 122, 9, 8, 11, 230, 10, 225, 227, 229, 228,
2768 224, 39, 222, 226, 41, 40, 0, 0, 72, 76,
2769 120, 92, 109, 111, 110, 116, 113, 0, 0, 294,
2770 214, 191, 0, 260, 0, 0, 118, 0, 103, 208,
2771 0, 218, 65, 0, 221, 0, 267, 286, 285, 263,
2772 243, 242, 0, 0, 209, 210, 211, 82, 0, 106,
2773 219, 0, 80, 44, 43, 120, 45, 29, 0, 46,
2774 47, 48, 50, 0, 49, 288, 1, 6, 120, 294,
2775 0, 68, 0, 0, 69, 53, 108, 0, 188, 0,
2776 161, 0, 160, 162, 298, 123, 0, 0, 0, 0,
2777 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2778 0, 0, 0, 0, 0, 0, 0, 0, 0, 284,
2779 283, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2780 0, 0, 0, 0, 0, 0, 0, 208, 0, 0,
2781 55, 73, 0, 0, 0, 120, 114, 0, 195, 0,
2782 198, 197, 299, 206, 178, 0, 0, 0, 27, 0,
2783 287, 0, 0, 270, 0, 262, 265, 212, 213, 83,
2784 205, 59, 60, 105, 220, 58, 81, 42, 28, 120,
2785 0, 205, 0, 0, 52, 295, 187, 186, 0, 134,
2786 136, 0, 223, 257, 258, 255, 256, 236, 237, 239,
2787 238, 234, 235, 277, 276, 272, 271, 279, 280, 278,
2788 274, 273, 275, 240, 241, 291, 249, 248, 247, 281,
2789 0, 246, 245, 244, 232, 233, 253, 252, 250, 254,
2790 251, 0, 0, 293, 0, 0, 0, 0, 0, 25,
2791 0, 120, 17, 23, 0, 20, 19, 22, 21, 120,
2792 112, 0, 208, 215, 167, 0, 0, 179, 183, 107,
2793 119, 196, 259, 0, 26, 217, 0, 268, 0, 0,
2794 57, 0, 120, 13, 57, 0, 0, 0, 0, 0,
2795 138, 0, 0, 205, 163, 164, 0, 216, 264, 0,
2796 0, 289, 120, 0, 0, 117, 18, 120, 0, 0,
2797 0, 0, 185, 180, 205, 0, 0, 120, 0, 203,
2798 202, 201, 204, 0, 62, 61, 51, 0, 120, 296,
2799 297, 178, 135, 0, 0, 199, 137, 142, 57, 0,
2800 282, 290, 292, 77, 0, 84, 0, 115, 207, 168,
2801 167, 0, 0, 182, 0, 0, 98, 102, 100, 104,
2802 63, 269, 56, 0, 75, 0, 139, 140, 0, 120,
2803 166, 165, 79, 0, 0, 0, 85, 88, 86, 24,
2804 184, 193, 181, 96, 0, 99, 101, 120, 66, 120,
2805 205, 120, 200, 0, 157, 0, 0, 120, 155, 0,
2806 27, 93, 89, 87, 27, 27, 205, 64, 74, 0,
2807 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2808 188, 143, 156, 27, 91, 0, 0, 0, 189, 120,
2809 141, 147, 0, 90, 194, 97, 94, 27, 0, 0,
2810 0, 0, 149, 178, 27, 190, 0, 0, 205, 95,
2814 /* YYDEFGOTO[NTERM-NUM]. */
2815 static const yytype_int16 yydefgoto[] =
2817 -1, 49, 50, 51, 52, 310, 311, 312, 333, 334,
2818 136, 137, 156, 313, 138, 384, 139, 245, 242, 448,
2819 56, 231, 152, 153, 57, 58, 59, 60, 212, 61,
2820 90, 140, 141, 435, 436, 437, 438, 62, 214, 416,
2821 500, 417, 465, 418, 419, 63, 228, 142, 64, 65,
2822 218, 219, 66, 319, 215, 67, 143, 69, 70, 350,
2823 352, 394, 315, 451, 316, 429, 474, 475, 476, 456,
2824 457, 458, 163, 317, 261, 354, 355, 372, 74, 326,
2825 327, 328, 258, 318, 497, 102, 76, 464, 220, 221,
2826 381, 396, 382, 340, 323, 123, 124, 125, 223, 77,
2827 78, 79, 144, 126, 80, 81, 82, 115, 116, 83,
2831 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2833 #define YYPACT_NINF -423
2834 static const yytype_int16 yypact[] =
2836 1655, -41, -423, -423, -423, -423, -423, -423, -30, -61,
2837 -423, -52, 17, -423, -423, -423, 61, -423, 2098, -423,
2838 87, -423, -423, 2153, -423, -19, 42, 11, -423, -423,
2839 -423, -423, -1, -3, -423, -423, 2098, 19, 2098, 2098,
2840 2098, -423, 2098, 2098, 2098, 2098, 2098, 623, 95, 136,
2841 -423, 494, -423, -423, -423, 13, -423, 2028, -423, -423,
2842 -423, -423, -423, -423, 1905, -423, -423, -423, 211, 394,
2843 -423, -423, -423, -423, -423, -423, -423, -423, -423, -423,
2844 44, -423, 2558, -423, -423, -423, 174, 83, -423, -423,
2845 1905, -423, -423, -423, -423, -423, -423, 20, 42, -423,
2846 -34, -423, 85, 18, 2098, 79, -423, 2098, -423, 2098,
2847 204, 18, -423, 105, 2558, 80, 113, 18, 18, -50,
2848 18, 18, -29, 89, 119, 2098, -423, 217, 226, 2098,
2849 2098, 226, 230, -423, -423, 752, -423, -423, 109, -423,
2850 -423, -423, -423, 214, -423, -423, -423, -423, 1010, 168,
2851 234, -423, 140, 172, -423, 142, -423, 245, 16, 247,
2852 -423, 249, -423, -423, -423, -423, 2098, 2098, 2098, 2098,
2853 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098,
2854 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, -423,
2855 -423, 250, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098,
2856 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 2098, 10,
2857 -423, -423, 2098, 243, 2098, 1139, -423, 42, 131, 133,
2858 -423, -423, -423, 141, 12, -27, 64, 2178, 1780, 129,
2859 -423, 2098, 2098, -423, 2098, -423, -423, -423, -423, -423,
2860 159, 166, -423, 44, 44, 166, -423, -423, -423, 1905,
2861 135, 159, 2098, 2098, -423, 169, -423, -423, 264, 216,
2862 218, 273, 2558, 486, 313, 313, 313, 2924, 2924, 2924,
2863 2924, 486, 486, 2558, 2558, 2558, 2558, 2558, 2558, 2558,
2864 2558, 2558, 2558, 2619, 2680, -423, 359, 359, 359, 2558,
2865 2375, 2741, 2802, 2863, 486, 486, -50, -50, 18, 18,
2866 18, 145, 2436, 190, 2098, 277, -16, 160, 2249, -423,
2867 151, 1268, -423, -423, 158, -423, -423, -423, -423, 1139,
2868 -423, 42, 2098, -423, 21, 281, 153, 187, -423, -423,
2869 -423, 163, -423, 161, 1780, -423, -15, -423, 186, 84,
2870 192, 226, 881, -423, -23, 29, -2, 130, 173, 42,
2871 282, 42, 171, 159, 202, -423, 2098, -423, -423, 301,
2872 2312, -423, 1905, 2098, 180, -423, -423, 1139, 175, 176,
2873 290, 84, -423, -423, 159, 14, 30, 1905, 2098, -423,
2874 -423, -423, -423, 2098, -423, -423, -423, 2098, 1905, -423,
2875 -423, 12, -423, 42, 185, -423, 224, -423, 192, 273,
2876 2558, -423, -423, -423, 15, 25, 184, -423, -423, -423,
2877 215, 199, 281, -423, 201, 207, -423, -423, 30, -423,
2878 265, -423, -423, 198, -423, 200, 224, -423, 42, 227,
2879 -423, -423, -423, 2098, 231, 205, 25, -423, -423, -423,
2880 -423, -423, -423, -423, 328, -423, -423, 1905, -423, 1905,
2881 159, 1397, -423, 336, -423, 315, 219, 337, -423, 2497,
2882 1780, -423, -423, -423, 1780, 1780, 159, -423, -423, 222,
2883 -423, -423, 223, 183, 229, 1526, -423, -423, -423, -423,
2884 16, -423, -423, 1780, -423, 232, 233, 210, -423, 1397,
2885 -423, -423, 346, -423, -423, -423, -423, 1780, 235, 241,
2886 228, 240, -423, 12, 1780, -423, 244, 246, 159, -423,
2890 /* YYPGOTO[NTERM-NUM]. */
2891 static const yytype_int16 yypgoto[] =
2893 -423, -423, 238, -423, 321, -282, -423, 67, -422, -25,
2894 1, -55, -74, 28, 2, -8, 332, 263, 52, -423,
2895 -423, -423, -423, -423, -423, -423, -423, -423, -423, -423,
2896 -423, -423, -423, -423, -423, -40, -39, -423, -423, -18,
2897 -423, -17, -423, -423, -423, -423, -423, -423, -423, -423,
2898 6, 103, -423, -423, -423, -423, 0, -423, 326, -423,
2899 -423, -423, 48, -423, 49, -423, -90, -423, -70, -423,
2900 -423, -48, -423, 3, -423, -423, 24, 5, 40, -377,
2901 -423, -301, -69, 4, -423, -423, -423, -423, -423, 391,
2902 -91, 26, 59, -240, -423, -97, -423, -423, -423, -423,
2903 -423, -423, -423, -32, -9, -49, -13, -423, -423, -423,
2907 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2908 positive, shift that token. If negative, reduce the rule which
2909 number is the opposite. If zero, do what YYDEFACT says.
2910 If YYTABLE_NINF, syntax error. */
2911 #define YYTABLE_NINF -155
2912 static const yytype_int16 yytable[] =
2914 68, 53, 55, 73, 75, 100, 113, 222, 154, 155,
2915 103, 344, 229, 303, 425, 324, 213, 324, 96, 87,
2916 92, 93, 135, 111, 373, 114, 117, 118, 54, 119,
2917 120, 121, 96, 114, 94, 155, 122, 368, 484, 189,
2918 190, 191, 485, 486, -70, 92, 93, 86, 71, 72,
2919 256, 68, 53, 55, 73, 75, 414, 191, 433, 94,
2920 89, 493, 415, 204, 205, 206, 257, 92, 93, 91,
2921 166, 207, 166, 208, 413, 501, 209, 98, 383, 54,
2922 248, 94, 507, 166, 166, 406, 434, 92, 93, 208,
2923 101, 88, 209, 238, 227, 225, 114, 166, 145, 71,
2924 72, 94, 104, 235, 325, 329, 412, 189, 190, 191,
2925 301, 442, 114, 398, 166, 97, 362, 377, 109, 379,
2926 243, 244, 370, 110, 108, 371, 506, 387, 166, 105,
2927 388, 304, 107, 389, 411, 390, 146, 305, 148, 207,
2928 112, 208, 95, 166, 209, 216, 217, 432, 68, 53,
2929 55, 73, 75, 262, 263, 264, 265, 266, 267, 268,
2930 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
2931 279, 280, 281, 282, 283, 284, 54, 210, 330, 286,
2932 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
2933 297, 298, 299, 300, 114, 302, 71, 72, 380, 157,
2934 337, 308, 338, 306, 211, 226, 224, 230, 158, 232,
2935 469, 233, 234, 236, 160, 68, 53, 314, 237, 114,
2936 239, 114, 336, 320, 342, 369, 487, 157, 162, 240,
2937 157, 2, 331, 246, 249, -71, 158, 251, 252, 253,
2938 254, 159, 160, 345, 346, 13, 14, 15, 255, 17,
2939 259, 19, 260, 285, 161, 307, 162, -113, 392, 321,
2940 395, 335, 322, 339, 24, 341, 343, 348, 510, 349,
2941 347, 351, 453, 29, 30, 31, 353, 357, 359, 248,
2942 361, 363, 365, 367, 324, 374, 375, 248, 403, -112,
2943 378, 360, 376, 383, 391, 3, 397, 393, 5, 6,
2944 7, 399, 395, 420, 401, 405, 407, 155, 408, 114,
2945 427, 68, 53, 314, 424, 439, 370, 21, 22, 68,
2946 53, 314, 155, 428, 441, 454, 443, 331, 444, 447,
2947 449, 466, 450, 155, 28, 460, 461, 452, 423, 479,
2948 480, 2, 496, 400, 34, 35, 421, 488, 489, 499,
2949 481, 422, 167, 504, 404, 13, 14, 15, -153, 17,
2950 490, 19, 503, 494, 495, 114, 502, 68, 53, 314,
2951 114, 505, 147, 467, 24, 468, 508, 509, 366, -155,
2952 -155, -155, 453, 29, 30, 31, 250, 175, 176, 151,
2953 430, 241, 155, 385, 155, 165, 462, 463, 2, 498,
2954 445, 446, 189, 190, 191, 491, 192, 193, 194, 482,
2955 409, 492, 13, 14, 15, 440, 17, 106, 19, 426,
2956 459, 200, 201, 431, 202, 203, 204, 205, 206, 455,
2957 410, 24, 0, 0, 207, 454, 208, 0, 0, 209,
2958 29, 30, 31, 0, 0, 0, 0, 0, 189, 190,
2959 191, 473, 471, 472, 477, 478, 0, 455, 0, 0,
2960 0, 0, 0, 0, 0, 0, 0, 0, -154, 0,
2961 202, 203, 204, 205, 206, 473, 471, 472, 477, 478,
2962 207, 0, 208, 0, 0, 209, 0, 0, 0, 473,
2963 471, 472, 477, 478, -4, 0, 0, 1, 2, 3,
2964 4, 0, 5, 6, 7, 8, 9, 10, 11, 0,
2965 0, 12, 13, 14, 15, 16, 17, 18, 19, 0,
2966 0, 21, 22, 0, 0, -155, 0, 0, 0, 23,
2967 0, 24, 25, 0, 26, 0, 27, 0, 28, 0,
2968 29, 30, 31, 0, 0, 32, 33, 0, 34, 35,
2969 0, 0, 0, 0, 0, 0, 36, 37, 0, 0,
2970 -155, -155, 0, 38, 0, 0, 0, 0, 0, 0,
2971 0, 0, 0, 0, 0, 189, 190, 191, 0, 192,
2972 193, 194, 0, 39, 40, 0, 0, 0, 0, 0,
2973 0, 0, 41, 0, -155, -155, 0, 202, 203, 204,
2974 205, 206, 0, 0, 0, 42, 0, 207, 0, 208,
2975 43, 44, 209, 0, 0, 45, 0, 46, 0, 47,
2976 0, 48, 0, 0, 0, -4, 1, 2, 3, 4,
2977 0, 5, 6, 7, 8, 9, 10, 11, 0, 0,
2978 0, 13, 14, 15, 16, 17, 18, 19, 20, 0,
2979 21, 22, 127, 0, 128, 0, 0, 0, 23, 129,
2980 24, 25, 0, 26, 130, 27, 0, 28, 131, 29,
2981 30, 31, 0, 0, 32, 33, 0, 34, 35, 0,
2982 0, 0, 0, 0, 0, 36, 37, 0, 132, 0,
2983 0, 0, 38, 0, 0, 0, 0, 0, 0, 0,
2984 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2985 0, 0, 39, 40, 0, 0, 0, 0, 0, 0,
2986 0, 133, 0, 0, 0, 0, 0, 0, 0, 0,
2987 0, 0, 0, 0, 42, 0, 0, 0, 0, 43,
2988 44, 0, 0, 0, 45, 0, 46, 0, 47, 0,
2989 48, 0, 0, 0, 134, 1, 2, 3, 4, 0,
2990 5, 6, 7, 8, 9, 10, 11, 0, 0, 0,
2991 13, 14, 15, 16, 17, 18, 19, 20, 0, 21,
2992 22, 127, 0, 128, 0, 0, 0, 23, 129, 24,
2993 25, 0, 26, 130, 27, 0, 28, 131, 29, 30,
2994 31, 0, 0, 32, 33, 0, 34, 35, 0, 0,
2995 0, 0, 0, 0, 36, 37, 0, 132, 0, 0,
2996 0, 38, 0, 0, 0, 0, 0, 0, 0, 0,
2997 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2998 0, 39, 40, 0, 0, 0, 0, 0, 0, 0,
2999 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3000 0, 0, 0, 42, 0, 0, 0, 0, 43, 44,
3001 0, 0, 0, 45, 0, 46, 0, 47, 0, 48,
3002 0, 0, 0, 247, 1, 2, 3, 4, 0, 5,
3003 6, 7, 8, 9, 10, 11, 0, 0, 0, 13,
3004 14, 15, 16, 17, 18, 19, 20, 0, 21, 22,
3005 127, 0, 128, 0, 0, 0, 23, 129, 24, 25,
3006 0, 26, 130, 27, 0, 28, 131, 29, 30, 31,
3007 0, 0, 32, 33, 0, 34, 35, 0, 0, 0,
3008 0, 0, 0, 36, 37, 0, 132, 0, 0, 0,
3009 38, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3010 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3011 39, 40, 0, 0, 0, 0, 0, 0, 0, 133,
3012 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3013 0, 0, 42, 0, 0, 0, 0, 43, 44, 0,
3014 0, 0, 45, 0, 46, 0, 47, 0, 48, 0,
3015 0, 0, 386, 1, 2, 3, 4, 0, 5, 6,
3016 7, 8, 9, 10, 11, 0, 0, 12, 13, 14,
3017 15, 16, 17, 18, 19, 0, 0, 21, 22, 0,
3018 0, 0, 0, 0, 0, 23, 0, 24, 25, 0,
3019 26, 0, 27, 0, 28, 0, 29, 30, 31, 0,
3020 0, 32, 33, 0, 34, 35, 0, 0, 0, 0,
3021 0, 0, 36, 37, 0, 0, 0, 0, 0, 38,
3022 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3023 0, 0, 0, 0, 0, 0, 0, 0, 0, 39,
3024 40, 0, 0, 0, 0, 0, 0, 0, 41, 0,
3025 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3026 0, 42, 0, 0, 0, 0, 43, 44, 0, 0,
3027 0, 45, 0, 46, 0, 47, 0, 48, 0, 0,
3028 0, -3, 1, 2, 3, 4, 0, 5, 6, 7,
3029 8, 9, 10, 11, 0, 0, 0, 13, 14, 15,
3030 16, 17, 18, 19, 0, 0, 21, 22, 0, 0,
3031 0, 0, 0, 0, 23, 0, 24, 25, 0, 26,
3032 0, 27, 0, 28, 0, 29, 30, 31, 0, 0,
3033 32, 33, 0, 34, 35, 0, 0, 0, 0, 0,
3034 0, 36, 37, 0, 0, 0, 0, 0, 38, 0,
3035 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3036 0, 0, 0, 0, 0, 0, 0, 0, 39, 40,
3037 0, 0, 0, 0, 0, 0, 0, 309, 0, 0,
3038 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3039 42, 0, 0, 0, 0, 43, 44, 0, 0, 0,
3040 45, 0, 46, 0, 47, 0, 48, 0, 0, 0,
3041 -15, 1, 2, 3, 4, 0, 5, 6, 7, 8,
3042 9, 10, 11, 0, 0, 0, 13, 14, 15, 16,
3043 17, 18, 19, 0, 0, 21, 22, 0, 0, 0,
3044 0, 0, 0, 23, 0, 24, 25, 0, 26, 0,
3045 27, 0, 28, 0, 29, 30, 31, 0, 0, 32,
3046 33, 0, 34, 35, 0, 0, 0, 0, 0, 0,
3047 36, 37, 0, 0, 0, 0, 0, 38, 0, 0,
3048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3049 0, 0, 0, 0, 0, 0, 0, 39, 40, 0,
3050 0, 0, 0, 0, 0, 0, 309, 0, 0, 0,
3051 0, 0, 0, 0, 0, 0, 0, 0, 0, 42,
3052 0, 0, 0, 0, 43, 44, 0, 0, 0, 45,
3053 0, 46, 0, 47, 0, 48, 0, 0, 0, -16,
3054 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
3055 10, 11, 0, 0, 0, 13, 14, 15, 16, 17,
3056 18, 19, 0, 0, 21, 22, 0, 0, 0, 0,
3057 0, 0, 23, 0, 24, 25, 0, 26, 0, 27,
3058 0, 28, 0, 29, 30, 31, 0, 0, 32, 33,
3059 0, 34, 35, 0, 0, 0, 0, 0, 0, 36,
3060 37, 0, 0, 0, 0, 0, 38, 0, 0, 0,
3061 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3062 0, 0, 0, 0, 0, 0, 39, 40, 0, 0,
3063 0, 0, 0, 0, 0, 470, 0, 0, 0, 0,
3064 0, 0, 0, 0, 0, 0, 0, 0, 42, 0,
3065 0, 0, 0, 43, 44, 0, 0, 0, 45, 0,
3066 46, 0, 47, 0, 48, 0, 0, 0, -144, 1,
3067 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3068 11, 0, 0, 0, 13, 14, 15, 16, 17, 18,
3069 19, 0, 0, 21, 22, 0, 0, 0, 0, 0,
3070 0, 23, 0, 24, 25, 0, 26, 0, 27, 0,
3071 28, 0, 29, 30, 31, 0, 0, 32, 33, 0,
3072 34, 35, 0, 0, 0, 0, 0, 0, 36, 37,
3073 0, 0, 0, 0, 0, 38, 0, 0, 0, 0,
3074 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3075 0, 0, 0, 0, 0, 39, 40, 0, 0, 0,
3076 0, 0, 0, 0, 470, 0, 0, 0, 0, 0,
3077 0, 0, 0, 0, 0, 0, 0, 42, 0, 0,
3078 0, 0, 43, 44, 0, 0, 0, 45, 0, 46,
3079 0, 47, 0, 48, 0, -3, 0, -145, 1, 2,
3080 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3081 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
3082 0, 0, 21, 22, 0, 0, 0, 0, 0, 0,
3083 23, 0, 24, 25, 0, 26, 0, 27, 0, 28,
3084 0, 29, 30, 31, 0, 0, 32, 33, 0, 34,
3085 35, 0, 0, 0, 0, 0, 0, 36, 37, 0,
3086 0, 0, 0, 0, 38, 0, 0, 0, 0, 0,
3087 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3088 0, 0, 0, 0, 39, 40, 0, 0, 0, 0,
3089 0, 0, 0, 41, 0, 0, 0, 0, 0, 0,
3090 0, 0, 0, 0, 0, 0, 42, 0, 0, 0,
3091 0, 43, 44, 0, 0, 0, 45, 0, 46, 0,
3092 47, 0, 48, 1, 2, 3, 4, 0, 5, 6,
3093 7, 8, 9, 10, 11, 0, -120, 0, 13, 14,
3094 15, 16, 17, 18, 19, 20, 0, 21, 22, 127,
3095 0, 128, 0, 0, 0, 23, 129, 24, 25, 0,
3096 26, 130, 27, 0, 28, 131, 29, 30, 31, 0,
3097 0, 32, 33, 0, 34, 35, 0, 0, 0, 0,
3098 0, 0, 36, 37, 0, 132, 0, 0, 0, 38,
3099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3100 0, 0, 0, 0, 0, 0, 0, 0, 0, 39,
3101 40, 0, 0, 0, 0, 0, 0, 0, 133, 0,
3102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3103 0, 42, 0, 0, 0, 0, 43, 44, 0, 0,
3104 0, 45, 0, 46, 0, 47, 0, 48, 1, 2,
3105 3, 4, 0, 5, 6, 7, 8, 9, 10, 11,
3106 0, 0, 0, 13, 14, 15, 16, 17, 18, 19,
3107 20, 0, 21, 22, 127, 0, 128, 0, 0, 0,
3108 23, 129, 24, 25, 0, 26, 130, 27, 0, 28,
3109 131, 29, 30, 31, 0, 0, 32, 33, 0, 34,
3110 35, 0, 0, 0, 0, 0, 0, 36, 37, 0,
3111 132, 0, 0, 0, 38, 0, 0, 0, 0, 0,
3112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3113 0, 0, 0, 0, 39, 40, 0, 0, 0, 0,
3114 0, 0, 0, 133, 0, 0, 0, 0, 0, 0,
3115 0, 0, 0, 0, 0, 0, 42, 0, 0, 0,
3116 0, 43, 44, 0, 0, 0, 45, 0, 46, 0,
3117 47, 149, 48, 3, 4, 0, 5, 6, 7, 0,
3118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3119 0, 18, 0, 20, 0, 21, 22, 0, 0, 128,
3120 0, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3121 27, 0, 28, 150, 0, 0, 0, 0, 0, 0,
3122 33, 0, 34, 35, 0, 0, 0, 0, 0, 0,
3123 36, 0, 0, 0, 0, 0, 0, 38, 0, 0,
3124 0, 99, 0, 3, 4, 0, 5, 6, 7, 0,
3125 0, 0, 0, 0, 0, 0, 0, 39, 40, 0,
3126 0, 18, 0, 20, 0, 21, 22, 0, 0, 0,
3127 0, 0, 0, 23, 0, 0, 0, 0, 0, 42,
3128 27, 0, 28, 0, 43, 44, 0, 0, 0, 45,
3129 33, 46, 34, 35, 0, 48, 99, 0, 3, 4,
3130 36, 5, 6, 7, 0, 0, 0, 38, 0, 0,
3131 0, 0, 0, 0, 0, 0, 18, 0, 20, 0,
3132 21, 22, 0, 0, 0, 0, 0, 39, 40, 0,
3133 0, 0, 0, 0, 0, 0, 0, 28, 0, 0,
3134 0, 0, 0, 0, 0, 33, 0, 34, 35, 42,
3135 0, 0, 0, 0, 43, 44, 0, 167, 0, 45,
3136 0, 46, 38, 0, 0, 48, 0, 0, 0, 0,
3137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3138 0, 0, 39, 40, 168, 169, 170, 0, 171, 172,
3139 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3140 183, 184, 185, 186, 187, 188, 0, 189, 190, 191,
3141 0, 192, 193, 194, 45, 0, 46, 0, 0, 195,
3142 48, 196, 0, 197, 198, 199, 200, 201, 167, 202,
3143 203, 204, 205, 206, 0, 0, 0, 0, 0, 207,
3144 0, 208, 0, 0, 209, 0, 0, 0, 0, 0,
3145 332, 0, 0, 0, 0, 168, 169, 170, 0, 171,
3146 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3147 182, 183, 184, 185, 186, 187, 188, 0, 189, 190,
3148 191, 0, 192, 193, 194, 0, 0, 0, 0, 0,
3149 195, 167, 196, 0, 197, 198, 199, 200, 201, 0,
3150 202, 203, 204, 205, 206, 0, 0, 0, 0, 0,
3151 207, 0, 208, 0, 0, 209, 0, 0, 168, 169,
3152 170, 364, 171, 172, 173, 174, 175, 176, 177, 178,
3153 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
3154 0, 189, 190, 191, 0, 192, 193, 194, 0, 0,
3155 0, 0, 0, 195, 167, 196, 0, 197, 198, 199,
3156 200, 201, 0, 202, 203, 204, 205, 206, 0, 0,
3157 0, 0, 0, 207, 0, 208, 0, 0, 209, 0,
3158 0, 168, 169, 170, 402, 171, 172, 173, 174, 175,
3159 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
3160 186, 187, 188, 0, 189, 190, 191, 0, 192, 193,
3161 194, 0, 0, 0, 0, 167, 195, 0, 196, 356,
3162 197, 198, 199, 200, 201, 0, 202, 203, 204, 205,
3163 206, 0, 0, 0, 0, 0, 207, 0, 208, 0,
3164 0, 209, 168, 169, 170, 0, 171, 172, 173, 174,
3165 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
3166 185, 186, 187, 188, 0, 189, 190, 191, 0, 192,
3167 193, 194, 0, 0, 0, 0, 167, 195, 0, 196,
3168 0, 197, 198, 199, 200, 201, 0, 202, 203, 204,
3169 205, 206, 0, 0, 0, 0, 0, 207, 0, 208,
3170 358, 0, 209, 168, 169, 170, 0, 171, 172, 173,
3171 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
3172 184, 185, 186, 187, 188, 0, 189, 190, 191, 0,
3173 192, 193, 194, 0, 0, 0, 0, 167, 195, 0,
3174 196, 483, 197, 198, 199, 200, 201, 0, 202, 203,
3175 204, 205, 206, 0, 0, 0, 0, 0, 207, 0,
3176 208, 0, 0, 209, 168, 169, 170, 0, 171, 172,
3177 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3178 183, 184, 185, 186, 187, 188, 0, 189, 190, 191,
3179 0, 192, 193, 194, 0, 0, 0, 0, 167, 195,
3180 0, 196, 0, 197, 198, 199, 200, 201, 0, 202,
3181 203, 204, 205, 206, 0, 0, 0, 0, 0, 207,
3182 0, 208, 0, 0, 209, 168, 169, 170, 0, 171,
3183 172, 173, 174, 175, 176, 0, 0, 0, 0, 0,
3184 0, 0, 0, 0, 0, 0, 188, 0, 189, 190,
3185 191, 0, 192, 193, 194, 0, 0, 0, 0, 167,
3186 0, 0, 0, 0, 197, 198, 199, 200, 201, 0,
3187 202, 203, 204, 205, 206, 0, 0, 0, 0, 0,
3188 207, 0, 208, 0, 0, 209, 168, 169, 170, 0,
3189 171, 172, 173, 174, 175, 176, 0, 0, 0, 0,
3190 0, 0, 0, 0, 0, 0, 0, 0, 0, 189,
3191 190, 191, 0, 192, 193, 194, 0, 0, 0, 0,
3192 167, 0, 0, 0, 0, 197, 198, 199, 200, 201,
3193 0, 202, 203, 204, 205, 206, 0, 0, 0, 0,
3194 0, 207, 0, 208, 0, 0, 209, 168, 169, 170,
3195 0, 171, 172, 173, 174, 175, 176, 0, 0, 0,
3196 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3197 189, 190, 191, 0, 192, 193, 194, 0, 0, 0,
3198 0, 167, 0, 0, 0, 0, 0, 198, 199, 200,
3199 201, 0, 202, 203, 204, 205, 206, 0, 0, 0,
3200 0, 0, 207, 0, 208, 0, 0, 209, 168, 169,
3201 170, 0, 171, 172, 173, 174, 175, 176, 0, 0,
3202 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3203 0, 189, 190, 191, 0, 192, 193, 194, 0, 0,
3204 0, 0, 167, 0, 0, 0, 0, 0, 0, 199,
3205 200, 201, 0, 202, 203, 204, 205, 206, 0, 0,
3206 0, 0, 0, 207, 0, 208, 0, 0, 209, 168,
3207 169, 170, 0, 171, 172, 173, 174, 175, 176, 0,
3208 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3209 0, 0, 189, 190, 191, 0, 192, 193, 194, 0,
3210 0, 0, 0, 167, 0, 0, 0, 0, 0, 0,
3211 -155, 200, 201, 0, 202, 203, 204, 205, 206, 0,
3212 0, 0, 0, 0, 207, 0, 208, 0, 0, 209,
3213 168, 169, 170, 0, -155, -155, -155, -155, 175, 176,
3214 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3215 0, 0, 0, 189, 190, 191, 0, 192, 193, 194,
3216 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3217 0, 0, 200, 201, 0, 202, 203, 204, 205, 206,
3218 0, 0, 0, 0, 0, 207, 0, 208, 0, 0,
3222 static const yytype_int16 yycheck[] =
3224 0, 0, 0, 0, 0, 18, 38, 98, 57, 64,
3225 23, 251, 109, 3, 391, 3, 90, 3, 12, 49,
3226 3, 4, 47, 36, 325, 38, 39, 40, 0, 42,
3227 43, 44, 26, 46, 17, 90, 45, 319, 460, 89,
3228 90, 91, 464, 465, 67, 3, 4, 88, 0, 0,
3229 34, 51, 51, 51, 51, 51, 26, 91, 33, 17,
3230 121, 483, 32, 113, 114, 115, 50, 3, 4, 121,
3231 99, 121, 99, 123, 375, 497, 126, 16, 101, 51,
3232 135, 17, 504, 99, 99, 367, 61, 3, 4, 123,
3233 3, 121, 126, 125, 107, 104, 109, 99, 3, 51,
3234 51, 17, 121, 132, 92, 132, 92, 89, 90, 91,
3235 207, 412, 125, 353, 99, 12, 132, 132, 121, 35,
3236 129, 130, 101, 126, 125, 104, 503, 98, 99, 26,
3237 132, 121, 121, 3, 374, 5, 0, 127, 125, 121,
3238 121, 123, 125, 99, 126, 125, 126, 132, 148, 148,
3239 148, 148, 148, 166, 167, 168, 169, 170, 171, 172,
3240 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3241 183, 184, 185, 186, 187, 188, 148, 3, 114, 192,
3242 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3243 203, 204, 205, 206, 207, 208, 148, 148, 114, 16,
3244 232, 214, 234, 212, 121, 126, 121, 3, 25, 104,
3245 450, 131, 99, 124, 31, 215, 215, 215, 99, 232,
3246 3, 234, 231, 217, 249, 322, 466, 16, 45, 3,
3247 16, 4, 226, 3, 125, 67, 25, 3, 98, 67,
3248 98, 30, 31, 252, 253, 18, 19, 20, 3, 22,
3249 3, 24, 3, 3, 43, 12, 45, 126, 349, 126,
3250 351, 132, 121, 104, 37, 99, 131, 3, 508, 53,
3251 101, 53, 45, 46, 47, 48, 3, 132, 88, 334,
3252 3, 121, 131, 125, 3, 132, 99, 342, 362, 126,
3253 104, 304, 131, 101, 121, 5, 125, 15, 8, 9,
3254 10, 99, 393, 377, 3, 125, 131, 362, 132, 322,
3255 125, 311, 311, 311, 388, 131, 101, 27, 28, 319,
3256 319, 319, 377, 99, 125, 98, 125, 321, 121, 64,
3257 132, 3, 132, 388, 44, 104, 131, 428, 387, 3,
3258 25, 4, 132, 356, 54, 55, 378, 125, 125, 3,
3259 131, 383, 39, 125, 363, 18, 19, 20, 131, 22,
3260 131, 24, 121, 131, 131, 378, 131, 367, 367, 367,
3261 383, 131, 51, 447, 37, 449, 132, 131, 311, 66,
3262 67, 68, 45, 46, 47, 48, 148, 74, 75, 57,
3263 398, 128, 447, 341, 449, 69, 436, 436, 4, 489,
3264 418, 418, 89, 90, 91, 475, 93, 94, 95, 457,
3265 370, 480, 18, 19, 20, 410, 22, 26, 24, 393,
3266 433, 108, 109, 399, 111, 112, 113, 114, 115, 429,
3267 371, 37, -1, -1, 121, 98, 123, -1, -1, 126,
3268 46, 47, 48, -1, -1, -1, -1, -1, 89, 90,
3269 91, 451, 451, 451, 451, 451, -1, 457, -1, -1,
3270 -1, -1, -1, -1, -1, -1, -1, -1, 131, -1,
3271 111, 112, 113, 114, 115, 475, 475, 475, 475, 475,
3272 121, -1, 123, -1, -1, 126, -1, -1, -1, 489,
3273 489, 489, 489, 489, 0, -1, -1, 3, 4, 5,
3274 6, -1, 8, 9, 10, 11, 12, 13, 14, -1,
3275 -1, 17, 18, 19, 20, 21, 22, 23, 24, -1,
3276 -1, 27, 28, -1, -1, 39, -1, -1, -1, 35,
3277 -1, 37, 38, -1, 40, -1, 42, -1, 44, -1,
3278 46, 47, 48, -1, -1, 51, 52, -1, 54, 55,
3279 -1, -1, -1, -1, -1, -1, 62, 63, -1, -1,
3280 74, 75, -1, 69, -1, -1, -1, -1, -1, -1,
3281 -1, -1, -1, -1, -1, 89, 90, 91, -1, 93,
3282 94, 95, -1, 89, 90, -1, -1, -1, -1, -1,
3283 -1, -1, 98, -1, 108, 109, -1, 111, 112, 113,
3284 114, 115, -1, -1, -1, 111, -1, 121, -1, 123,
3285 116, 117, 126, -1, -1, 121, -1, 123, -1, 125,
3286 -1, 127, -1, -1, -1, 131, 3, 4, 5, 6,
3287 -1, 8, 9, 10, 11, 12, 13, 14, -1, -1,
3288 -1, 18, 19, 20, 21, 22, 23, 24, 25, -1,
3289 27, 28, 29, -1, 31, -1, -1, -1, 35, 36,
3290 37, 38, -1, 40, 41, 42, -1, 44, 45, 46,
3291 47, 48, -1, -1, 51, 52, -1, 54, 55, -1,
3292 -1, -1, -1, -1, -1, 62, 63, -1, 65, -1,
3293 -1, -1, 69, -1, -1, -1, -1, -1, -1, -1,
3294 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3295 -1, -1, 89, 90, -1, -1, -1, -1, -1, -1,
3296 -1, 98, -1, -1, -1, -1, -1, -1, -1, -1,
3297 -1, -1, -1, -1, 111, -1, -1, -1, -1, 116,
3298 117, -1, -1, -1, 121, -1, 123, -1, 125, -1,
3299 127, -1, -1, -1, 131, 3, 4, 5, 6, -1,
3300 8, 9, 10, 11, 12, 13, 14, -1, -1, -1,
3301 18, 19, 20, 21, 22, 23, 24, 25, -1, 27,
3302 28, 29, -1, 31, -1, -1, -1, 35, 36, 37,
3303 38, -1, 40, 41, 42, -1, 44, 45, 46, 47,
3304 48, -1, -1, 51, 52, -1, 54, 55, -1, -1,
3305 -1, -1, -1, -1, 62, 63, -1, 65, -1, -1,
3306 -1, 69, -1, -1, -1, -1, -1, -1, -1, -1,
3307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3308 -1, 89, 90, -1, -1, -1, -1, -1, -1, -1,
3309 98, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3310 -1, -1, -1, 111, -1, -1, -1, -1, 116, 117,
3311 -1, -1, -1, 121, -1, 123, -1, 125, -1, 127,
3312 -1, -1, -1, 131, 3, 4, 5, 6, -1, 8,
3313 9, 10, 11, 12, 13, 14, -1, -1, -1, 18,
3314 19, 20, 21, 22, 23, 24, 25, -1, 27, 28,
3315 29, -1, 31, -1, -1, -1, 35, 36, 37, 38,
3316 -1, 40, 41, 42, -1, 44, 45, 46, 47, 48,
3317 -1, -1, 51, 52, -1, 54, 55, -1, -1, -1,
3318 -1, -1, -1, 62, 63, -1, 65, -1, -1, -1,
3319 69, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3320 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3321 89, 90, -1, -1, -1, -1, -1, -1, -1, 98,
3322 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3323 -1, -1, 111, -1, -1, -1, -1, 116, 117, -1,
3324 -1, -1, 121, -1, 123, -1, 125, -1, 127, -1,
3325 -1, -1, 131, 3, 4, 5, 6, -1, 8, 9,
3326 10, 11, 12, 13, 14, -1, -1, 17, 18, 19,
3327 20, 21, 22, 23, 24, -1, -1, 27, 28, -1,
3328 -1, -1, -1, -1, -1, 35, -1, 37, 38, -1,
3329 40, -1, 42, -1, 44, -1, 46, 47, 48, -1,
3330 -1, 51, 52, -1, 54, 55, -1, -1, -1, -1,
3331 -1, -1, 62, 63, -1, -1, -1, -1, -1, 69,
3332 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3333 -1, -1, -1, -1, -1, -1, -1, -1, -1, 89,
3334 90, -1, -1, -1, -1, -1, -1, -1, 98, -1,
3335 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3336 -1, 111, -1, -1, -1, -1, 116, 117, -1, -1,
3337 -1, 121, -1, 123, -1, 125, -1, 127, -1, -1,
3338 -1, 131, 3, 4, 5, 6, -1, 8, 9, 10,
3339 11, 12, 13, 14, -1, -1, -1, 18, 19, 20,
3340 21, 22, 23, 24, -1, -1, 27, 28, -1, -1,
3341 -1, -1, -1, -1, 35, -1, 37, 38, -1, 40,
3342 -1, 42, -1, 44, -1, 46, 47, 48, -1, -1,
3343 51, 52, -1, 54, 55, -1, -1, -1, -1, -1,
3344 -1, 62, 63, -1, -1, -1, -1, -1, 69, -1,
3345 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3346 -1, -1, -1, -1, -1, -1, -1, -1, 89, 90,
3347 -1, -1, -1, -1, -1, -1, -1, 98, -1, -1,
3348 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3349 111, -1, -1, -1, -1, 116, 117, -1, -1, -1,
3350 121, -1, 123, -1, 125, -1, 127, -1, -1, -1,
3351 131, 3, 4, 5, 6, -1, 8, 9, 10, 11,
3352 12, 13, 14, -1, -1, -1, 18, 19, 20, 21,
3353 22, 23, 24, -1, -1, 27, 28, -1, -1, -1,
3354 -1, -1, -1, 35, -1, 37, 38, -1, 40, -1,
3355 42, -1, 44, -1, 46, 47, 48, -1, -1, 51,
3356 52, -1, 54, 55, -1, -1, -1, -1, -1, -1,
3357 62, 63, -1, -1, -1, -1, -1, 69, -1, -1,
3358 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3359 -1, -1, -1, -1, -1, -1, -1, 89, 90, -1,
3360 -1, -1, -1, -1, -1, -1, 98, -1, -1, -1,
3361 -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
3362 -1, -1, -1, -1, 116, 117, -1, -1, -1, 121,
3363 -1, 123, -1, 125, -1, 127, -1, -1, -1, 131,
3364 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3365 13, 14, -1, -1, -1, 18, 19, 20, 21, 22,
3366 23, 24, -1, -1, 27, 28, -1, -1, -1, -1,
3367 -1, -1, 35, -1, 37, 38, -1, 40, -1, 42,
3368 -1, 44, -1, 46, 47, 48, -1, -1, 51, 52,
3369 -1, 54, 55, -1, -1, -1, -1, -1, -1, 62,
3370 63, -1, -1, -1, -1, -1, 69, -1, -1, -1,
3371 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3372 -1, -1, -1, -1, -1, -1, 89, 90, -1, -1,
3373 -1, -1, -1, -1, -1, 98, -1, -1, -1, -1,
3374 -1, -1, -1, -1, -1, -1, -1, -1, 111, -1,
3375 -1, -1, -1, 116, 117, -1, -1, -1, 121, -1,
3376 123, -1, 125, -1, 127, -1, -1, -1, 131, 3,
3377 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3378 14, -1, -1, -1, 18, 19, 20, 21, 22, 23,
3379 24, -1, -1, 27, 28, -1, -1, -1, -1, -1,
3380 -1, 35, -1, 37, 38, -1, 40, -1, 42, -1,
3381 44, -1, 46, 47, 48, -1, -1, 51, 52, -1,
3382 54, 55, -1, -1, -1, -1, -1, -1, 62, 63,
3383 -1, -1, -1, -1, -1, 69, -1, -1, -1, -1,
3384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3385 -1, -1, -1, -1, -1, 89, 90, -1, -1, -1,
3386 -1, -1, -1, -1, 98, -1, -1, -1, -1, -1,
3387 -1, -1, -1, -1, -1, -1, -1, 111, -1, -1,
3388 -1, -1, 116, 117, -1, -1, -1, 121, -1, 123,
3389 -1, 125, -1, 127, -1, 0, -1, 131, 3, 4,
3390 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3391 -1, -1, 17, 18, 19, 20, 21, 22, 23, 24,
3392 -1, -1, 27, 28, -1, -1, -1, -1, -1, -1,
3393 35, -1, 37, 38, -1, 40, -1, 42, -1, 44,
3394 -1, 46, 47, 48, -1, -1, 51, 52, -1, 54,
3395 55, -1, -1, -1, -1, -1, -1, 62, 63, -1,
3396 -1, -1, -1, -1, 69, -1, -1, -1, -1, -1,
3397 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3398 -1, -1, -1, -1, 89, 90, -1, -1, -1, -1,
3399 -1, -1, -1, 98, -1, -1, -1, -1, -1, -1,
3400 -1, -1, -1, -1, -1, -1, 111, -1, -1, -1,
3401 -1, 116, 117, -1, -1, -1, 121, -1, 123, -1,
3402 125, -1, 127, 3, 4, 5, 6, -1, 8, 9,
3403 10, 11, 12, 13, 14, -1, 16, -1, 18, 19,
3404 20, 21, 22, 23, 24, 25, -1, 27, 28, 29,
3405 -1, 31, -1, -1, -1, 35, 36, 37, 38, -1,
3406 40, 41, 42, -1, 44, 45, 46, 47, 48, -1,
3407 -1, 51, 52, -1, 54, 55, -1, -1, -1, -1,
3408 -1, -1, 62, 63, -1, 65, -1, -1, -1, 69,
3409 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3410 -1, -1, -1, -1, -1, -1, -1, -1, -1, 89,
3411 90, -1, -1, -1, -1, -1, -1, -1, 98, -1,
3412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3413 -1, 111, -1, -1, -1, -1, 116, 117, -1, -1,
3414 -1, 121, -1, 123, -1, 125, -1, 127, 3, 4,
3415 5, 6, -1, 8, 9, 10, 11, 12, 13, 14,
3416 -1, -1, -1, 18, 19, 20, 21, 22, 23, 24,
3417 25, -1, 27, 28, 29, -1, 31, -1, -1, -1,
3418 35, 36, 37, 38, -1, 40, 41, 42, -1, 44,
3419 45, 46, 47, 48, -1, -1, 51, 52, -1, 54,
3420 55, -1, -1, -1, -1, -1, -1, 62, 63, -1,
3421 65, -1, -1, -1, 69, -1, -1, -1, -1, -1,
3422 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3423 -1, -1, -1, -1, 89, 90, -1, -1, -1, -1,
3424 -1, -1, -1, 98, -1, -1, -1, -1, -1, -1,
3425 -1, -1, -1, -1, -1, -1, 111, -1, -1, -1,
3426 -1, 116, 117, -1, -1, -1, 121, -1, 123, -1,
3427 125, 3, 127, 5, 6, -1, 8, 9, 10, -1,
3428 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3429 -1, 23, -1, 25, -1, 27, 28, -1, -1, 31,
3430 -1, -1, -1, 35, -1, -1, -1, -1, -1, -1,
3431 42, -1, 44, 45, -1, -1, -1, -1, -1, -1,
3432 52, -1, 54, 55, -1, -1, -1, -1, -1, -1,
3433 62, -1, -1, -1, -1, -1, -1, 69, -1, -1,
3434 -1, 3, -1, 5, 6, -1, 8, 9, 10, -1,
3435 -1, -1, -1, -1, -1, -1, -1, 89, 90, -1,
3436 -1, 23, -1, 25, -1, 27, 28, -1, -1, -1,
3437 -1, -1, -1, 35, -1, -1, -1, -1, -1, 111,
3438 42, -1, 44, -1, 116, 117, -1, -1, -1, 121,
3439 52, 123, 54, 55, -1, 127, 3, -1, 5, 6,
3440 62, 8, 9, 10, -1, -1, -1, 69, -1, -1,
3441 -1, -1, -1, -1, -1, -1, 23, -1, 25, -1,
3442 27, 28, -1, -1, -1, -1, -1, 89, 90, -1,
3443 -1, -1, -1, -1, -1, -1, -1, 44, -1, -1,
3444 -1, -1, -1, -1, -1, 52, -1, 54, 55, 111,
3445 -1, -1, -1, -1, 116, 117, -1, 39, -1, 121,
3446 -1, 123, 69, -1, -1, 127, -1, -1, -1, -1,
3447 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3448 -1, -1, 89, 90, 66, 67, 68, -1, 70, 71,
3449 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3450 82, 83, 84, 85, 86, 87, -1, 89, 90, 91,
3451 -1, 93, 94, 95, 121, -1, 123, -1, -1, 101,
3452 127, 103, -1, 105, 106, 107, 108, 109, 39, 111,
3453 112, 113, 114, 115, -1, -1, -1, -1, -1, 121,
3454 -1, 123, -1, -1, 126, -1, -1, -1, -1, -1,
3455 132, -1, -1, -1, -1, 66, 67, 68, -1, 70,
3456 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3457 81, 82, 83, 84, 85, 86, 87, -1, 89, 90,
3458 91, -1, 93, 94, 95, -1, -1, -1, -1, -1,
3459 101, 39, 103, -1, 105, 106, 107, 108, 109, -1,
3460 111, 112, 113, 114, 115, -1, -1, -1, -1, -1,
3461 121, -1, 123, -1, -1, 126, -1, -1, 66, 67,
3462 68, 132, 70, 71, 72, 73, 74, 75, 76, 77,
3463 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3464 -1, 89, 90, 91, -1, 93, 94, 95, -1, -1,
3465 -1, -1, -1, 101, 39, 103, -1, 105, 106, 107,
3466 108, 109, -1, 111, 112, 113, 114, 115, -1, -1,
3467 -1, -1, -1, 121, -1, 123, -1, -1, 126, -1,
3468 -1, 66, 67, 68, 132, 70, 71, 72, 73, 74,
3469 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3470 85, 86, 87, -1, 89, 90, 91, -1, 93, 94,
3471 95, -1, -1, -1, -1, 39, 101, -1, 103, 104,
3472 105, 106, 107, 108, 109, -1, 111, 112, 113, 114,
3473 115, -1, -1, -1, -1, -1, 121, -1, 123, -1,
3474 -1, 126, 66, 67, 68, -1, 70, 71, 72, 73,
3475 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3476 84, 85, 86, 87, -1, 89, 90, 91, -1, 93,
3477 94, 95, -1, -1, -1, -1, 39, 101, -1, 103,
3478 -1, 105, 106, 107, 108, 109, -1, 111, 112, 113,
3479 114, 115, -1, -1, -1, -1, -1, 121, -1, 123,
3480 124, -1, 126, 66, 67, 68, -1, 70, 71, 72,
3481 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3482 83, 84, 85, 86, 87, -1, 89, 90, 91, -1,
3483 93, 94, 95, -1, -1, -1, -1, 39, 101, -1,
3484 103, 104, 105, 106, 107, 108, 109, -1, 111, 112,
3485 113, 114, 115, -1, -1, -1, -1, -1, 121, -1,
3486 123, -1, -1, 126, 66, 67, 68, -1, 70, 71,
3487 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3488 82, 83, 84, 85, 86, 87, -1, 89, 90, 91,
3489 -1, 93, 94, 95, -1, -1, -1, -1, 39, 101,
3490 -1, 103, -1, 105, 106, 107, 108, 109, -1, 111,
3491 112, 113, 114, 115, -1, -1, -1, -1, -1, 121,
3492 -1, 123, -1, -1, 126, 66, 67, 68, -1, 70,
3493 71, 72, 73, 74, 75, -1, -1, -1, -1, -1,
3494 -1, -1, -1, -1, -1, -1, 87, -1, 89, 90,
3495 91, -1, 93, 94, 95, -1, -1, -1, -1, 39,
3496 -1, -1, -1, -1, 105, 106, 107, 108, 109, -1,
3497 111, 112, 113, 114, 115, -1, -1, -1, -1, -1,
3498 121, -1, 123, -1, -1, 126, 66, 67, 68, -1,
3499 70, 71, 72, 73, 74, 75, -1, -1, -1, -1,
3500 -1, -1, -1, -1, -1, -1, -1, -1, -1, 89,
3501 90, 91, -1, 93, 94, 95, -1, -1, -1, -1,
3502 39, -1, -1, -1, -1, 105, 106, 107, 108, 109,
3503 -1, 111, 112, 113, 114, 115, -1, -1, -1, -1,
3504 -1, 121, -1, 123, -1, -1, 126, 66, 67, 68,
3505 -1, 70, 71, 72, 73, 74, 75, -1, -1, -1,
3506 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3507 89, 90, 91, -1, 93, 94, 95, -1, -1, -1,
3508 -1, 39, -1, -1, -1, -1, -1, 106, 107, 108,
3509 109, -1, 111, 112, 113, 114, 115, -1, -1, -1,
3510 -1, -1, 121, -1, 123, -1, -1, 126, 66, 67,
3511 68, -1, 70, 71, 72, 73, 74, 75, -1, -1,
3512 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3513 -1, 89, 90, 91, -1, 93, 94, 95, -1, -1,
3514 -1, -1, 39, -1, -1, -1, -1, -1, -1, 107,
3515 108, 109, -1, 111, 112, 113, 114, 115, -1, -1,
3516 -1, -1, -1, 121, -1, 123, -1, -1, 126, 66,
3517 67, 68, -1, 70, 71, 72, 73, 74, 75, -1,
3518 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3519 -1, -1, 89, 90, 91, -1, 93, 94, 95, -1,
3520 -1, -1, -1, 39, -1, -1, -1, -1, -1, -1,
3521 107, 108, 109, -1, 111, 112, 113, 114, 115, -1,
3522 -1, -1, -1, -1, 121, -1, 123, -1, -1, 126,
3523 66, 67, 68, -1, 70, 71, 72, 73, 74, 75,
3524 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3525 -1, -1, -1, 89, 90, 91, -1, 93, 94, 95,
3526 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3527 -1, -1, 108, 109, -1, 111, 112, 113, 114, 115,
3528 -1, -1, -1, -1, -1, 121, -1, 123, -1, -1,
3532 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3533 symbol of state STATE-NUM. */
3534 static const yytype_uint8 yystos[] =
3536 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3537 13, 14, 17, 18, 19, 20, 21, 22, 23, 24,
3538 25, 27, 28, 35, 37, 38, 40, 42, 44, 46,
3539 47, 48, 51, 52, 54, 55, 62, 63, 69, 89,
3540 90, 98, 111, 116, 117, 121, 123, 125, 127, 134,
3541 135, 136, 137, 143, 146, 147, 153, 157, 158, 159,
3542 160, 162, 170, 178, 181, 182, 185, 188, 189, 190,
3543 191, 195, 197, 206, 211, 216, 219, 232, 233, 234,
3544 237, 238, 239, 242, 244, 245, 88, 49, 121, 121,
3545 163, 121, 3, 4, 17, 125, 183, 184, 16, 3,
3546 239, 3, 218, 239, 121, 184, 222, 121, 125, 121,
3547 126, 239, 121, 236, 239, 240, 241, 239, 239, 239,
3548 239, 239, 237, 228, 229, 230, 236, 29, 31, 36,
3549 41, 45, 65, 98, 131, 142, 143, 144, 147, 149,
3550 164, 165, 180, 189, 235, 3, 0, 137, 125, 3,
3551 45, 149, 155, 156, 238, 144, 145, 16, 25, 30,
3552 31, 43, 45, 205, 243, 191, 99, 39, 66, 67,
3553 68, 70, 71, 72, 73, 74, 75, 76, 77, 78,
3554 79, 80, 81, 82, 83, 84, 85, 86, 87, 89,
3555 90, 91, 93, 94, 95, 101, 103, 105, 106, 107,
3556 108, 109, 111, 112, 113, 114, 115, 121, 123, 126,
3557 3, 121, 161, 145, 171, 187, 125, 126, 183, 184,
3558 221, 222, 223, 231, 121, 237, 126, 239, 179, 228,
3559 3, 154, 104, 131, 99, 132, 124, 99, 236, 3,
3560 3, 150, 151, 237, 237, 150, 3, 131, 144, 125,
3561 135, 3, 98, 67, 98, 3, 34, 50, 215, 3,
3562 3, 207, 239, 239, 239, 239, 239, 239, 239, 239,
3563 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
3564 239, 239, 239, 239, 239, 3, 239, 239, 239, 239,
3565 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
3566 239, 228, 239, 3, 121, 127, 237, 12, 239, 98,
3567 138, 139, 140, 146, 147, 195, 197, 206, 216, 186,
3568 183, 126, 121, 227, 3, 92, 212, 213, 214, 132,
3569 114, 183, 132, 141, 142, 132, 237, 236, 236, 104,
3570 226, 99, 142, 131, 226, 237, 237, 101, 3, 53,
3571 192, 53, 193, 3, 208, 209, 104, 132, 124, 88,
3572 239, 3, 132, 121, 132, 131, 140, 125, 138, 228,
3573 101, 104, 210, 214, 132, 99, 131, 132, 104, 35,
3574 114, 223, 225, 101, 148, 151, 131, 98, 132, 3,
3575 5, 121, 223, 15, 194, 223, 224, 125, 226, 99,
3576 239, 3, 132, 145, 237, 125, 138, 131, 132, 211,
3577 225, 226, 92, 214, 26, 32, 172, 174, 176, 177,
3578 145, 236, 236, 238, 145, 212, 224, 125, 99, 198,
3579 148, 209, 132, 33, 61, 166, 167, 168, 169, 131,
3580 210, 125, 214, 125, 121, 172, 174, 64, 152, 132,
3581 132, 196, 223, 45, 98, 189, 202, 203, 204, 239,
3582 104, 131, 168, 169, 220, 175, 3, 145, 145, 226,
3583 98, 143, 147, 189, 199, 200, 201, 206, 216, 3,
3584 25, 131, 204, 104, 141, 141, 141, 226, 125, 125,
3585 131, 201, 215, 141, 131, 131, 132, 217, 199, 3,
3586 173, 141, 131, 121, 125, 131, 212, 141, 132, 131,
3590 #define yyerrok (yyerrstatus = 0)
3591 #define yyclearin (yychar = YYEMPTY)
3592 #define YYEMPTY (-2)
3595 #define YYACCEPT goto yyacceptlab
3596 #define YYABORT goto yyabortlab
3597 #define YYERROR goto yyerrorlab
3600 /* Like YYERROR except do call yyerror. This remains here temporarily
3601 to ease the transition to the new meaning of YYERROR, for GCC.
3602 Once GCC version 2 has supplanted version 1, this can go. */
3604 #define YYFAIL goto yyerrlab
3606 #define YYRECOVERING() (!!yyerrstatus)
3608 #define YYBACKUP(Token, Value) \
3610 if (yychar == YYEMPTY && yylen == 1) \
3614 yytoken = YYTRANSLATE (yychar); \
3620 yyerror (YY_("syntax error: cannot back up")); \
3627 #define YYERRCODE 256
3630 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3631 If N is 0, then set CURRENT to the empty location which ends
3632 the previous symbol: RHS[0] (always defined). */
3634 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3635 #ifndef YYLLOC_DEFAULT
3636 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3640 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3641 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3642 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3643 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3647 (Current).first_line = (Current).last_line = \
3648 YYRHSLOC (Rhs, 0).last_line; \
3649 (Current).first_column = (Current).last_column = \
3650 YYRHSLOC (Rhs, 0).last_column; \
3656 /* YY_LOCATION_PRINT -- Print the location on the stream.
3657 This macro was not mandated originally: define only if we know
3658 we won't break user code: when these are the locations we know. */
3660 #ifndef YY_LOCATION_PRINT
3661 # if YYLTYPE_IS_TRIVIAL
3662 # define YY_LOCATION_PRINT(File, Loc) \
3663 fprintf (File, "%d.%d-%d.%d", \
3664 (Loc).first_line, (Loc).first_column, \
3665 (Loc).last_line, (Loc).last_column)
3667 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3672 /* YYLEX -- calling `yylex' with the right arguments. */
3675 # define YYLEX yylex (YYLEX_PARAM)
3677 # define YYLEX yylex ()
3680 /* Enable debugging if requested. */
3684 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3685 # define YYFPRINTF fprintf
3688 # define YYDPRINTF(Args) \
3694 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3698 YYFPRINTF (stderr, "%s ", Title); \
3699 yy_symbol_print (stderr, \
3701 YYFPRINTF (stderr, "\n"); \
3706 /*--------------------------------.
3707 | Print this symbol on YYOUTPUT. |
3708 `--------------------------------*/
3711 #if (defined __STDC__ || defined __C99__FUNC__ \
3712 || defined __cplusplus || defined _MSC_VER)
3714 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3717 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3720 YYSTYPE const * const yyvaluep;
3726 if (yytype < YYNTOKENS)
3727 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3739 /*--------------------------------.
3740 | Print this symbol on YYOUTPUT. |
3741 `--------------------------------*/
3743 #if (defined __STDC__ || defined __C99__FUNC__ \
3744 || defined __cplusplus || defined _MSC_VER)
3746 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3749 yy_symbol_print (yyoutput, yytype, yyvaluep)
3752 YYSTYPE const * const yyvaluep;
3755 if (yytype < YYNTOKENS)
3756 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3758 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3760 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3761 YYFPRINTF (yyoutput, ")");
3764 /*------------------------------------------------------------------.
3765 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3767 `------------------------------------------------------------------*/
3769 #if (defined __STDC__ || defined __C99__FUNC__ \
3770 || defined __cplusplus || defined _MSC_VER)
3772 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3775 yy_stack_print (yybottom, yytop)
3776 yytype_int16 *yybottom;
3777 yytype_int16 *yytop;
3780 YYFPRINTF (stderr, "Stack now");
3781 for (; yybottom <= yytop; yybottom++)
3783 int yybot = *yybottom;
3784 YYFPRINTF (stderr, " %d", yybot);
3786 YYFPRINTF (stderr, "\n");
3789 # define YY_STACK_PRINT(Bottom, Top) \
3792 yy_stack_print ((Bottom), (Top)); \
3796 /*------------------------------------------------.
3797 | Report that the YYRULE is going to be reduced. |
3798 `------------------------------------------------*/
3800 #if (defined __STDC__ || defined __C99__FUNC__ \
3801 || defined __cplusplus || defined _MSC_VER)
3803 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3806 yy_reduce_print (yyvsp, yyrule)
3811 int yynrhs = yyr2[yyrule];
3813 unsigned long int yylno = yyrline[yyrule];
3814 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3816 /* The symbols being reduced. */
3817 for (yyi = 0; yyi < yynrhs; yyi++)
3819 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3820 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3821 &(yyvsp[(yyi + 1) - (yynrhs)])
3823 YYFPRINTF (stderr, "\n");
3827 # define YY_REDUCE_PRINT(Rule) \
3830 yy_reduce_print (yyvsp, Rule); \
3833 /* Nonzero means print parse trace. It is left uninitialized so that
3834 multiple parsers can coexist. */
3836 #else /* !YYDEBUG */
3837 # define YYDPRINTF(Args)
3838 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3839 # define YY_STACK_PRINT(Bottom, Top)
3840 # define YY_REDUCE_PRINT(Rule)
3841 #endif /* !YYDEBUG */
3844 /* YYINITDEPTH -- initial size of the parser's stacks. */
3846 # define YYINITDEPTH 200
3849 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3850 if the built-in stack extension method is used).
3852 Do not make this value too large; the results are undefined if
3853 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3854 evaluated with infinite-precision integer arithmetic. */
3857 # define YYMAXDEPTH 10000
3865 # if defined __GLIBC__ && defined _STRING_H
3866 # define yystrlen strlen
3868 /* Return the length of YYSTR. */
3869 #if (defined __STDC__ || defined __C99__FUNC__ \
3870 || defined __cplusplus || defined _MSC_VER)
3872 yystrlen (const char *yystr)
3880 for (yylen = 0; yystr[yylen]; yylen++)
3888 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3889 # define yystpcpy stpcpy
3891 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3893 #if (defined __STDC__ || defined __C99__FUNC__ \
3894 || defined __cplusplus || defined _MSC_VER)
3896 yystpcpy (char *yydest, const char *yysrc)
3899 yystpcpy (yydest, yysrc)
3905 const char *yys = yysrc;
3907 while ((*yyd++ = *yys++) != '\0')
3916 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3917 quotes and backslashes, so that it's suitable for yyerror. The
3918 heuristic is that double-quoting is unnecessary unless the string
3919 contains an apostrophe, a comma, or backslash (other than
3920 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3921 null, do not copy; instead, return the length of what the result
3924 yytnamerr (char *yyres, const char *yystr)
3929 char const *yyp = yystr;
3936 goto do_not_strip_quotes;
3940 goto do_not_strip_quotes;
3953 do_not_strip_quotes: ;
3957 return yystrlen (yystr);
3959 return yystpcpy (yyres, yystr) - yyres;
3963 /* Copy into YYRESULT an error message about the unexpected token
3964 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3965 including the terminating null byte. If YYRESULT is null, do not
3966 copy anything; just return the number of bytes that would be
3967 copied. As a special case, return 0 if an ordinary "syntax error"
3968 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3969 size calculation. */
3971 yysyntax_error (char *yyresult, int yystate, int yychar)
3973 int yyn = yypact[yystate];
3975 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3979 int yytype = YYTRANSLATE (yychar);
3980 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3981 YYSIZE_T yysize = yysize0;
3983 int yysize_overflow = 0;
3984 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3985 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3989 /* This is so xgettext sees the translatable formats that are
3990 constructed on the fly. */
3991 YY_("syntax error, unexpected %s");
3992 YY_("syntax error, unexpected %s, expecting %s");
3993 YY_("syntax error, unexpected %s, expecting %s or %s");
3994 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3995 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3999 static char const yyunexpected[] = "syntax error, unexpected %s";
4000 static char const yyexpecting[] = ", expecting %s";
4001 static char const yyor[] = " or %s";
4002 char yyformat[sizeof yyunexpected
4003 + sizeof yyexpecting - 1
4004 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
4005 * (sizeof yyor - 1))];
4006 char const *yyprefix = yyexpecting;
4008 /* Start YYX at -YYN if negative to avoid negative indexes in
4010 int yyxbegin = yyn < 0 ? -yyn : 0;
4012 /* Stay within bounds of both yycheck and yytname. */
4013 int yychecklim = YYLAST - yyn + 1;
4014 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
4017 yyarg[0] = yytname[yytype];
4018 yyfmt = yystpcpy (yyformat, yyunexpected);
4020 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
4021 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
4023 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
4027 yyformat[sizeof yyunexpected - 1] = '\0';
4030 yyarg[yycount++] = yytname[yyx];
4031 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
4032 yysize_overflow |= (yysize1 < yysize);
4034 yyfmt = yystpcpy (yyfmt, yyprefix);
4038 yyf = YY_(yyformat);
4039 yysize1 = yysize + yystrlen (yyf);
4040 yysize_overflow |= (yysize1 < yysize);
4043 if (yysize_overflow)
4044 return YYSIZE_MAXIMUM;
4048 /* Avoid sprintf, as that infringes on the user's name space.
4049 Don't have undefined behavior even if the translation
4050 produced a string with the wrong number of "%s"s. */
4051 char *yyp = yyresult;
4053 while ((*yyp = *yyf) != '\0')
4055 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4057 yyp += yytnamerr (yyp, yyarg[yyi++]);
4070 #endif /* YYERROR_VERBOSE */
4073 /*-----------------------------------------------.
4074 | Release the memory associated to this symbol. |
4075 `-----------------------------------------------*/
4078 #if (defined __STDC__ || defined __C99__FUNC__ \
4079 || defined __cplusplus || defined _MSC_VER)
4081 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4084 yydestruct (yymsg, yytype, yyvaluep)
4094 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4104 /* Prevent warnings from -Wmissing-prototypes. */
4105 #ifdef YYPARSE_PARAM
4106 #if defined __STDC__ || defined __cplusplus
4107 int yyparse (void *YYPARSE_PARAM);
4111 #else /* ! YYPARSE_PARAM */
4112 #if defined __STDC__ || defined __cplusplus
4117 #endif /* ! YYPARSE_PARAM */
4120 /* The lookahead symbol. */
4123 /* The semantic value of the lookahead symbol. */
4126 /* Number of syntax errors so far. */
4131 /*-------------------------.
4132 | yyparse or yypush_parse. |
4133 `-------------------------*/
4135 #ifdef YYPARSE_PARAM
4136 #if (defined __STDC__ || defined __C99__FUNC__ \
4137 || defined __cplusplus || defined _MSC_VER)
4139 yyparse (void *YYPARSE_PARAM)
4142 yyparse (YYPARSE_PARAM)
4143 void *YYPARSE_PARAM;
4145 #else /* ! YYPARSE_PARAM */
4146 #if (defined __STDC__ || defined __C99__FUNC__ \
4147 || defined __cplusplus || defined _MSC_VER)
4160 /* Number of tokens to shift before error messages enabled. */
4163 /* The stacks and their tools:
4164 `yyss': related to states.
4165 `yyvs': related to semantic values.
4167 Refer to the stacks thru separate pointers, to allow yyoverflow
4168 to reallocate them elsewhere. */
4170 /* The state stack. */
4171 yytype_int16 yyssa[YYINITDEPTH];
4173 yytype_int16 *yyssp;
4175 /* The semantic value stack. */
4176 YYSTYPE yyvsa[YYINITDEPTH];
4180 YYSIZE_T yystacksize;
4184 /* Lookahead token as an internal (translated) token number. */
4186 /* The variables used to return semantic value and location from the
4191 /* Buffer for error messages, and its allocated size. */
4193 char *yymsg = yymsgbuf;
4194 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4197 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4199 /* The number of symbols on the RHS of the reduced rule.
4200 Keep to zero when no symbol should be popped. */
4206 yystacksize = YYINITDEPTH;
4208 YYDPRINTF ((stderr, "Starting parse\n"));
4213 yychar = YYEMPTY; /* Cause a token to be read. */
4215 /* Initialize stack pointers.
4216 Waste one element of value and location stack
4217 so that they stay on the same level as the state stack.
4218 The wasted elements are never initialized. */
4224 /*------------------------------------------------------------.
4225 | yynewstate -- Push a new state, which is found in yystate. |
4226 `------------------------------------------------------------*/
4228 /* In all cases, when you get here, the value and location stacks
4229 have just been pushed. So pushing a state here evens the stacks. */
4235 if (yyss + yystacksize - 1 <= yyssp)
4237 /* Get the current used size of the three stacks, in elements. */
4238 YYSIZE_T yysize = yyssp - yyss + 1;
4242 /* Give user a chance to reallocate the stack. Use copies of
4243 these so that the &'s don't force the real ones into
4245 YYSTYPE *yyvs1 = yyvs;
4246 yytype_int16 *yyss1 = yyss;
4248 /* Each stack pointer address is followed by the size of the
4249 data in use in that stack, in bytes. This used to be a
4250 conditional around just the two extra args, but that might
4251 be undefined if yyoverflow is a macro. */
4252 yyoverflow (YY_("memory exhausted"),
4253 &yyss1, yysize * sizeof (*yyssp),
4254 &yyvs1, yysize * sizeof (*yyvsp),
4260 #else /* no yyoverflow */
4261 # ifndef YYSTACK_RELOCATE
4262 goto yyexhaustedlab;
4264 /* Extend the stack our own way. */
4265 if (YYMAXDEPTH <= yystacksize)
4266 goto yyexhaustedlab;
4268 if (YYMAXDEPTH < yystacksize)
4269 yystacksize = YYMAXDEPTH;
4272 yytype_int16 *yyss1 = yyss;
4273 union yyalloc *yyptr =
4274 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4276 goto yyexhaustedlab;
4277 YYSTACK_RELOCATE (yyss_alloc, yyss);
4278 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4279 # undef YYSTACK_RELOCATE
4281 YYSTACK_FREE (yyss1);
4284 #endif /* no yyoverflow */
4286 yyssp = yyss + yysize - 1;
4287 yyvsp = yyvs + yysize - 1;
4289 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4290 (unsigned long int) yystacksize));
4292 if (yyss + yystacksize - 1 <= yyssp)
4296 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4298 if (yystate == YYFINAL)
4308 /* Do appropriate processing given the current state. Read a
4309 lookahead token if we need one and don't already have one. */
4311 /* First try to decide what to do without reference to lookahead token. */
4312 yyn = yypact[yystate];
4313 if (yyn == YYPACT_NINF)
4316 /* Not known => get a lookahead token if don't already have one. */
4318 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4319 if (yychar == YYEMPTY)
4321 YYDPRINTF ((stderr, "Reading a token: "));
4325 if (yychar <= YYEOF)
4327 yychar = yytoken = YYEOF;
4328 YYDPRINTF ((stderr, "Now at end of input.\n"));
4332 yytoken = YYTRANSLATE (yychar);
4333 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4336 /* If the proper action on seeing token YYTOKEN is to reduce or to
4337 detect an error, take that action. */
4339 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4344 if (yyn == 0 || yyn == YYTABLE_NINF)
4350 /* Count tokens shifted since error; after three, turn off error
4355 /* Shift the lookahead token. */
4356 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4358 /* Discard the shifted token. */
4367 /*-----------------------------------------------------------.
4368 | yydefault -- do the default action for the current state. |
4369 `-----------------------------------------------------------*/
4371 yyn = yydefact[yystate];
4377 /*-----------------------------.
4378 | yyreduce -- Do a reduction. |
4379 `-----------------------------*/
4381 /* yyn is the number of a rule to reduce with. */
4384 /* If YYLEN is nonzero, implement the default value of the action:
4387 Otherwise, the following line sets YYVAL to garbage.
4388 This behavior is undocumented and Bison
4389 users should not rely upon it. Assigning to YYVAL
4390 unconditionally makes the parser a bit smaller, and it avoids a
4391 GCC warning that YYVAL may be used uninitialized. */
4392 yyval = yyvsp[1-yylen];
4395 YY_REDUCE_PRINT (yyn);
4402 /* Line 1464 of skeleton.m4 */
4403 #line 2086 "parser.y"
4404 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4413 /* Line 1464 of skeleton.m4 */
4414 #line 2098 "parser.y"
4415 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4424 /* Line 1464 of skeleton.m4 */
4425 #line 2101 "parser.y"
4426 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4435 /* Line 1464 of skeleton.m4 */
4436 #line 2102 "parser.y"
4437 {(yyval.code)=code_new();}
4446 /* Line 1464 of skeleton.m4 */
4447 #line 2104 "parser.y"
4448 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4457 /* Line 1464 of skeleton.m4 */
4458 #line 2105 "parser.y"
4459 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4468 /* Line 1464 of skeleton.m4 */
4469 #line 2120 "parser.y"
4470 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4479 /* Line 1464 of skeleton.m4 */
4480 #line 2121 "parser.y"
4490 /* Line 1464 of skeleton.m4 */
4491 #line 2124 "parser.y"
4501 /* Line 1464 of skeleton.m4 */
4502 #line 2131 "parser.y"
4503 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
4512 /* Line 1464 of skeleton.m4 */
4513 #line 2135 "parser.y"
4514 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4523 /* Line 1464 of skeleton.m4 */
4524 #line 2136 "parser.y"
4525 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4534 /* Line 1464 of skeleton.m4 */
4535 #line 2140 "parser.y"
4537 code_t**cc = &global->init->method->body->code;
4538 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4548 /* Line 1464 of skeleton.m4 */
4549 #line 2147 "parser.y"
4552 (yyval.number_int)=as3_pass;
4553 char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id));
4554 if(!definitions || !dict_contains(definitions, key)) {
4567 /* Line 1464 of skeleton.m4 */
4568 #line 2166 "parser.y"
4569 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4578 /* Line 1464 of skeleton.m4 */
4579 #line 2167 "parser.y"
4580 {(yyval.value).c=abc_pushundefined(0);
4581 (yyval.value).t=TYPE_ANY;
4591 /* Line 1464 of skeleton.m4 */
4592 #line 2171 "parser.y"
4593 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4602 /* Line 1464 of skeleton.m4 */
4603 #line 2172 "parser.y"
4604 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4613 /* Line 1464 of skeleton.m4 */
4614 #line 2174 "parser.y"
4615 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4624 /* Line 1464 of skeleton.m4 */
4625 #line 2175 "parser.y"
4626 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4635 /* Line 1464 of skeleton.m4 */
4636 #line 2178 "parser.y"
4639 if(variable_exists((yyvsp[(1) - (3)].id)))
4640 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4642 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4645 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4646 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4647 (yyvsp[(2) - (3)].classinfo)->name);
4652 if(state->method->uses_slots) {
4653 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4655 // this variable is stored in a slot
4657 v->type = (yyvsp[(2) - (3)].classinfo);
4663 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4666 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4668 if((yyvsp[(2) - (3)].classinfo)) {
4669 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4670 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4671 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4673 code_free((yyvsp[(3) - (3)].value).c);
4674 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4677 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4678 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4679 (yyval.code) = abc_coerce_a((yyval.code));
4681 // don't do anything
4682 code_free((yyvsp[(3) - (3)].value).c);
4683 code_free((yyval.code));
4689 (yyval.code) = abc_setslot((yyval.code), index);
4691 (yyval.code) = abc_setlocal((yyval.code), index);
4702 /* Line 1464 of skeleton.m4 */
4703 #line 2238 "parser.y"
4704 {(yyval.code) = code_new();}
4713 /* Line 1464 of skeleton.m4 */
4714 #line 2239 "parser.y"
4715 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4724 /* Line 1464 of skeleton.m4 */
4725 #line 2242 "parser.y"
4726 {PASS12 new_state();}
4735 /* Line 1464 of skeleton.m4 */
4736 #line 2242 "parser.y"
4739 (yyval.code) = code_new();
4740 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4741 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4743 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4744 if((yyvsp[(7) - (7)].code)) {
4745 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4747 myif->branch = (yyval.code) = abc_nop((yyval.code));
4748 if((yyvsp[(7) - (7)].code)) {
4749 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4750 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4752 (yyval.code) = var_block((yyval.code));
4763 /* Line 1464 of skeleton.m4 */
4764 #line 2261 "parser.y"
4765 {(yyval.code)=code_new();}
4774 /* Line 1464 of skeleton.m4 */
4775 #line 2268 "parser.y"
4777 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4778 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4788 /* Line 1464 of skeleton.m4 */
4789 #line 2272 "parser.y"
4792 (yyval.id)=(yyvsp[(1) - (1)].id);
4802 /* Line 1464 of skeleton.m4 */
4803 #line 2277 "parser.y"
4804 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4813 /* Line 1464 of skeleton.m4 */
4814 #line 2278 "parser.y"
4815 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4824 /* Line 1464 of skeleton.m4 */
4825 #line 2280 "parser.y"
4827 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4828 (yyval.code) = code_new();
4829 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4830 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4831 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4832 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4833 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4834 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4835 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4836 (yyval.code) = abc_jump((yyval.code), loopstart);
4837 code_t*out = (yyval.code) = abc_nop((yyval.code));
4838 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4839 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4842 (yyval.code) = var_block((yyval.code));
4853 /* Line 1464 of skeleton.m4 */
4854 #line 2300 "parser.y"
4856 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4858 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4861 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4862 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4863 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4864 int array = new_variable(tmp1name, 0, 0, 0);
4866 (yyval.code) = code_new();
4867 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4868 (yyval.code) = abc_coerce_a((yyval.code));
4869 (yyval.code) = abc_setlocal((yyval.code), array);
4870 (yyval.code) = abc_pushbyte((yyval.code), 0);
4871 (yyval.code) = abc_setlocal((yyval.code), it);
4873 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4875 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4876 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4877 (yyval.code) = abc_getlocal((yyval.code), array);
4878 (yyval.code) = abc_getlocal((yyval.code), it);
4879 if(!(yyvsp[(1) - (6)].for_start).each)
4880 (yyval.code) = abc_nextname((yyval.code));
4882 (yyval.code) = abc_nextvalue((yyval.code));
4883 (yyval.code) = converttype((yyval.code), 0, var->type);
4884 (yyval.code) = abc_setlocal((yyval.code), var->index);
4886 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4887 (yyval.code) = abc_jump((yyval.code), loopstart);
4889 code_t*out = (yyval.code) = abc_nop((yyval.code));
4890 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4891 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4895 (yyval.code) = var_block((yyval.code));
4910 /* Line 1464 of skeleton.m4 */
4911 #line 2348 "parser.y"
4912 {PASS12 new_state();}
4921 /* Line 1464 of skeleton.m4 */
4922 #line 2348 "parser.y"
4925 (yyval.code) = code_new();
4927 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4928 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4929 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4930 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4931 myjmp->branch = cont;
4932 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4933 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4934 code_t*out = (yyval.code) = abc_nop((yyval.code));
4935 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4936 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4938 (yyval.code) = var_block((yyval.code));
4949 /* Line 1464 of skeleton.m4 */
4950 #line 2367 "parser.y"
4951 {PASS12 new_state();}
4960 /* Line 1464 of skeleton.m4 */
4961 #line 2367 "parser.y"
4963 (yyval.code) = code_new();
4964 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4965 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4966 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4967 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4968 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4969 code_t*out = (yyval.code) = abc_nop((yyval.code));
4970 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4971 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4973 (yyval.code) = var_block((yyval.code));
4984 /* Line 1464 of skeleton.m4 */
4985 #line 2382 "parser.y"
4987 (yyval.code) = abc___break__(0, "");
4997 /* Line 1464 of skeleton.m4 */
4998 #line 2385 "parser.y"
5000 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
5010 /* Line 1464 of skeleton.m4 */
5011 #line 2388 "parser.y"
5013 (yyval.code) = abc___continue__(0, "");
5023 /* Line 1464 of skeleton.m4 */
5024 #line 2391 "parser.y"
5026 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
5036 /* Line 1464 of skeleton.m4 */
5037 #line 2395 "parser.y"
5047 /* Line 1464 of skeleton.m4 */
5048 #line 2396 "parser.y"
5049 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5058 /* Line 1464 of skeleton.m4 */
5059 #line 2397 "parser.y"
5060 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5069 /* Line 1464 of skeleton.m4 */
5070 #line 2398 "parser.y"
5071 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
5080 /* Line 1464 of skeleton.m4 */
5081 #line 2399 "parser.y"
5082 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5091 /* Line 1464 of skeleton.m4 */
5092 #line 2400 "parser.y"
5093 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5102 /* Line 1464 of skeleton.m4 */
5103 #line 2402 "parser.y"
5105 (yyval.code) = abc_getlocal(0, state->switch_var);
5106 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
5107 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5108 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5109 if((yyval.code)->opcode != OPCODE___BREAK__) {
5110 (yyval.code) = abc___fallthrough__((yyval.code), "");
5112 code_t*e = (yyval.code) = abc_nop((yyval.code));
5123 /* Line 1464 of skeleton.m4 */
5124 #line 2413 "parser.y"
5126 (yyval.code) = (yyvsp[(3) - (3)].code);
5136 /* Line 1464 of skeleton.m4 */
5137 #line 2416 "parser.y"
5138 {PASS12 new_state();state->switch_var=alloc_local();}
5147 /* Line 1464 of skeleton.m4 */
5148 #line 2416 "parser.y"
5150 (yyval.code)=(yyvsp[(4) - (8)].value).c;
5151 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5152 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5154 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5155 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5157 code_t*c = (yyval.code),*lastblock=0;
5159 if(c->opcode == OPCODE_IFNE) {
5160 if(!c->next) syntaxerror("internal error in fallthrough handling");
5162 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5164 c->opcode = OPCODE_JUMP;
5165 c->branch = lastblock;
5167 /* fall through end of switch */
5168 c->opcode = OPCODE_NOP;
5174 (yyval.code) = var_block((yyval.code));
5185 /* Line 1464 of skeleton.m4 */
5186 #line 2447 "parser.y"
5187 {PASS12 new_state();
5188 state->exception_name=(yyvsp[(3) - (5)].id);
5189 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5190 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5200 /* Line 1464 of skeleton.m4 */
5201 #line 2452 "parser.y"
5203 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5204 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5206 NEW(abc_exception_t, e)
5207 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5208 e->var_name = multiname_clone(&name);
5209 (yyval.exception) = e;
5212 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5213 e->target = c = abc_nop(0);
5214 c = abc_setlocal(c, i);
5215 c = code_append(c, code_dup(state->method->scope_code));
5216 c = code_append(c, (yyvsp[(8) - (9)].code));
5230 /* Line 1464 of skeleton.m4 */
5231 #line 2472 "parser.y"
5232 {PASS12 new_state();state->exception_name=0;}
5241 /* Line 1464 of skeleton.m4 */
5242 #line 2472 "parser.y"
5244 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5245 if(!(yyvsp[(4) - (5)].code)) {
5246 (yyval.exception)=0;
5248 NEW(abc_exception_t, e)
5249 e->exc_type = 0; //all exceptions
5250 e->var_name = 0; //no name
5253 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5254 (yyval.exception) = e;
5266 /* Line 1464 of skeleton.m4 */
5267 #line 2488 "parser.y"
5268 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5277 /* Line 1464 of skeleton.m4 */
5278 #line 2489 "parser.y"
5279 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5288 /* Line 1464 of skeleton.m4 */
5289 #line 2490 "parser.y"
5290 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5299 /* Line 1464 of skeleton.m4 */
5300 #line 2491 "parser.y"
5302 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5303 (yyval.catch_list).finally = 0;
5304 if((yyvsp[(2) - (2)].exception)) {
5305 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5306 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5317 /* Line 1464 of skeleton.m4 */
5318 #line 2499 "parser.y"
5320 (yyval.catch_list).l=list_new();
5321 (yyval.catch_list).finally = 0;
5322 if((yyvsp[(1) - (1)].exception)) {
5323 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5324 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5335 /* Line 1464 of skeleton.m4 */
5336 #line 2508 "parser.y"
5337 {PASS12 new_state();
5338 state->method->has_exceptions=1;
5339 state->method->late_binding=1;//for invariant scope_code
5349 /* Line 1464 of skeleton.m4 */
5350 #line 2511 "parser.y"
5352 code_t*out = abc_nop(0);
5354 code_t*start = abc_nop(0);
5355 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5356 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5357 (yyval.code) = abc_jump((yyval.code), out);
5359 code_t*end = (yyval.code) = abc_nop((yyval.code));
5362 if((yyvsp[(6) - (6)].catch_list).finally)
5363 tmp = new_variable("__finally__", 0, 0, 0);
5365 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5368 abc_exception_t*e = l->abc_exception;
5370 (yyval.code) = code_append((yyval.code), e->target);
5371 (yyval.code) = abc_jump((yyval.code), out);
5373 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5375 e->target = (yyval.code) = abc_nop((yyval.code));
5376 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5377 (yyval.code) = abc___rethrow__((yyval.code));
5385 (yyval.code) = code_append((yyval.code), out);
5387 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5389 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5391 (yyval.code) = var_block((yyval.code));
5402 /* Line 1464 of skeleton.m4 */
5403 #line 2557 "parser.y"
5405 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5406 (yyval.code)=abc_throw((yyval.code));
5416 /* Line 1464 of skeleton.m4 */
5417 #line 2561 "parser.y"
5419 if(!state->exception_name)
5420 syntaxerror("re-throw only possible within a catch block");
5421 variable_t*v = find_variable(state, state->exception_name);
5422 (yyval.code)=code_new();
5423 (yyval.code)=abc_getlocal((yyval.code), v->index);
5424 (yyval.code)=abc_throw((yyval.code));
5434 /* Line 1464 of skeleton.m4 */
5435 #line 2572 "parser.y"
5438 if(state->method->has_exceptions) {
5439 int v = alloc_local();
5440 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5441 state->method->scope_code = abc_pushwith(state->method->scope_code);
5442 (yyval.value_list).number = v;
5444 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5454 /* Line 1464 of skeleton.m4 */
5455 #line 2582 "parser.y"
5457 /* remove getlocal;pushwith from scope code again */
5458 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5460 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5461 if(state->method->has_exceptions) {
5462 (yyval.code) = abc_dup((yyval.code));
5463 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5465 (yyval.code) = abc_pushwith((yyval.code));
5466 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5467 (yyval.code) = abc_popscope((yyval.code));
5478 /* Line 1464 of skeleton.m4 */
5479 #line 2600 "parser.y"
5480 {PASS12 (yyval.id)="package";}
5489 /* Line 1464 of skeleton.m4 */
5490 #line 2601 "parser.y"
5491 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5500 /* Line 1464 of skeleton.m4 */
5501 #line 2603 "parser.y"
5502 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5511 /* Line 1464 of skeleton.m4 */
5512 #line 2604 "parser.y"
5513 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5522 /* Line 1464 of skeleton.m4 */
5523 #line 2606 "parser.y"
5524 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5533 /* Line 1464 of skeleton.m4 */
5534 #line 2607 "parser.y"
5535 {PASS12 endpackage();(yyval.code)=0;}
5544 /* Line 1464 of skeleton.m4 */
5545 #line 2608 "parser.y"
5546 {PASS12 startpackage("");}
5555 /* Line 1464 of skeleton.m4 */
5556 #line 2609 "parser.y"
5557 {PASS12 endpackage();(yyval.code)=0;}
5566 /* Line 1464 of skeleton.m4 */
5567 #line 2631 "parser.y"
5570 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5571 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5572 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5574 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5576 syntaxerror("Couldn't import class\n");
5577 state_has_imports();
5578 dict_put(state->imports, c->name, c);
5579 import_toplevel(c->package);
5590 /* Line 1464 of skeleton.m4 */
5591 #line 2645 "parser.y"
5594 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5595 as3_schedule_package((yyvsp[(2) - (4)].id));
5599 i->package = (yyvsp[(2) - (4)].id);
5600 state_has_imports();
5601 list_append(state->wildcard_imports, i);
5602 import_toplevel(i->package);
5613 /* Line 1464 of skeleton.m4 */
5614 #line 2661 "parser.y"
5615 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5624 /* Line 1464 of skeleton.m4 */
5625 #line 2662 "parser.y"
5626 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5635 /* Line 1464 of skeleton.m4 */
5636 #line 2663 "parser.y"
5637 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5646 /* Line 1464 of skeleton.m4 */
5647 #line 2664 "parser.y"
5650 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5651 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5652 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5663 /* Line 1464 of skeleton.m4 */
5664 #line 2671 "parser.y"
5665 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5674 /* Line 1464 of skeleton.m4 */
5675 #line 2672 "parser.y"
5676 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5685 /* Line 1464 of skeleton.m4 */
5686 #line 2673 "parser.y"
5687 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5696 /* Line 1464 of skeleton.m4 */
5697 #line 2674 "parser.y"
5698 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5707 /* Line 1464 of skeleton.m4 */
5708 #line 2675 "parser.y"
5709 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5718 /* Line 1464 of skeleton.m4 */
5719 #line 2676 "parser.y"
5720 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5729 /* Line 1464 of skeleton.m4 */
5730 #line 2677 "parser.y"
5731 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5740 /* Line 1464 of skeleton.m4 */
5741 #line 2678 "parser.y"
5742 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5751 /* Line 1464 of skeleton.m4 */
5752 #line 2679 "parser.y"
5753 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5762 /* Line 1464 of skeleton.m4 */
5763 #line 2680 "parser.y"
5764 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5765 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5775 /* Line 1464 of skeleton.m4 */
5776 #line 2684 "parser.y"
5777 {PASS12 (yyval.classinfo)=0;}
5786 /* Line 1464 of skeleton.m4 */
5787 #line 2685 "parser.y"
5788 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5797 /* Line 1464 of skeleton.m4 */
5798 #line 2687 "parser.y"
5799 {PASS12 (yyval.classinfo_list)=list_new();}
5808 /* Line 1464 of skeleton.m4 */
5809 #line 2688 "parser.y"
5810 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5819 /* Line 1464 of skeleton.m4 */
5820 #line 2690 "parser.y"
5821 {PASS12 (yyval.classinfo_list)=list_new();}
5830 /* Line 1464 of skeleton.m4 */
5831 #line 2691 "parser.y"
5832 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5841 /* Line 1464 of skeleton.m4 */
5842 #line 2695 "parser.y"
5843 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5852 /* Line 1464 of skeleton.m4 */
5853 #line 2697 "parser.y"
5854 {PASS12 endclass();(yyval.code)=0;}
5863 /* Line 1464 of skeleton.m4 */
5864 #line 2701 "parser.y"
5865 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5866 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5875 /* Line 1464 of skeleton.m4 */
5876 #line 2704 "parser.y"
5877 {PASS12 endclass();(yyval.code)=0;}
5886 /* Line 1464 of skeleton.m4 */
5887 #line 2713 "parser.y"
5888 {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);}
5897 /* Line 1464 of skeleton.m4 */
5898 #line 2717 "parser.y"
5900 code_t*c = state->cls->static_init->header;
5901 c = code_append(c, (yyvsp[(1) - (1)].code));
5902 state->cls->static_init->header = c;
5912 /* Line 1464 of skeleton.m4 */
5913 #line 2728 "parser.y"
5915 syntaxerror("variable declarations not allowed in interfaces");
5925 /* Line 1464 of skeleton.m4 */
5926 #line 2731 "parser.y"
5929 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5930 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5931 syntaxerror("invalid method modifiers: interface methods always need to be public");
5933 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5934 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5935 list_deep_free((yyvsp[(6) - (8)].params).list);
5945 /* Line 1464 of skeleton.m4 */
5946 #line 2765 "parser.y"
5947 {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5956 /* Line 1464 of skeleton.m4 */
5957 #line 2765 "parser.y"
5958 {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5967 /* Line 1464 of skeleton.m4 */
5968 #line 2767 "parser.y"
5969 {PASS12 (yyval.code)=0;}
5978 /* Line 1464 of skeleton.m4 */
5979 #line 2768 "parser.y"
5980 {PASS12 (yyval.code)=0;}
5989 /* Line 1464 of skeleton.m4 */
5990 #line 2771 "parser.y"
5993 int flags = slotstate_flags->flags;
5994 namespace_t ns = modifiers2access(slotstate_flags);
5998 varinfo_t* info = 0;
6000 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
6002 check_override(i, flags);
6004 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
6006 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
6008 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
6010 if(ns.name && ns.name[0]) {
6011 syntaxerror("namespaces not allowed on package-level variables");
6013 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
6016 info->type = (yyvsp[(2) - (3)].classinfo);
6017 info->flags = flags;
6019 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, info);
6023 varinfo_t*info = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
6026 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
6028 trait_list_t**traits;
6032 ns.name = state->package;
6033 traits = &global->init->traits;
6034 code = &global->init->method->body->code;
6035 } else if(flags&FLAG_STATIC) {
6037 traits = &state->cls->abc->static_traits;
6038 code = &state->cls->static_init->header;
6040 // instance variable
6041 traits = &state->cls->abc->traits;
6042 code = &state->cls->init->header;
6046 if((yyvsp[(2) - (3)].classinfo)) {
6047 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
6048 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
6050 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
6052 info->slot = t->slot_id;
6054 /* initalization code (if needed) */
6056 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
6057 c = abc_getlocal_0(c);
6058 c = code_append(c, (yyvsp[(3) - (3)].value).c);
6059 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
6060 c = abc_setslot(c, t->slot_id);
6063 *code = code_append(*code, c);
6065 if(slotstate_varconst==KW_CONST) {
6066 t->kind= TRAIT_CONST;
6080 /* Line 1464 of skeleton.m4 */
6081 #line 2855 "parser.y"
6082 {(yyval.constant)=0;}
6091 /* Line 1464 of skeleton.m4 */
6092 #line 2856 "parser.y"
6093 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
6102 /* Line 1464 of skeleton.m4 */
6103 #line 2859 "parser.y"
6104 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6113 /* Line 1464 of skeleton.m4 */
6114 #line 2860 "parser.y"
6116 (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));
6126 /* Line 1464 of skeleton.m4 */
6127 #line 2863 "parser.y"
6128 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6137 /* Line 1464 of skeleton.m4 */
6138 #line 2864 "parser.y"
6139 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6148 /* Line 1464 of skeleton.m4 */
6149 #line 2865 "parser.y"
6150 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6159 /* Line 1464 of skeleton.m4 */
6160 #line 2866 "parser.y"
6161 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6170 /* Line 1464 of skeleton.m4 */
6171 #line 2867 "parser.y"
6172 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6181 /* Line 1464 of skeleton.m4 */
6182 #line 2868 "parser.y"
6183 {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));}
6192 /* Line 1464 of skeleton.m4 */
6193 #line 2869 "parser.y"
6194 {(yyval.constant) = constant_new_float(__builtin_nan(""));}
6203 /* Line 1464 of skeleton.m4 */
6204 #line 2884 "parser.y"
6207 memset(&(yyval.params),0,sizeof((yyval.params)));
6217 /* Line 1464 of skeleton.m4 */
6218 #line 2888 "parser.y"
6221 (yyval.params)=(yyvsp[(1) - (1)].params);
6231 /* Line 1464 of skeleton.m4 */
6232 #line 2894 "parser.y"
6235 memset(&(yyval.params),0,sizeof((yyval.params)));
6236 (yyval.params).varargs=1;
6237 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6247 /* Line 1464 of skeleton.m4 */
6248 #line 2900 "parser.y"
6251 (yyval.params) =(yyvsp[(1) - (4)].params);
6252 (yyval.params).varargs=1;
6253 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6263 /* Line 1464 of skeleton.m4 */
6264 #line 2908 "parser.y"
6267 (yyval.params) = (yyvsp[(1) - (3)].params);
6268 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6278 /* Line 1464 of skeleton.m4 */
6279 #line 2913 "parser.y"
6282 memset(&(yyval.params),0,sizeof((yyval.params)));
6283 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6293 /* Line 1464 of skeleton.m4 */
6294 #line 2919 "parser.y"
6297 (yyval.param) = rfx_calloc(sizeof(param_t));
6298 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6299 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6301 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6311 /* Line 1464 of skeleton.m4 */
6312 #line 2927 "parser.y"
6315 (yyval.param) = rfx_calloc(sizeof(param_t));
6316 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6317 (yyval.param)->type = TYPE_ANY;
6319 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6329 /* Line 1464 of skeleton.m4 */
6330 #line 2937 "parser.y"
6331 {PASS12 (yyval.token)=0;}
6340 /* Line 1464 of skeleton.m4 */
6341 #line 2940 "parser.y"
6342 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6351 /* Line 1464 of skeleton.m4 */
6352 #line 2941 "parser.y"
6355 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6357 if(!state->method->info) syntaxerror("internal error");
6359 code_t*c = method_header(state->method);
6360 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6362 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6364 list_deep_free((yyvsp[(6) - (12)].params).list);
6375 /* Line 1464 of skeleton.m4 */
6376 #line 2957 "parser.y"
6377 {PASS12 (yyval.id)=0;}
6386 /* Line 1464 of skeleton.m4 */
6387 #line 2959 "parser.y"
6388 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6397 /* Line 1464 of skeleton.m4 */
6398 #line 2960 "parser.y"
6401 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6403 methodinfo_t*f = state->method->info;
6404 if(!f || !f->kind) syntaxerror("internal error");
6406 code_t*c = method_header(state->method);
6407 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6409 int index = state->method->var_index;
6410 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6412 (yyval.value).c = abc_getlocal(0, index);
6413 (yyval.value).t = TYPE_FUNCTION(f);
6415 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6425 /* Line 1464 of skeleton.m4 */
6426 #line 2982 "parser.y"
6428 PASS1 NEW(unresolvedinfo_t,c);
6429 memset(c, 0, sizeof(*c));
6430 c->kind = INFOTYPE_UNRESOLVED;
6431 c->name = (yyvsp[(1) - (1)].id);
6432 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6434 c->nsset = get_current_imports();
6435 /* make the compiler look for this class in the current directory,
6437 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6439 (yyval.classinfo) = (classinfo_t*)c;
6441 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6442 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6443 (yyval.classinfo) = (classinfo_t*)s;
6453 /* Line 1464 of skeleton.m4 */
6454 #line 3001 "parser.y"
6456 PASS1 NEW(unresolvedinfo_t,c);
6457 memset(c, 0, sizeof(*c));
6458 c->kind = INFOTYPE_UNRESOLVED;
6459 c->package = (yyvsp[(1) - (3)].id);
6460 c->name = (yyvsp[(3) - (3)].id);
6461 (yyval.classinfo) = (classinfo_t*)c;
6463 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6464 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6465 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6466 (yyval.classinfo) = (classinfo_t*)s;
6476 /* Line 1464 of skeleton.m4 */
6477 #line 3018 "parser.y"
6478 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6487 /* Line 1464 of skeleton.m4 */
6488 #line 3019 "parser.y"
6489 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6498 /* Line 1464 of skeleton.m4 */
6499 #line 3021 "parser.y"
6500 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6509 /* Line 1464 of skeleton.m4 */
6510 #line 3022 "parser.y"
6511 {PASS12 (yyval.classinfo)=registry_getanytype();}
6520 /* Line 1464 of skeleton.m4 */
6521 #line 3023 "parser.y"
6522 {PASS12 (yyval.classinfo)=registry_getanytype();}
6531 /* Line 1464 of skeleton.m4 */
6532 #line 3032 "parser.y"
6533 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6542 /* Line 1464 of skeleton.m4 */
6543 #line 3033 "parser.y"
6544 {PASS12 (yyval.classinfo)=0;}
6553 /* Line 1464 of skeleton.m4 */
6554 #line 3037 "parser.y"
6555 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6564 /* Line 1464 of skeleton.m4 */
6565 #line 3038 "parser.y"
6566 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6575 /* Line 1464 of skeleton.m4 */
6576 #line 3040 "parser.y"
6577 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6586 /* Line 1464 of skeleton.m4 */
6587 #line 3044 "parser.y"
6588 {(yyval.value_list).number=1;
6589 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6599 /* Line 1464 of skeleton.m4 */
6600 #line 3048 "parser.y"
6601 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6610 /* Line 1464 of skeleton.m4 */
6611 #line 3049 "parser.y"
6613 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6614 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6624 /* Line 1464 of skeleton.m4 */
6625 #line 3055 "parser.y"
6627 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6628 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6630 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6631 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6632 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6633 (yyval.value).c = code_cutlast((yyval.value).c);
6634 (yyval.value).c = code_append((yyval.value).c, paramcode);
6635 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6636 multiname_destroy(name);
6637 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6638 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6639 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6640 multiname_t*name = t->name;
6641 (yyval.value).c = code_cutlast((yyval.value).c);
6642 (yyval.value).c = code_append((yyval.value).c, paramcode);
6643 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6645 (yyval.value).c = code_append((yyval.value).c, paramcode);
6646 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6649 (yyval.value).t = TYPE_ANY;
6650 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6651 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6653 (yyval.value).c = abc_coerce_a((yyval.value).c);
6654 (yyval.value).t = TYPE_ANY;
6665 /* Line 1464 of skeleton.m4 */
6666 #line 3091 "parser.y"
6669 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6670 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6671 (yyval.value).c = code_cutlast((yyval.value).c);
6673 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6675 (yyval.value).t = TYPE_ANY;
6676 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6677 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6678 (yyval.value).c = code_cutlast((yyval.value).c);
6679 (yyval.value).c = code_append((yyval.value).c, paramcode);
6680 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6681 multiname_destroy(name);
6682 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6683 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6684 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6685 if(t->kind!=TRAIT_METHOD) {
6686 //ok: flash allows to assign closures to members.
6688 multiname_t*name = t->name;
6689 (yyval.value).c = code_cutlast((yyval.value).c);
6690 (yyval.value).c = code_append((yyval.value).c, paramcode);
6691 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6692 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6693 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6694 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6695 (yyval.value).c = code_cutlast((yyval.value).c);
6696 (yyval.value).c = code_append((yyval.value).c, paramcode);
6697 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6698 multiname_destroy(name);
6700 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6701 (yyval.value).c = code_append((yyval.value).c, paramcode);
6702 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6705 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6706 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6708 (yyval.value).c = abc_coerce_a((yyval.value).c);
6709 (yyval.value).t = TYPE_ANY;
6720 /* Line 1464 of skeleton.m4 */
6721 #line 3137 "parser.y"
6723 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6724 if(!state->method) syntaxerror("super() not allowed outside of a function");
6725 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6727 (yyval.value).c = code_new();
6728 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6730 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6732 this is dependent on the control path, check this somewhere else
6733 if(state->method->has_super)
6734 syntaxerror("constructor may call super() only once");
6736 state->method->has_super = 1;
6738 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6739 (yyval.value).c = abc_pushundefined((yyval.value).c);
6740 (yyval.value).t = TYPE_ANY;
6750 /* Line 1464 of skeleton.m4 */
6751 #line 3158 "parser.y"
6753 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6754 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6755 (yyval.value).c = code_cutlast((yyval.value).c);
6757 multiname_t*name = 0;
6758 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6759 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6760 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6761 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6762 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6763 (yyval.value).c = code_cutlast((yyval.value).c);
6764 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6766 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6767 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6768 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6770 (yyval.value).t = TYPE_BOOLEAN;
6780 /* Line 1464 of skeleton.m4 */
6781 #line 3179 "parser.y"
6783 (yyval.code) = abc_returnvoid(0);
6793 /* Line 1464 of skeleton.m4 */
6794 #line 3182 "parser.y"
6796 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6797 (yyval.code) = abc_returnvalue((yyval.code));
6807 /* Line 1464 of skeleton.m4 */
6808 #line 3189 "parser.y"
6809 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6818 /* Line 1464 of skeleton.m4 */
6819 #line 3190 "parser.y"
6820 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6829 /* Line 1464 of skeleton.m4 */
6830 #line 3191 "parser.y"
6832 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6833 (yyval.value).c = cut_last_push((yyval.value).c);
6834 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6835 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6845 /* Line 1464 of skeleton.m4 */
6846 #line 3197 "parser.y"
6848 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6858 /* Line 1464 of skeleton.m4 */
6859 #line 3203 "parser.y"
6860 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6869 /* Line 1464 of skeleton.m4 */
6870 #line 3204 "parser.y"
6871 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6880 /* Line 1464 of skeleton.m4 */
6881 #line 3205 "parser.y"
6882 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6891 /* Line 1464 of skeleton.m4 */
6892 #line 3206 "parser.y"
6893 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6902 /* Line 1464 of skeleton.m4 */
6903 #line 3210 "parser.y"
6905 node_t*n = mkconstnode((yyvsp[(1) - (1)].constant));
6906 (yyval.value) = node_read(n);
6916 /* Line 1464 of skeleton.m4 */
6917 #line 3215 "parser.y"
6919 (yyval.value).c = 0;
6920 namespace_t ns = {ACCESS_PACKAGE, ""};
6921 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6922 if(!(yyvsp[(1) - (1)].regexp).options) {
6923 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6924 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6925 (yyval.value).c = abc_construct((yyval.value).c, 1);
6927 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6928 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6929 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6930 (yyval.value).c = abc_construct((yyval.value).c, 2);
6932 (yyval.value).t = TYPE_REGEXP;
6942 /* Line 1464 of skeleton.m4 */
6943 #line 3232 "parser.y"
6944 {(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);
6945 (yyval.value).t = TYPE_BOOLEAN;
6955 /* Line 1464 of skeleton.m4 */
6956 #line 3235 "parser.y"
6957 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6958 (yyval.value).t = TYPE_BOOLEAN;
6968 /* Line 1464 of skeleton.m4 */
6969 #line 3238 "parser.y"
6970 {(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);
6971 (yyval.value).t = TYPE_BOOLEAN;
6981 /* Line 1464 of skeleton.m4 */
6982 #line 3241 "parser.y"
6983 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
6984 (yyval.value).t = TYPE_BOOLEAN;
6994 /* Line 1464 of skeleton.m4 */
6995 #line 3244 "parser.y"
6996 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
6997 (yyval.value).t = TYPE_BOOLEAN;
7007 /* Line 1464 of skeleton.m4 */
7008 #line 3247 "parser.y"
7009 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
7010 (yyval.value).t = TYPE_BOOLEAN;
7020 /* Line 1464 of skeleton.m4 */
7021 #line 3250 "parser.y"
7022 {(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);
7023 (yyval.value).t = TYPE_BOOLEAN;
7033 /* Line 1464 of skeleton.m4 */
7034 #line 3253 "parser.y"
7035 {(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);
7036 (yyval.value).t = TYPE_BOOLEAN;
7046 /* Line 1464 of skeleton.m4 */
7047 #line 3257 "parser.y"
7048 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
7049 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7050 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7051 (yyval.value).c = abc_dup((yyval.value).c);
7052 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
7053 (yyval.value).c = cut_last_push((yyval.value).c);
7054 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7055 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7056 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7057 jmp->branch = label;
7067 /* Line 1464 of skeleton.m4 */
7068 #line 3268 "parser.y"
7070 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
7071 /*printf("%08x:\n",$1.t);
7072 code_dump($1.c, 0, 0, "", stdout);
7073 printf("%08x:\n",$3.t);
7074 code_dump($3.c, 0, 0, "", stdout);
7075 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
7076 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7077 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7078 (yyval.value).c = abc_dup((yyval.value).c);
7079 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7080 (yyval.value).c = cut_last_push((yyval.value).c);
7081 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7082 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7083 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7084 jmp->branch = label;
7094 /* Line 1464 of skeleton.m4 */
7095 #line 3286 "parser.y"
7096 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7097 (yyval.value).c = abc_not((yyval.value).c);
7098 (yyval.value).t = TYPE_BOOLEAN;
7108 /* Line 1464 of skeleton.m4 */
7109 #line 3291 "parser.y"
7110 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7111 (yyval.value).c = abc_bitnot((yyval.value).c);
7112 (yyval.value).t = TYPE_INT;
7122 /* Line 1464 of skeleton.m4 */
7123 #line 3296 "parser.y"
7124 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7125 (yyval.value).c = abc_bitand((yyval.value).c);
7126 (yyval.value).t = TYPE_INT;
7136 /* Line 1464 of skeleton.m4 */
7137 #line 3301 "parser.y"
7138 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7139 (yyval.value).c = abc_bitxor((yyval.value).c);
7140 (yyval.value).t = TYPE_INT;
7150 /* Line 1464 of skeleton.m4 */
7151 #line 3306 "parser.y"
7152 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7153 (yyval.value).c = abc_bitor((yyval.value).c);
7154 (yyval.value).t = TYPE_INT;
7164 /* Line 1464 of skeleton.m4 */
7165 #line 3311 "parser.y"
7166 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7167 (yyval.value).c = abc_rshift((yyval.value).c);
7168 (yyval.value).t = TYPE_INT;
7178 /* Line 1464 of skeleton.m4 */
7179 #line 3315 "parser.y"
7180 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7181 (yyval.value).c = abc_urshift((yyval.value).c);
7182 (yyval.value).t = TYPE_INT;
7192 /* Line 1464 of skeleton.m4 */
7193 #line 3319 "parser.y"
7194 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7195 (yyval.value).c = abc_lshift((yyval.value).c);
7196 (yyval.value).t = TYPE_INT;
7206 /* Line 1464 of skeleton.m4 */
7207 #line 3324 "parser.y"
7208 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7209 (yyval.value).c = abc_divide((yyval.value).c);
7210 (yyval.value).t = TYPE_NUMBER;
7220 /* Line 1464 of skeleton.m4 */
7221 #line 3328 "parser.y"
7222 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7223 (yyval.value).c = abc_modulo((yyval.value).c);
7224 (yyval.value).t = TYPE_NUMBER;
7234 /* Line 1464 of skeleton.m4 */
7235 #line 3332 "parser.y"
7236 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7237 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7238 (yyval.value).c = abc_add_i((yyval.value).c);
7239 (yyval.value).t = TYPE_INT;
7241 (yyval.value).c = abc_add((yyval.value).c);
7242 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7253 /* Line 1464 of skeleton.m4 */
7254 #line 3341 "parser.y"
7255 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7256 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7257 (yyval.value).c = abc_subtract_i((yyval.value).c);
7258 (yyval.value).t = TYPE_INT;
7260 (yyval.value).c = abc_subtract((yyval.value).c);
7261 (yyval.value).t = TYPE_NUMBER;
7272 /* Line 1464 of skeleton.m4 */
7273 #line 3350 "parser.y"
7274 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7275 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7276 (yyval.value).c = abc_multiply_i((yyval.value).c);
7277 (yyval.value).t = TYPE_INT;
7279 (yyval.value).c = abc_multiply((yyval.value).c);
7280 (yyval.value).t = TYPE_NUMBER;
7291 /* Line 1464 of skeleton.m4 */
7292 #line 3360 "parser.y"
7293 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7294 (yyval.value).c = abc_in((yyval.value).c);
7295 (yyval.value).t = TYPE_BOOLEAN;
7305 /* Line 1464 of skeleton.m4 */
7306 #line 3365 "parser.y"
7307 {char use_astype=0; // flash player's astype works differently than astypelate
7308 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7309 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7310 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7311 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7313 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7314 (yyval.value).c = abc_astypelate((yyval.value).c);
7315 (yyval.value).t = TYPE_ANY;
7326 /* Line 1464 of skeleton.m4 */
7327 #line 3378 "parser.y"
7328 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7329 (yyval.value).c = abc_instanceof((yyval.value).c);
7330 (yyval.value).t = TYPE_BOOLEAN;
7340 /* Line 1464 of skeleton.m4 */
7341 #line 3383 "parser.y"
7342 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7343 (yyval.value).c = abc_istypelate((yyval.value).c);
7344 (yyval.value).t = TYPE_BOOLEAN;
7354 /* Line 1464 of skeleton.m4 */
7355 #line 3388 "parser.y"
7357 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7358 (yyval.value).c = abc_typeof((yyval.value).c);
7359 (yyval.value).t = TYPE_STRING;
7369 /* Line 1464 of skeleton.m4 */
7370 #line 3394 "parser.y"
7372 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7373 (yyval.value).c = abc_pushundefined((yyval.value).c);
7374 (yyval.value).t = TYPE_ANY;
7384 /* Line 1464 of skeleton.m4 */
7385 #line 3400 "parser.y"
7386 { (yyval.value).c = abc_pushundefined(0);
7387 (yyval.value).t = TYPE_ANY;
7397 /* Line 1464 of skeleton.m4 */
7398 #line 3404 "parser.y"
7399 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7408 /* Line 1464 of skeleton.m4 */
7409 #line 3406 "parser.y"
7411 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
7412 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7413 (yyval.value).c=abc_negate_i((yyval.value).c);
7414 (yyval.value).t = TYPE_INT;
7416 (yyval.value).c=abc_negate((yyval.value).c);
7417 (yyval.value).t = TYPE_NUMBER;
7428 /* Line 1464 of skeleton.m4 */
7429 #line 3417 "parser.y"
7431 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7432 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7434 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7435 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7436 (yyval.value).t = 0; // array elements have unknown type
7446 /* Line 1464 of skeleton.m4 */
7447 #line 3426 "parser.y"
7449 (yyval.value).c = code_new();
7450 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7451 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).number);
7452 (yyval.value).t = registry_getarrayclass();
7462 /* Line 1464 of skeleton.m4 */
7463 #line 3433 "parser.y"
7464 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7473 /* Line 1464 of skeleton.m4 */
7474 #line 3434 "parser.y"
7475 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7484 /* Line 1464 of skeleton.m4 */
7485 #line 3436 "parser.y"
7487 (yyval.value_list).cc = 0;
7488 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7489 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7490 (yyval.value_list).number = 2;
7500 /* Line 1464 of skeleton.m4 */
7501 #line 3442 "parser.y"
7503 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7504 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7505 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7506 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7516 /* Line 1464 of skeleton.m4 */
7517 #line 3451 "parser.y"
7519 (yyval.value).c = code_new();
7520 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7521 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).number/2);
7522 (yyval.value).t = registry_getobjectclass();
7532 /* Line 1464 of skeleton.m4 */
7533 #line 3458 "parser.y"
7535 code_t*c = (yyvsp[(3) - (3)].value).c;
7536 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7537 c=abc_multiply_i(c);
7541 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
7542 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7543 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7553 /* Line 1464 of skeleton.m4 */
7554 #line 3470 "parser.y"
7556 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
7557 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
7558 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7559 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7569 /* Line 1464 of skeleton.m4 */
7570 #line 3476 "parser.y"
7572 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
7573 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
7574 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7575 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7585 /* Line 1464 of skeleton.m4 */
7586 #line 3482 "parser.y"
7588 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7589 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7590 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7591 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7601 /* Line 1464 of skeleton.m4 */
7602 #line 3488 "parser.y"
7604 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7605 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7606 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7607 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7617 /* Line 1464 of skeleton.m4 */
7618 #line 3494 "parser.y"
7620 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7621 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7622 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7623 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7633 /* Line 1464 of skeleton.m4 */
7634 #line 3500 "parser.y"
7636 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
7637 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7638 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7639 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7649 /* Line 1464 of skeleton.m4 */
7650 #line 3506 "parser.y"
7652 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7653 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7654 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7655 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7665 /* Line 1464 of skeleton.m4 */
7666 #line 3512 "parser.y"
7668 code_t*c = (yyvsp[(3) - (3)].value).c;
7670 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7674 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7677 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7678 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7688 /* Line 1464 of skeleton.m4 */
7689 #line 3525 "parser.y"
7690 { code_t*c = (yyvsp[(3) - (3)].value).c;
7691 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7692 c=abc_subtract_i(c);
7695 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7698 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0, 1);
7699 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7709 /* Line 1464 of skeleton.m4 */
7710 #line 3536 "parser.y"
7712 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7713 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7714 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0, 1);
7715 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7725 /* Line 1464 of skeleton.m4 */
7726 #line 3543 "parser.y"
7728 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7729 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7730 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7731 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7732 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7733 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7734 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7735 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7736 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7737 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7747 /* Line 1464 of skeleton.m4 */
7748 #line 3556 "parser.y"
7750 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7751 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7752 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7753 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7754 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7755 (yyval.value).c = abc_getlocal(0, nr);
7756 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7757 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7758 (yyval.value).c = abc_getlocal(0, nr);
7759 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7760 } else syntaxerror("internal error");
7762 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7763 c=abc_increment_i(c);
7769 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7770 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1, 1);
7771 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7782 /* Line 1464 of skeleton.m4 */
7783 #line 3583 "parser.y"
7785 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7786 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7787 c=abc_decrement_i(c);
7793 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7794 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1, 1);
7795 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7805 /* Line 1464 of skeleton.m4 */
7806 #line 3597 "parser.y"
7808 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7809 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7810 c=abc_increment_i(c);
7816 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7817 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0, 1);
7818 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7828 /* Line 1464 of skeleton.m4 */
7829 #line 3611 "parser.y"
7831 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7832 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7833 c=abc_decrement_i(c);
7839 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7840 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0, 1);
7841 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7851 /* Line 1464 of skeleton.m4 */
7852 #line 3626 "parser.y"
7853 { if(!state->cls->info)
7854 syntaxerror("super keyword not allowed outside a class");
7855 classinfo_t*t = state->cls->info->superclass;
7856 if(!t) t = TYPE_OBJECT;
7858 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7860 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7861 (yyval.value).c = 0;
7862 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7863 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7864 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7874 /* Line 1464 of skeleton.m4 */
7875 #line 3640 "parser.y"
7878 (yyval.value).c = abc_pushundefined(0);
7879 (yyval.value).t = 0;
7880 as3_warning("ignored @ operator");
7890 /* Line 1464 of skeleton.m4 */
7891 #line 3647 "parser.y"
7893 // child attribute TODO
7894 (yyval.value).c = abc_pushundefined(0);
7895 (yyval.value).t = 0;
7896 as3_warning("ignored .@ operator");
7906 /* Line 1464 of skeleton.m4 */
7907 #line 3654 "parser.y"
7909 // namespace declaration TODO
7910 (yyval.value).c = abc_pushundefined(0);
7911 (yyval.value).t = 0;
7912 as3_warning("ignored :: operator");
7922 /* Line 1464 of skeleton.m4 */
7923 #line 3661 "parser.y"
7926 (yyval.value).c = abc_pushundefined(0);
7927 (yyval.value).t = 0;
7928 as3_warning("ignored .. operator");
7938 /* Line 1464 of skeleton.m4 */
7939 #line 3668 "parser.y"
7942 (yyval.value).c = abc_pushundefined(0);
7943 (yyval.value).t = 0;
7944 as3_warning("ignored .() operator");
7954 /* Line 1464 of skeleton.m4 */
7955 #line 3683 "parser.y"
7957 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7958 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7960 if(TYPE_IS_CLASS(t) && t->data) {
7965 if(t->subtype==INFOTYPE_UNRESOLVED) {
7966 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
7968 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7970 if(f && !is_static != !(f->flags&FLAG_STATIC))
7972 if(f && f->slot && !noslot) {
7973 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7976 as3_warning("Access of undefined property '%s' in %s", (yyvsp[(3) - (3)].id), t->name);
7979 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7980 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7982 /* determine type */
7983 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7984 if(!(yyval.value).t)
7985 (yyval.value).c = abc_coerce_a((yyval.value).c);
7986 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
7987 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
7988 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
7990 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
7992 (yyval.value) = push_class(a);
7993 } else if(dict_contains(state->import_toplevel_packages, package2) ||
7994 registry_ispackage(package2)) {
7995 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7996 (yyval.value).c->data[0] = string_new4(package2);
7997 (yyval.value).t = 0;
7999 syntaxerror("couldn't resolve %s", package2);
8002 /* when resolving a property on an unknown type, we do know the
8003 name of the property (and don't seem to need the package), but
8004 we need to make avm2 try out all access modes */
8005 as3_warning("Resolving %s on unknown type", (yyvsp[(3) - (3)].id));
8006 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8007 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8008 (yyval.value).c = abc_coerce_a((yyval.value).c);
8009 (yyval.value).t = registry_getanytype();
8020 /* Line 1464 of skeleton.m4 */
8021 #line 3740 "parser.y"
8024 /* Queue unresolved identifiers for checking against the parent
8025 function's variables.
8026 We consider everything which is not a local variable "unresolved".
8027 This encompasses class names, members of the surrounding class
8028 etc. which is *correct* because local variables of the parent function
8031 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
8032 unknown_variable((yyvsp[(1) - (1)].id));
8035 /* let the compiler know that it might want to check the current directory/package
8036 for this identifier- maybe there's a file $1.as defining $1. */
8037 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
8040 (yyval.value).t = 0;
8041 (yyval.value).c = 0;
8046 /* look at variables */
8047 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
8048 // $1 is a local variable
8049 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
8050 (yyval.value).t = v->type;
8053 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
8054 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
8055 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
8056 (yyval.value).t = v->type;
8060 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
8062 /* look at current class' members */
8063 if(!state->method->inner &&
8065 (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
8066 (f->flags&FLAG_STATIC) >= i_am_static)
8068 // $1 is a function in this class
8069 int var_is_static = (f->flags&FLAG_STATIC);
8071 if(f->kind == INFOTYPE_METHOD) {
8072 (yyval.value).t = TYPE_FUNCTION(f);
8074 (yyval.value).t = f->type;
8076 if(var_is_static && !i_am_static) {
8077 /* access to a static member from a non-static location.
8078 do this via findpropstrict:
8079 there doesn't seem to be any non-lookup way to access
8080 static properties of a class */
8081 state->method->late_binding = 1;
8082 (yyval.value).t = f->type;
8083 namespace_t ns = {f->access, f->package};
8084 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8085 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8086 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8088 } else if(f->slot>0) {
8089 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8090 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8093 namespace_t ns = {f->access, f->package};
8094 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8095 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8096 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8101 /* look at actual classes, in the current package and imported */
8102 if((a = find_class((yyvsp[(1) - (1)].id)))) {
8103 (yyval.value) = push_class(a);
8107 /* look through package prefixes */
8108 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) ||
8109 registry_ispackage((yyvsp[(1) - (1)].id))) {
8110 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
8111 (yyval.value).t = 0;
8115 /* unknown object, let the avm2 resolve it */
8117 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
8118 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
8119 state->method->late_binding = 1;
8121 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
8123 (yyval.value).t = 0;
8124 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8125 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8136 /* Line 1464 of skeleton.m4 */
8137 #line 3849 "parser.y"
8140 NEW(namespace_decl_t,n);
8141 n->name = (yyvsp[(2) - (2)].id);
8142 n->url = (yyvsp[(2) - (2)].id);
8143 (yyval.namespace_decl)=n;
8153 /* Line 1464 of skeleton.m4 */
8154 #line 3856 "parser.y"
8157 NEW(namespace_decl_t,n);
8158 n->name = (yyvsp[(2) - (4)].id);
8159 n->url = (yyvsp[(4) - (4)].id);
8160 (yyval.namespace_decl)=n;
8170 /* Line 1464 of skeleton.m4 */
8171 #line 3863 "parser.y"
8174 NEW(namespace_decl_t,n);
8175 n->name = (yyvsp[(2) - (4)].id);
8176 n->url = (yyvsp[(4) - (4)].str).str;
8177 (yyval.namespace_decl)=n;
8187 /* Line 1464 of skeleton.m4 */
8188 #line 3870 "parser.y"
8191 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8193 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8194 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8195 var->type = TYPE_NAMESPACE;
8197 ns.access = ACCESS_NAMESPACE;
8198 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8199 var->value = constant_new_namespace(&ns);
8211 /* Line 1464 of skeleton.m4 */
8212 #line 3894 "parser.y"
8215 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8217 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8218 if(s->kind == INFOTYPE_UNRESOLVED) {
8219 s = (varinfo_t*)registry_resolve((slotinfo_t*)s);
8221 syntaxerror("Couldn't resolve namespace %s", (yyvsp[(3) - (3)].classinfo)->name);
8224 if(!s || s->kind != INFOTYPE_SLOT)
8225 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8226 if(!s->value || !NS_TYPE(s->value->type))
8227 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8228 url = s->value->ns->name;
8230 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8231 add_active_url(url);
8240 /* Line 1464 of skeleton.m4 */
8241 #line 8242 "parser.tab.c"
8244 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8248 YY_STACK_PRINT (yyss, yyssp);
8252 /* Now `shift' the result of the reduction. Determine what state
8253 that goes to, based on the state we popped back to and the rule
8254 number reduced by. */
8258 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8259 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8260 yystate = yytable[yystate];
8262 yystate = yydefgoto[yyn - YYNTOKENS];
8267 /*------------------------------------.
8268 | yyerrlab -- here on detecting error |
8269 `------------------------------------*/
8271 /* If not already recovering from an error, report this error. */
8275 #if ! YYERROR_VERBOSE
8276 yyerror (YY_("syntax error"));
8279 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8280 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8282 YYSIZE_T yyalloc = 2 * yysize;
8283 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8284 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8285 if (yymsg != yymsgbuf)
8286 YYSTACK_FREE (yymsg);
8287 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8289 yymsg_alloc = yyalloc;
8293 yymsg_alloc = sizeof yymsgbuf;
8297 if (0 < yysize && yysize <= yymsg_alloc)
8299 (void) yysyntax_error (yymsg, yystate, yychar);
8304 yyerror (YY_("syntax error"));
8306 goto yyexhaustedlab;
8314 if (yyerrstatus == 3)
8316 /* If just tried and failed to reuse lookahead token after an
8317 error, discard it. */
8319 if (yychar <= YYEOF)
8321 /* Return failure if at end of input. */
8322 if (yychar == YYEOF)
8327 yydestruct ("Error: discarding",
8333 /* Else will try to reuse lookahead token after shifting the error
8338 /*---------------------------------------------------.
8339 | yyerrorlab -- error raised explicitly by YYERROR. |
8340 `---------------------------------------------------*/
8343 /* Pacify compilers like GCC when the user code never invokes
8344 YYERROR and the label yyerrorlab therefore never appears in user
8346 if (/*CONSTCOND*/ 0)
8349 /* Do not reclaim the symbols of the rule which action triggered
8353 YY_STACK_PRINT (yyss, yyssp);
8358 /*-------------------------------------------------------------.
8359 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8360 `-------------------------------------------------------------*/
8362 yyerrstatus = 3; /* Each real token shifted decrements this. */
8366 yyn = yypact[yystate];
8367 if (yyn != YYPACT_NINF)
8370 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8378 /* Pop the current state because it cannot handle the error token. */
8383 yydestruct ("Error: popping",
8384 yystos[yystate], yyvsp);
8387 YY_STACK_PRINT (yyss, yyssp);
8393 /* Shift the error token. */
8394 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8400 /*-------------------------------------.
8401 | yyacceptlab -- YYACCEPT comes here. |
8402 `-------------------------------------*/
8407 /*-----------------------------------.
8408 | yyabortlab -- YYABORT comes here. |
8409 `-----------------------------------*/
8414 #if !defined(yyoverflow) || YYERROR_VERBOSE
8415 /*-------------------------------------------------.
8416 | yyexhaustedlab -- memory exhaustion comes here. |
8417 `-------------------------------------------------*/
8419 yyerror (YY_("memory exhausted"));
8425 if (yychar != YYEMPTY)
8426 yydestruct ("Cleanup: discarding lookahead",
8428 /* Do not reclaim the symbols of the rule which action triggered
8429 this YYABORT or YYACCEPT. */
8431 YY_STACK_PRINT (yyss, yyssp);
8432 while (yyssp != yyss)
8434 yydestruct ("Cleanup: popping",
8435 yystos[*yyssp], yyvsp);
8440 YYSTACK_FREE (yyss);
8443 if (yymsg != yymsgbuf)
8444 YYSTACK_FREE (yymsg);
8446 /* Make sure YYID is used. */
8447 return YYID (yyresult);