2 /* A Bison parser, made by GNU Bison 2.4. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4"
52 #define YYSKELETON_NAME "./skeleton.m4"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse a3_parse
69 #define yyerror a3_error
70 #define yylval a3_lval
71 #define yychar a3_char
72 #define yydebug a3_debug
73 #define yynerrs a3_nerrs
76 /* Copy the first part of user declarations. */
78 /* Line 198 of skeleton.m4 */
87 #include "tokenizer.h"
97 /* Line 198 of skeleton.m4 */
98 #line 99 "parser.tab.c"
100 /* Enabling traces. */
105 /* Enabling verbose error messages. */
106 #ifdef YYERROR_VERBOSE
107 # undef YYERROR_VERBOSE
108 # define YYERROR_VERBOSE 1
110 # define YYERROR_VERBOSE 1
113 /* Enabling the token table. */
114 #ifndef YYTOKEN_TABLE
115 # define YYTOKEN_TABLE 0
122 /* Put the tokens into the symbol table, so that GDB and other debuggers
220 below_semicolon = 353,
221 below_assignment = 354,
223 minusminus_prefix = 357,
224 plusplus_prefix = 358,
227 above_identifier = 361,
235 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
237 /* Line 223 of skeleton.m4 */
242 /* Line 223 of skeleton.m4 */
245 enum yytokentype token;
247 classinfo_t*classinfo;
248 classinfo_list_t*classinfo_list;
250 slotinfo_list_t*slotinfo_list;
253 unsigned int number_uint;
257 //typedcode_list_t*value_list;
258 codeandnumber_t value_list;
264 for_start_t for_start;
265 abc_exception_t *exception;
268 namespace_decl_t* namespace_decl;
270 abc_exception_list_t *l;
276 /* Line 223 of skeleton.m4 */
277 #line 278 "parser.tab.c"
279 # define YYSTYPE_IS_TRIVIAL 1
280 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
281 # define YYSTYPE_IS_DECLARED 1
285 /* Copy the second part of user declarations. */
287 /* Line 273 of skeleton.m4 */
291 static int a3_error(char*s)
293 syntaxerror("%s", s);
294 return 0; //make gcc happy
298 static char* concat2(const char* t1, const char* t2)
302 char*text = malloc(l1+l2+1);
303 memcpy(text , t1, l1);
304 memcpy(text+l1, t2, l2);
308 static char* concat3(const char* t1, const char* t2, const char* t3)
313 char*text = malloc(l1+l2+l3+1);
314 memcpy(text , t1, l1);
315 memcpy(text+l1, t2, l2);
316 memcpy(text+l1+l2, t3, l3);
321 typedef struct _import {
325 DECLARE_LIST(import);
327 DECLARE(methodstate);
328 DECLARE_LIST(methodstate);
330 typedef struct _classstate {
336 methodstate_t*static_init;
338 //code_t*static_init;
340 char has_constructor;
343 struct _methodstate {
353 dict_t*unresolved_variables;
356 char uses_parent_function;
361 int var_index; // for inner methods
362 int slot_index; // for inner methods
363 char is_a_slot; // for inner methods
368 abc_exception_list_t*exceptions;
370 methodstate_list_t*innerfunctions;
373 typedef struct _state {
378 import_list_t*wildcard_imports;
379 dict_t*import_toplevel_packages;
382 namespace_list_t*active_namespace_urls;
384 char has_own_imports;
385 char new_vars; // e.g. transition between two functions
388 methodstate_t*method;
397 typedef struct _global {
401 dict_t*file2token2info;
404 static global_t*global = 0;
405 static state_t* state = 0;
409 #define MULTINAME(m,x) \
413 registry_fill_multiname(&m, &m##_ns, (slotinfo_t*)(x));
415 #define MEMBER_MULTINAME(m,f,n) \
419 if((m##_ns.access = ((slotinfo_t*)(f))->access)==ACCESS_NAMESPACE) \
420 m##_ns.name = ((slotinfo_t*)(f))->package; \
425 m.namespace_set = 0; \
426 m.name = ((slotinfo_t*)(f))->name; \
428 m.type = MULTINAME; \
430 m.namespace_set = &nopackage_namespace_set; \
434 /* warning: list length of namespace set is undefined */
435 #define MULTINAME_LATE(m, access, package) \
436 namespace_t m##_ns = {access, package}; \
437 namespace_set_t m##_nsset; \
438 namespace_list_t m##_l;m##_l.next = 0; \
439 m##_nsset.namespaces = &m##_l; \
440 m##_nsset = m##_nsset; \
441 m##_l.namespace = &m##_ns; \
442 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
444 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
445 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
446 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
447 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
448 static namespace_list_t nl4 = {&ns4,0};
449 static namespace_list_t nl3 = {&ns3,&nl4};
450 static namespace_list_t nl2 = {&ns2,&nl3};
451 static namespace_list_t nl1 = {&ns1,&nl2};
452 static namespace_set_t nopackage_namespace_set = {&nl1};
454 static void new_state()
457 state_t*oldstate = state;
459 memcpy(s, state, sizeof(state_t)); //shallow copy
461 s->imports = dict_new();
463 if(!s->import_toplevel_packages) {
464 s->import_toplevel_packages = dict_new();
468 state->has_own_imports = 0;
469 state->vars = dict_new();
470 state->old = oldstate;
473 trie_remember(active_namespaces);
476 state->active_namespace_urls = list_clone(oldstate->active_namespace_urls);
478 static void state_has_imports()
480 state->wildcard_imports = list_clone(state->wildcard_imports);
481 state->imports = dict_clone(state->imports);
482 state->has_own_imports = 1;
484 static void import_toplevel(const char*package)
486 char* s = strdup(package);
488 dict_put(state->import_toplevel_packages, s, 0);
489 char*x = strrchr(s, '.');
497 static void state_destroy(state_t*state)
499 if(state->has_own_imports) {
500 list_free(state->wildcard_imports);
501 dict_destroy(state->imports);state->imports=0;
503 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
504 dict_destroy(state->imports);state->imports=0;
508 for(t=0;t<state->vars->hashsize;t++) {
509 dictentry_t*e =state->vars->slots[t];
511 free(e->data);e->data=0;
515 dict_destroy(state->vars);state->vars=0;
518 list_free(state->active_namespace_urls)
519 state->active_namespace_urls = 0;
524 static void old_state()
526 trie_rollback(active_namespaces);
528 if(!state || !state->old)
529 syntaxerror("invalid nesting");
530 state_t*leaving = state;
534 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
535 free(leaving->method);
538 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
543 state_destroy(leaving);
546 static code_t* method_header(methodstate_t*m);
547 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
548 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0);
551 static char* internal_filename_package = 0;
552 void initialize_file(char*filename)
555 syntaxerror("invalid call to initialize_file during parsing of another file");
558 active_namespaces = trie_new();
561 state->package = internal_filename_package = strdup(filename);
563 global->token2info = dict_lookup(global->file2token2info,
564 current_filename // use long version
566 if(!global->token2info) {
567 global->token2info = dict_new2(&ptr_type);
568 dict_put(global->file2token2info, current_filename, global->token2info);
572 state->method = rfx_calloc(sizeof(methodstate_t));
573 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
574 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
576 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
577 function_initvars(state->method, 0, 0, 1);
578 global->init = abc_initscript(global->file);
584 if(!state || state->level!=1) {
585 syntaxerror("unexpected end of file in pass %d", as3_pass);
589 code_t*header = method_header(state->method);
590 code_t*c = wrap_function(header, 0, global->init->method->body->code);
591 global->init->method->body->code = c;
592 free(state->method);state->method=0;
595 //free(state->package);state->package=0; // used in registry
596 state_destroy(state);state=0;
599 void initialize_parser()
601 global = rfx_calloc(sizeof(global_t));
602 global->file = abc_file_new();
603 global->file->flags &= ~ABCFILE_LAZY;
604 global->file2token2info = dict_new();
605 global->token2info = 0;
608 void* finish_parser()
610 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
612 global->token2info=0;
618 static void xx_scopetest()
620 /* findpropstrict doesn't just return a scope object- it
621 also makes it "active" somehow. Push local_0 on the
622 scope stack and read it back with findpropstrict, it'll
623 contain properties like "trace". Trying to find the same
624 property on a "vanilla" local_0 yields only a "undefined" */
625 //c = abc_findpropstrict(c, "[package]::trace");
627 /*c = abc_getlocal_0(c);
628 c = abc_findpropstrict(c, "[package]::trace");
630 c = abc_setlocal_1(c);
632 c = abc_pushbyte(c, 0);
633 c = abc_setlocal_2(c);
635 code_t*xx = c = abc_label(c);
636 c = abc_findpropstrict(c, "[package]::trace");
637 c = abc_pushstring(c, "prop:");
638 c = abc_hasnext2(c, 1, 2);
640 c = abc_setlocal_3(c);
641 c = abc_callpropvoid(c, "[package]::trace", 2);
642 c = abc_getlocal_3(c);
644 c = abc_iftrue(c,xx);*/
647 typedef struct _variable {
651 methodstate_t*is_inner_method;
654 static variable_t* find_variable(state_t*s, char*name)
658 v = dict_lookup(s->vars, name);
660 if(s->new_vars) break;
665 static variable_t* find_slot(state_t*s, const char*name)
667 if(s->method && s->method->slots)
668 return dict_lookup(s->method->slots, name);
672 static variable_t* find_variable_safe(state_t*s, char*name)
674 variable_t* v = find_variable(s, name);
676 syntaxerror("undefined variable: %s", name);
679 static char variable_exists(char*name)
681 return dict_contains(state->vars, name);
683 code_t*defaultvalue(code_t*c, classinfo_t*type);
685 static int alloc_local()
687 return state->method->variable_count++;
690 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
693 variable_t*v = find_slot(state, name);
699 v->index = alloc_local();
704 dict_put(state->vars, name, v);
708 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
710 return new_variable2(name, type, init, maybeslot)->index;
713 #define TEMPVARNAME "__as3_temp__"
714 static int gettempvar()
716 variable_t*v = find_variable(state, TEMPVARNAME);
719 return new_variable(TEMPVARNAME, 0, 0, 0);
722 code_t* var_block(code_t*body)
728 for(t=0;t<state->vars->hashsize;t++) {
729 dictentry_t*e = state->vars->slots[t];
731 variable_t*v = (variable_t*)e->data;
732 if(v->type && v->init) {
733 c = defaultvalue(c, v->type);
734 c = abc_setlocal(c, v->index);
735 k = abc_kill(k, v->index);
745 if(x->opcode== OPCODE___BREAK__ ||
746 x->opcode== OPCODE___CONTINUE__) {
747 /* link kill code before break/continue */
748 code_t*e = code_dup(k);
749 code_t*s = code_start(e);
761 c = code_append(c, body);
762 c = code_append(c, k);
766 void unknown_variable(char*name)
768 if(!state->method->unresolved_variables)
769 state->method->unresolved_variables = dict_new();
770 if(!dict_contains(state->method->unresolved_variables, name))
771 dict_put(state->method->unresolved_variables, name, 0);
774 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
776 static void parsererror(const char*file, int line, const char*f)
778 syntaxerror("internal error in %s, %s:%d", f, file, line);
782 static code_t* add_scope_code(code_t*c, methodstate_t*m)
784 if(m->uses_slots || (m->late_binding && !m->inner)) {
785 c = abc_getlocal_0(c);
786 c = abc_pushscope(c);
789 /* FIXME: does this need to be the same activation object as
790 in the function header? */
791 c = abc_newactivation(c);
792 c = abc_pushscope(c);
797 static code_t* method_header(methodstate_t*m)
801 c = add_scope_code(c, m);
803 methodstate_list_t*l = m->innerfunctions;
805 parserassert(l->methodstate->abc);
806 if(m->uses_slots && l->methodstate->is_a_slot) {
807 c = abc_getscopeobject(c, 1);
808 c = abc_newfunction(c, l->methodstate->abc);
810 c = abc_setlocal(c, l->methodstate->var_index);
811 c = abc_setslot(c, l->methodstate->slot_index);
813 c = abc_newfunction(c, l->methodstate->abc);
814 c = abc_setlocal(c, l->methodstate->var_index);
816 free(l->methodstate);l->methodstate=0;
820 c = code_append(c, m->header);
823 if(m->is_constructor && !m->has_super) {
824 // call default constructor
825 c = abc_getlocal_0(c);
826 c = abc_constructsuper(c, 0);
828 list_free(m->innerfunctions);
829 m->innerfunctions = 0;
834 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
836 c = code_append(c, header);
837 c = code_append(c, var_block(body));
838 /* append return if necessary */
839 if(!c || (c->opcode != OPCODE_RETURNVOID &&
840 c->opcode != OPCODE_RETURNVALUE)) {
841 c = abc_returnvoid(c);
847 static void startpackage(char*name)
850 /*printf("entering package \"%s\"\n", name);*/
851 state->package = strdup(name);
853 static void endpackage()
855 /*printf("leaving package \"%s\"\n", state->package);*/
857 //used e.g. in classinfo_register:
858 //free(state->package);state->package=0;
863 #define FLAG_PUBLIC 256
864 #define FLAG_PROTECTED 512
865 #define FLAG_PRIVATE 1024
866 #define FLAG_PACKAGEINTERNAL 2048
867 #define FLAG_NAMESPACE 4096
869 static namespace_t modifiers2access(modifiers_t*mod)
874 if(mod->flags&FLAG_NAMESPACE) {
875 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
876 syntaxerror("invalid combination of access levels and namespaces");
877 ns.access = ACCESS_NAMESPACE;
879 const char*url = (const char*)trie_lookup(active_namespaces, mod->ns);
881 /* shouldn't happen- the tokenizer only reports something as a namespace
882 if it was already registered */
883 trie_dump(active_namespaces);
884 syntaxerror("unknown namespace: %s", mod->ns);
887 } else if(mod->flags&FLAG_PUBLIC) {
888 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
889 syntaxerror("invalid combination of access levels");
890 ns.access = ACCESS_PACKAGE;
891 } else if(mod->flags&FLAG_PRIVATE) {
892 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
893 syntaxerror("invalid combination of access levels");
894 ns.access = ACCESS_PRIVATE;
895 } else if(mod->flags&FLAG_PROTECTED) {
896 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
897 syntaxerror("invalid combination of access levels");
898 ns.access = ACCESS_PROTECTED;
900 ns.access = ACCESS_PACKAGEINTERNAL;
904 static slotinfo_t* find_class(const char*name);
906 static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse)
908 return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse);
911 void add_active_url(const char*url)
915 list_append(state->active_namespace_urls, n);
918 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
923 index = new_variable("this", 0, 0, 0);
924 else if(!m->is_global)
925 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
927 index = new_variable("globalscope", 0, 0, 0);
930 parserassert(!index);
934 /* as variables and slots share the same number, make sure
935 that those variable indices are reserved. It's up to the
936 optimizer to later shuffle the variables down to lower
938 m->variable_count = m->uses_slots;
943 for(p=params->list;p;p=p->next) {
944 new_variable(p->param->name, p->param->type, 0, 1);
949 m->scope_code = add_scope_code(m->scope_code, m);
953 methodstate_list_t*l = m->innerfunctions;
955 methodstate_t*m = l->methodstate;
957 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
958 m->var_index = v->index;
959 m->slot_index = v->index;
960 v->is_inner_method = m;
965 if(as3_pass==2 && m->slots) {
966 /* exchange unresolved identifiers with the actual objects */
967 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
968 if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
969 v->type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
970 if(!v->type || v->type->kind != INFOTYPE_CLASS) {
971 syntaxerror("Couldn't find class %s", v->type->name);
979 char*as3_globalclass=0;
980 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
983 syntaxerror("inner classes now allowed");
988 classinfo_list_t*mlist=0;
990 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
991 syntaxerror("invalid modifier(s)");
993 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
994 syntaxerror("public and internal not supported at the same time.");
996 //if(!(mod->flags&FLAG_INTERFACE) && !extends) {
997 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
998 // all classes extend object
999 extends = registry_getobjectclass();
1002 /* create the class name, together with the proper attributes */
1006 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
1007 access = ACCESS_PRIVATE; package = internal_filename_package;
1008 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
1009 access = ACCESS_PACKAGEINTERNAL; package = state->package;
1010 } else if(state->package!=internal_filename_package) {
1011 access = ACCESS_PACKAGE; package = state->package;
1013 syntaxerror("public classes only allowed inside a package");
1017 state->cls = rfx_calloc(sizeof(classstate_t));
1018 state->cls->init = rfx_calloc(sizeof(methodstate_t));
1019 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
1020 /* notice: we make no effort to initialize the top variable (local0) here,
1021 even though it has special meaning. We just rely on the facat
1022 that pass 1 won't do anything with variables */
1024 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
1026 /* set current method to constructor- all code within the class-level (except
1027 static variable initializations) will be executed during construction time */
1028 state->method = state->cls->init;
1030 if(registry_find(package, classname)) {
1031 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
1033 /* build info struct */
1034 int num_interfaces = (list_length(implements));
1035 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
1036 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
1039 classinfo_list_t*l = implements;
1040 for(l=implements;l;l=l->next) {
1041 state->cls->info->interfaces[pos++] = l->classinfo;
1046 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1048 state->method = state->cls->init;
1049 parserassert(state->cls && state->cls->info);
1051 function_initvars(state->cls->init, 0, 0, 1);
1052 function_initvars(state->cls->static_init, 0, 0, 0);
1054 if(extends && (extends->flags & FLAG_FINAL))
1055 syntaxerror("Can't extend final class '%s'", extends->name);
1058 while(state->cls->info->interfaces[pos]) {
1059 if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE))
1060 syntaxerror("'%s' is not an interface",
1061 state->cls->info->interfaces[pos]->name);
1065 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
1066 state->cls->info->superclass = extends;
1068 /* generate the abc code for this class */
1069 MULTINAME(classname2,state->cls->info);
1070 multiname_t*extends2 = sig2mname(extends);
1072 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1073 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1074 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1075 if(state->cls->info->flags&FLAG_INTERFACE) {
1076 abc_class_interface(state->cls->abc);
1079 abc_class_protectedNS(state->cls->abc, classname);
1081 for(mlist=implements;mlist;mlist=mlist->next) {
1082 MULTINAME(m, mlist->classinfo);
1083 abc_class_add_interface(state->cls->abc, &m);
1086 /* write the construction code for this class to the global init
1088 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1090 abc_method_body_t*m = global->init->method->body;
1091 __ getglobalscope(m);
1092 classinfo_t*s = extends;
1097 //TODO: take a look at the current scope stack, maybe
1098 // we can re-use something
1103 multiname_t*s2 = sig2mname(s);
1105 multiname_destroy(s2);
1107 __ pushscope(m); count++;
1108 m->code = m->code->prev->prev; // invert
1110 /* continue appending after last op end */
1111 while(m->code && m->code->next) m->code = m->code->next;
1113 /* TODO: if this is one of *our* classes, we can also
1114 do a getglobalscope/getslot <nr> (which references
1115 the init function's slots) */
1117 __ getlex2(m, extends2);
1119 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1120 stack is not the superclass */
1121 __ pushscope(m);count++;
1124 /* notice: we get a verify error #1107 if the top element on the scope
1125 stack is not the global object */
1127 __ pushscope(m);count++;
1129 __ newclass(m,state->cls->abc);
1133 __ setslot(m, slotindex);
1134 multiname_destroy(extends2);
1136 /* flash.display.MovieClip handling */
1138 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1139 if(state->package && state->package[0]) {
1140 as3_globalclass = concat3(state->package, ".", classname);
1142 as3_globalclass = strdup(classname);
1148 static int slotstate_varconst = 0;
1149 static modifiers_t*slotstate_flags = 0;
1150 static void setslotstate(modifiers_t* flags, int varconst)
1152 slotstate_varconst = varconst;
1153 slotstate_flags = flags;
1155 if(flags && flags->flags&FLAG_STATIC) {
1156 state->method = state->cls->static_init;
1158 state->method = state->cls->init;
1161 parserassert(state->method);
1165 static void endclass()
1168 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1170 c = abc_getlocal_0(c);
1171 c = abc_constructsuper(c, 0);
1172 state->cls->init->header = code_append(state->cls->init->header, c);
1173 state->cls->has_constructor=1;
1175 if(state->cls->init) {
1176 if(state->cls->info->flags&FLAG_INTERFACE) {
1177 if(state->cls->init->header)
1178 syntaxerror("interface can not have class-level code");
1180 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1181 code_t*c = method_header(state->cls->init);
1182 m->body->code = wrap_function(c, 0, m->body->code);
1185 if(state->cls->static_init) {
1186 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1187 code_t*c = method_header(state->cls->static_init);
1188 m->body->code = wrap_function(c, 0, m->body->code);
1195 void check_code_for_break(code_t*c)
1198 if(c->opcode == OPCODE___BREAK__) {
1199 char*name = string_cstr(c->data[0]);
1200 syntaxerror("Unresolved \"break %s\"", name);
1202 if(c->opcode == OPCODE___CONTINUE__) {
1203 char*name = string_cstr(c->data[0]);
1204 syntaxerror("Unresolved \"continue %s\"", name);
1206 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1207 char*name = string_cstr(c->data[0]);
1208 syntaxerror("Can't reference a package (%s) as such", name);
1215 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1218 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1219 if(TYPE_IS_NUMBER(t)) {
1220 xassert(c->type == CONSTANT_FLOAT
1221 || c->type == CONSTANT_INT
1222 || c->type == CONSTANT_UINT);
1223 } else if(TYPE_IS_UINT(t)) {
1224 xassert(c->type == CONSTANT_UINT ||
1225 (c->type == CONSTANT_INT && c->i>=0));
1226 } else if(TYPE_IS_INT(t)) {
1227 xassert(c->type == CONSTANT_INT);
1228 } else if(TYPE_IS_BOOLEAN(t)) {
1229 xassert(c->type == CONSTANT_TRUE
1230 || c->type == CONSTANT_FALSE);
1234 static void check_override(memberinfo_t*m, int flags)
1238 if(m->parent == state->cls->info)
1239 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1241 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1242 if(m->access==ACCESS_PRIVATE)
1244 if(m->flags & FLAG_FINAL)
1245 syntaxerror("can't override final member %s", m->name);
1247 /* allow this. it's no issue.
1248 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1249 syntaxerror("can't override static member %s", m->name);*/
1251 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1252 syntaxerror("can't override non-static member %s with static declaration", m->name);
1254 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1255 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1256 if(m->kind == INFOTYPE_METHOD)
1257 syntaxerror("can't override without explicit 'override' declaration");
1259 syntaxerror("can't override '%s'", m->name);
1264 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1266 methodinfo_t*minfo = 0;
1267 namespace_t ns = modifiers2access(mod);
1270 minfo = methodinfo_register_global(ns.access, state->package, name);
1271 minfo->return_type = 0; // save this for pass 2
1272 } else if(getset != KW_GET && getset != KW_SET) {
1274 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1276 printf("%s.%s | %s.%s\n",
1277 m->package, m->name,
1279 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1281 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1282 minfo->return_type = 0; // save this for pass 2
1283 // getslot on a member slot only returns "undefined", so no need
1284 // to actually store these
1285 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1287 //class getter/setter
1288 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1290 if(getset == KW_GET) {
1292 } else if(params->list && params->list->param && !params->list->next) {
1293 type = params->list->param->type;
1295 syntaxerror("setter function needs to take exactly one argument");
1296 // not sure wether to look into superclasses here, too
1297 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1299 if(minfo->kind!=INFOTYPE_SLOT)
1300 syntaxerror("class already contains a method called '%s'", name);
1301 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1302 syntaxerror("class already contains a field called '%s'", name);
1303 if(minfo->subtype & gs)
1304 syntaxerror("getter/setter for '%s' already defined", name);
1305 /* make a setter or getter into a getset */
1306 minfo->subtype |= gs;
1309 FIXME: this check needs to be done in pass 2
1311 if((!minfo->return_type != !type) ||
1312 (minfo->return_type && type &&
1313 !strcmp(minfo->return_type->name, type->name))) {
1314 syntaxerror("different type in getter and setter: %s and %s",
1315 minfo->return_type?minfo->return_type->name:"*",
1316 type?type->name:"*");
1319 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1320 minfo->kind = INFOTYPE_SLOT; //hack
1321 minfo->subtype = gs;
1322 minfo->return_type = 0;
1324 /* can't assign a slot as getter and setter might have different slots */
1325 //minfo->slot = slot;
1327 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1328 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1329 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1334 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1336 //parserassert(state->method && state->method->info);
1338 methodstate_t*parent_method = state->method;
1341 return_type = 0; // not valid in pass 1
1345 state->new_vars = 1;
1348 state->method = rfx_calloc(sizeof(methodstate_t));
1349 state->method->inner = 1;
1350 state->method->variable_count = 0;
1351 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1353 NEW(methodinfo_t,minfo);
1354 minfo->kind = INFOTYPE_METHOD;
1355 minfo->access = ACCESS_PACKAGEINTERNAL;
1357 state->method->info = minfo;
1360 list_append(parent_method->innerfunctions, state->method);
1362 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1364 function_initvars(state->method, params, 0, 1);
1368 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1369 state->method->variable_count = 0;
1370 parserassert(state->method);
1372 state->method->info->return_type = return_type;
1373 function_initvars(state->method, params, 0, 1);
1377 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1378 params_t*params, classinfo_t*return_type)
1380 if(state->method && state->method->info) {
1381 syntaxerror("not able to start another method scope");
1384 state->new_vars = 1;
1387 state->method = rfx_calloc(sizeof(methodstate_t));
1388 state->method->has_super = 0;
1391 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1393 state->method->is_global = 1;
1394 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1396 if(state->method->is_constructor)
1397 name = "__as3_constructor__";
1399 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1401 function_initvars(state->method, params, mod->flags, 1);
1403 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1407 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1408 state->method->variable_count = 0;
1409 parserassert(state->method);
1412 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1413 check_override(m, mod->flags);
1417 state->cls->has_constructor |= state->method->is_constructor;
1420 state->method->info->return_type = return_type;
1421 function_initvars(state->method, params, mod->flags, 1);
1425 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1426 params_t*params, classinfo_t*return_type, code_t*body)
1429 // store inner methods in variables
1430 function_initvars(state->method, 0, 0, 0);
1432 methodstate_list_t*ml = state->method->innerfunctions;
1434 dict_t*xvars = dict_new();
1437 methodstate_t*m = ml->methodstate;
1438 parserassert(m->inner);
1439 if(m->unresolved_variables) {
1440 dict_t*d = m->unresolved_variables;
1442 for(t=0;t<d->hashsize;t++) {
1443 dictentry_t*l = d->slots[t];
1445 /* check parent method's variables */
1447 if((v=find_variable(state, l->key))) {
1448 m->uses_parent_function = 1;
1449 state->method->uses_slots = 1;
1450 dict_put(xvars, l->key, 0);
1457 dict_destroy(m->unresolved_variables);
1458 m->unresolved_variables = 0;
1463 if(state->method->uses_slots) {
1464 state->method->slots = dict_new();
1466 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1467 if(!name) syntaxerror("internal error");
1468 if(v->index && dict_contains(xvars, name)) {
1471 if(v->is_inner_method) {
1472 v->is_inner_method->is_a_slot = 1;
1475 dict_put(state->method->slots, name, v);
1478 state->method->uses_slots = i;
1479 dict_destroy(state->vars);state->vars = 0;
1486 /*if(state->method->uses_parent_function){
1487 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1492 multiname_t*type2 = sig2mname(return_type);
1494 if(state->method->inner) {
1495 f = state->method->abc;
1496 abc_method_init(f, global->file, type2, 1);
1497 } else if(state->method->is_constructor) {
1498 f = abc_class_getconstructor(state->cls->abc, type2);
1499 } else if(!state->method->is_global) {
1500 namespace_t mname_ns = modifiers2access(mod);
1501 multiname_t mname = {QNAME, &mname_ns, 0, name};
1503 if(mod->flags&FLAG_STATIC)
1504 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1506 f = abc_class_method(state->cls->abc, type2, &mname);
1507 slot = f->trait->slot_id;
1509 namespace_t mname_ns = {state->method->info->access, state->package};
1510 multiname_t mname = {QNAME, &mname_ns, 0, name};
1512 f = abc_method_new(global->file, type2, 1);
1513 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1514 //abc_code_t*c = global->init->method->body->code;
1516 //flash doesn't seem to allow us to access function slots
1517 //state->method->info->slot = slot;
1519 if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1520 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1521 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1522 if(params->varargs) f->flags |= METHOD_NEED_REST;
1526 for(p=params->list;p;p=p->next) {
1527 if(params->varargs && !p->next) {
1528 break; //varargs: omit last parameter in function signature
1530 multiname_t*m = sig2mname(p->param->type);
1531 list_append(f->parameters, m);
1532 if(p->param->value) {
1533 check_constant_against_type(p->param->type, p->param->value);
1534 opt=1;list_append(f->optional_parameters, p->param->value);
1536 syntaxerror("non-optional parameter not allowed after optional parameters");
1539 if(state->method->slots) {
1540 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1542 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1543 multiname_t*type = sig2mname(v->type);
1544 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1545 t->slot_id = v->index;
1550 check_code_for_break(body);
1552 /* Seems this works now.
1553 if(state->method->exceptions && state->method->uses_slots) {
1554 as3_warning("try/catch and activation not supported yet within the same method");
1558 f->body->code = body;
1559 f->body->exceptions = state->method->exceptions;
1560 } else { //interface
1562 syntaxerror("interface methods can't have a method body");
1572 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1577 void breakjumpsto(code_t*c, char*name, code_t*jump)
1580 if(c->opcode == OPCODE___BREAK__) {
1581 string_t*name2 = c->data[0];
1582 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1583 c->opcode = OPCODE_JUMP;
1590 void continuejumpsto(code_t*c, char*name, code_t*jump)
1593 if(c->opcode == OPCODE___CONTINUE__) {
1594 string_t*name2 = c->data[0];
1595 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1596 c->opcode = OPCODE_JUMP;
1604 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1605 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1606 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1608 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1610 if(!type1 || !type2)
1611 return registry_getanytype();
1612 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1613 return registry_getanytype();
1616 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1625 return registry_getanytype();
1627 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1632 return abc_coerce_a(c);
1636 // cast an "any" type to a specific type. subject to
1637 // runtime exceptions
1638 return abc_coerce2(c, &m);
1641 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1642 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1643 // allow conversion between number types
1644 return abc_coerce2(c, &m);
1646 //printf("%s.%s\n", from.package, from.name);
1647 //printf("%s.%s\n", to.package, to.name);
1649 classinfo_t*supertype = from;
1651 if(supertype == to) {
1652 // target type is one of from's superclasses
1653 return abc_coerce2(c, &m);
1656 while(supertype->interfaces[t]) {
1657 if(supertype->interfaces[t]==to) {
1658 // target type is one of from's interfaces
1659 return abc_coerce2(c, &m);
1663 supertype = supertype->superclass;
1665 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1667 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1669 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1672 as3_error("can't convert type %s%s%s to %s%s%s",
1673 from->package, from->package?".":"", from->name,
1674 to->package, to->package?".":"", to->name);
1678 code_t*defaultvalue(code_t*c, classinfo_t*type)
1680 if(TYPE_IS_INT(type)) {
1681 c = abc_pushbyte(c, 0);
1682 } else if(TYPE_IS_UINT(type)) {
1683 c = abc_pushuint(c, 0);
1684 } else if(TYPE_IS_FLOAT(type)) {
1686 } else if(TYPE_IS_BOOLEAN(type)) {
1687 c = abc_pushfalse(c);
1689 //c = abc_pushundefined(c);
1691 c = abc_pushnull(c);
1693 c = abc_coerce2(c, &m);
1698 char is_pushundefined(code_t*c)
1700 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1703 static const char* get_package_from_name(const char*name)
1705 /* try explicit imports */
1706 dictentry_t* e = dict_get_slot(state->imports, name);
1708 if(!strcmp(e->key, name)) {
1709 slotinfo_t*c = (slotinfo_t*)e->data;
1710 if(c) return c->package;
1716 static namespace_list_t*get_current_imports()
1718 namespace_list_t*searchlist = 0;
1720 list_append(searchlist, namespace_new_package(state->package));
1722 import_list_t*l = state->wildcard_imports;
1724 namespace_t*ns = namespace_new_package(l->import->package);
1725 list_append(searchlist, ns);
1728 list_append(searchlist, namespace_new_package(""));
1729 list_append(searchlist, namespace_new_package(internal_filename_package));
1733 static slotinfo_t* find_class(const char*name)
1737 c = registry_find(state->package, name);
1740 /* try explicit imports */
1741 dictentry_t* e = dict_get_slot(state->imports, name);
1744 if(!strcmp(e->key, name)) {
1745 c = (slotinfo_t*)e->data;
1751 /* try package.* imports */
1752 import_list_t*l = state->wildcard_imports;
1754 //printf("does package %s contain a class %s?\n", l->import->package, name);
1755 c = registry_find(l->import->package, name);
1760 /* try global package */
1761 c = registry_find("", name);
1764 /* try local "filename" package */
1765 c = registry_find(internal_filename_package, name);
1770 typedcode_t push_class(slotinfo_t*a)
1775 if(a->access == ACCESS_PACKAGEINTERNAL &&
1776 strcmp(a->package, state->package) &&
1777 strcmp(a->package, internal_filename_package)
1779 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1780 infotypename(a), a->name, a->package, state->package);
1783 if(a->kind != INFOTYPE_CLASS) {
1785 x.c = abc_findpropstrict2(x.c, &m);
1786 x.c = abc_getproperty2(x.c, &m);
1787 if(a->kind == INFOTYPE_METHOD) {
1788 methodinfo_t*f = (methodinfo_t*)a;
1789 x.t = TYPE_FUNCTION(f);
1791 varinfo_t*v = (varinfo_t*)a;
1795 classinfo_t*c = (classinfo_t*)a;
1797 x.c = abc_getglobalscope(x.c);
1798 x.c = abc_getslot(x.c, c->slot);
1801 x.c = abc_getlex2(x.c, &m);
1803 x.t = TYPE_CLASS(c);
1808 static char is_getlocal(code_t*c)
1810 if(!c || c->prev || c->next)
1812 return(c->opcode == OPCODE_GETLOCAL
1813 || c->opcode == OPCODE_GETLOCAL_0
1814 || c->opcode == OPCODE_GETLOCAL_1
1815 || c->opcode == OPCODE_GETLOCAL_2
1816 || c->opcode == OPCODE_GETLOCAL_3);
1818 static int getlocalnr(code_t*c)
1820 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1821 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1822 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1823 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1824 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1825 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1829 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1833 [prefix code] [read instruction]
1837 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1839 if(in && in->opcode == OPCODE_COERCE_A) {
1840 in = code_cutlast(in);
1843 syntaxerror("internal error");
1845 /* chop off read instruction */
1849 prefix = r->prev;r->prev = 0;
1855 char use_temp_var = readbefore;
1857 /* generate the write instruction, and maybe append a dup to the prefix code */
1858 code_t* write = abc_nop(0);
1859 if(r->opcode == OPCODE_GETPROPERTY) {
1860 write->opcode = OPCODE_SETPROPERTY;
1861 multiname_t*m = (multiname_t*)r->data[0];
1862 write->data[0] = multiname_clone(m);
1863 if(m->type == QNAME || m->type == MULTINAME) {
1865 prefix = abc_dup(prefix); // we need the object, too
1868 } else if(m->type == MULTINAMEL) {
1870 /* dupping two values on the stack requires 5 operations and one register-
1871 couldn't adobe just have given us a dup2? */
1872 int temp = gettempvar();
1873 prefix = abc_setlocal(prefix, temp);
1874 prefix = abc_dup(prefix);
1875 prefix = abc_getlocal(prefix, temp);
1876 prefix = abc_swap(prefix);
1877 prefix = abc_getlocal(prefix, temp);
1879 prefix = abc_kill(prefix, temp);
1883 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1885 } else if(r->opcode == OPCODE_GETSLOT) {
1886 write->opcode = OPCODE_SETSLOT;
1887 write->data[0] = r->data[0];
1889 prefix = abc_dup(prefix); // we need the object, too
1892 } else if(r->opcode == OPCODE_GETLOCAL) {
1893 write->opcode = OPCODE_SETLOCAL;
1894 write->data[0] = r->data[0];
1895 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1896 write->opcode = OPCODE_SETLOCAL_0;
1897 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1898 write->opcode = OPCODE_SETLOCAL_1;
1899 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1900 write->opcode = OPCODE_SETLOCAL_2;
1901 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1902 write->opcode = OPCODE_SETLOCAL_3;
1903 } else if(r->opcode == OPCODE_GETSUPER) {
1904 write->opcode = OPCODE_SETSUPER;
1905 multiname_t*m = (multiname_t*)r->data[0];
1906 write->data[0] = multiname_clone(m);
1909 syntaxerror("illegal lvalue: can't assign a value to this expression");
1916 /* with getproperty/getslot, we have to be extra careful not
1917 to execute the read code twice, as it might have side-effects
1918 (e.g. if the property is in fact a setter/getter combination)
1920 So read the value, modify it, and write it again,
1921 using prefix only once and making sure (by using a temporary
1922 register) that the return value is what we just wrote */
1923 temp = gettempvar();
1924 c = code_append(c, prefix);
1925 c = code_append(c, r);
1928 c = abc_setlocal(c, temp);
1930 c = code_append(c, middlepart);
1933 c = abc_setlocal(c, temp);
1935 c = code_append(c, write);
1936 c = abc_getlocal(c, temp);
1937 c = abc_kill(c, temp);
1939 /* if we're allowed to execute the read code twice *and*
1940 the middlepart doesn't modify the code, things are easier.
1942 code_t* r2 = code_dup(r);
1943 //c = code_append(c, prefix);
1944 parserassert(!prefix);
1945 c = code_append(c, r);
1946 c = code_append(c, middlepart);
1947 c = code_append(c, write);
1948 c = code_append(c, r2);
1951 /* even smaller version: overwrite the value without reading
1955 c = code_append(c, prefix);
1958 c = code_append(c, middlepart);
1959 c = code_append(c, write);
1960 c = code_append(c, r);
1963 temp = gettempvar();
1965 c = code_append(c, prefix);
1967 c = code_append(c, middlepart);
1969 c = abc_setlocal(c, temp);
1970 c = code_append(c, write);
1971 c = abc_getlocal(c, temp);
1972 c = abc_kill(c, temp);
1978 char is_break_or_jump(code_t*c)
1982 if(c->opcode == OPCODE_JUMP ||
1983 c->opcode == OPCODE___BREAK__ ||
1984 c->opcode == OPCODE___CONTINUE__ ||
1985 c->opcode == OPCODE_THROW ||
1986 c->opcode == OPCODE_RETURNVOID ||
1987 c->opcode == OPCODE_RETURNVALUE) {
1993 #define IS_FINALLY_TARGET(op) \
1994 ((op) == OPCODE___CONTINUE__ || \
1995 (op) == OPCODE___BREAK__ || \
1996 (op) == OPCODE_RETURNVOID || \
1997 (op) == OPCODE_RETURNVALUE || \
1998 (op) == OPCODE___RETHROW__)
2000 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
2002 #define NEED_EXTRA_STACK_ARG
2003 code_t*finally_label = abc_nop(0);
2004 NEW(lookupswitch_t, l);
2010 code_t*prev = i->prev;
2011 if(IS_FINALLY_TARGET(i->opcode)) {
2014 if(i->opcode == OPCODE___RETHROW__ ||
2015 i->opcode == OPCODE_RETURNVALUE) {
2016 if(i->opcode == OPCODE___RETHROW__)
2017 i->opcode = OPCODE_THROW;
2019 p = abc_coerce_a(p);
2020 p = abc_setlocal(p, tempvar);
2022 p = abc_pushbyte(p, count++);
2023 p = abc_jump(p, finally_label);
2024 code_t*target = p = abc_label(p);
2025 #ifdef NEED_EXTRA_STACK_ARG
2029 p = abc_getlocal(p, tempvar);
2032 p->next = i;i->prev = p;
2033 list_append(l->targets, target);
2039 c = abc_pushbyte(c, -1);
2040 c = code_append(c, finally_label);
2041 c = code_append(c, finally);
2043 #ifdef NEED_EXTRA_STACK_ARG
2046 c = abc_lookupswitch(c, l);
2047 c = l->def = abc_label(c);
2048 #ifdef NEED_EXTRA_STACK_ARG
2055 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
2059 code_t*prev = i->prev;
2060 if(IS_FINALLY_TARGET(i->opcode)) {
2061 if(i->opcode == OPCODE___RETHROW__)
2062 i->opcode = OPCODE_THROW;
2063 code_t*end = code_dup(finally);
2064 code_t*start = code_start(end);
2065 if(prev) prev->next = start;
2072 return code_append(c, finally);
2075 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
2081 int num_insertion_points=0;
2083 if(IS_FINALLY_TARGET(i->opcode))
2084 num_insertion_points++;
2091 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2096 int simple_version_cost = (1+num_insertion_points)*code_size;
2097 int lookup_version_cost = 4*num_insertion_points + 5;
2099 if(cantdup || simple_version_cost > lookup_version_cost) {
2100 //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost);
2101 return insert_finally_lookup(c, finally, tempvar);
2103 //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost);
2104 return insert_finally_simple(c, finally, tempvar);
2108 #define PASS1 }} if(as3_pass == 1) {{
2109 #define PASS1END }} if(as3_pass == 2) {{
2110 #define PASS2 }} if(as3_pass == 2) {{
2111 #define PASS12 }} {{
2112 #define PASS12END }} if(as3_pass == 2) {{
2116 /* Line 273 of skeleton.m4 */
2117 #line 2118 "parser.tab.c"
2124 typedef YYTYPE_UINT8 yytype_uint8;
2126 typedef unsigned char yytype_uint8;
2130 typedef YYTYPE_INT8 yytype_int8;
2131 #elif (defined __STDC__ || defined __C99__FUNC__ \
2132 || defined __cplusplus || defined _MSC_VER)
2133 typedef signed char yytype_int8;
2135 typedef short int yytype_int8;
2138 #ifdef YYTYPE_UINT16
2139 typedef YYTYPE_UINT16 yytype_uint16;
2141 typedef unsigned short int yytype_uint16;
2145 typedef YYTYPE_INT16 yytype_int16;
2147 typedef short int yytype_int16;
2151 # ifdef __SIZE_TYPE__
2152 # define YYSIZE_T __SIZE_TYPE__
2153 # elif defined size_t
2154 # define YYSIZE_T size_t
2155 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2156 || defined __cplusplus || defined _MSC_VER)
2157 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2158 # define YYSIZE_T size_t
2160 # define YYSIZE_T unsigned int
2164 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2169 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2170 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2174 # define YY_(msgid) msgid
2178 /* Suppress unused-variable warnings by "using" E. */
2179 #if ! defined lint || defined __GNUC__
2180 # define YYUSE(e) ((void) (e))
2182 # define YYUSE(e) /* empty */
2185 /* Identity function, used to suppress warnings about constant conditions. */
2187 # define YYID(n) (n)
2189 #if (defined __STDC__ || defined __C99__FUNC__ \
2190 || defined __cplusplus || defined _MSC_VER)
2203 #if ! defined yyoverflow || YYERROR_VERBOSE
2205 /* The parser invokes alloca or malloc; define the necessary symbols. */
2207 # ifdef YYSTACK_USE_ALLOCA
2208 # if YYSTACK_USE_ALLOCA
2210 # define YYSTACK_ALLOC __builtin_alloca
2211 # elif defined __BUILTIN_VA_ARG_INCR
2212 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2214 # define YYSTACK_ALLOC __alloca
2215 # elif defined _MSC_VER
2216 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2217 # define alloca _alloca
2219 # define YYSTACK_ALLOC alloca
2220 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2221 || defined __cplusplus || defined _MSC_VER)
2222 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2224 # define _STDLIB_H 1
2231 # ifdef YYSTACK_ALLOC
2232 /* Pacify GCC's `empty if-body' warning. */
2233 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2234 # ifndef YYSTACK_ALLOC_MAXIMUM
2235 /* The OS might guarantee only one guard page at the bottom of the stack,
2236 and a page size can be as small as 4096 bytes. So we cannot safely
2237 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2238 to allow for a few compiler-allocated temporary stack slots. */
2239 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2242 # define YYSTACK_ALLOC YYMALLOC
2243 # define YYSTACK_FREE YYFREE
2244 # ifndef YYSTACK_ALLOC_MAXIMUM
2245 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2247 # if (defined __cplusplus && ! defined _STDLIB_H \
2248 && ! ((defined YYMALLOC || defined malloc) \
2249 && (defined YYFREE || defined free)))
2250 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2252 # define _STDLIB_H 1
2256 # define YYMALLOC malloc
2257 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2258 || defined __cplusplus || defined _MSC_VER)
2259 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2263 # define YYFREE free
2264 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2265 || defined __cplusplus || defined _MSC_VER)
2266 void free (void *); /* INFRINGES ON USER NAME SPACE */
2270 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2273 #if (! defined yyoverflow \
2274 && (! defined __cplusplus \
2275 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2277 /* A type that is properly aligned for any stack member. */
2280 yytype_int16 yyss_alloc;
2284 /* The size of the maximum gap between one aligned stack and the next. */
2285 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2287 /* The size of an array large to enough to hold all stacks, each with
2289 # define YYSTACK_BYTES(N) \
2290 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2291 + YYSTACK_GAP_MAXIMUM)
2293 /* Copy COUNT objects from FROM to TO. The source and destination do
2296 # if defined __GNUC__ && 1 < __GNUC__
2297 # define YYCOPY(To, From, Count) \
2298 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2300 # define YYCOPY(To, From, Count) \
2304 for (yyi = 0; yyi < (Count); yyi++) \
2305 (To)[yyi] = (From)[yyi]; \
2311 /* Relocate STACK from its old location to the new one. The
2312 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2313 elements in the stack, and YYPTR gives the new location of the
2314 stack. Advance YYPTR to a properly aligned location for the next
2316 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2319 YYSIZE_T yynewbytes; \
2320 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2321 Stack = &yyptr->Stack_alloc; \
2322 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2323 yyptr += yynewbytes / sizeof (*yyptr); \
2329 /* YYFINAL -- State number of the termination state. */
2331 /* YYLAST -- Last index in YYTABLE. */
2334 /* YYNTOKENS -- Number of terminals. */
2335 #define YYNTOKENS 134
2336 /* YYNNTS -- Number of nonterminals. */
2338 /* YYNRULES -- Number of rules. */
2339 #define YYNRULES 309
2340 /* YYNRULES -- Number of states. */
2341 #define YYNSTATES 521
2343 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2344 #define YYUNDEFTOK 2
2345 #define YYMAXUTOK 363
2347 #define YYTRANSLATE(YYX) \
2348 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2350 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2351 static const yytype_uint8 yytranslate[] =
2353 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2354 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2355 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2356 2, 2, 2, 118, 2, 2, 2, 116, 108, 2,
2357 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2358 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2359 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2360 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2361 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2362 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2363 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2364 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2365 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2366 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2367 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2368 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2369 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2371 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2372 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2373 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2374 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2375 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2376 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2377 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2378 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2379 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2380 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2381 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2382 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2383 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2384 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2385 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2386 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2387 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2388 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2393 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2395 static const yytype_uint16 yyprhs[] =
2397 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2398 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2399 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2400 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2401 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2402 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2403 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2404 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2405 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2406 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2407 275, 277, 280, 282, 283, 290, 293, 295, 300, 303,
2408 305, 307, 309, 313, 315, 316, 323, 324, 330, 333,
2409 338, 339, 341, 343, 346, 348, 350, 352, 354, 356,
2410 358, 360, 362, 364, 366, 367, 370, 371, 374, 375,
2411 378, 379, 389, 390, 399, 400, 402, 404, 407, 409,
2412 414, 416, 418, 420, 421, 423, 425, 428, 430, 433,
2413 442, 444, 446, 447, 452, 454, 458, 462, 463, 466,
2414 468, 470, 472, 474, 476, 478, 480, 482, 484, 485,
2415 487, 490, 495, 499, 501, 506, 509, 511, 513, 514,
2416 515, 528, 530, 531, 532, 543, 545, 549, 551, 553,
2417 555, 559, 561, 563, 565, 568, 569, 570, 574, 575,
2418 577, 579, 581, 584, 587, 588, 593, 598, 603, 606,
2419 608, 611, 613, 615, 619, 621, 623, 625, 627, 629,
2420 631, 633, 635, 637, 639, 641, 643, 645, 647, 649,
2421 651, 653, 655, 659, 663, 667, 671, 675, 679, 683,
2422 687, 691, 695, 698, 701, 705, 709, 713, 717, 721,
2423 725, 729, 733, 737, 741, 745, 749, 753, 757, 761,
2424 766, 769, 771, 775, 778, 783, 787, 788, 790, 794,
2425 800, 804, 808, 812, 816, 820, 824, 828, 832, 836,
2426 840, 844, 848, 854, 857, 860, 863, 866, 870, 873,
2427 878, 884, 888, 894, 898, 900, 903, 908, 913, 916
2430 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2431 static const yytype_int16 yyrhs[] =
2433 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2434 137, 138, -1, 186, -1, 198, -1, 196, -1, 217,
2435 -1, 207, -1, 147, -1, 148, 126, 136, 132, -1,
2436 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2437 198, -1, 196, -1, 217, -1, 207, -1, 147, -1,
2438 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2439 143, 145, -1, 145, -1, 189, -1, 159, -1, 160,
2440 -1, 161, -1, 163, -1, 171, -1, 154, -1, 183,
2441 -1, 179, -1, 239, -1, 247, -1, 246, -1, 126,
2442 143, 132, -1, 126, 132, -1, 99, -1, 144, -1,
2443 150, -1, 165, -1, 166, -1, 236, -1, 181, -1,
2444 148, 126, 143, 132, -1, 145, 99, -1, 145, -1,
2445 144, -1, 3, 89, 3, -1, 102, 237, -1, -1,
2446 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2447 152, -1, 3, 227, 149, -1, -1, 65, 146, -1,
2448 -1, 64, 122, 155, 238, 133, 146, 153, -1, -1,
2449 150, -1, 239, -1, 46, 3, 227, -1, 3, -1,
2450 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2451 238, 99, 239, 133, 146, -1, 158, 157, 68, 238,
2452 133, 146, -1, -1, 14, 122, 162, 238, 133, 146,
2453 -1, -1, 15, 164, 146, 14, 122, 238, 133, -1,
2454 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2455 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2456 168, 169, -1, 34, 240, 105, 142, -1, 62, 105,
2457 142, -1, -1, 16, 122, 172, 240, 133, 126, 167,
2458 132, -1, -1, 33, 122, 3, 227, 133, 174, 126,
2459 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2460 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2461 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2462 37, 238, -1, 37, -1, 39, 122, 238, 133, -1,
2463 182, 146, -1, 3, -1, 19, -1, 4, -1, 185,
2464 127, 184, -1, 184, -1, -1, 19, 185, 126, 187,
2465 139, 132, -1, -1, 19, 126, 188, 139, 132, -1,
2466 41, 223, -1, 41, 185, 127, 115, -1, -1, 191,
2467 -1, 192, -1, 191, 192, -1, 21, -1, 22, -1,
2468 20, -1, 38, -1, 47, -1, 49, -1, 48, -1,
2469 26, -1, 24, -1, 4, -1, -1, 54, 224, -1,
2470 -1, 54, 225, -1, -1, 17, 225, -1, -1, 190,
2471 31, 3, 193, 195, 126, 197, 200, 132, -1, -1,
2472 190, 44, 3, 194, 126, 199, 203, 132, -1, -1,
2473 201, -1, 202, -1, 201, 202, -1, 99, -1, 148,
2474 126, 200, 132, -1, 207, -1, 217, -1, 144, -1,
2475 -1, 204, -1, 205, -1, 204, 205, -1, 99, -1,
2476 46, 3, -1, 190, 27, 216, 3, 122, 213, 133,
2477 227, -1, 46, -1, 32, -1, -1, 190, 206, 208,
2478 209, -1, 210, -1, 209, 100, 210, -1, 3, 227,
2479 149, -1, -1, 102, 212, -1, 10, -1, 8, -1,
2480 9, -1, 12, -1, 5, -1, 56, -1, 55, -1,
2481 45, -1, 3, -1, -1, 214, -1, 93, 215, -1,
2482 214, 100, 93, 215, -1, 214, 100, 215, -1, 215,
2483 -1, 3, 105, 226, 211, -1, 3, 211, -1, 51,
2484 -1, 35, -1, -1, -1, 190, 27, 216, 3, 122,
2485 213, 133, 227, 126, 218, 142, 132, -1, 3, -1,
2486 -1, -1, 27, 219, 122, 213, 133, 227, 126, 221,
2487 142, 132, -1, 184, -1, 185, 127, 184, -1, 223,
2488 -1, 222, -1, 224, -1, 225, 100, 224, -1, 224,
2489 -1, 115, -1, 36, -1, 105, 226, -1, -1, -1,
2490 122, 229, 133, -1, -1, 230, -1, 231, -1, 237,
2491 -1, 230, 100, -1, 231, 237, -1, -1, 25, 240,
2492 232, 228, -1, 240, 122, 229, 133, -1, 53, 122,
2493 229, 133, -1, 63, 240, -1, 42, -1, 42, 238,
2494 -1, 240, -1, 240, -1, 238, 100, 240, -1, 238,
2495 -1, 220, -1, 241, -1, 244, -1, 233, -1, 235,
2496 -1, 234, -1, 6, -1, 10, -1, 11, -1, 8,
2497 -1, 9, -1, 12, -1, 5, -1, 29, -1, 56,
2498 -1, 55, -1, 45, -1, 240, 109, 240, -1, 240,
2499 110, 240, -1, 240, 75, 240, -1, 240, 76, 240,
2500 -1, 240, 71, 240, -1, 240, 72, 240, -1, 240,
2501 74, 240, -1, 240, 73, 240, -1, 240, 87, 240,
2502 -1, 240, 88, 240, -1, 118, 240, -1, 117, 240,
2503 -1, 240, 108, 240, -1, 240, 107, 240, -1, 240,
2504 106, 240, -1, 240, 96, 240, -1, 240, 95, 240,
2505 -1, 240, 94, 240, -1, 240, 114, 240, -1, 240,
2506 116, 240, -1, 240, 113, 240, -1, 240, 112, 240,
2507 -1, 240, 115, 240, -1, 240, 68, 240, -1, 240,
2508 69, 240, -1, 240, 40, 240, -1, 240, 67, 240,
2509 -1, 43, 122, 240, 133, -1, 36, 240, -1, 36,
2510 -1, 122, 238, 133, -1, 112, 240, -1, 240, 124,
2511 240, 125, -1, 124, 229, 125, -1, -1, 243, -1,
2512 237, 105, 237, -1, 243, 100, 237, 105, 237, -1,
2513 70, 242, 132, -1, 240, 80, 240, -1, 240, 79,
2514 240, -1, 240, 85, 240, -1, 240, 84, 240, -1,
2515 240, 86, 240, -1, 240, 78, 240, -1, 240, 77,
2516 240, -1, 240, 83, 240, -1, 240, 81, 240, -1,
2517 240, 82, 240, -1, 240, 102, 240, -1, 240, 104,
2518 240, 105, 240, -1, 240, 91, -1, 240, 90, -1,
2519 91, 240, -1, 90, 240, -1, 53, 127, 3, -1,
2520 128, 3, -1, 240, 127, 128, 3, -1, 240, 127,
2521 3, 89, 3, -1, 240, 92, 3, -1, 240, 127,
2522 122, 240, 133, -1, 240, 127, 3, -1, 3, -1,
2523 18, 3, -1, 18, 3, 102, 3, -1, 18, 3,
2524 102, 5, -1, 190, 245, -1, 23, 18, 224, -1
2527 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2528 static const yytype_uint16 yyrline[] =
2530 0, 2096, 2096, 2098, 2098, 2099, 2100, 2102, 2103, 2104,
2531 2105, 2106, 2107, 2108, 2109, 2111, 2111, 2112, 2113, 2115,
2532 2116, 2117, 2118, 2119, 2120, 2121, 2123, 2124, 2126, 2127,
2533 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139,
2534 2140, 2141, 2142, 2143, 2146, 2147, 2148, 2149, 2150, 2151,
2535 2152, 2153, 2157, 2158, 2162, 2169, 2173, 2174, 2178, 2179,
2536 2181, 2182, 2184, 2245, 2246, 2249, 2249, 2268, 2269, 2270,
2537 2275, 2279, 2284, 2285, 2287, 2307, 2355, 2355, 2374, 2374,
2538 2389, 2392, 2395, 2398, 2402, 2403, 2404, 2405, 2406, 2407,
2539 2409, 2420, 2423, 2423, 2454, 2454, 2479, 2479, 2495, 2496,
2540 2497, 2498, 2506, 2515, 2515, 2564, 2568, 2579, 2589, 2606,
2541 2607, 2608, 2610, 2611, 2613, 2613, 2615, 2615, 2618, 2634,
2542 2651, 2652, 2653, 2654, 2661, 2662, 2663, 2664, 2665, 2666,
2543 2667, 2668, 2669, 2670, 2674, 2675, 2677, 2678, 2680, 2681,
2544 2685, 2683, 2691, 2689, 2698, 2699, 2700, 2701, 2702, 2703,
2545 2704, 2705, 2707, 2713, 2714, 2715, 2716, 2717, 2718, 2721,
2546 2734, 2734, 2736, 2736, 2738, 2739, 2741, 2816, 2817, 2819,
2547 2820, 2821, 2822, 2823, 2825, 2826, 2827, 2828, 2840, 2844,
2548 2850, 2856, 2864, 2869, 2875, 2883, 2891, 2892, 2893, 2896,
2549 2895, 2912, 2913, 2915, 2914, 2938, 2957, 2971, 2972, 2974,
2550 2975, 2977, 2978, 2979, 2988, 2989, 2993, 2994, 2996, 2997,
2551 2998, 3000, 3004, 3005, 3010, 3011, 3047, 3093, 3114, 3135,
2552 3138, 3145, 3146, 3147, 3153, 3159, 3161, 3163, 3165, 3167,
2553 3169, 3171, 3188, 3193, 3196, 3199, 3202, 3205, 3208, 3211,
2554 3214, 3217, 3221, 3224, 3227, 3230, 3233, 3236, 3239, 3242,
2555 3246, 3257, 3275, 3280, 3285, 3290, 3295, 3300, 3304, 3308,
2556 3313, 3317, 3321, 3330, 3339, 3349, 3354, 3366, 3372, 3377,
2557 3383, 3389, 3393, 3395, 3406, 3415, 3422, 3423, 3425, 3431,
2558 3440, 3447, 3459, 3465, 3471, 3477, 3483, 3489, 3495, 3501,
2559 3514, 3525, 3532, 3545, 3572, 3586, 3600, 3614, 3629, 3636,
2560 3643, 3650, 3657, 3668, 3720, 3826, 3833, 3840, 3847, 3862
2564 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2565 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2566 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2567 static const char *const yytname[] =
2569 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2570 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2571 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2572 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2573 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2574 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2575 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2576 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2577 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2578 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2579 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2580 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2581 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2582 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2583 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2584 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2585 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2586 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2587 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2588 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2589 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2590 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2591 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2592 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2593 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2594 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2595 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2596 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2597 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2598 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2599 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2600 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2601 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH_HEAD",
2602 "WITH", "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9",
2603 "IMPORT", "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2604 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2605 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2606 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2607 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2608 "ONE_SLOT", "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2609 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2610 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2611 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2612 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2613 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2614 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2615 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2616 "NAMESPACE_ID", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2621 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2623 static const yytype_uint16 yytoknum[] =
2625 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2626 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2627 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2628 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2629 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2630 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2631 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2632 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2633 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2634 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2635 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2636 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2637 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2642 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2643 static const yytype_uint8 yyr1[] =
2645 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2646 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2647 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2648 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2649 144, 144, 144, 144, 145, 145, 145, 145, 145, 145,
2650 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2651 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2652 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2653 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2654 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2655 178, 178, 178, 180, 179, 181, 181, 182, 183, 184,
2656 184, 184, 185, 185, 187, 186, 188, 186, 189, 189,
2657 190, 190, 191, 191, 192, 192, 192, 192, 192, 192,
2658 192, 192, 192, 192, 193, 193, 194, 194, 195, 195,
2659 197, 196, 199, 198, 200, 200, 201, 201, 202, 202,
2660 202, 202, 202, 203, 203, 204, 204, 205, 205, 205,
2661 206, 206, 208, 207, 209, 209, 210, 211, 211, 212,
2662 212, 212, 212, 212, 212, 212, 212, 212, 213, 213,
2663 213, 213, 214, 214, 215, 215, 216, 216, 216, 218,
2664 217, 219, 219, 221, 220, 222, 223, 224, 224, 225,
2665 225, 226, 226, 226, 227, 227, 228, 228, 229, 229,
2666 229, 230, 231, 230, 232, 233, 234, 234, 235, 236,
2667 236, 237, 238, 238, 239, 240, 240, 240, 240, 240,
2668 240, 240, 241, 241, 241, 241, 241, 241, 241, 241,
2669 241, 241, 240, 240, 240, 240, 240, 240, 240, 240,
2670 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2671 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2672 240, 240, 240, 240, 240, 240, 242, 242, 243, 243,
2673 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2674 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2675 240, 240, 240, 240, 244, 245, 245, 245, 246, 247
2678 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2679 static const yytype_uint8 yyr2[] =
2681 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2682 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2683 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2684 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2685 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2686 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2687 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2688 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2689 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2690 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2691 1, 2, 1, 0, 6, 2, 1, 4, 2, 1,
2692 1, 1, 3, 1, 0, 6, 0, 5, 2, 4,
2693 0, 1, 1, 2, 1, 1, 1, 1, 1, 1,
2694 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2695 0, 9, 0, 8, 0, 1, 1, 2, 1, 4,
2696 1, 1, 1, 0, 1, 1, 2, 1, 2, 8,
2697 1, 1, 0, 4, 1, 3, 3, 0, 2, 1,
2698 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
2699 2, 4, 3, 1, 4, 2, 1, 1, 0, 0,
2700 12, 1, 0, 0, 10, 1, 3, 1, 1, 1,
2701 3, 1, 1, 1, 2, 0, 0, 3, 0, 1,
2702 1, 1, 2, 2, 0, 4, 4, 4, 2, 1,
2703 2, 1, 1, 3, 1, 1, 1, 1, 1, 1,
2704 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2705 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
2706 3, 3, 2, 2, 3, 3, 3, 3, 3, 3,
2707 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
2708 2, 1, 3, 2, 4, 3, 0, 1, 3, 5,
2709 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2710 3, 3, 5, 2, 2, 2, 2, 3, 2, 4,
2711 5, 3, 5, 3, 1, 2, 4, 4, 2, 3
2714 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2715 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2716 means the default is an error. */
2717 static const yytype_uint16 yydefact[] =
2719 120, 304, 133, 237, 231, 234, 235, 232, 233, 236,
2720 0, 0, 78, 0, 0, 126, 124, 125, 0, 132,
2721 0, 131, 192, 238, 271, 127, 0, 0, 0, 241,
2722 128, 130, 129, 0, 0, 240, 239, 0, 0, 276,
2723 0, 0, 14, 0, 0, 0, 0, 208, 120, 0,
2724 0, 2, 120, 5, 54, 12, 0, 36, 67, 31,
2725 32, 33, 34, 35, 38, 120, 37, 7, 30, 0,
2726 121, 122, 9, 8, 11, 10, 225, 228, 230, 229,
2727 224, 39, 222, 226, 227, 41, 40, 0, 0, 72,
2728 76, 120, 92, 109, 111, 110, 116, 113, 0, 0,
2729 304, 214, 191, 0, 270, 0, 0, 118, 0, 103,
2730 208, 0, 218, 65, 0, 221, 0, 277, 296, 295,
2731 273, 253, 252, 0, 0, 209, 210, 211, 82, 0,
2732 106, 219, 0, 80, 44, 43, 120, 45, 29, 0,
2733 46, 47, 48, 50, 0, 49, 298, 1, 6, 120,
2734 304, 0, 68, 0, 0, 69, 53, 108, 0, 188,
2735 0, 161, 0, 160, 162, 308, 123, 0, 0, 0,
2736 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2738 294, 293, 0, 0, 0, 0, 0, 0, 0, 0,
2739 0, 0, 0, 0, 0, 0, 0, 0, 208, 0,
2740 0, 55, 73, 0, 0, 0, 120, 114, 0, 195,
2741 0, 198, 197, 309, 206, 178, 0, 0, 0, 27,
2742 0, 297, 0, 0, 280, 0, 272, 275, 212, 213,
2743 83, 205, 59, 60, 105, 220, 58, 81, 42, 28,
2744 120, 0, 205, 0, 0, 52, 305, 187, 186, 0,
2745 134, 136, 0, 223, 267, 268, 265, 266, 246, 247,
2746 249, 248, 244, 245, 287, 286, 282, 281, 289, 290,
2747 288, 284, 283, 285, 250, 251, 301, 259, 258, 257,
2748 291, 0, 256, 255, 254, 242, 243, 263, 262, 260,
2749 264, 261, 0, 0, 303, 0, 0, 0, 0, 0,
2750 25, 0, 120, 17, 23, 0, 20, 19, 22, 21,
2751 120, 112, 0, 208, 215, 167, 0, 0, 179, 183,
2752 107, 119, 196, 269, 0, 26, 217, 0, 278, 0,
2753 0, 57, 0, 120, 13, 57, 0, 0, 0, 0,
2754 0, 138, 0, 0, 205, 163, 164, 0, 216, 274,
2755 0, 0, 299, 120, 0, 0, 117, 18, 120, 0,
2756 0, 0, 0, 185, 180, 205, 0, 0, 120, 0,
2757 203, 202, 201, 204, 0, 62, 61, 51, 0, 120,
2758 306, 307, 178, 135, 0, 0, 199, 137, 142, 57,
2759 0, 292, 300, 302, 77, 0, 84, 0, 115, 207,
2760 177, 173, 170, 171, 169, 172, 176, 175, 174, 168,
2761 167, 0, 0, 182, 0, 0, 98, 102, 100, 104,
2762 63, 279, 56, 0, 75, 0, 139, 140, 0, 120,
2763 166, 165, 79, 0, 0, 0, 85, 88, 86, 24,
2764 184, 193, 181, 96, 0, 99, 101, 120, 66, 120,
2765 205, 120, 200, 0, 157, 0, 0, 120, 155, 0,
2766 27, 93, 89, 87, 27, 27, 205, 64, 74, 0,
2767 148, 152, 0, 0, 0, 120, 146, 150, 151, 158,
2768 188, 143, 156, 27, 91, 0, 0, 0, 189, 120,
2769 141, 147, 0, 90, 194, 97, 94, 27, 0, 0,
2770 0, 0, 149, 178, 27, 190, 0, 0, 205, 95,
2774 /* YYDEFGOTO[NTERM-NUM]. */
2775 static const yytype_int16 yydefgoto[] =
2777 -1, 50, 51, 52, 53, 311, 312, 313, 334, 335,
2778 137, 138, 157, 314, 139, 385, 140, 246, 243, 458,
2779 57, 232, 153, 154, 58, 59, 60, 61, 213, 62,
2780 91, 141, 142, 445, 446, 447, 448, 63, 215, 426,
2781 510, 427, 475, 428, 429, 64, 229, 143, 65, 66,
2782 219, 220, 67, 320, 216, 68, 144, 70, 71, 351,
2783 353, 395, 316, 461, 317, 439, 484, 485, 486, 466,
2784 467, 468, 164, 318, 262, 355, 356, 373, 419, 327,
2785 328, 329, 259, 319, 507, 103, 76, 474, 221, 222,
2786 382, 397, 383, 341, 324, 124, 125, 126, 224, 77,
2787 78, 79, 145, 127, 80, 81, 82, 83, 116, 117,
2791 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2793 #define YYPACT_NINF -403
2794 static const yytype_int16 yypact[] =
2796 1674, -70, -403, -403, -403, -403, -403, -403, -403, -403,
2797 -15, -72, -403, -52, 19, -403, -403, -403, 80, -403,
2798 2094, -403, 99, -403, 2164, -403, -16, 42, -5, -403,
2799 -403, -403, -403, -1, 5, -403, -403, 2094, 13, 2094,
2800 2094, 2094, -403, 2094, 2094, 2094, 2094, 2094, 634, 123,
2801 128, -403, 504, -403, -403, -403, 8, -403, 2024, -403,
2802 -403, -403, -403, -403, -403, 1926, -403, -403, -403, 240,
2803 361, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2804 38, -403, 2569, -403, -403, -403, -403, 137, 20, -403,
2805 -403, 1926, -403, -403, -403, -403, -403, -403, -87, 42,
2806 -403, -67, -403, 21, -48, 2094, 79, -403, 2094, -403,
2807 2094, 138, -48, -403, 43, 2569, 76, 107, -48, -48,
2808 604, -48, -48, -29, 84, 110, 2094, -403, 210, 211,
2809 2094, 2094, 211, 212, -403, -403, 764, -403, -403, 85,
2810 -403, -403, -403, -403, 209, -403, -403, -403, -403, 1024,
2811 158, 232, -403, 139, 171, -403, 141, -403, 238, 12,
2812 239, -403, 247, -403, -403, -403, -403, 2094, 2094, 2094,
2813 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2814 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2815 -403, -403, 249, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2816 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094, 2094,
2817 11, -403, -403, 2094, 229, 2094, 1154, -403, 42, 133,
2818 135, -403, -403, -403, 142, 15, -10, 90, 2189, 1800,
2819 130, -403, 2094, 2094, -403, 2094, -403, -403, -403, -403,
2820 -403, 161, 169, -403, 38, 38, 169, -403, -403, -403,
2821 1926, 149, 161, 2094, 2094, -403, 168, -403, -403, 280,
2822 231, 233, 286, 2569, 1016, 496, 496, 496, 322, 322,
2823 322, 322, 1016, 1016, 2569, 2569, 2569, 2569, 2569, 2569,
2824 2569, 2569, 2569, 2569, 2630, 2691, -403, 368, 368, 368,
2825 2569, 2386, 2752, 2813, 2874, 1016, 1016, 604, 604, -48,
2826 -48, -48, 157, 2447, 202, 2094, 291, 14, 173, 2260,
2827 -403, 165, 1284, -403, -403, 172, -403, -403, -403, -403,
2828 1154, -403, 42, 2094, -403, -43, 296, 167, 201, -403,
2829 -403, -403, 175, -403, 174, 1800, -403, 44, -403, 200,
2830 63, 207, 211, 894, -403, -27, -11, 46, 113, 189,
2831 42, 298, 42, 190, 161, 217, -403, 2094, -403, -403,
2832 315, 2323, -403, 1926, 2094, 193, -403, -403, 1154, 192,
2833 194, 75, 63, -403, -403, 161, 26, 96, 1926, 2094,
2834 -403, -403, -403, -403, 2094, -403, -403, -403, 2094, 1926,
2835 -403, -403, 15, -403, 42, 199, -403, 230, -403, 207,
2836 286, 2569, -403, -403, -403, 103, 24, 197, -403, -403,
2837 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2838 234, 205, 296, -403, 206, 213, -403, -403, 96, -403,
2839 268, -403, -403, 204, -403, 215, 230, -403, 42, 208,
2840 -403, -403, -403, 2094, 236, 214, 24, -403, -403, -403,
2841 -403, -403, -403, -403, 335, -403, -403, 1926, -403, 1926,
2842 161, 1414, -403, 339, -403, 316, 219, 227, -403, 2508,
2843 1800, -403, -403, -403, 1800, 1800, 161, -403, -403, 223,
2844 -403, -403, 226, 250, 221, 1544, -403, -403, -403, -403,
2845 12, -403, -403, 1800, -403, 222, 224, 225, -403, 1414,
2846 -403, -403, 354, -403, -403, -403, -403, 1800, 228, 241,
2847 235, 243, -403, 15, 1800, -403, 244, 246, 161, -403,
2851 /* YYPGOTO[NTERM-NUM]. */
2852 static const yytype_int16 yypgoto[] =
2854 -403, -403, 218, -403, 312, -299, -403, 61, -402, -31,
2855 1, -55, -85, 48, 2, -23, 321, 251, 58, -403,
2856 -403, -403, -403, -403, -403, -403, -403, -403, -403, -403,
2857 -403, -403, -403, -403, -403, -62, -60, -403, -403, -40,
2858 -403, -36, -403, -403, -403, -403, -403, -403, -403, -403,
2859 6, 50, -403, -403, -403, -403, 0, -403, 331, -403,
2860 -403, -403, 49, -403, 51, -403, -96, -403, -80, -403,
2861 -403, -61, -403, 3, -403, -403, 7, 9, -403, -376,
2862 -403, -311, -79, 4, -403, -403, -403, -403, -403, 388,
2863 -91, 25, 52, -239, -403, -98, -403, -403, -403, -403,
2864 -403, -403, -403, -34, -9, -49, -13, -403, -403, -403,
2865 -403, -403, -403, -403
2868 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2869 positive, shift that token. If negative, reduce the rule which
2870 number is the opposite. If zero, do what YYDEFACT says.
2871 If YYTABLE_NINF, syntax error. */
2872 #define YYTABLE_NINF -155
2873 static const yytype_int16 yytable[] =
2875 69, 54, 56, 74, 75, 114, 214, 101, 223, 155,
2876 156, 104, 230, 345, 304, 374, 435, 136, 325, 87,
2877 97, 369, 93, 94, 112, 192, 115, 118, 119, 325,
2878 120, 121, 122, 97, 115, 88, 156, 123, 95, 217,
2879 218, -70, 190, 191, 192, 93, 94, 257, 55, 72,
2880 90, 73, 69, 54, 56, 74, 75, 209, 443, 371,
2881 210, 95, 372, 258, 98, 423, 93, 94, 494, 407,
2882 92, 167, 495, 496, 208, 384, 209, 106, 410, 210,
2883 411, 249, 95, 412, 413, 414, 444, 415, 388, 167,
2884 167, 503, 239, 93, 94, 228, 226, 115, 99, 380,
2885 55, 72, 102, 73, 236, 511, 105, 89, 326, 95,
2886 302, 452, 517, 115, 167, 399, 390, 108, 391, 422,
2887 416, 244, 245, 330, 424, 109, 146, 110, 147, 425,
2888 417, 418, 111, 305, 149, 113, 421, 516, 167, 306,
2889 211, 231, 212, 225, 167, 96, 167, 363, 233, 69,
2890 54, 56, 74, 75, 263, 264, 265, 266, 267, 268,
2891 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
2892 279, 280, 281, 282, 283, 284, 285, 378, 381, 389,
2893 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
2894 297, 298, 299, 300, 301, 115, 303, 55, 72, 338,
2895 73, 339, 309, 167, 307, 331, 227, 235, 234, 237,
2896 238, 250, 2, 240, 241, 247, 69, 54, 315, 343,
2897 115, 479, 115, 337, 321, 370, -71, 158, 15, 16,
2898 17, 2, 19, 332, 21, 252, 442, 497, 253, 254,
2899 255, 256, 260, 308, 346, 347, 25, 15, 16, 17,
2900 261, 19, 286, 21, 463, 30, 31, 32, 158, 393,
2901 -113, 396, 322, 336, 323, 25, 340, 159, 158, 342,
2902 348, 160, 161, 463, 30, 31, 32, 159, 404, 520,
2903 249, 344, 161, 349, 162, 350, 163, 352, 249, 354,
2904 358, 360, 361, 430, 362, 364, 163, 366, 368, 325,
2905 375, 376, -112, 396, 434, 379, 377, 464, 156, 384,
2906 115, 392, 69, 54, 315, 394, 398, 400, 402, 406,
2907 69, 54, 315, 156, 408, 437, 464, 409, 332, 449,
2908 438, 451, 453, 457, 156, 454, 371, 459, 476, 433,
2909 -153, 470, 489, 490, 401, 431, 471, 462, 460, 498,
2910 432, 491, 499, 500, 504, 405, 505, 509, 506, -154,
2911 512, 514, 168, 513, 148, 2, 115, 251, 69, 54,
2912 315, 115, 477, 367, 478, 515, 440, 518, 519, 152,
2913 242, 15, 16, 17, 472, 19, 473, 21, 455, 169,
2914 170, 171, 456, -155, -155, -155, -155, 176, 177, 25,
2915 386, 166, 156, 508, 156, 501, 492, 441, 30, 31,
2916 32, 502, 190, 191, 192, 107, 193, 194, 195, 436,
2917 0, 0, 0, 0, 420, 0, 0, 0, 0, 450,
2918 469, 201, 202, 0, 203, 204, 205, 206, 207, 465,
2919 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
2920 0, 0, 0, 0, 0, 0, 0, 0, 190, 191,
2921 192, 483, 481, 482, 487, 488, 0, 465, 0, 0,
2922 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2923 203, 204, 205, 206, 207, 483, 481, 482, 487, 488,
2924 208, 0, 209, 0, 0, 210, 0, 0, 0, 483,
2925 481, 482, 487, 488, -4, 0, 0, 1, 2, 3,
2926 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2927 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2928 21, 0, 0, 23, 0, 0, 168, 0, 0, 0,
2929 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2930 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2931 36, 0, 0, -155, -155, -155, 0, 37, 38, 0,
2932 0, 176, 177, 0, 39, 0, 0, 0, 0, 0,
2933 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2934 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2935 0, 0, 0, 42, 0, 201, 202, 0, 203, 204,
2936 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2937 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2938 48, 0, 49, 0, 0, 0, -4, 1, 2, 3,
2939 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2940 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2941 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2942 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2943 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2944 36, 0, 0, 0, 190, 191, 192, 37, 38, 0,
2945 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2946 0, 0, 0, 0, 0, 0, 0, 0, 205, 206,
2947 207, 0, 0, 0, 40, 41, 208, 0, 209, 0,
2948 0, 210, 0, 134, 0, 0, 0, 0, 0, 0,
2949 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2950 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2951 48, 0, 49, 0, 0, 0, 135, 1, 2, 3,
2952 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2953 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2954 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2955 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2956 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2957 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2958 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2959 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2960 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2961 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2962 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2963 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2964 48, 0, 49, 0, 0, 0, 248, 1, 2, 3,
2965 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2966 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2967 21, 22, 0, 23, 128, 0, 129, 0, 0, 0,
2968 24, 130, 25, 26, 0, 27, 131, 28, 0, 29,
2969 132, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2970 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2971 133, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2972 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2973 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2974 0, 0, 0, 134, 0, 0, 0, 0, 0, 0,
2975 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
2976 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
2977 48, 0, 49, 0, 0, 0, 387, 1, 2, 3,
2978 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2979 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
2980 21, 0, 0, 23, 0, 0, -155, 0, 0, 0,
2981 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2982 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2983 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2984 0, -155, -155, 0, 39, 0, 0, 0, 0, 0,
2985 0, 0, 0, 0, 0, 0, 190, 191, 192, 0,
2986 193, 194, 195, 0, 40, 41, 0, 0, 0, 0,
2987 0, 0, 0, 42, 0, -155, -155, 0, 203, 204,
2988 205, 206, 207, 0, 0, 0, 43, 0, 208, 0,
2989 209, 44, 45, 210, 0, 0, 46, 0, 47, 0,
2990 48, 0, 49, 0, 0, 0, -3, 1, 2, 3,
2991 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2992 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2993 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
2994 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
2995 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2996 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2997 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2998 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2999 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3000 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3001 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3002 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3003 48, 0, 49, 0, 0, 0, -15, 1, 2, 3,
3004 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3005 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3006 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3007 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3008 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3009 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3010 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3011 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3012 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3013 0, 0, 0, 310, 0, 0, 0, 0, 0, 0,
3014 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3015 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3016 48, 0, 49, 0, 0, 0, -16, 1, 2, 3,
3017 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3018 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3019 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3020 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3021 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3022 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3023 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3024 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3025 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3026 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3027 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3028 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3029 48, 0, 49, 0, 0, 0, -144, 1, 2, 3,
3030 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3031 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
3032 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3033 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3034 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3035 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3036 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3037 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3038 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3039 0, 0, 0, 480, 0, 0, 0, 0, 0, 0,
3040 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3041 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3042 48, 0, 49, 0, -3, 0, -145, 1, 2, 3,
3043 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
3044 13, 0, 0, 14, 15, 16, 17, 18, 19, 20,
3045 21, 0, 0, 23, 0, 0, 0, 0, 0, 0,
3046 24, 0, 25, 26, 0, 27, 0, 28, 0, 29,
3047 0, 30, 31, 32, 0, 0, 33, 34, 0, 35,
3048 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
3049 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3051 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
3052 0, 0, 0, 42, 0, 0, 0, 0, 0, 0,
3053 0, 0, 0, 0, 0, 0, 43, 0, 0, 0,
3054 0, 44, 45, 0, 0, 0, 46, 0, 47, 0,
3055 48, 0, 49, 1, 2, 3, 4, 0, 5, 6,
3056 7, 8, 9, 10, 11, 12, 13, 0, -120, 0,
3057 15, 16, 17, 18, 19, 20, 21, 22, 0, 23,
3058 128, 0, 129, 0, 0, 0, 24, 130, 25, 26,
3059 0, 27, 131, 28, 0, 29, 132, 30, 31, 32,
3060 0, 0, 33, 34, 0, 35, 36, 0, 0, 0,
3061 0, 0, 0, 37, 38, 0, 133, 0, 0, 0,
3062 39, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3063 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3064 40, 41, 0, 0, 0, 0, 0, 0, 0, 134,
3065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3066 0, 0, 43, 0, 0, 0, 0, 44, 45, 0,
3067 0, 0, 46, 0, 47, 0, 48, 0, 49, 1,
3068 2, 3, 4, 0, 5, 6, 7, 8, 9, 10,
3069 11, 12, 13, 0, 0, 0, 15, 16, 17, 18,
3070 19, 20, 21, 22, 0, 23, 128, 0, 129, 0,
3071 0, 0, 24, 130, 25, 26, 0, 27, 131, 28,
3072 0, 29, 132, 30, 31, 32, 0, 0, 33, 34,
3073 0, 35, 36, 0, 0, 0, 0, 0, 0, 37,
3074 38, 0, 133, 0, 0, 0, 39, 0, 0, 0,
3075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3076 0, 0, 0, 0, 0, 0, 40, 41, 0, 0,
3077 0, 0, 0, 0, 0, 134, 0, 150, 0, 3,
3078 4, 0, 5, 6, 7, 8, 9, 0, 43, 0,
3079 0, 0, 0, 44, 45, 0, 0, 0, 46, 20,
3080 47, 22, 48, 23, 49, 0, 129, 0, 0, 0,
3081 24, 0, 0, 0, 0, 0, 0, 28, 0, 29,
3082 151, 0, 0, 0, 0, 0, 0, 34, 0, 35,
3083 36, 0, 0, 0, 0, 0, 0, 37, 0, 0,
3084 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3085 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3086 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3087 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3088 24, 0, 0, 0, 0, 0, 43, 28, 0, 29,
3089 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3090 36, 0, 49, 0, 0, 0, 0, 37, 0, 0,
3091 0, 0, 0, 0, 39, 0, 0, 100, 0, 3,
3092 4, 0, 5, 6, 7, 8, 9, 0, 0, 0,
3093 0, 0, 0, 0, 40, 41, 0, 0, 0, 20,
3094 0, 22, 0, 23, 0, 0, 0, 0, 0, 0,
3095 0, 0, 0, 0, 0, 0, 43, 0, 0, 29,
3096 0, 44, 45, 0, 0, 0, 46, 34, 47, 35,
3097 36, 0, 49, 0, 0, 0, 0, 0, 0, 168,
3098 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
3099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3100 0, 0, 0, 0, 40, 41, 169, 170, 171, 0,
3101 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3102 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3103 191, 192, 0, 193, 194, 195, 46, 0, 47, 0,
3104 0, 196, 49, 197, 0, 198, 199, 200, 201, 202,
3105 168, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3106 0, 208, 0, 209, 0, 0, 210, 0, 0, 0,
3107 0, 0, 333, 0, 0, 0, 0, 169, 170, 171,
3108 0, 172, 173, 174, 175, 176, 177, 178, 179, 180,
3109 181, 182, 183, 184, 185, 186, 187, 188, 189, 0,
3110 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3111 0, 0, 196, 168, 197, 0, 198, 199, 200, 201,
3112 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3113 0, 0, 208, 0, 209, 0, 0, 210, 0, 0,
3114 169, 170, 171, 365, 172, 173, 174, 175, 176, 177,
3115 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
3116 188, 189, 0, 190, 191, 192, 0, 193, 194, 195,
3117 0, 0, 0, 0, 0, 196, 168, 197, 0, 198,
3118 199, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3119 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3120 210, 0, 0, 169, 170, 171, 403, 172, 173, 174,
3121 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
3122 185, 186, 187, 188, 189, 0, 190, 191, 192, 0,
3123 193, 194, 195, 0, 0, 0, 0, 168, 196, 0,
3124 197, 357, 198, 199, 200, 201, 202, 0, 203, 204,
3125 205, 206, 207, 0, 0, 0, 0, 0, 208, 0,
3126 209, 0, 0, 210, 169, 170, 171, 0, 172, 173,
3127 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
3128 184, 185, 186, 187, 188, 189, 0, 190, 191, 192,
3129 0, 193, 194, 195, 0, 0, 0, 0, 168, 196,
3130 0, 197, 0, 198, 199, 200, 201, 202, 0, 203,
3131 204, 205, 206, 207, 0, 0, 0, 0, 0, 208,
3132 0, 209, 359, 0, 210, 169, 170, 171, 0, 172,
3133 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3134 183, 184, 185, 186, 187, 188, 189, 0, 190, 191,
3135 192, 0, 193, 194, 195, 0, 0, 0, 0, 168,
3136 196, 0, 197, 493, 198, 199, 200, 201, 202, 0,
3137 203, 204, 205, 206, 207, 0, 0, 0, 0, 0,
3138 208, 0, 209, 0, 0, 210, 169, 170, 171, 0,
3139 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3140 182, 183, 184, 185, 186, 187, 188, 189, 0, 190,
3141 191, 192, 0, 193, 194, 195, 0, 0, 0, 0,
3142 168, 196, 0, 197, 0, 198, 199, 200, 201, 202,
3143 0, 203, 204, 205, 206, 207, 0, 0, 0, 0,
3144 0, 208, 0, 209, 0, 0, 210, 169, 170, 171,
3145 0, 172, 173, 174, 175, 176, 177, 0, 0, 0,
3146 0, 0, 0, 0, 0, 0, 0, 0, 189, 0,
3147 190, 191, 192, 0, 193, 194, 195, 0, 0, 0,
3148 0, 168, 0, 0, 0, 0, 198, 199, 200, 201,
3149 202, 0, 203, 204, 205, 206, 207, 0, 0, 0,
3150 0, 0, 208, 0, 209, 0, 0, 210, 169, 170,
3151 171, 0, 172, 173, 174, 175, 176, 177, 0, 0,
3152 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3153 0, 190, 191, 192, 0, 193, 194, 195, 0, 0,
3154 0, 0, 168, 0, 0, 0, 0, 198, 199, 200,
3155 201, 202, 0, 203, 204, 205, 206, 207, 0, 0,
3156 0, 0, 0, 208, 0, 209, 0, 0, 210, 169,
3157 170, 171, 0, 172, 173, 174, 175, 176, 177, 0,
3158 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3159 0, 0, 190, 191, 192, 0, 193, 194, 195, 0,
3160 0, 0, 0, 168, 0, 0, 0, 0, 0, 199,
3161 200, 201, 202, 0, 203, 204, 205, 206, 207, 0,
3162 0, 0, 0, 0, 208, 0, 209, 0, 0, 210,
3163 169, 170, 171, 0, 172, 173, 174, 175, 176, 177,
3164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3165 0, 0, 0, 190, 191, 192, 0, 193, 194, 195,
3166 0, 0, 0, 0, 168, 0, 0, 0, 0, 0,
3167 0, 200, 201, 202, 0, 203, 204, 205, 206, 207,
3168 0, 0, 0, 0, 0, 208, 0, 209, 0, 0,
3169 210, 169, 170, 171, 0, 172, 173, 174, 175, 176,
3170 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3171 0, 0, 0, 0, 190, 191, 192, 0, 193, 194,
3172 195, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3173 0, 0, -155, 201, 202, 0, 203, 204, 205, 206,
3174 207, 0, 0, 0, 0, 0, 208, 0, 209, 0,
3178 static const yytype_int16 yycheck[] =
3180 0, 0, 0, 0, 0, 39, 91, 20, 99, 58,
3181 65, 24, 110, 252, 3, 326, 392, 48, 3, 89,
3182 14, 320, 3, 4, 37, 92, 39, 40, 41, 3,
3183 43, 44, 45, 27, 47, 50, 91, 46, 19, 126,
3184 127, 68, 90, 91, 92, 3, 4, 35, 0, 0,
3185 122, 0, 52, 52, 52, 52, 52, 124, 34, 102,
3186 127, 19, 105, 51, 14, 376, 3, 4, 470, 368,
3187 122, 100, 474, 475, 122, 102, 124, 27, 3, 127,
3188 5, 136, 19, 8, 9, 10, 62, 12, 99, 100,
3189 100, 493, 126, 3, 4, 108, 105, 110, 18, 36,
3190 52, 52, 3, 52, 133, 507, 122, 122, 93, 19,
3191 208, 422, 514, 126, 100, 354, 3, 122, 5, 93,
3192 45, 130, 131, 133, 28, 126, 3, 122, 0, 33,
3193 55, 56, 127, 122, 126, 122, 375, 513, 100, 128,
3194 3, 3, 122, 122, 100, 126, 100, 133, 105, 149,
3195 149, 149, 149, 149, 167, 168, 169, 170, 171, 172,
3196 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3197 183, 184, 185, 186, 187, 188, 189, 133, 115, 133,
3198 193, 194, 195, 196, 197, 198, 199, 200, 201, 202,
3199 203, 204, 205, 206, 207, 208, 209, 149, 149, 233,
3200 149, 235, 215, 100, 213, 115, 127, 100, 132, 125,
3201 100, 126, 4, 3, 3, 3, 216, 216, 216, 250,
3202 233, 460, 235, 232, 218, 323, 68, 18, 20, 21,
3203 22, 4, 24, 227, 26, 3, 133, 476, 99, 68,
3204 99, 3, 3, 14, 253, 254, 38, 20, 21, 22,
3205 3, 24, 3, 26, 46, 47, 48, 49, 18, 350,
3206 127, 352, 127, 133, 122, 38, 105, 27, 18, 100,
3207 102, 31, 32, 46, 47, 48, 49, 27, 363, 518,
3208 335, 132, 32, 3, 44, 54, 46, 54, 343, 3,
3209 133, 89, 305, 378, 3, 122, 46, 132, 126, 3,
3210 133, 100, 127, 394, 389, 105, 132, 99, 363, 102,
3211 323, 122, 312, 312, 312, 17, 126, 100, 3, 126,
3212 320, 320, 320, 378, 132, 126, 99, 133, 322, 132,
3213 100, 126, 126, 65, 389, 122, 102, 133, 3, 388,
3214 132, 105, 3, 27, 357, 379, 132, 438, 133, 126,
3215 384, 132, 126, 132, 132, 364, 132, 3, 133, 132,
3216 132, 126, 40, 122, 52, 4, 379, 149, 368, 368,
3217 368, 384, 457, 312, 459, 132, 399, 133, 132, 58,
3218 129, 20, 21, 22, 446, 24, 446, 26, 428, 67,
3219 68, 69, 428, 71, 72, 73, 74, 75, 76, 38,
3220 342, 70, 457, 499, 459, 485, 467, 400, 47, 48,
3221 49, 490, 90, 91, 92, 27, 94, 95, 96, 394,
3222 -1, -1, -1, -1, 372, -1, -1, -1, -1, 420,
3223 443, 109, 110, -1, 112, 113, 114, 115, 116, 439,
3224 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3225 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3226 92, 461, 461, 461, 461, 461, -1, 467, -1, -1,
3227 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3228 112, 113, 114, 115, 116, 485, 485, 485, 485, 485,
3229 122, -1, 124, -1, -1, 127, -1, -1, -1, 499,
3230 499, 499, 499, 499, 0, -1, -1, 3, 4, 5,
3231 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3232 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3233 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3234 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3235 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3236 56, -1, -1, 67, 68, 69, -1, 63, 64, -1,
3237 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3238 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3239 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3240 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3241 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3242 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3243 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3244 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3245 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3246 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3247 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3248 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3249 56, -1, -1, -1, 90, 91, 92, 63, 64, -1,
3250 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3251 -1, -1, -1, -1, -1, -1, -1, -1, 114, 115,
3252 116, -1, -1, -1, 90, 91, 122, -1, 124, -1,
3253 -1, 127, -1, 99, -1, -1, -1, -1, -1, -1,
3254 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3255 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3256 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3257 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3258 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3259 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3260 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3261 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3262 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3263 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3264 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3265 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3266 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3267 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3268 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3269 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3270 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3271 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3272 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3273 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3274 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3275 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3276 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3278 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3279 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3280 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3281 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3282 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3283 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3284 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3285 26, -1, -1, 29, -1, -1, 40, -1, -1, -1,
3286 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3287 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3288 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3289 -1, 75, 76, -1, 70, -1, -1, -1, -1, -1,
3290 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3291 94, 95, 96, -1, 90, 91, -1, -1, -1, -1,
3292 -1, -1, -1, 99, -1, 109, 110, -1, 112, 113,
3293 114, 115, 116, -1, -1, -1, 112, -1, 122, -1,
3294 124, 117, 118, 127, -1, -1, 122, -1, 124, -1,
3295 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3296 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3297 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3298 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3299 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3300 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3301 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3302 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3303 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3304 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3305 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3306 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3307 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3308 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3309 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3310 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3311 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3312 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3313 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3314 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3315 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3316 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3317 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3318 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3319 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3320 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3321 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3322 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3323 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3324 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3325 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3326 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3327 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3328 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3330 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3331 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3332 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3333 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3334 126, -1, 128, -1, -1, -1, 132, 3, 4, 5,
3335 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3336 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3337 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3338 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3339 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3340 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3341 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3342 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3343 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3344 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3345 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3346 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3347 126, -1, 128, -1, 0, -1, 132, 3, 4, 5,
3348 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3349 16, -1, -1, 19, 20, 21, 22, 23, 24, 25,
3350 26, -1, -1, 29, -1, -1, -1, -1, -1, -1,
3351 36, -1, 38, 39, -1, 41, -1, 43, -1, 45,
3352 -1, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3353 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3354 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3355 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3356 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3357 -1, -1, -1, 99, -1, -1, -1, -1, -1, -1,
3358 -1, -1, -1, -1, -1, -1, 112, -1, -1, -1,
3359 -1, 117, 118, -1, -1, -1, 122, -1, 124, -1,
3360 126, -1, 128, 3, 4, 5, 6, -1, 8, 9,
3361 10, 11, 12, 13, 14, 15, 16, -1, 18, -1,
3362 20, 21, 22, 23, 24, 25, 26, 27, -1, 29,
3363 30, -1, 32, -1, -1, -1, 36, 37, 38, 39,
3364 -1, 41, 42, 43, -1, 45, 46, 47, 48, 49,
3365 -1, -1, 52, 53, -1, 55, 56, -1, -1, -1,
3366 -1, -1, -1, 63, 64, -1, 66, -1, -1, -1,
3367 70, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3368 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3369 90, 91, -1, -1, -1, -1, -1, -1, -1, 99,
3370 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3371 -1, -1, 112, -1, -1, -1, -1, 117, 118, -1,
3372 -1, -1, 122, -1, 124, -1, 126, -1, 128, 3,
3373 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
3374 14, 15, 16, -1, -1, -1, 20, 21, 22, 23,
3375 24, 25, 26, 27, -1, 29, 30, -1, 32, -1,
3376 -1, -1, 36, 37, 38, 39, -1, 41, 42, 43,
3377 -1, 45, 46, 47, 48, 49, -1, -1, 52, 53,
3378 -1, 55, 56, -1, -1, -1, -1, -1, -1, 63,
3379 64, -1, 66, -1, -1, -1, 70, -1, -1, -1,
3380 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3381 -1, -1, -1, -1, -1, -1, 90, 91, -1, -1,
3382 -1, -1, -1, -1, -1, 99, -1, 3, -1, 5,
3383 6, -1, 8, 9, 10, 11, 12, -1, 112, -1,
3384 -1, -1, -1, 117, 118, -1, -1, -1, 122, 25,
3385 124, 27, 126, 29, 128, -1, 32, -1, -1, -1,
3386 36, -1, -1, -1, -1, -1, -1, 43, -1, 45,
3387 46, -1, -1, -1, -1, -1, -1, 53, -1, 55,
3388 56, -1, -1, -1, -1, -1, -1, 63, -1, -1,
3389 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3390 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3391 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3392 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3393 36, -1, -1, -1, -1, -1, 112, 43, -1, 45,
3394 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3395 56, -1, 128, -1, -1, -1, -1, 63, -1, -1,
3396 -1, -1, -1, -1, 70, -1, -1, 3, -1, 5,
3397 6, -1, 8, 9, 10, 11, 12, -1, -1, -1,
3398 -1, -1, -1, -1, 90, 91, -1, -1, -1, 25,
3399 -1, 27, -1, 29, -1, -1, -1, -1, -1, -1,
3400 -1, -1, -1, -1, -1, -1, 112, -1, -1, 45,
3401 -1, 117, 118, -1, -1, -1, 122, 53, 124, 55,
3402 56, -1, 128, -1, -1, -1, -1, -1, -1, 40,
3403 -1, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3404 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3405 -1, -1, -1, -1, 90, 91, 67, 68, 69, -1,
3406 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3407 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3408 91, 92, -1, 94, 95, 96, 122, -1, 124, -1,
3409 -1, 102, 128, 104, -1, 106, 107, 108, 109, 110,
3410 40, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3411 -1, 122, -1, 124, -1, -1, 127, -1, -1, -1,
3412 -1, -1, 133, -1, -1, -1, -1, 67, 68, 69,
3413 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
3414 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
3415 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3416 -1, -1, 102, 40, 104, -1, 106, 107, 108, 109,
3417 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3418 -1, -1, 122, -1, 124, -1, -1, 127, -1, -1,
3419 67, 68, 69, 133, 71, 72, 73, 74, 75, 76,
3420 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3421 87, 88, -1, 90, 91, 92, -1, 94, 95, 96,
3422 -1, -1, -1, -1, -1, 102, 40, 104, -1, 106,
3423 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3424 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3425 127, -1, -1, 67, 68, 69, 133, 71, 72, 73,
3426 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3427 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3428 94, 95, 96, -1, -1, -1, -1, 40, 102, -1,
3429 104, 105, 106, 107, 108, 109, 110, -1, 112, 113,
3430 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3431 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3432 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3433 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3434 -1, 94, 95, 96, -1, -1, -1, -1, 40, 102,
3435 -1, 104, -1, 106, 107, 108, 109, 110, -1, 112,
3436 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3437 -1, 124, 125, -1, 127, 67, 68, 69, -1, 71,
3438 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3439 82, 83, 84, 85, 86, 87, 88, -1, 90, 91,
3440 92, -1, 94, 95, 96, -1, -1, -1, -1, 40,
3441 102, -1, 104, 105, 106, 107, 108, 109, 110, -1,
3442 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3443 122, -1, 124, -1, -1, 127, 67, 68, 69, -1,
3444 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3445 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3446 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3447 40, 102, -1, 104, -1, 106, 107, 108, 109, 110,
3448 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3449 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3450 -1, 71, 72, 73, 74, 75, 76, -1, -1, -1,
3451 -1, -1, -1, -1, -1, -1, -1, -1, 88, -1,
3452 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3453 -1, 40, -1, -1, -1, -1, 106, 107, 108, 109,
3454 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3455 -1, -1, 122, -1, 124, -1, -1, 127, 67, 68,
3456 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3457 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3458 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3459 -1, -1, 40, -1, -1, -1, -1, 106, 107, 108,
3460 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3461 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3462 68, 69, -1, 71, 72, 73, 74, 75, 76, -1,
3463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3464 -1, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3465 -1, -1, -1, 40, -1, -1, -1, -1, -1, 107,
3466 108, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3467 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3468 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3469 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3470 -1, -1, -1, 90, 91, 92, -1, 94, 95, 96,
3471 -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
3472 -1, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3473 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3474 127, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3475 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3476 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3477 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3478 -1, -1, 108, 109, 110, -1, 112, 113, 114, 115,
3479 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3483 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3484 symbol of state STATE-NUM. */
3485 static const yytype_uint8 yystos[] =
3487 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3488 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3489 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3490 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3491 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3492 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3493 160, 161, 163, 171, 179, 182, 183, 186, 189, 190,
3494 191, 192, 196, 198, 207, 217, 220, 233, 234, 235,
3495 238, 239, 240, 241, 244, 246, 247, 89, 50, 122,
3496 122, 164, 122, 3, 4, 19, 126, 184, 185, 18,
3497 3, 240, 3, 219, 240, 122, 185, 223, 122, 126,
3498 122, 127, 240, 122, 237, 240, 242, 243, 240, 240,
3499 240, 240, 240, 238, 229, 230, 231, 237, 30, 32,
3500 37, 42, 46, 66, 99, 132, 143, 144, 145, 148,
3501 150, 165, 166, 181, 190, 236, 3, 0, 138, 126,
3502 3, 46, 150, 156, 157, 239, 145, 146, 18, 27,
3503 31, 32, 44, 46, 206, 245, 192, 100, 40, 67,
3504 68, 69, 71, 72, 73, 74, 75, 76, 77, 78,
3505 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3506 90, 91, 92, 94, 95, 96, 102, 104, 106, 107,
3507 108, 109, 110, 112, 113, 114, 115, 116, 122, 124,
3508 127, 3, 122, 162, 146, 172, 188, 126, 127, 184,
3509 185, 222, 223, 224, 232, 122, 238, 127, 240, 180,
3510 229, 3, 155, 105, 132, 100, 133, 125, 100, 237,
3511 3, 3, 151, 152, 238, 238, 151, 3, 132, 145,
3512 126, 136, 3, 99, 68, 99, 3, 35, 51, 216,
3513 3, 3, 208, 240, 240, 240, 240, 240, 240, 240,
3514 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3515 240, 240, 240, 240, 240, 240, 3, 240, 240, 240,
3516 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
3517 240, 240, 229, 240, 3, 122, 128, 238, 14, 240,
3518 99, 139, 140, 141, 147, 148, 196, 198, 207, 217,
3519 187, 184, 127, 122, 228, 3, 93, 213, 214, 215,
3520 133, 115, 184, 133, 142, 143, 133, 238, 237, 237,
3521 105, 227, 100, 143, 132, 227, 238, 238, 102, 3,
3522 54, 193, 54, 194, 3, 209, 210, 105, 133, 125,
3523 89, 240, 3, 133, 122, 133, 132, 141, 126, 139,
3524 229, 102, 105, 211, 215, 133, 100, 132, 133, 105,
3525 36, 115, 224, 226, 102, 149, 152, 132, 99, 133,
3526 3, 5, 122, 224, 17, 195, 224, 225, 126, 227,
3527 100, 240, 3, 133, 146, 238, 126, 139, 132, 133,
3528 3, 5, 8, 9, 10, 12, 45, 55, 56, 212,
3529 226, 227, 93, 215, 28, 33, 173, 175, 177, 178,
3530 146, 237, 237, 239, 146, 213, 225, 126, 100, 199,
3531 149, 210, 133, 34, 62, 167, 168, 169, 170, 132,
3532 211, 126, 215, 126, 122, 173, 175, 65, 153, 133,
3533 133, 197, 224, 46, 99, 190, 203, 204, 205, 240,
3534 105, 132, 169, 170, 221, 176, 3, 146, 146, 227,
3535 99, 144, 148, 190, 200, 201, 202, 207, 217, 3,
3536 27, 132, 205, 105, 142, 142, 142, 227, 126, 126,
3537 132, 202, 216, 142, 132, 132, 133, 218, 200, 3,
3538 174, 142, 132, 122, 126, 132, 213, 142, 133, 132,
3542 #define yyerrok (yyerrstatus = 0)
3543 #define yyclearin (yychar = YYEMPTY)
3544 #define YYEMPTY (-2)
3547 #define YYACCEPT goto yyacceptlab
3548 #define YYABORT goto yyabortlab
3549 #define YYERROR goto yyerrorlab
3552 /* Like YYERROR except do call yyerror. This remains here temporarily
3553 to ease the transition to the new meaning of YYERROR, for GCC.
3554 Once GCC version 2 has supplanted version 1, this can go. */
3556 #define YYFAIL goto yyerrlab
3558 #define YYRECOVERING() (!!yyerrstatus)
3560 #define YYBACKUP(Token, Value) \
3562 if (yychar == YYEMPTY && yylen == 1) \
3566 yytoken = YYTRANSLATE (yychar); \
3572 yyerror (YY_("syntax error: cannot back up")); \
3579 #define YYERRCODE 256
3582 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3583 If N is 0, then set CURRENT to the empty location which ends
3584 the previous symbol: RHS[0] (always defined). */
3586 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3587 #ifndef YYLLOC_DEFAULT
3588 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3592 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3593 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3594 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3595 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3599 (Current).first_line = (Current).last_line = \
3600 YYRHSLOC (Rhs, 0).last_line; \
3601 (Current).first_column = (Current).last_column = \
3602 YYRHSLOC (Rhs, 0).last_column; \
3608 /* YY_LOCATION_PRINT -- Print the location on the stream.
3609 This macro was not mandated originally: define only if we know
3610 we won't break user code: when these are the locations we know. */
3612 #ifndef YY_LOCATION_PRINT
3613 # if YYLTYPE_IS_TRIVIAL
3614 # define YY_LOCATION_PRINT(File, Loc) \
3615 fprintf (File, "%d.%d-%d.%d", \
3616 (Loc).first_line, (Loc).first_column, \
3617 (Loc).last_line, (Loc).last_column)
3619 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3624 /* YYLEX -- calling `yylex' with the right arguments. */
3627 # define YYLEX yylex (YYLEX_PARAM)
3629 # define YYLEX yylex ()
3632 /* Enable debugging if requested. */
3636 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3637 # define YYFPRINTF fprintf
3640 # define YYDPRINTF(Args) \
3646 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3650 YYFPRINTF (stderr, "%s ", Title); \
3651 yy_symbol_print (stderr, \
3653 YYFPRINTF (stderr, "\n"); \
3658 /*--------------------------------.
3659 | Print this symbol on YYOUTPUT. |
3660 `--------------------------------*/
3663 #if (defined __STDC__ || defined __C99__FUNC__ \
3664 || defined __cplusplus || defined _MSC_VER)
3666 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3669 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3672 YYSTYPE const * const yyvaluep;
3678 if (yytype < YYNTOKENS)
3679 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3691 /*--------------------------------.
3692 | Print this symbol on YYOUTPUT. |
3693 `--------------------------------*/
3695 #if (defined __STDC__ || defined __C99__FUNC__ \
3696 || defined __cplusplus || defined _MSC_VER)
3698 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3701 yy_symbol_print (yyoutput, yytype, yyvaluep)
3704 YYSTYPE const * const yyvaluep;
3707 if (yytype < YYNTOKENS)
3708 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3710 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3712 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3713 YYFPRINTF (yyoutput, ")");
3716 /*------------------------------------------------------------------.
3717 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3719 `------------------------------------------------------------------*/
3721 #if (defined __STDC__ || defined __C99__FUNC__ \
3722 || defined __cplusplus || defined _MSC_VER)
3724 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3727 yy_stack_print (yybottom, yytop)
3728 yytype_int16 *yybottom;
3729 yytype_int16 *yytop;
3732 YYFPRINTF (stderr, "Stack now");
3733 for (; yybottom <= yytop; yybottom++)
3735 int yybot = *yybottom;
3736 YYFPRINTF (stderr, " %d", yybot);
3738 YYFPRINTF (stderr, "\n");
3741 # define YY_STACK_PRINT(Bottom, Top) \
3744 yy_stack_print ((Bottom), (Top)); \
3748 /*------------------------------------------------.
3749 | Report that the YYRULE is going to be reduced. |
3750 `------------------------------------------------*/
3752 #if (defined __STDC__ || defined __C99__FUNC__ \
3753 || defined __cplusplus || defined _MSC_VER)
3755 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3758 yy_reduce_print (yyvsp, yyrule)
3763 int yynrhs = yyr2[yyrule];
3765 unsigned long int yylno = yyrline[yyrule];
3766 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3768 /* The symbols being reduced. */
3769 for (yyi = 0; yyi < yynrhs; yyi++)
3771 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3772 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3773 &(yyvsp[(yyi + 1) - (yynrhs)])
3775 YYFPRINTF (stderr, "\n");
3779 # define YY_REDUCE_PRINT(Rule) \
3782 yy_reduce_print (yyvsp, Rule); \
3785 /* Nonzero means print parse trace. It is left uninitialized so that
3786 multiple parsers can coexist. */
3788 #else /* !YYDEBUG */
3789 # define YYDPRINTF(Args)
3790 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3791 # define YY_STACK_PRINT(Bottom, Top)
3792 # define YY_REDUCE_PRINT(Rule)
3793 #endif /* !YYDEBUG */
3796 /* YYINITDEPTH -- initial size of the parser's stacks. */
3798 # define YYINITDEPTH 200
3801 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3802 if the built-in stack extension method is used).
3804 Do not make this value too large; the results are undefined if
3805 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3806 evaluated with infinite-precision integer arithmetic. */
3809 # define YYMAXDEPTH 10000
3817 # if defined __GLIBC__ && defined _STRING_H
3818 # define yystrlen strlen
3820 /* Return the length of YYSTR. */
3821 #if (defined __STDC__ || defined __C99__FUNC__ \
3822 || defined __cplusplus || defined _MSC_VER)
3824 yystrlen (const char *yystr)
3832 for (yylen = 0; yystr[yylen]; yylen++)
3840 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3841 # define yystpcpy stpcpy
3843 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3845 #if (defined __STDC__ || defined __C99__FUNC__ \
3846 || defined __cplusplus || defined _MSC_VER)
3848 yystpcpy (char *yydest, const char *yysrc)
3851 yystpcpy (yydest, yysrc)
3857 const char *yys = yysrc;
3859 while ((*yyd++ = *yys++) != '\0')
3868 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3869 quotes and backslashes, so that it's suitable for yyerror. The
3870 heuristic is that double-quoting is unnecessary unless the string
3871 contains an apostrophe, a comma, or backslash (other than
3872 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3873 null, do not copy; instead, return the length of what the result
3876 yytnamerr (char *yyres, const char *yystr)
3881 char const *yyp = yystr;
3888 goto do_not_strip_quotes;
3892 goto do_not_strip_quotes;
3905 do_not_strip_quotes: ;
3909 return yystrlen (yystr);
3911 return yystpcpy (yyres, yystr) - yyres;
3915 /* Copy into YYRESULT an error message about the unexpected token
3916 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3917 including the terminating null byte. If YYRESULT is null, do not
3918 copy anything; just return the number of bytes that would be
3919 copied. As a special case, return 0 if an ordinary "syntax error"
3920 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3921 size calculation. */
3923 yysyntax_error (char *yyresult, int yystate, int yychar)
3925 int yyn = yypact[yystate];
3927 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3931 int yytype = YYTRANSLATE (yychar);
3932 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3933 YYSIZE_T yysize = yysize0;
3935 int yysize_overflow = 0;
3936 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3937 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3941 /* This is so xgettext sees the translatable formats that are
3942 constructed on the fly. */
3943 YY_("syntax error, unexpected %s");
3944 YY_("syntax error, unexpected %s, expecting %s");
3945 YY_("syntax error, unexpected %s, expecting %s or %s");
3946 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3947 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3951 static char const yyunexpected[] = "syntax error, unexpected %s";
3952 static char const yyexpecting[] = ", expecting %s";
3953 static char const yyor[] = " or %s";
3954 char yyformat[sizeof yyunexpected
3955 + sizeof yyexpecting - 1
3956 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3957 * (sizeof yyor - 1))];
3958 char const *yyprefix = yyexpecting;
3960 /* Start YYX at -YYN if negative to avoid negative indexes in
3962 int yyxbegin = yyn < 0 ? -yyn : 0;
3964 /* Stay within bounds of both yycheck and yytname. */
3965 int yychecklim = YYLAST - yyn + 1;
3966 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3969 yyarg[0] = yytname[yytype];
3970 yyfmt = yystpcpy (yyformat, yyunexpected);
3972 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3973 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3975 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3979 yyformat[sizeof yyunexpected - 1] = '\0';
3982 yyarg[yycount++] = yytname[yyx];
3983 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3984 yysize_overflow |= (yysize1 < yysize);
3986 yyfmt = yystpcpy (yyfmt, yyprefix);
3990 yyf = YY_(yyformat);
3991 yysize1 = yysize + yystrlen (yyf);
3992 yysize_overflow |= (yysize1 < yysize);
3995 if (yysize_overflow)
3996 return YYSIZE_MAXIMUM;
4000 /* Avoid sprintf, as that infringes on the user's name space.
4001 Don't have undefined behavior even if the translation
4002 produced a string with the wrong number of "%s"s. */
4003 char *yyp = yyresult;
4005 while ((*yyp = *yyf) != '\0')
4007 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
4009 yyp += yytnamerr (yyp, yyarg[yyi++]);
4022 #endif /* YYERROR_VERBOSE */
4025 /*-----------------------------------------------.
4026 | Release the memory associated to this symbol. |
4027 `-----------------------------------------------*/
4030 #if (defined __STDC__ || defined __C99__FUNC__ \
4031 || defined __cplusplus || defined _MSC_VER)
4033 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
4036 yydestruct (yymsg, yytype, yyvaluep)
4046 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
4056 /* Prevent warnings from -Wmissing-prototypes. */
4057 #ifdef YYPARSE_PARAM
4058 #if defined __STDC__ || defined __cplusplus
4059 int yyparse (void *YYPARSE_PARAM);
4063 #else /* ! YYPARSE_PARAM */
4064 #if defined __STDC__ || defined __cplusplus
4069 #endif /* ! YYPARSE_PARAM */
4072 /* The lookahead symbol. */
4075 /* The semantic value of the lookahead symbol. */
4078 /* Number of syntax errors so far. */
4083 /*-------------------------.
4084 | yyparse or yypush_parse. |
4085 `-------------------------*/
4087 #ifdef YYPARSE_PARAM
4088 #if (defined __STDC__ || defined __C99__FUNC__ \
4089 || defined __cplusplus || defined _MSC_VER)
4091 yyparse (void *YYPARSE_PARAM)
4094 yyparse (YYPARSE_PARAM)
4095 void *YYPARSE_PARAM;
4097 #else /* ! YYPARSE_PARAM */
4098 #if (defined __STDC__ || defined __C99__FUNC__ \
4099 || defined __cplusplus || defined _MSC_VER)
4112 /* Number of tokens to shift before error messages enabled. */
4115 /* The stacks and their tools:
4116 `yyss': related to states.
4117 `yyvs': related to semantic values.
4119 Refer to the stacks thru separate pointers, to allow yyoverflow
4120 to reallocate them elsewhere. */
4122 /* The state stack. */
4123 yytype_int16 yyssa[YYINITDEPTH];
4125 yytype_int16 *yyssp;
4127 /* The semantic value stack. */
4128 YYSTYPE yyvsa[YYINITDEPTH];
4132 YYSIZE_T yystacksize;
4136 /* Lookahead token as an internal (translated) token number. */
4138 /* The variables used to return semantic value and location from the
4143 /* Buffer for error messages, and its allocated size. */
4145 char *yymsg = yymsgbuf;
4146 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4149 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4151 /* The number of symbols on the RHS of the reduced rule.
4152 Keep to zero when no symbol should be popped. */
4158 yystacksize = YYINITDEPTH;
4160 YYDPRINTF ((stderr, "Starting parse\n"));
4165 yychar = YYEMPTY; /* Cause a token to be read. */
4167 /* Initialize stack pointers.
4168 Waste one element of value and location stack
4169 so that they stay on the same level as the state stack.
4170 The wasted elements are never initialized. */
4176 /*------------------------------------------------------------.
4177 | yynewstate -- Push a new state, which is found in yystate. |
4178 `------------------------------------------------------------*/
4180 /* In all cases, when you get here, the value and location stacks
4181 have just been pushed. So pushing a state here evens the stacks. */
4187 if (yyss + yystacksize - 1 <= yyssp)
4189 /* Get the current used size of the three stacks, in elements. */
4190 YYSIZE_T yysize = yyssp - yyss + 1;
4194 /* Give user a chance to reallocate the stack. Use copies of
4195 these so that the &'s don't force the real ones into
4197 YYSTYPE *yyvs1 = yyvs;
4198 yytype_int16 *yyss1 = yyss;
4200 /* Each stack pointer address is followed by the size of the
4201 data in use in that stack, in bytes. This used to be a
4202 conditional around just the two extra args, but that might
4203 be undefined if yyoverflow is a macro. */
4204 yyoverflow (YY_("memory exhausted"),
4205 &yyss1, yysize * sizeof (*yyssp),
4206 &yyvs1, yysize * sizeof (*yyvsp),
4212 #else /* no yyoverflow */
4213 # ifndef YYSTACK_RELOCATE
4214 goto yyexhaustedlab;
4216 /* Extend the stack our own way. */
4217 if (YYMAXDEPTH <= yystacksize)
4218 goto yyexhaustedlab;
4220 if (YYMAXDEPTH < yystacksize)
4221 yystacksize = YYMAXDEPTH;
4224 yytype_int16 *yyss1 = yyss;
4225 union yyalloc *yyptr =
4226 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4228 goto yyexhaustedlab;
4229 YYSTACK_RELOCATE (yyss_alloc, yyss);
4230 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4231 # undef YYSTACK_RELOCATE
4233 YYSTACK_FREE (yyss1);
4236 #endif /* no yyoverflow */
4238 yyssp = yyss + yysize - 1;
4239 yyvsp = yyvs + yysize - 1;
4241 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4242 (unsigned long int) yystacksize));
4244 if (yyss + yystacksize - 1 <= yyssp)
4248 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4250 if (yystate == YYFINAL)
4260 /* Do appropriate processing given the current state. Read a
4261 lookahead token if we need one and don't already have one. */
4263 /* First try to decide what to do without reference to lookahead token. */
4264 yyn = yypact[yystate];
4265 if (yyn == YYPACT_NINF)
4268 /* Not known => get a lookahead token if don't already have one. */
4270 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4271 if (yychar == YYEMPTY)
4273 YYDPRINTF ((stderr, "Reading a token: "));
4277 if (yychar <= YYEOF)
4279 yychar = yytoken = YYEOF;
4280 YYDPRINTF ((stderr, "Now at end of input.\n"));
4284 yytoken = YYTRANSLATE (yychar);
4285 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4288 /* If the proper action on seeing token YYTOKEN is to reduce or to
4289 detect an error, take that action. */
4291 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4296 if (yyn == 0 || yyn == YYTABLE_NINF)
4302 /* Count tokens shifted since error; after three, turn off error
4307 /* Shift the lookahead token. */
4308 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4310 /* Discard the shifted token. */
4319 /*-----------------------------------------------------------.
4320 | yydefault -- do the default action for the current state. |
4321 `-----------------------------------------------------------*/
4323 yyn = yydefact[yystate];
4329 /*-----------------------------.
4330 | yyreduce -- Do a reduction. |
4331 `-----------------------------*/
4333 /* yyn is the number of a rule to reduce with. */
4336 /* If YYLEN is nonzero, implement the default value of the action:
4339 Otherwise, the following line sets YYVAL to garbage.
4340 This behavior is undocumented and Bison
4341 users should not rely upon it. Assigning to YYVAL
4342 unconditionally makes the parser a bit smaller, and it avoids a
4343 GCC warning that YYVAL may be used uninitialized. */
4344 yyval = yyvsp[1-yylen];
4347 YY_REDUCE_PRINT (yyn);
4354 /* Line 1464 of skeleton.m4 */
4355 #line 2123 "parser.y"
4356 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4365 /* Line 1464 of skeleton.m4 */
4366 #line 2124 "parser.y"
4367 {(yyval.code)=code_new();}
4376 /* Line 1464 of skeleton.m4 */
4377 #line 2126 "parser.y"
4378 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4387 /* Line 1464 of skeleton.m4 */
4388 #line 2127 "parser.y"
4389 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4398 /* Line 1464 of skeleton.m4 */
4399 #line 2142 "parser.y"
4400 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4409 /* Line 1464 of skeleton.m4 */
4410 #line 2143 "parser.y"
4420 /* Line 1464 of skeleton.m4 */
4421 #line 2146 "parser.y"
4431 /* Line 1464 of skeleton.m4 */
4432 #line 2153 "parser.y"
4433 {(yyval.code)=(yyvsp[(3) - (4)].code);}
4442 /* Line 1464 of skeleton.m4 */
4443 #line 2157 "parser.y"
4444 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4453 /* Line 1464 of skeleton.m4 */
4454 #line 2158 "parser.y"
4455 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4464 /* Line 1464 of skeleton.m4 */
4465 #line 2162 "parser.y"
4467 code_t**cc = &global->init->method->body->code;
4468 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4478 /* Line 1464 of skeleton.m4 */
4479 #line 2173 "parser.y"
4480 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4489 /* Line 1464 of skeleton.m4 */
4490 #line 2174 "parser.y"
4491 {(yyval.value).c=abc_pushundefined(0);
4492 (yyval.value).t=TYPE_ANY;
4502 /* Line 1464 of skeleton.m4 */
4503 #line 2178 "parser.y"
4504 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4513 /* Line 1464 of skeleton.m4 */
4514 #line 2179 "parser.y"
4515 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4524 /* Line 1464 of skeleton.m4 */
4525 #line 2181 "parser.y"
4526 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4535 /* Line 1464 of skeleton.m4 */
4536 #line 2182 "parser.y"
4537 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4546 /* Line 1464 of skeleton.m4 */
4547 #line 2185 "parser.y"
4550 if(variable_exists((yyvsp[(1) - (3)].id)))
4551 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4553 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4556 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4557 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4558 (yyvsp[(2) - (3)].classinfo)->name);
4563 if(state->method->uses_slots) {
4564 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4566 // this variable is stored in a slot
4568 v->type = (yyvsp[(2) - (3)].classinfo);
4574 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4577 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4579 if((yyvsp[(2) - (3)].classinfo)) {
4580 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4581 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4582 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4584 code_free((yyvsp[(3) - (3)].value).c);
4585 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4588 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4589 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4590 (yyval.code) = abc_coerce_a((yyval.code));
4592 // don't do anything
4593 code_free((yyvsp[(3) - (3)].value).c);
4594 code_free((yyval.code));
4600 (yyval.code) = abc_setslot((yyval.code), index);
4602 (yyval.code) = abc_setlocal((yyval.code), index);
4613 /* Line 1464 of skeleton.m4 */
4614 #line 2245 "parser.y"
4615 {(yyval.code) = code_new();}
4624 /* Line 1464 of skeleton.m4 */
4625 #line 2246 "parser.y"
4626 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4635 /* Line 1464 of skeleton.m4 */
4636 #line 2249 "parser.y"
4637 {PASS12 new_state();}
4646 /* Line 1464 of skeleton.m4 */
4647 #line 2249 "parser.y"
4650 (yyval.code) = code_new();
4651 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4652 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4654 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4655 if((yyvsp[(7) - (7)].code)) {
4656 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4658 myif->branch = (yyval.code) = abc_nop((yyval.code));
4659 if((yyvsp[(7) - (7)].code)) {
4660 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4661 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4663 (yyval.code) = var_block((yyval.code));
4674 /* Line 1464 of skeleton.m4 */
4675 #line 2268 "parser.y"
4676 {(yyval.code)=code_new();}
4685 /* Line 1464 of skeleton.m4 */
4686 #line 2275 "parser.y"
4688 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4689 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4699 /* Line 1464 of skeleton.m4 */
4700 #line 2279 "parser.y"
4703 (yyval.id)=(yyvsp[(1) - (1)].id);
4713 /* Line 1464 of skeleton.m4 */
4714 #line 2284 "parser.y"
4715 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4724 /* Line 1464 of skeleton.m4 */
4725 #line 2285 "parser.y"
4726 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4735 /* Line 1464 of skeleton.m4 */
4736 #line 2287 "parser.y"
4738 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4739 (yyval.code) = code_new();
4740 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4741 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4742 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4743 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4744 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4745 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4746 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4747 (yyval.code) = abc_jump((yyval.code), loopstart);
4748 code_t*out = (yyval.code) = abc_nop((yyval.code));
4749 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4750 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4753 (yyval.code) = var_block((yyval.code));
4764 /* Line 1464 of skeleton.m4 */
4765 #line 2307 "parser.y"
4767 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4769 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4772 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4773 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4774 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4775 int array = new_variable(tmp1name, 0, 0, 0);
4777 (yyval.code) = code_new();
4778 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4779 (yyval.code) = abc_coerce_a((yyval.code));
4780 (yyval.code) = abc_setlocal((yyval.code), array);
4781 (yyval.code) = abc_pushbyte((yyval.code), 0);
4782 (yyval.code) = abc_setlocal((yyval.code), it);
4784 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4786 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4787 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4788 (yyval.code) = abc_getlocal((yyval.code), array);
4789 (yyval.code) = abc_getlocal((yyval.code), it);
4790 if(!(yyvsp[(1) - (6)].for_start).each)
4791 (yyval.code) = abc_nextname((yyval.code));
4793 (yyval.code) = abc_nextvalue((yyval.code));
4794 (yyval.code) = converttype((yyval.code), 0, var->type);
4795 (yyval.code) = abc_setlocal((yyval.code), var->index);
4797 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4798 (yyval.code) = abc_jump((yyval.code), loopstart);
4800 code_t*out = (yyval.code) = abc_nop((yyval.code));
4801 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4802 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4806 (yyval.code) = var_block((yyval.code));
4821 /* Line 1464 of skeleton.m4 */
4822 #line 2355 "parser.y"
4823 {PASS12 new_state();}
4832 /* Line 1464 of skeleton.m4 */
4833 #line 2355 "parser.y"
4836 (yyval.code) = code_new();
4838 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4839 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4840 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4841 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4842 myjmp->branch = cont;
4843 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4844 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4845 code_t*out = (yyval.code) = abc_nop((yyval.code));
4846 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4847 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4849 (yyval.code) = var_block((yyval.code));
4860 /* Line 1464 of skeleton.m4 */
4861 #line 2374 "parser.y"
4862 {PASS12 new_state();}
4871 /* Line 1464 of skeleton.m4 */
4872 #line 2374 "parser.y"
4874 (yyval.code) = code_new();
4875 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4876 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4877 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4878 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4879 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4880 code_t*out = (yyval.code) = abc_nop((yyval.code));
4881 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4882 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4884 (yyval.code) = var_block((yyval.code));
4895 /* Line 1464 of skeleton.m4 */
4896 #line 2389 "parser.y"
4898 (yyval.code) = abc___break__(0, "");
4908 /* Line 1464 of skeleton.m4 */
4909 #line 2392 "parser.y"
4911 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4921 /* Line 1464 of skeleton.m4 */
4922 #line 2395 "parser.y"
4924 (yyval.code) = abc___continue__(0, "");
4934 /* Line 1464 of skeleton.m4 */
4935 #line 2398 "parser.y"
4937 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4947 /* Line 1464 of skeleton.m4 */
4948 #line 2402 "parser.y"
4958 /* Line 1464 of skeleton.m4 */
4959 #line 2403 "parser.y"
4960 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4969 /* Line 1464 of skeleton.m4 */
4970 #line 2404 "parser.y"
4971 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4980 /* Line 1464 of skeleton.m4 */
4981 #line 2405 "parser.y"
4982 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4991 /* Line 1464 of skeleton.m4 */
4992 #line 2406 "parser.y"
4993 {(yyval.code)=(yyvsp[(1) - (1)].code);}
5002 /* Line 1464 of skeleton.m4 */
5003 #line 2407 "parser.y"
5004 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
5013 /* Line 1464 of skeleton.m4 */
5014 #line 2409 "parser.y"
5016 (yyval.code) = abc_getlocal(0, state->switch_var);
5017 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
5018 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
5019 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
5020 if((yyval.code)->opcode != OPCODE___BREAK__) {
5021 (yyval.code) = abc___fallthrough__((yyval.code), "");
5023 code_t*e = (yyval.code) = abc_nop((yyval.code));
5034 /* Line 1464 of skeleton.m4 */
5035 #line 2420 "parser.y"
5037 (yyval.code) = (yyvsp[(3) - (3)].code);
5047 /* Line 1464 of skeleton.m4 */
5048 #line 2423 "parser.y"
5049 {PASS12 new_state();state->switch_var=alloc_local();}
5058 /* Line 1464 of skeleton.m4 */
5059 #line 2423 "parser.y"
5061 (yyval.code)=(yyvsp[(4) - (8)].value).c;
5062 (yyval.code) = abc_setlocal((yyval.code), state->switch_var);
5063 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
5065 code_t*out = (yyval.code) = abc_kill((yyval.code), state->switch_var);
5066 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
5068 code_t*c = (yyval.code),*lastblock=0;
5070 if(c->opcode == OPCODE_IFNE) {
5071 if(!c->next) syntaxerror("internal error in fallthrough handling");
5073 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
5075 c->opcode = OPCODE_JUMP;
5076 c->branch = lastblock;
5078 /* fall through end of switch */
5079 c->opcode = OPCODE_NOP;
5085 (yyval.code) = var_block((yyval.code));
5096 /* Line 1464 of skeleton.m4 */
5097 #line 2454 "parser.y"
5098 {PASS12 new_state();
5099 state->exception_name=(yyvsp[(3) - (5)].id);
5100 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5101 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5111 /* Line 1464 of skeleton.m4 */
5112 #line 2459 "parser.y"
5114 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5115 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5117 NEW(abc_exception_t, e)
5118 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5119 e->var_name = multiname_clone(&name);
5120 (yyval.exception) = e;
5123 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5124 e->target = c = abc_nop(0);
5125 c = abc_setlocal(c, i);
5126 c = code_append(c, code_dup(state->method->scope_code));
5127 c = code_append(c, (yyvsp[(8) - (9)].code));
5141 /* Line 1464 of skeleton.m4 */
5142 #line 2479 "parser.y"
5143 {PASS12 new_state();state->exception_name=0;}
5152 /* Line 1464 of skeleton.m4 */
5153 #line 2479 "parser.y"
5155 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5156 if(!(yyvsp[(4) - (5)].code)) {
5157 (yyval.exception)=0;
5159 NEW(abc_exception_t, e)
5160 e->exc_type = 0; //all exceptions
5161 e->var_name = 0; //no name
5164 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5165 (yyval.exception) = e;
5177 /* Line 1464 of skeleton.m4 */
5178 #line 2495 "parser.y"
5179 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5188 /* Line 1464 of skeleton.m4 */
5189 #line 2496 "parser.y"
5190 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5199 /* Line 1464 of skeleton.m4 */
5200 #line 2497 "parser.y"
5201 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5210 /* Line 1464 of skeleton.m4 */
5211 #line 2498 "parser.y"
5213 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5214 (yyval.catch_list).finally = 0;
5215 if((yyvsp[(2) - (2)].exception)) {
5216 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5217 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5228 /* Line 1464 of skeleton.m4 */
5229 #line 2506 "parser.y"
5231 (yyval.catch_list).l=list_new();
5232 (yyval.catch_list).finally = 0;
5233 if((yyvsp[(1) - (1)].exception)) {
5234 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5235 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5246 /* Line 1464 of skeleton.m4 */
5247 #line 2515 "parser.y"
5248 {PASS12 new_state();
5249 state->method->has_exceptions=1;
5250 state->method->late_binding=1;//for invariant scope_code
5260 /* Line 1464 of skeleton.m4 */
5261 #line 2518 "parser.y"
5263 code_t*out = abc_nop(0);
5265 code_t*start = abc_nop(0);
5266 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5267 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5268 (yyval.code) = abc_jump((yyval.code), out);
5270 code_t*end = (yyval.code) = abc_nop((yyval.code));
5273 if((yyvsp[(6) - (6)].catch_list).finally)
5274 tmp = new_variable("__finally__", 0, 0, 0);
5276 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5279 abc_exception_t*e = l->abc_exception;
5281 (yyval.code) = code_append((yyval.code), e->target);
5282 (yyval.code) = abc_jump((yyval.code), out);
5284 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5286 e->target = (yyval.code) = abc_nop((yyval.code));
5287 (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code));
5288 (yyval.code) = abc___rethrow__((yyval.code));
5296 (yyval.code) = code_append((yyval.code), out);
5298 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5300 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5302 (yyval.code) = var_block((yyval.code));
5313 /* Line 1464 of skeleton.m4 */
5314 #line 2564 "parser.y"
5316 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5317 (yyval.code)=abc_throw((yyval.code));
5327 /* Line 1464 of skeleton.m4 */
5328 #line 2568 "parser.y"
5330 if(!state->exception_name)
5331 syntaxerror("re-throw only possible within a catch block");
5332 variable_t*v = find_variable(state, state->exception_name);
5333 (yyval.code)=code_new();
5334 (yyval.code)=abc_getlocal((yyval.code), v->index);
5335 (yyval.code)=abc_throw((yyval.code));
5345 /* Line 1464 of skeleton.m4 */
5346 #line 2579 "parser.y"
5349 if(state->method->has_exceptions) {
5350 int v = alloc_local();
5351 state->method->scope_code = abc_getlocal(state->method->scope_code, v);
5352 state->method->scope_code = abc_pushwith(state->method->scope_code);
5353 (yyval.value_list).number = v;
5355 (yyval.value_list).cc = (yyvsp[(3) - (4)].value).c;
5365 /* Line 1464 of skeleton.m4 */
5366 #line 2589 "parser.y"
5368 /* remove getlocal;pushwith from scope code again */
5369 state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code));
5371 (yyval.code) = (yyvsp[(1) - (2)].value_list).cc;
5372 if(state->method->has_exceptions) {
5373 (yyval.code) = abc_dup((yyval.code));
5374 (yyval.code) = abc_setlocal((yyval.code), (yyvsp[(1) - (2)].value_list).number);
5376 (yyval.code) = abc_pushwith((yyval.code));
5377 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (2)].code));
5378 (yyval.code) = abc_popscope((yyval.code));
5389 /* Line 1464 of skeleton.m4 */
5390 #line 2607 "parser.y"
5391 {PASS12 (yyval.id)="package";}
5400 /* Line 1464 of skeleton.m4 */
5401 #line 2608 "parser.y"
5402 {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);}
5411 /* Line 1464 of skeleton.m4 */
5412 #line 2610 "parser.y"
5413 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5422 /* Line 1464 of skeleton.m4 */
5423 #line 2611 "parser.y"
5424 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5433 /* Line 1464 of skeleton.m4 */
5434 #line 2613 "parser.y"
5435 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5444 /* Line 1464 of skeleton.m4 */
5445 #line 2614 "parser.y"
5446 {PASS12 endpackage();(yyval.code)=0;}
5455 /* Line 1464 of skeleton.m4 */
5456 #line 2615 "parser.y"
5457 {PASS12 startpackage("");}
5466 /* Line 1464 of skeleton.m4 */
5467 #line 2616 "parser.y"
5468 {PASS12 endpackage();(yyval.code)=0;}
5477 /* Line 1464 of skeleton.m4 */
5478 #line 2618 "parser.y"
5481 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5482 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5483 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5487 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5489 syntaxerror("Couldn't import class\n");
5490 state_has_imports();
5491 dict_put(state->imports, c->name, c);
5492 import_toplevel(c->package);
5503 /* Line 1464 of skeleton.m4 */
5504 #line 2634 "parser.y"
5507 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5508 as3_schedule_package((yyvsp[(2) - (4)].id));
5513 i->package = (yyvsp[(2) - (4)].id);
5514 state_has_imports();
5515 list_append(state->wildcard_imports, i);
5516 import_toplevel(i->package);
5527 /* Line 1464 of skeleton.m4 */
5528 #line 2651 "parser.y"
5529 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5538 /* Line 1464 of skeleton.m4 */
5539 #line 2652 "parser.y"
5540 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5549 /* Line 1464 of skeleton.m4 */
5550 #line 2653 "parser.y"
5551 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5560 /* Line 1464 of skeleton.m4 */
5561 #line 2654 "parser.y"
5564 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5565 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5566 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5577 /* Line 1464 of skeleton.m4 */
5578 #line 2661 "parser.y"
5579 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5588 /* Line 1464 of skeleton.m4 */
5589 #line 2662 "parser.y"
5590 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5599 /* Line 1464 of skeleton.m4 */
5600 #line 2663 "parser.y"
5601 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5610 /* Line 1464 of skeleton.m4 */
5611 #line 2664 "parser.y"
5612 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5621 /* Line 1464 of skeleton.m4 */
5622 #line 2665 "parser.y"
5623 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5632 /* Line 1464 of skeleton.m4 */
5633 #line 2666 "parser.y"
5634 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5643 /* Line 1464 of skeleton.m4 */
5644 #line 2667 "parser.y"
5645 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5654 /* Line 1464 of skeleton.m4 */
5655 #line 2668 "parser.y"
5656 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5665 /* Line 1464 of skeleton.m4 */
5666 #line 2669 "parser.y"
5667 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5676 /* Line 1464 of skeleton.m4 */
5677 #line 2670 "parser.y"
5678 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5679 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5689 /* Line 1464 of skeleton.m4 */
5690 #line 2674 "parser.y"
5691 {PASS12 (yyval.classinfo)=0;}
5700 /* Line 1464 of skeleton.m4 */
5701 #line 2675 "parser.y"
5702 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5711 /* Line 1464 of skeleton.m4 */
5712 #line 2677 "parser.y"
5713 {PASS12 (yyval.classinfo_list)=list_new();}
5722 /* Line 1464 of skeleton.m4 */
5723 #line 2678 "parser.y"
5724 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5733 /* Line 1464 of skeleton.m4 */
5734 #line 2680 "parser.y"
5735 {PASS12 (yyval.classinfo_list)=list_new();}
5744 /* Line 1464 of skeleton.m4 */
5745 #line 2681 "parser.y"
5746 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5755 /* Line 1464 of skeleton.m4 */
5756 #line 2685 "parser.y"
5757 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5766 /* Line 1464 of skeleton.m4 */
5767 #line 2687 "parser.y"
5768 {PASS12 endclass();(yyval.code)=0;}
5777 /* Line 1464 of skeleton.m4 */
5778 #line 2691 "parser.y"
5779 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5780 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5789 /* Line 1464 of skeleton.m4 */
5790 #line 2694 "parser.y"
5791 {PASS12 endclass();(yyval.code)=0;}
5800 /* Line 1464 of skeleton.m4 */
5801 #line 2707 "parser.y"
5803 code_t*c = state->cls->static_init->header;
5804 c = code_append(c, (yyvsp[(1) - (1)].code));
5805 state->cls->static_init->header = c;
5815 /* Line 1464 of skeleton.m4 */
5816 #line 2718 "parser.y"
5818 syntaxerror("variable declarations not allowed in interfaces");
5828 /* Line 1464 of skeleton.m4 */
5829 #line 2721 "parser.y"
5832 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5833 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5834 syntaxerror("invalid method modifiers: interface methods always need to be public");
5836 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5837 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5838 list_deep_free((yyvsp[(6) - (8)].params).list);
5848 /* Line 1464 of skeleton.m4 */
5849 #line 2736 "parser.y"
5850 {setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5859 /* Line 1464 of skeleton.m4 */
5860 #line 2736 "parser.y"
5861 {(yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5870 /* Line 1464 of skeleton.m4 */
5871 #line 2738 "parser.y"
5872 {(yyval.code) = (yyvsp[(1) - (1)].code);}
5881 /* Line 1464 of skeleton.m4 */
5882 #line 2739 "parser.y"
5883 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
5892 /* Line 1464 of skeleton.m4 */
5893 #line 2742 "parser.y"
5895 int flags = slotstate_flags->flags;
5896 namespace_t ns = modifiers2access(slotstate_flags);
5898 varinfo_t* info = 0;
5900 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
5902 check_override(i, flags);
5904 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
5906 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
5908 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
5910 if(ns.name && ns.name[0]) {
5911 syntaxerror("namespaces not allowed on package-level variables");
5913 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
5916 info->type = (yyvsp[(2) - (3)].classinfo);
5917 info->flags = flags;
5920 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
5922 trait_list_t**traits;
5926 ns.name = state->package;
5927 traits = &global->init->traits;
5928 code = &global->init->method->body->code;
5929 } else if(flags&FLAG_STATIC) {
5931 traits = &state->cls->abc->static_traits;
5932 code = &state->cls->static_init->header;
5934 // instance variable
5935 traits = &state->cls->abc->traits;
5936 code = &state->cls->init->header;
5940 if((yyvsp[(2) - (3)].classinfo)) {
5941 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
5942 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5944 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5946 info->slot = t->slot_id;
5948 /* initalization code (if needed) */
5950 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
5951 c = abc_getlocal_0(c);
5952 c = code_append(c, (yyvsp[(3) - (3)].value).c);
5953 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
5954 c = abc_setslot(c, t->slot_id);
5957 *code = code_append(*code, c);
5959 if(slotstate_varconst==KW_CONST) {
5960 t->kind= TRAIT_CONST;
5973 /* Line 1464 of skeleton.m4 */
5974 #line 2816 "parser.y"
5975 {(yyval.constant)=0;}
5984 /* Line 1464 of skeleton.m4 */
5985 #line 2817 "parser.y"
5986 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
5995 /* Line 1464 of skeleton.m4 */
5996 #line 2819 "parser.y"
5997 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
6006 /* Line 1464 of skeleton.m4 */
6007 #line 2820 "parser.y"
6008 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
6017 /* Line 1464 of skeleton.m4 */
6018 #line 2821 "parser.y"
6019 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
6028 /* Line 1464 of skeleton.m4 */
6029 #line 2822 "parser.y"
6030 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
6039 /* Line 1464 of skeleton.m4 */
6040 #line 2823 "parser.y"
6041 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
6050 /* Line 1464 of skeleton.m4 */
6051 #line 2825 "parser.y"
6052 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
6061 /* Line 1464 of skeleton.m4 */
6062 #line 2826 "parser.y"
6063 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
6072 /* Line 1464 of skeleton.m4 */
6073 #line 2827 "parser.y"
6074 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
6083 /* Line 1464 of skeleton.m4 */
6084 #line 2828 "parser.y"
6086 if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) {
6087 (yyval.constant) = constant_new_float(__builtin_nan(""));
6089 as3_warning("Couldn't evaluate constant value of %s", (yyvsp[(1) - (1)].id));
6090 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
6101 /* Line 1464 of skeleton.m4 */
6102 #line 2840 "parser.y"
6105 memset(&(yyval.params),0,sizeof((yyval.params)));
6115 /* Line 1464 of skeleton.m4 */
6116 #line 2844 "parser.y"
6119 (yyval.params)=(yyvsp[(1) - (1)].params);
6129 /* Line 1464 of skeleton.m4 */
6130 #line 2850 "parser.y"
6133 memset(&(yyval.params),0,sizeof((yyval.params)));
6134 (yyval.params).varargs=1;
6135 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6145 /* Line 1464 of skeleton.m4 */
6146 #line 2856 "parser.y"
6149 (yyval.params) =(yyvsp[(1) - (4)].params);
6150 (yyval.params).varargs=1;
6151 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6161 /* Line 1464 of skeleton.m4 */
6162 #line 2864 "parser.y"
6165 (yyval.params) = (yyvsp[(1) - (3)].params);
6166 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6176 /* Line 1464 of skeleton.m4 */
6177 #line 2869 "parser.y"
6180 memset(&(yyval.params),0,sizeof((yyval.params)));
6181 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6191 /* Line 1464 of skeleton.m4 */
6192 #line 2875 "parser.y"
6195 (yyval.param) = rfx_calloc(sizeof(param_t));
6196 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6197 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6199 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6209 /* Line 1464 of skeleton.m4 */
6210 #line 2883 "parser.y"
6213 (yyval.param) = rfx_calloc(sizeof(param_t));
6214 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6215 (yyval.param)->type = TYPE_ANY;
6217 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6227 /* Line 1464 of skeleton.m4 */
6228 #line 2893 "parser.y"
6229 {PASS12 (yyval.token)=0;}
6238 /* Line 1464 of skeleton.m4 */
6239 #line 2896 "parser.y"
6240 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6249 /* Line 1464 of skeleton.m4 */
6250 #line 2897 "parser.y"
6253 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6255 if(!state->method->info) syntaxerror("internal error");
6257 code_t*c = method_header(state->method);
6258 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6260 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6262 list_deep_free((yyvsp[(6) - (12)].params).list);
6273 /* Line 1464 of skeleton.m4 */
6274 #line 2913 "parser.y"
6275 {PASS12 (yyval.id)=0;}
6284 /* Line 1464 of skeleton.m4 */
6285 #line 2915 "parser.y"
6286 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6295 /* Line 1464 of skeleton.m4 */
6296 #line 2916 "parser.y"
6299 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6301 methodinfo_t*f = state->method->info;
6302 if(!f || !f->kind) syntaxerror("internal error");
6304 code_t*c = method_header(state->method);
6305 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6307 int index = state->method->var_index;
6308 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6310 (yyval.value).c = abc_getlocal(0, index);
6311 (yyval.value).t = TYPE_FUNCTION(f);
6313 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6323 /* Line 1464 of skeleton.m4 */
6324 #line 2938 "parser.y"
6326 PASS1 NEW(unresolvedinfo_t,c);
6327 memset(c, 0, sizeof(*c));
6328 c->kind = INFOTYPE_UNRESOLVED;
6329 c->name = (yyvsp[(1) - (1)].id);
6330 c->package = get_package_from_name((yyvsp[(1) - (1)].id));
6332 c->nsset = get_current_imports();
6333 /* make the compiler look for this class in the current directory,
6335 //as3_schedule_class_noerror(state->package, $1);
6337 (yyval.classinfo) = (classinfo_t*)c;
6339 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6340 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6341 (yyval.classinfo) = (classinfo_t*)s;
6351 /* Line 1464 of skeleton.m4 */
6352 #line 2957 "parser.y"
6354 PASS1 NEW(unresolvedinfo_t,c);
6355 memset(c, 0, sizeof(*c));
6356 c->kind = INFOTYPE_UNRESOLVED;
6357 c->package = (yyvsp[(1) - (3)].id);
6358 c->name = (yyvsp[(3) - (3)].id);
6359 (yyval.classinfo) = (classinfo_t*)c;
6361 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6362 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6363 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6364 (yyval.classinfo) = (classinfo_t*)s;
6374 /* Line 1464 of skeleton.m4 */
6375 #line 2974 "parser.y"
6376 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6385 /* Line 1464 of skeleton.m4 */
6386 #line 2975 "parser.y"
6387 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6396 /* Line 1464 of skeleton.m4 */
6397 #line 2977 "parser.y"
6398 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6407 /* Line 1464 of skeleton.m4 */
6408 #line 2978 "parser.y"
6409 {PASS12 (yyval.classinfo)=registry_getanytype();}
6418 /* Line 1464 of skeleton.m4 */
6419 #line 2979 "parser.y"
6420 {PASS12 (yyval.classinfo)=registry_getanytype();}
6429 /* Line 1464 of skeleton.m4 */
6430 #line 2988 "parser.y"
6431 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6440 /* Line 1464 of skeleton.m4 */
6441 #line 2989 "parser.y"
6442 {PASS12 (yyval.classinfo)=0;}
6451 /* Line 1464 of skeleton.m4 */
6452 #line 2993 "parser.y"
6453 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6462 /* Line 1464 of skeleton.m4 */
6463 #line 2994 "parser.y"
6464 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6473 /* Line 1464 of skeleton.m4 */
6474 #line 2996 "parser.y"
6475 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
6484 /* Line 1464 of skeleton.m4 */
6485 #line 3000 "parser.y"
6486 {(yyval.value_list).number=1;
6487 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6497 /* Line 1464 of skeleton.m4 */
6498 #line 3004 "parser.y"
6499 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6508 /* Line 1464 of skeleton.m4 */
6509 #line 3005 "parser.y"
6511 (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1;
6512 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6522 /* Line 1464 of skeleton.m4 */
6523 #line 3011 "parser.y"
6525 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6526 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6528 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6529 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6530 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6531 (yyval.value).c = code_cutlast((yyval.value).c);
6532 (yyval.value).c = code_append((yyval.value).c, paramcode);
6533 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6534 multiname_destroy(name);
6535 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6536 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6537 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6538 multiname_t*name = t->name;
6539 (yyval.value).c = code_cutlast((yyval.value).c);
6540 (yyval.value).c = code_append((yyval.value).c, paramcode);
6541 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number);
6543 (yyval.value).c = code_append((yyval.value).c, paramcode);
6544 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number);
6547 (yyval.value).t = TYPE_ANY;
6548 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6549 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6551 (yyval.value).c = abc_coerce_a((yyval.value).c);
6552 (yyval.value).t = TYPE_ANY;
6563 /* Line 1464 of skeleton.m4 */
6564 #line 3047 "parser.y"
6567 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6568 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6569 (yyval.value).c = code_cutlast((yyval.value).c);
6571 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6573 (yyval.value).t = TYPE_ANY;
6574 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6575 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6576 (yyval.value).c = code_cutlast((yyval.value).c);
6577 (yyval.value).c = code_append((yyval.value).c, paramcode);
6578 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6579 multiname_destroy(name);
6580 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6581 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6582 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6583 if(t->kind!=TRAIT_METHOD) {
6584 //ok: flash allows to assign closures to members.
6586 multiname_t*name = t->name;
6587 (yyval.value).c = code_cutlast((yyval.value).c);
6588 (yyval.value).c = code_append((yyval.value).c, paramcode);
6589 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6590 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6591 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6592 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6593 (yyval.value).c = code_cutlast((yyval.value).c);
6594 (yyval.value).c = code_append((yyval.value).c, paramcode);
6595 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).number);
6596 multiname_destroy(name);
6598 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6599 (yyval.value).c = code_append((yyval.value).c, paramcode);
6600 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6603 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6604 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6606 (yyval.value).c = abc_coerce_a((yyval.value).c);
6607 (yyval.value).t = TYPE_ANY;
6618 /* Line 1464 of skeleton.m4 */
6619 #line 3093 "parser.y"
6621 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6622 if(!state->method) syntaxerror("super() not allowed outside of a function");
6623 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6625 (yyval.value).c = code_new();
6626 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6628 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6630 this is dependent on the control path, check this somewhere else
6631 if(state->method->has_super)
6632 syntaxerror("constructor may call super() only once");
6634 state->method->has_super = 1;
6636 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).number);
6637 (yyval.value).c = abc_pushundefined((yyval.value).c);
6638 (yyval.value).t = TYPE_ANY;
6648 /* Line 1464 of skeleton.m4 */
6649 #line 3114 "parser.y"
6651 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6652 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6653 (yyval.value).c = code_cutlast((yyval.value).c);
6655 multiname_t*name = 0;
6656 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6657 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6658 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6659 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6660 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6661 (yyval.value).c = code_cutlast((yyval.value).c);
6662 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6664 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6665 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6666 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6668 (yyval.value).t = TYPE_BOOLEAN;
6678 /* Line 1464 of skeleton.m4 */
6679 #line 3135 "parser.y"
6681 (yyval.code) = abc_returnvoid(0);
6691 /* Line 1464 of skeleton.m4 */
6692 #line 3138 "parser.y"
6694 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6695 (yyval.code) = abc_returnvalue((yyval.code));
6705 /* Line 1464 of skeleton.m4 */
6706 #line 3145 "parser.y"
6707 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6716 /* Line 1464 of skeleton.m4 */
6717 #line 3146 "parser.y"
6718 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6727 /* Line 1464 of skeleton.m4 */
6728 #line 3147 "parser.y"
6730 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6731 (yyval.value).c = cut_last_push((yyval.value).c);
6732 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6733 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6743 /* Line 1464 of skeleton.m4 */
6744 #line 3153 "parser.y"
6746 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6756 /* Line 1464 of skeleton.m4 */
6757 #line 3159 "parser.y"
6758 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6767 /* Line 1464 of skeleton.m4 */
6768 #line 3163 "parser.y"
6769 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6778 /* Line 1464 of skeleton.m4 */
6779 #line 3165 "parser.y"
6780 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6789 /* Line 1464 of skeleton.m4 */
6790 #line 3167 "parser.y"
6791 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6800 /* Line 1464 of skeleton.m4 */
6801 #line 3171 "parser.y"
6803 (yyval.value).c = 0;
6804 namespace_t ns = {ACCESS_PACKAGE, ""};
6805 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6806 if(!(yyvsp[(1) - (1)].regexp).options) {
6807 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6808 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6809 (yyval.value).c = abc_construct((yyval.value).c, 1);
6811 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6812 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6813 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6814 (yyval.value).c = abc_construct((yyval.value).c, 2);
6816 (yyval.value).t = TYPE_REGEXP;
6826 /* Line 1464 of skeleton.m4 */
6827 #line 3188 "parser.y"
6828 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6829 //MULTINAME(m, registry_getintclass());
6830 //$$.c = abc_coerce2($$.c, &m); // FIXME
6831 (yyval.value).t = TYPE_INT;
6841 /* Line 1464 of skeleton.m4 */
6842 #line 3193 "parser.y"
6843 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6844 (yyval.value).t = TYPE_INT;
6854 /* Line 1464 of skeleton.m4 */
6855 #line 3196 "parser.y"
6856 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6857 (yyval.value).t = TYPE_INT;
6867 /* Line 1464 of skeleton.m4 */
6868 #line 3199 "parser.y"
6869 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6870 (yyval.value).t = TYPE_UINT;
6880 /* Line 1464 of skeleton.m4 */
6881 #line 3202 "parser.y"
6882 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6883 (yyval.value).t = TYPE_FLOAT;
6893 /* Line 1464 of skeleton.m4 */
6894 #line 3205 "parser.y"
6895 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6896 (yyval.value).t = TYPE_STRING;
6906 /* Line 1464 of skeleton.m4 */
6907 #line 3208 "parser.y"
6908 {(yyval.value).c = abc_pushundefined(0);
6909 (yyval.value).t = TYPE_ANY;
6919 /* Line 1464 of skeleton.m4 */
6920 #line 3211 "parser.y"
6921 {(yyval.value).c = abc_pushtrue(0);
6922 (yyval.value).t = TYPE_BOOLEAN;
6932 /* Line 1464 of skeleton.m4 */
6933 #line 3214 "parser.y"
6934 {(yyval.value).c = abc_pushfalse(0);
6935 (yyval.value).t = TYPE_BOOLEAN;
6945 /* Line 1464 of skeleton.m4 */
6946 #line 3217 "parser.y"
6947 {(yyval.value).c = abc_pushnull(0);
6948 (yyval.value).t = TYPE_NULL;
6958 /* Line 1464 of skeleton.m4 */
6959 #line 3221 "parser.y"
6960 {(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);
6961 (yyval.value).t = TYPE_BOOLEAN;
6971 /* Line 1464 of skeleton.m4 */
6972 #line 3224 "parser.y"
6973 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6974 (yyval.value).t = TYPE_BOOLEAN;
6984 /* Line 1464 of skeleton.m4 */
6985 #line 3227 "parser.y"
6986 {(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);
6987 (yyval.value).t = TYPE_BOOLEAN;
6997 /* Line 1464 of skeleton.m4 */
6998 #line 3230 "parser.y"
6999 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
7000 (yyval.value).t = TYPE_BOOLEAN;
7010 /* Line 1464 of skeleton.m4 */
7011 #line 3233 "parser.y"
7012 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
7013 (yyval.value).t = TYPE_BOOLEAN;
7023 /* Line 1464 of skeleton.m4 */
7024 #line 3236 "parser.y"
7025 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
7026 (yyval.value).t = TYPE_BOOLEAN;
7036 /* Line 1464 of skeleton.m4 */
7037 #line 3239 "parser.y"
7038 {(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);
7039 (yyval.value).t = TYPE_BOOLEAN;
7049 /* Line 1464 of skeleton.m4 */
7050 #line 3242 "parser.y"
7051 {(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);
7052 (yyval.value).t = TYPE_BOOLEAN;
7062 /* Line 1464 of skeleton.m4 */
7063 #line 3246 "parser.y"
7064 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
7065 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7066 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7067 (yyval.value).c = abc_dup((yyval.value).c);
7068 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
7069 (yyval.value).c = cut_last_push((yyval.value).c);
7070 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7071 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7072 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7073 jmp->branch = label;
7083 /* Line 1464 of skeleton.m4 */
7084 #line 3257 "parser.y"
7086 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
7087 /*printf("%08x:\n",$1.t);
7088 code_dump($1.c, 0, 0, "", stdout);
7089 printf("%08x:\n",$3.t);
7090 code_dump($3.c, 0, 0, "", stdout);
7091 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
7092 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7093 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
7094 (yyval.value).c = abc_dup((yyval.value).c);
7095 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7096 (yyval.value).c = cut_last_push((yyval.value).c);
7097 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
7098 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
7099 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
7100 jmp->branch = label;
7110 /* Line 1464 of skeleton.m4 */
7111 #line 3275 "parser.y"
7112 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7113 (yyval.value).c = abc_not((yyval.value).c);
7114 (yyval.value).t = TYPE_BOOLEAN;
7124 /* Line 1464 of skeleton.m4 */
7125 #line 3280 "parser.y"
7126 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
7127 (yyval.value).c = abc_bitnot((yyval.value).c);
7128 (yyval.value).t = TYPE_INT;
7138 /* Line 1464 of skeleton.m4 */
7139 #line 3285 "parser.y"
7140 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7141 (yyval.value).c = abc_bitand((yyval.value).c);
7142 (yyval.value).t = TYPE_INT;
7152 /* Line 1464 of skeleton.m4 */
7153 #line 3290 "parser.y"
7154 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7155 (yyval.value).c = abc_bitxor((yyval.value).c);
7156 (yyval.value).t = TYPE_INT;
7166 /* Line 1464 of skeleton.m4 */
7167 #line 3295 "parser.y"
7168 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7169 (yyval.value).c = abc_bitor((yyval.value).c);
7170 (yyval.value).t = TYPE_INT;
7180 /* Line 1464 of skeleton.m4 */
7181 #line 3300 "parser.y"
7182 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7183 (yyval.value).c = abc_rshift((yyval.value).c);
7184 (yyval.value).t = TYPE_INT;
7194 /* Line 1464 of skeleton.m4 */
7195 #line 3304 "parser.y"
7196 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7197 (yyval.value).c = abc_urshift((yyval.value).c);
7198 (yyval.value).t = TYPE_INT;
7208 /* Line 1464 of skeleton.m4 */
7209 #line 3308 "parser.y"
7210 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7211 (yyval.value).c = abc_lshift((yyval.value).c);
7212 (yyval.value).t = TYPE_INT;
7222 /* Line 1464 of skeleton.m4 */
7223 #line 3313 "parser.y"
7224 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7225 (yyval.value).c = abc_divide((yyval.value).c);
7226 (yyval.value).t = TYPE_NUMBER;
7236 /* Line 1464 of skeleton.m4 */
7237 #line 3317 "parser.y"
7238 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7239 (yyval.value).c = abc_modulo((yyval.value).c);
7240 (yyval.value).t = TYPE_NUMBER;
7250 /* Line 1464 of skeleton.m4 */
7251 #line 3321 "parser.y"
7252 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7253 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7254 (yyval.value).c = abc_add_i((yyval.value).c);
7255 (yyval.value).t = TYPE_INT;
7257 (yyval.value).c = abc_add((yyval.value).c);
7258 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7269 /* Line 1464 of skeleton.m4 */
7270 #line 3330 "parser.y"
7271 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7272 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7273 (yyval.value).c = abc_subtract_i((yyval.value).c);
7274 (yyval.value).t = TYPE_INT;
7276 (yyval.value).c = abc_subtract((yyval.value).c);
7277 (yyval.value).t = TYPE_NUMBER;
7288 /* Line 1464 of skeleton.m4 */
7289 #line 3339 "parser.y"
7290 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7291 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7292 (yyval.value).c = abc_multiply_i((yyval.value).c);
7293 (yyval.value).t = TYPE_INT;
7295 (yyval.value).c = abc_multiply((yyval.value).c);
7296 (yyval.value).t = TYPE_NUMBER;
7307 /* Line 1464 of skeleton.m4 */
7308 #line 3349 "parser.y"
7309 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7310 (yyval.value).c = abc_in((yyval.value).c);
7311 (yyval.value).t = TYPE_BOOLEAN;
7321 /* Line 1464 of skeleton.m4 */
7322 #line 3354 "parser.y"
7323 {char use_astype=0; // flash player's astype works differently than astypelate
7324 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7325 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7326 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7327 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7329 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7330 (yyval.value).c = abc_astypelate((yyval.value).c);
7331 (yyval.value).t = TYPE_ANY;
7342 /* Line 1464 of skeleton.m4 */
7343 #line 3367 "parser.y"
7344 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7345 (yyval.value).c = abc_instanceof((yyval.value).c);
7346 (yyval.value).t = TYPE_BOOLEAN;
7356 /* Line 1464 of skeleton.m4 */
7357 #line 3372 "parser.y"
7358 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7359 (yyval.value).c = abc_istypelate((yyval.value).c);
7360 (yyval.value).t = TYPE_BOOLEAN;
7370 /* Line 1464 of skeleton.m4 */
7371 #line 3377 "parser.y"
7373 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7374 (yyval.value).c = abc_typeof((yyval.value).c);
7375 (yyval.value).t = TYPE_STRING;
7385 /* Line 1464 of skeleton.m4 */
7386 #line 3383 "parser.y"
7388 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7389 (yyval.value).c = abc_pushundefined((yyval.value).c);
7390 (yyval.value).t = TYPE_ANY;
7400 /* Line 1464 of skeleton.m4 */
7401 #line 3389 "parser.y"
7402 { (yyval.value).c = abc_pushundefined(0);
7403 (yyval.value).t = TYPE_ANY;
7413 /* Line 1464 of skeleton.m4 */
7414 #line 3393 "parser.y"
7415 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7424 /* Line 1464 of skeleton.m4 */
7425 #line 3395 "parser.y"
7427 (yyval.value)=(yyvsp[(2) - (2)].value);
7428 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7429 (yyval.value).c=abc_negate_i((yyval.value).c);
7430 (yyval.value).t = TYPE_INT;
7432 (yyval.value).c=abc_negate((yyval.value).c);
7433 (yyval.value).t = TYPE_NUMBER;
7444 /* Line 1464 of skeleton.m4 */
7445 #line 3406 "parser.y"
7447 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7448 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7450 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7451 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7452 (yyval.value).t = 0; // array elements have unknown type
7462 /* Line 1464 of skeleton.m4 */
7463 #line 3415 "parser.y"
7465 (yyval.value).c = code_new();
7466 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7467 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).number);
7468 (yyval.value).t = registry_getarrayclass();
7478 /* Line 1464 of skeleton.m4 */
7479 #line 3422 "parser.y"
7480 {(yyval.value_list).cc=0;(yyval.value_list).number=0;}
7489 /* Line 1464 of skeleton.m4 */
7490 #line 3423 "parser.y"
7491 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7500 /* Line 1464 of skeleton.m4 */
7501 #line 3425 "parser.y"
7503 (yyval.value_list).cc = 0;
7504 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7505 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7506 (yyval.value_list).number = 2;
7516 /* Line 1464 of skeleton.m4 */
7517 #line 3431 "parser.y"
7519 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7520 (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2;
7521 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7522 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7532 /* Line 1464 of skeleton.m4 */
7533 #line 3440 "parser.y"
7535 (yyval.value).c = code_new();
7536 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7537 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).number/2);
7538 (yyval.value).t = registry_getobjectclass();
7548 /* Line 1464 of skeleton.m4 */
7549 #line 3447 "parser.y"
7551 code_t*c = (yyvsp[(3) - (3)].value).c;
7552 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7553 c=abc_multiply_i(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);
7559 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7569 /* Line 1464 of skeleton.m4 */
7570 #line 3459 "parser.y"
7572 code_t*c = abc_modulo((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);
7575 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7585 /* Line 1464 of skeleton.m4 */
7586 #line 3465 "parser.y"
7588 code_t*c = abc_lshift((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);
7591 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7601 /* Line 1464 of skeleton.m4 */
7602 #line 3471 "parser.y"
7604 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7605 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7606 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7607 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7617 /* Line 1464 of skeleton.m4 */
7618 #line 3477 "parser.y"
7620 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7621 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7622 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7623 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7633 /* Line 1464 of skeleton.m4 */
7634 #line 3483 "parser.y"
7636 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7637 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7638 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7639 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7649 /* Line 1464 of skeleton.m4 */
7650 #line 3489 "parser.y"
7652 code_t*c = abc_bitor((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);
7655 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7665 /* Line 1464 of skeleton.m4 */
7666 #line 3495 "parser.y"
7668 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7669 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7670 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7671 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7681 /* Line 1464 of skeleton.m4 */
7682 #line 3501 "parser.y"
7684 code_t*c = (yyvsp[(3) - (3)].value).c;
7686 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7690 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7693 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7694 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7704 /* Line 1464 of skeleton.m4 */
7705 #line 3514 "parser.y"
7706 { code_t*c = (yyvsp[(3) - (3)].value).c;
7707 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7708 c=abc_subtract_i(c);
7711 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7714 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7715 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7725 /* Line 1464 of skeleton.m4 */
7726 #line 3525 "parser.y"
7728 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7729 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7730 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7731 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7741 /* Line 1464 of skeleton.m4 */
7742 #line 3532 "parser.y"
7744 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7745 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7746 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7747 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7748 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7749 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7750 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7751 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7752 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7753 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7763 /* Line 1464 of skeleton.m4 */
7764 #line 3545 "parser.y"
7766 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7767 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7768 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7769 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7770 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7771 (yyval.value).c = abc_getlocal(0, nr);
7772 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7773 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7774 (yyval.value).c = abc_getlocal(0, nr);
7775 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7776 } else syntaxerror("internal error");
7778 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7779 c=abc_increment_i(c);
7785 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7786 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7787 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7798 /* Line 1464 of skeleton.m4 */
7799 #line 3572 "parser.y"
7801 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7802 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7803 c=abc_decrement_i(c);
7809 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7810 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7811 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7821 /* Line 1464 of skeleton.m4 */
7822 #line 3586 "parser.y"
7824 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7825 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7826 c=abc_increment_i(c);
7832 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7833 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7834 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7844 /* Line 1464 of skeleton.m4 */
7845 #line 3600 "parser.y"
7847 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7848 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7849 c=abc_decrement_i(c);
7855 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7856 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7857 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7867 /* Line 1464 of skeleton.m4 */
7868 #line 3615 "parser.y"
7869 { if(!state->cls->info)
7870 syntaxerror("super keyword not allowed outside a class");
7871 classinfo_t*t = state->cls->info->superclass;
7872 if(!t) t = TYPE_OBJECT;
7874 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7876 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7877 (yyval.value).c = 0;
7878 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7879 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7880 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7890 /* Line 1464 of skeleton.m4 */
7891 #line 3629 "parser.y"
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 3636 "parser.y"
7909 // child attribute 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 3643 "parser.y"
7925 // namespace declaration TODO
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 3650 "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 3657 "parser.y"
7958 (yyval.value).c = abc_pushundefined(0);
7959 (yyval.value).t = 0;
7960 as3_warning("ignored .() operator");
7970 /* Line 1464 of skeleton.m4 */
7971 #line 3668 "parser.y"
7973 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7974 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7976 if(TYPE_IS_CLASS(t) && t->data) {
7981 if(t->subtype==INFOTYPE_UNRESOLVED) {
7982 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
7984 memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1);
7986 if(f && !is_static != !(f->flags&FLAG_STATIC))
7988 if(f && f->slot && !noslot) {
7989 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7991 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7992 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7994 /* determine type */
7995 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7996 if(!(yyval.value).t)
7997 (yyval.value).c = abc_coerce_a((yyval.value).c);
7998 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
7999 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
8000 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
8002 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
8004 (yyval.value) = push_class(a);
8005 } else if(dict_contains(state->import_toplevel_packages, package2) ||
8006 registry_ispackage(package2)) {
8007 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
8008 (yyval.value).c->data[0] = string_new4(package2);
8009 (yyval.value).t = 0;
8011 syntaxerror("couldn't resolve %s", package2);
8014 /* when resolving a property on an unknown type, we do know the
8015 name of the property (and don't seem to need the package), but
8016 we need to make avm2 try out all access modes */
8017 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
8018 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8019 (yyval.value).c = abc_coerce_a((yyval.value).c);
8020 (yyval.value).t = registry_getanytype();
8031 /* Line 1464 of skeleton.m4 */
8032 #line 3720 "parser.y"
8035 /* Queue unresolved identifiers for checking against the parent
8036 function's variables.
8037 We consider everything which is not a local variable "unresolved".
8038 This encompasses class names, members of the surrounding class
8039 etc. which is *correct* because local variables of the parent function
8042 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
8043 unknown_variable((yyvsp[(1) - (1)].id));
8046 /* let the compiler know that it might want to check the current directory/package
8047 for this identifier- maybe there's a file $1.as defining $1. */
8048 //as3_schedule_class_noerror(state->package, $1);
8051 (yyval.value).t = 0;
8052 (yyval.value).c = 0;
8057 /* look at variables */
8058 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
8059 // $1 is a local variable
8060 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
8061 (yyval.value).t = v->type;
8064 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
8065 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
8066 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
8067 (yyval.value).t = v->type;
8071 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
8073 /* look at current class' members */
8074 if(state->cls && (f = findmember_nsset(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
8075 (f->flags&FLAG_STATIC) >= i_am_static) {
8076 // $1 is a function in this class
8077 int var_is_static = (f->flags&FLAG_STATIC);
8079 if(f->kind == INFOTYPE_METHOD) {
8080 (yyval.value).t = TYPE_FUNCTION(f);
8082 (yyval.value).t = f->type;
8084 if(var_is_static && !i_am_static) {
8085 /* access to a static member from a non-static location.
8086 do this via findpropstrict:
8087 there doesn't seem to be any non-lookup way to access
8088 static properties of a class */
8089 state->method->late_binding = 1;
8090 (yyval.value).t = f->type;
8091 namespace_t ns = {f->access, ""};
8092 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8093 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8094 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8096 } else if(f->slot>0) {
8097 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8098 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
8101 namespace_t ns = {f->access, ""};
8102 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
8103 (yyval.value).c = abc_getlocal_0((yyval.value).c);
8104 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8109 /* look at actual classes, in the current package and imported */
8110 if((a = find_class((yyvsp[(1) - (1)].id)))) {
8111 (yyval.value) = push_class(a);
8115 /* look through package prefixes */
8116 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id)) ||
8117 registry_ispackage((yyvsp[(1) - (1)].id))) {
8118 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
8119 (yyval.value).t = 0;
8123 /* unknown object, let the avm2 resolve it */
8125 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
8126 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
8127 state->method->late_binding = 1;
8129 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
8131 (yyval.value).t = 0;
8132 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
8133 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
8144 /* Line 1464 of skeleton.m4 */
8145 #line 3826 "parser.y"
8148 NEW(namespace_decl_t,n);
8149 n->name = (yyvsp[(2) - (2)].id);
8150 n->url = (yyvsp[(2) - (2)].id);
8151 (yyval.namespace_decl)=n;
8161 /* Line 1464 of skeleton.m4 */
8162 #line 3833 "parser.y"
8165 NEW(namespace_decl_t,n);
8166 n->name = (yyvsp[(2) - (4)].id);
8167 n->url = (yyvsp[(4) - (4)].id);
8168 (yyval.namespace_decl)=n;
8178 /* Line 1464 of skeleton.m4 */
8179 #line 3840 "parser.y"
8182 NEW(namespace_decl_t,n);
8183 n->name = (yyvsp[(2) - (4)].id);
8184 n->url = (yyvsp[(4) - (4)].str).str;
8185 (yyval.namespace_decl)=n;
8195 /* Line 1464 of skeleton.m4 */
8196 #line 3847 "parser.y"
8199 trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url);
8201 namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags));
8202 varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name);
8203 var->type = TYPE_NAMESPACE;
8205 ns.access = ACCESS_NAMESPACE;
8206 ns.name = (yyvsp[(2) - (2)].namespace_decl)->url;
8207 var->value = constant_new_namespace(&ns);
8219 /* Line 1464 of skeleton.m4 */
8220 #line 3862 "parser.y"
8223 const char*url = (yyvsp[(3) - (3)].classinfo)->name;
8224 varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo);
8225 if(!s || s->kind != INFOTYPE_SLOT)
8226 syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1);
8227 if(!s->value || !NS_TYPE(s->value->type))
8228 syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name);
8229 url = s->value->ns->name;
8231 trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url);
8232 add_active_url(url);
8241 /* Line 1464 of skeleton.m4 */
8242 #line 8243 "parser.tab.c"
8245 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8249 YY_STACK_PRINT (yyss, yyssp);
8253 /* Now `shift' the result of the reduction. Determine what state
8254 that goes to, based on the state we popped back to and the rule
8255 number reduced by. */
8259 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8260 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8261 yystate = yytable[yystate];
8263 yystate = yydefgoto[yyn - YYNTOKENS];
8268 /*------------------------------------.
8269 | yyerrlab -- here on detecting error |
8270 `------------------------------------*/
8272 /* If not already recovering from an error, report this error. */
8276 #if ! YYERROR_VERBOSE
8277 yyerror (YY_("syntax error"));
8280 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8281 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8283 YYSIZE_T yyalloc = 2 * yysize;
8284 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8285 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8286 if (yymsg != yymsgbuf)
8287 YYSTACK_FREE (yymsg);
8288 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8290 yymsg_alloc = yyalloc;
8294 yymsg_alloc = sizeof yymsgbuf;
8298 if (0 < yysize && yysize <= yymsg_alloc)
8300 (void) yysyntax_error (yymsg, yystate, yychar);
8305 yyerror (YY_("syntax error"));
8307 goto yyexhaustedlab;
8315 if (yyerrstatus == 3)
8317 /* If just tried and failed to reuse lookahead token after an
8318 error, discard it. */
8320 if (yychar <= YYEOF)
8322 /* Return failure if at end of input. */
8323 if (yychar == YYEOF)
8328 yydestruct ("Error: discarding",
8334 /* Else will try to reuse lookahead token after shifting the error
8339 /*---------------------------------------------------.
8340 | yyerrorlab -- error raised explicitly by YYERROR. |
8341 `---------------------------------------------------*/
8344 /* Pacify compilers like GCC when the user code never invokes
8345 YYERROR and the label yyerrorlab therefore never appears in user
8347 if (/*CONSTCOND*/ 0)
8350 /* Do not reclaim the symbols of the rule which action triggered
8354 YY_STACK_PRINT (yyss, yyssp);
8359 /*-------------------------------------------------------------.
8360 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8361 `-------------------------------------------------------------*/
8363 yyerrstatus = 3; /* Each real token shifted decrements this. */
8367 yyn = yypact[yystate];
8368 if (yyn != YYPACT_NINF)
8371 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8379 /* Pop the current state because it cannot handle the error token. */
8384 yydestruct ("Error: popping",
8385 yystos[yystate], yyvsp);
8388 YY_STACK_PRINT (yyss, yyssp);
8394 /* Shift the error token. */
8395 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8401 /*-------------------------------------.
8402 | yyacceptlab -- YYACCEPT comes here. |
8403 `-------------------------------------*/
8408 /*-----------------------------------.
8409 | yyabortlab -- YYABORT comes here. |
8410 `-----------------------------------*/
8415 #if !defined(yyoverflow) || YYERROR_VERBOSE
8416 /*-------------------------------------------------.
8417 | yyexhaustedlab -- memory exhaustion comes here. |
8418 `-------------------------------------------------*/
8420 yyerror (YY_("memory exhausted"));
8426 if (yychar != YYEMPTY)
8427 yydestruct ("Cleanup: discarding lookahead",
8429 /* Do not reclaim the symbols of the rule which action triggered
8430 this YYABORT or YYACCEPT. */
8432 YY_STACK_PRINT (yyss, yyssp);
8433 while (yyssp != yyss)
8435 yydestruct ("Cleanup: popping",
8436 yystos[*yyssp], yyvsp);
8441 YYSTACK_FREE (yyss);
8444 if (yymsg != yymsgbuf)
8445 YYSTACK_FREE (yymsg);
8447 /* Make sure YYID is used. */
8448 return YYID (yyresult);