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 {
352 dict_t*unresolved_variables;
355 char uses_parent_function;
360 int var_index; // for inner methods
361 int slot_index; // for inner methods
362 char is_a_slot; // for inner methods
365 abc_exception_list_t*exceptions;
367 methodstate_list_t*innerfunctions;
370 typedef struct _state {
375 import_list_t*wildcard_imports;
376 dict_t*import_toplevel_packages;
378 namespace_list_t*active_namespaces;
379 namespace_decl_list_t*new_namespaces;
380 char has_own_imports;
381 char new_vars; // e.g. transition between two functions
384 methodstate_t*method;
391 typedef struct _global {
395 dict_t*file2token2info;
398 static global_t*global = 0;
399 static state_t* state = 0;
403 #define MULTINAME(m,x) \
407 registry_fill_multiname(&m, &m##_ns, (slotinfo_t*)(x));
409 #define MEMBER_MULTINAME(m,f,n) \
413 if((m##_ns.access = ((slotinfo_t*)(f))->access)==ACCESS_NAMESPACE) \
414 m##_ns.name = ((slotinfo_t*)(f))->package; \
419 m.namespace_set = 0; \
420 m.name = ((slotinfo_t*)(f))->name; \
422 m.type = MULTINAME; \
424 m.namespace_set = &nopackage_namespace_set; \
428 /* warning: list length of namespace set is undefined */
429 #define MULTINAME_LATE(m, access, package) \
430 namespace_t m##_ns = {access, package}; \
431 namespace_set_t m##_nsset; \
432 namespace_list_t m##_l;m##_l.next = 0; \
433 m##_nsset.namespaces = &m##_l; \
434 m##_nsset = m##_nsset; \
435 m##_l.namespace = &m##_ns; \
436 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
438 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
439 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
440 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
441 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
442 static namespace_list_t nl4 = {&ns4,0};
443 static namespace_list_t nl3 = {&ns3,&nl4};
444 static namespace_list_t nl2 = {&ns2,&nl3};
445 static namespace_list_t nl1 = {&ns1,&nl2};
446 static namespace_set_t nopackage_namespace_set = {&nl1};
448 static void new_state()
451 state_t*oldstate = state;
453 memcpy(s, state, sizeof(state_t)); //shallow copy
455 s->imports = dict_new();
457 if(!s->import_toplevel_packages) {
458 s->import_toplevel_packages = dict_new();
462 state->has_own_imports = 0;
463 state->new_namespaces = 0;
464 state->vars = dict_new();
465 state->old = oldstate;
468 static void state_has_imports()
470 state->wildcard_imports = list_clone(state->wildcard_imports);
471 state->imports = dict_clone(state->imports);
472 state->has_own_imports = 1;
474 static void import_toplevel(const char*package)
476 char* s = strdup(package);
478 dict_put(state->import_toplevel_packages, s, 0);
479 char*x = strrchr(s, '.');
487 static void state_destroy(state_t*state)
489 if(state->has_own_imports) {
490 list_free(state->wildcard_imports);
491 dict_destroy(state->imports);state->imports=0;
493 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
494 dict_destroy(state->imports);state->imports=0;
498 for(t=0;t<state->vars->hashsize;t++) {
499 dictentry_t*e =state->vars->slots[t];
501 free(e->data);e->data=0;
505 dict_destroy(state->vars);state->vars=0;
511 static void old_state()
513 if(!state || !state->old)
514 syntaxerror("invalid nesting");
515 state_t*leaving = state;
519 namespace_decl_list_t*nl=leaving->new_namespaces;
521 tokenizer_unregister_namespace(nl->namespace_decl->name);
525 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
526 free(leaving->method);
529 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
534 state_destroy(leaving);
537 static code_t* method_header(methodstate_t*m);
538 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
539 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0);
542 static char* internal_filename_package = 0;
543 void initialize_file(char*filename)
546 syntaxerror("invalid call to initialize_file during parsing of another file");
549 state->package = internal_filename_package = strdup(filename);
551 global->token2info = dict_lookup(global->file2token2info,
552 current_filename // use long version
554 if(!global->token2info) {
555 global->token2info = dict_new2(&ptr_type);
556 dict_put(global->file2token2info, current_filename, global->token2info);
560 state->method = rfx_calloc(sizeof(methodstate_t));
561 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
563 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
564 function_initvars(state->method, 0, 0, 1);
565 global->init = abc_initscript(global->file);
566 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
572 if(!state || state->level!=1) {
573 syntaxerror("unexpected end of file in pass %d", as3_pass);
577 code_t*header = method_header(state->method);
578 code_t*c = wrap_function(header, 0, global->init->method->body->code);
579 global->init->method->body->code = c;
580 free(state->method);state->method=0;
583 //free(state->package);state->package=0; // used in registry
584 state_destroy(state);state=0;
587 void initialize_parser()
589 global = rfx_calloc(sizeof(global_t));
590 global->file = abc_file_new();
591 global->file->flags &= ~ABCFILE_LAZY;
592 global->file2token2info = dict_new();
593 global->token2info = 0;
596 void* finish_parser()
598 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
600 global->token2info=0;
606 static void xx_scopetest()
608 /* findpropstrict doesn't just return a scope object- it
609 also makes it "active" somehow. Push local_0 on the
610 scope stack and read it back with findpropstrict, it'll
611 contain properties like "trace". Trying to find the same
612 property on a "vanilla" local_0 yields only a "undefined" */
613 //c = abc_findpropstrict(c, "[package]::trace");
615 /*c = abc_getlocal_0(c);
616 c = abc_findpropstrict(c, "[package]::trace");
618 c = abc_setlocal_1(c);
620 c = abc_pushbyte(c, 0);
621 c = abc_setlocal_2(c);
623 code_t*xx = c = abc_label(c);
624 c = abc_findpropstrict(c, "[package]::trace");
625 c = abc_pushstring(c, "prop:");
626 c = abc_hasnext2(c, 1, 2);
628 c = abc_setlocal_3(c);
629 c = abc_callpropvoid(c, "[package]::trace", 2);
630 c = abc_getlocal_3(c);
632 c = abc_iftrue(c,xx);*/
635 typedef struct _variable {
639 methodstate_t*is_inner_method;
642 static variable_t* find_variable(state_t*s, char*name)
646 v = dict_lookup(s->vars, name);
648 if(s->new_vars) break;
653 static variable_t* find_slot(state_t*s, const char*name)
655 if(s->method && s->method->slots)
656 return dict_lookup(s->method->slots, name);
660 static variable_t* find_variable_safe(state_t*s, char*name)
662 variable_t* v = find_variable(s, name);
664 syntaxerror("undefined variable: %s", name);
667 static char variable_exists(char*name)
669 return dict_contains(state->vars, name);
671 code_t*defaultvalue(code_t*c, classinfo_t*type);
673 static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot)
676 variable_t*v = find_slot(state, name);
682 v->index = state->method->variable_count++;
686 dict_put(state->vars, name, v);
690 static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot)
692 return new_variable2(name, type, init, maybeslot)->index;
695 #define TEMPVARNAME "__as3_temp__"
696 static int gettempvar()
698 variable_t*v = find_variable(state, TEMPVARNAME);
701 return new_variable(TEMPVARNAME, 0, 0, 0);
704 code_t* var_block(code_t*body)
710 for(t=0;t<state->vars->hashsize;t++) {
711 dictentry_t*e = state->vars->slots[t];
713 variable_t*v = (variable_t*)e->data;
714 if(v->type && v->init) {
715 c = defaultvalue(c, v->type);
716 c = abc_setlocal(c, v->index);
717 k = abc_kill(k, v->index);
727 if(x->opcode== OPCODE___BREAK__ ||
728 x->opcode== OPCODE___CONTINUE__) {
729 /* link kill code before break/continue */
730 code_t*e = code_dup(k);
731 code_t*s = code_start(e);
743 c = code_append(c, body);
744 c = code_append(c, k);
748 void unknown_variable(char*name)
750 if(!state->method->unresolved_variables)
751 state->method->unresolved_variables = dict_new();
752 if(!dict_contains(state->method->unresolved_variables, name))
753 dict_put(state->method->unresolved_variables, name, 0);
756 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
758 static void parsererror(const char*file, int line, const char*f)
760 syntaxerror("internal error in %s, %s:%d", f, file, line);
764 static code_t* method_header(methodstate_t*m)
767 if(m->uses_slots || (m->late_binding && !m->inner)) {
768 c = abc_getlocal_0(c);
769 c = abc_pushscope(c);
772 c = abc_newactivation(c);
773 c = abc_pushscope(c);
775 methodstate_list_t*l = m->innerfunctions;
777 parserassert(l->methodstate->abc);
778 if(m->uses_slots && l->methodstate->is_a_slot) {
779 c = abc_getscopeobject(c, 1);
780 c = abc_newfunction(c, l->methodstate->abc);
782 c = abc_setlocal(c, l->methodstate->var_index);
783 c = abc_setslot(c, l->methodstate->slot_index);
785 c = abc_newfunction(c, l->methodstate->abc);
786 c = abc_setlocal(c, l->methodstate->var_index);
788 free(l->methodstate);l->methodstate=0;
792 c = code_append(c, m->header);
795 if(m->is_constructor && !m->has_super) {
796 // call default constructor
797 c = abc_getlocal_0(c);
798 c = abc_constructsuper(c, 0);
800 list_free(m->innerfunctions);
801 m->innerfunctions = 0;
806 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
808 c = code_append(c, header);
809 c = code_append(c, var_block(body));
810 /* append return if necessary */
811 if(!c || (c->opcode != OPCODE_RETURNVOID &&
812 c->opcode != OPCODE_RETURNVALUE)) {
813 c = abc_returnvoid(c);
819 static void startpackage(char*name)
822 /*printf("entering package \"%s\"\n", name);*/
823 state->package = strdup(name);
825 static void endpackage()
827 /*printf("leaving package \"%s\"\n", state->package);*/
829 //used e.g. in classinfo_register:
830 //free(state->package);state->package=0;
835 #define FLAG_PUBLIC 256
836 #define FLAG_PROTECTED 512
837 #define FLAG_PRIVATE 1024
838 #define FLAG_PACKAGEINTERNAL 2048
839 #define FLAG_NAMESPACE 4096
841 static namespace_t modifiers2access(modifiers_t*mod)
846 if(mod->flags&FLAG_NAMESPACE) {
847 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
848 syntaxerror("invalid combination of access levels and namespaces");
849 ns.access = ACCESS_NAMESPACE;
851 } else if(mod->flags&FLAG_PUBLIC) {
852 if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
853 syntaxerror("invalid combination of access levels");
854 ns.access = ACCESS_PACKAGE;
855 } else if(mod->flags&FLAG_PRIVATE) {
856 if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
857 syntaxerror("invalid combination of access levels");
858 ns.access = ACCESS_PRIVATE;
859 } else if(mod->flags&FLAG_PROTECTED) {
860 if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
861 syntaxerror("invalid combination of access levels");
862 ns.access = ACCESS_PROTECTED;
864 ns.access = ACCESS_PACKAGEINTERNAL;
868 static slotinfo_t* find_class(const char*name);
870 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
875 index = new_variable("this", 0, 0, 0);
876 else if(!m->is_global)
877 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0);
879 index = new_variable("globalscope", 0, 0, 0);
882 parserassert(!index);
885 /* as variables and slots share the same number, make sure
886 that those variable indices are reserved. It's up to the
887 optimizer to later shuffle the variables down to lower
889 m->variable_count = m->uses_slots;
890 DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
893 v->type = (classinfo_t*)registry_find(v->type->package, v->type->name);
895 v->type = (classinfo_t*)find_class(v->type->name);
896 if(!v->type || v->type->kind != INFOTYPE_CLASS) {
897 syntaxerror("Couldn't find class %s", v->type->name);
905 for(p=params->list;p;p=p->next) {
906 new_variable(p->param->name, p->param->type, 0, 1);
910 methodstate_list_t*l = m->innerfunctions;
912 methodstate_t*m = l->methodstate;
913 variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 1);
914 m->var_index = v->index;
915 m->slot_index = v->index;
916 v->is_inner_method = m;
922 char*as3_globalclass=0;
923 static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements)
926 syntaxerror("inner classes now allowed");
931 classinfo_list_t*mlist=0;
933 if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
934 syntaxerror("invalid modifier(s)");
936 if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
937 syntaxerror("public and internal not supported at the same time.");
939 if(!(mod->flags&FLAG_INTERFACE) && !extends) {
940 // all classes extend object
941 extends = registry_getobjectclass();
944 /* create the class name, together with the proper attributes */
948 if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
949 access = ACCESS_PRIVATE; package = internal_filename_package;
950 } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
951 access = ACCESS_PACKAGEINTERNAL; package = state->package;
952 } else if(state->package!=internal_filename_package) {
953 access = ACCESS_PACKAGE; package = state->package;
955 syntaxerror("public classes only allowed inside a package");
959 state->cls = rfx_calloc(sizeof(classstate_t));
960 state->cls->init = rfx_calloc(sizeof(methodstate_t));
961 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
962 /* notice: we make no effort to initialize the top variable (local0) here,
963 even though it has special meaning. We just rely on the facat
964 that pass 1 won't do anything with variables */
966 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
968 /* set current method to constructor- all code within the class-level (except
969 static variable initializations) will be executed during construction time */
970 state->method = state->cls->init;
972 if(registry_find(package, classname)) {
973 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
975 /* build info struct */
976 int num_interfaces = (list_length(implements));
977 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
978 state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
982 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
984 state->method = state->cls->init;
985 parserassert(state->cls && state->cls->info);
987 function_initvars(state->cls->init, 0, 0, 1);
988 function_initvars(state->cls->static_init, 0, 0, 0);
990 if(extends && (extends->flags & FLAG_FINAL))
991 syntaxerror("Can't extend final class '%s'", extends->name);
993 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
994 state->cls->info->superclass = extends;
996 classinfo_list_t*l = implements;
997 for(l=implements;l;l=l->next) {
998 if(!(l->classinfo->flags & FLAG_INTERFACE))
999 syntaxerror("'%s' is not an interface", l->classinfo->name);
1000 state->cls->info->interfaces[pos++] = l->classinfo;
1003 /* generate the abc code for this class */
1004 MULTINAME(classname2,state->cls->info);
1005 multiname_t*extends2 = sig2mname(extends);
1007 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
1008 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
1009 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
1010 if(state->cls->info->flags&FLAG_INTERFACE) {
1011 abc_class_interface(state->cls->abc);
1014 abc_class_protectedNS(state->cls->abc, classname);
1016 for(mlist=implements;mlist;mlist=mlist->next) {
1017 MULTINAME(m, mlist->classinfo);
1018 abc_class_add_interface(state->cls->abc, &m);
1021 /* write the construction code for this class to the global init
1023 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
1025 abc_method_body_t*m = global->init->method->body;
1026 __ getglobalscope(m);
1027 classinfo_t*s = extends;
1032 //TODO: take a look at the current scope stack, maybe
1033 // we can re-use something
1038 multiname_t*s2 = sig2mname(s);
1040 multiname_destroy(s2);
1042 __ pushscope(m); count++;
1043 m->code = m->code->prev->prev; // invert
1045 /* continue appending after last op end */
1046 while(m->code && m->code->next) m->code = m->code->next;
1048 /* TODO: if this is one of *our* classes, we can also
1049 do a getglobalscope/getslot <nr> (which references
1050 the init function's slots) */
1052 __ getlex2(m, extends2);
1054 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
1055 stack is not the superclass */
1056 __ pushscope(m);count++;
1059 /* notice: we get a verify error #1107 if the top element on the scope
1060 stack is not the global object */
1062 __ pushscope(m);count++;
1064 __ newclass(m,state->cls->abc);
1068 __ setslot(m, slotindex);
1069 multiname_destroy(extends2);
1071 /* flash.display.MovieClip handling */
1073 if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
1074 if(state->package && state->package[0]) {
1075 as3_globalclass = concat3(state->package, ".", classname);
1077 as3_globalclass = strdup(classname);
1083 static int slotstate_varconst = 0;
1084 static modifiers_t*slotstate_flags = 0;
1085 static void setslotstate(modifiers_t* flags, int varconst)
1087 slotstate_varconst = varconst;
1088 slotstate_flags = flags;
1090 if(flags && flags->flags&FLAG_STATIC) {
1091 state->method = state->cls->static_init;
1093 state->method = state->cls->init;
1096 parserassert(state->method);
1100 static void endclass()
1103 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1105 c = abc_getlocal_0(c);
1106 c = abc_constructsuper(c, 0);
1107 state->cls->init->header = code_append(state->cls->init->header, c);
1108 state->cls->has_constructor=1;
1110 if(state->cls->init) {
1111 if(state->cls->info->flags&FLAG_INTERFACE) {
1112 if(state->cls->init->header)
1113 syntaxerror("interface can not have class-level code");
1115 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1116 code_t*c = method_header(state->cls->init);
1117 m->body->code = wrap_function(c, 0, m->body->code);
1120 if(state->cls->static_init) {
1121 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1122 code_t*c = method_header(state->cls->static_init);
1123 m->body->code = wrap_function(c, 0, m->body->code);
1130 void check_code_for_break(code_t*c)
1133 if(c->opcode == OPCODE___BREAK__) {
1134 char*name = string_cstr(c->data[0]);
1135 syntaxerror("Unresolved \"break %s\"", name);
1137 if(c->opcode == OPCODE___CONTINUE__) {
1138 char*name = string_cstr(c->data[0]);
1139 syntaxerror("Unresolved \"continue %s\"", name);
1141 if(c->opcode == OPCODE___PUSHPACKAGE__) {
1142 char*name = string_cstr(c->data[0]);
1143 syntaxerror("Can't reference a package (%s) as such", name);
1150 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1152 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1153 if(TYPE_IS_NUMBER(t)) {
1154 xassert(c->type == CONSTANT_FLOAT
1155 || c->type == CONSTANT_INT
1156 || c->type == CONSTANT_UINT);
1157 } else if(TYPE_IS_UINT(t)) {
1158 xassert(c->type == CONSTANT_UINT ||
1159 (c->type == CONSTANT_INT && c->i>=0));
1160 } else if(TYPE_IS_INT(t)) {
1161 xassert(c->type == CONSTANT_INT);
1162 } else if(TYPE_IS_BOOLEAN(t)) {
1163 xassert(c->type == CONSTANT_TRUE
1164 || c->type == CONSTANT_FALSE);
1168 static void check_override(memberinfo_t*m, int flags)
1172 if(m->parent == state->cls->info)
1173 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1175 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1176 if(m->access==ACCESS_PRIVATE)
1178 if(m->flags & FLAG_FINAL)
1179 syntaxerror("can't override final member %s", m->name);
1181 /* allow this. it's no issue.
1182 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1183 syntaxerror("can't override static member %s", m->name);*/
1185 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1186 syntaxerror("can't override non-static member %s with static declaration", m->name);
1188 if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) {
1189 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1190 if(m->kind == INFOTYPE_METHOD)
1191 syntaxerror("can't override without explicit 'override' declaration");
1193 syntaxerror("can't override '%s'", m->name);
1198 static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot)
1200 methodinfo_t*minfo = 0;
1201 namespace_t ns = modifiers2access(mod);
1204 minfo = methodinfo_register_global(ns.access, state->package, name);
1205 minfo->return_type = 0; // save this for pass 2
1206 } else if(getset != KW_GET && getset != KW_SET) {
1208 memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0);
1210 printf("%s.%s | %s.%s\n",
1211 m->package, m->name,
1213 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1215 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1216 minfo->return_type = 0; // save this for pass 2
1217 // getslot on a member slot only returns "undefined", so no need
1218 // to actually store these
1219 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1221 //class getter/setter
1222 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1224 if(getset == KW_GET) {
1226 } else if(params->list && params->list->param && !params->list->next) {
1227 type = params->list->param->type;
1229 syntaxerror("setter function needs to take exactly one argument");
1230 // not sure wether to look into superclasses here, too
1231 minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1);
1233 if(minfo->kind!=INFOTYPE_SLOT)
1234 syntaxerror("class already contains a method called '%s'", name);
1235 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1236 syntaxerror("class already contains a field called '%s'", name);
1237 if(minfo->subtype & gs)
1238 syntaxerror("getter/setter for '%s' already defined", name);
1239 /* make a setter or getter into a getset */
1240 minfo->subtype |= gs;
1243 FIXME: this check needs to be done in pass 2
1245 if((!minfo->return_type != !type) ||
1246 (minfo->return_type && type &&
1247 !strcmp(minfo->return_type->name, type->name))) {
1248 syntaxerror("different type in getter and setter: %s and %s",
1249 minfo->return_type?minfo->return_type->name:"*",
1250 type?type->name:"*");
1253 minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name);
1254 minfo->kind = INFOTYPE_SLOT; //hack
1255 minfo->subtype = gs;
1256 minfo->return_type = 0;
1258 /* can't assign a slot as getter and setter might have different slots */
1259 //minfo->slot = slot;
1261 if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1262 if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1263 if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1268 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1270 //parserassert(state->method && state->method->info);
1272 methodstate_t*parent_method = state->method;
1275 return_type = 0; // not valid in pass 1
1279 state->new_vars = 1;
1282 state->method = rfx_calloc(sizeof(methodstate_t));
1283 state->method->inner = 1;
1284 state->method->variable_count = 0;
1285 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1287 NEW(methodinfo_t,minfo);
1288 minfo->kind = INFOTYPE_METHOD;
1289 minfo->access = ACCESS_PACKAGEINTERNAL;
1291 state->method->info = minfo;
1294 list_append(parent_method->innerfunctions, state->method);
1296 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1298 function_initvars(state->method, params, 0, 1);
1302 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1303 state->method->variable_count = 0;
1304 parserassert(state->method);
1306 state->method->info->return_type = return_type;
1307 function_initvars(state->method, params, 0, 1);
1311 static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1312 params_t*params, classinfo_t*return_type)
1314 if(state->method && state->method->info) {
1315 syntaxerror("not able to start another method scope");
1318 state->new_vars = 1;
1321 state->method = rfx_calloc(sizeof(methodstate_t));
1322 state->method->has_super = 0;
1325 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1327 state->method->is_global = 1;
1328 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1330 if(state->method->is_constructor)
1331 name = "__as3_constructor__";
1333 state->method->info = registerfunction(getset, mod, name, params, return_type, 0);
1335 function_initvars(state->method, params, mod->flags, 1);
1337 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1341 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1342 state->method->variable_count = 0;
1343 parserassert(state->method);
1346 memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2);
1347 check_override(m, mod->flags);
1351 state->cls->has_constructor |= state->method->is_constructor;
1354 state->method->info->return_type = return_type;
1355 function_initvars(state->method, params, mod->flags, 1);
1359 static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name,
1360 params_t*params, classinfo_t*return_type, code_t*body)
1362 int flags = mod?mod->flags:0;
1365 // store inner methods in variables
1366 function_initvars(state->method, 0, 0, 0);
1368 methodstate_list_t*ml = state->method->innerfunctions;
1370 dict_t*xvars = dict_new();
1373 methodstate_t*m = ml->methodstate;
1374 parserassert(m->inner);
1375 if(m->unresolved_variables) {
1376 dict_t*d = m->unresolved_variables;
1378 for(t=0;t<d->hashsize;t++) {
1379 dictentry_t*l = d->slots[t];
1381 /* check parent method's variables */
1383 if((v=find_variable(state, l->key))) {
1384 m->uses_parent_function = 1;
1385 state->method->uses_slots = 1;
1386 dict_put(xvars, l->key, 0);
1393 dict_destroy(m->unresolved_variables);
1394 m->unresolved_variables = 0;
1399 if(state->method->uses_slots) {
1400 state->method->slots = dict_new();
1402 DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) {
1403 if(v->index && dict_contains(xvars, name)) {
1406 if(v->is_inner_method) {
1407 v->is_inner_method->is_a_slot = 1;
1410 dict_put(state->method->slots, name, v);
1413 state->method->uses_slots = i;
1414 dict_destroy(state->vars);state->vars = 0;
1421 /*if(state->method->uses_parent_function){
1422 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1427 multiname_t*type2 = sig2mname(return_type);
1429 if(state->method->inner) {
1430 f = state->method->abc;
1431 abc_method_init(f, global->file, type2, 1);
1432 } else if(state->method->is_constructor) {
1433 f = abc_class_getconstructor(state->cls->abc, type2);
1434 } else if(!state->method->is_global) {
1435 namespace_t mname_ns = {state->method->info->access, ""};
1436 multiname_t mname = {QNAME, &mname_ns, 0, name};
1438 if(flags&FLAG_STATIC)
1439 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1441 f = abc_class_method(state->cls->abc, type2, &mname);
1442 slot = f->trait->slot_id;
1444 namespace_t mname_ns = {state->method->info->access, state->package};
1445 multiname_t mname = {QNAME, &mname_ns, 0, name};
1447 f = abc_method_new(global->file, type2, 1);
1448 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1449 //abc_code_t*c = global->init->method->body->code;
1451 //flash doesn't seem to allow us to access function slots
1452 //state->method->info->slot = slot;
1454 if(flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1455 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1456 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1457 if(params->varargs) f->flags |= METHOD_NEED_REST;
1461 for(p=params->list;p;p=p->next) {
1462 if(params->varargs && !p->next) {
1463 break; //varargs: omit last parameter in function signature
1465 multiname_t*m = sig2mname(p->param->type);
1466 list_append(f->parameters, m);
1467 if(p->param->value) {
1468 check_constant_against_type(p->param->type, p->param->value);
1469 opt=1;list_append(f->optional_parameters, p->param->value);
1471 syntaxerror("non-optional parameter not allowed after optional parameters");
1474 if(state->method->slots) {
1475 DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) {
1477 multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name);
1478 multiname_t*type = sig2mname(v->type);
1479 trait_t*t = trait_new_member(&f->body->traits, type, mname, 0);
1480 t->slot_id = v->index;
1485 check_code_for_break(body);
1487 if(state->method->exceptions &&
1488 (state->method->late_binding || state->method->uses_slots)) {
1489 //syntaxerror("try/catch and activation or late binding not supported yet within the same method");
1490 as3_warning("try/catch and activation or late binding not supported yet within the same method");
1494 f->body->code = body;
1495 f->body->exceptions = state->method->exceptions;
1496 } else { //interface
1498 syntaxerror("interface methods can't have a method body");
1508 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1513 void breakjumpsto(code_t*c, char*name, code_t*jump)
1516 if(c->opcode == OPCODE___BREAK__) {
1517 string_t*name2 = c->data[0];
1518 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1519 c->opcode = OPCODE_JUMP;
1526 void continuejumpsto(code_t*c, char*name, code_t*jump)
1529 if(c->opcode == OPCODE___CONTINUE__) {
1530 string_t*name2 = c->data[0];
1531 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1532 c->opcode = OPCODE_JUMP;
1540 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1541 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1542 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1544 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1546 if(!type1 || !type2)
1547 return registry_getanytype();
1548 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1549 return registry_getanytype();
1552 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1561 return registry_getanytype();
1563 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1568 return abc_coerce_a(c);
1572 // cast an "any" type to a specific type. subject to
1573 // runtime exceptions
1574 return abc_coerce2(c, &m);
1577 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1578 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1579 // allow conversion between number types
1580 return abc_coerce2(c, &m);
1582 //printf("%s.%s\n", from.package, from.name);
1583 //printf("%s.%s\n", to.package, to.name);
1585 classinfo_t*supertype = from;
1587 if(supertype == to) {
1588 // target type is one of from's superclasses
1589 return abc_coerce2(c, &m);
1592 while(supertype->interfaces[t]) {
1593 if(supertype->interfaces[t]==to) {
1594 // target type is one of from's interfaces
1595 return abc_coerce2(c, &m);
1599 supertype = supertype->superclass;
1601 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1603 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1605 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1608 as3_error("can't convert type %s%s%s to %s%s%s",
1609 from->package, from->package?".":"", from->name,
1610 to->package, to->package?".":"", to->name);
1614 code_t*defaultvalue(code_t*c, classinfo_t*type)
1616 if(TYPE_IS_INT(type)) {
1617 c = abc_pushbyte(c, 0);
1618 } else if(TYPE_IS_UINT(type)) {
1619 c = abc_pushuint(c, 0);
1620 } else if(TYPE_IS_FLOAT(type)) {
1622 } else if(TYPE_IS_BOOLEAN(type)) {
1623 c = abc_pushfalse(c);
1625 //c = abc_pushundefined(c);
1627 c = abc_pushnull(c);
1629 c = abc_coerce2(c, &m);
1634 char is_pushundefined(code_t*c)
1636 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1639 static slotinfo_t* find_class(const char*name)
1643 c = registry_find(state->package, name);
1646 /* try explicit imports */
1647 dictentry_t* e = dict_get_slot(state->imports, name);
1650 if(!strcmp(e->key, name)) {
1651 c = (slotinfo_t*)e->data;
1657 /* try package.* imports */
1658 import_list_t*l = state->wildcard_imports;
1660 //printf("does package %s contain a class %s?\n", l->import->package, name);
1661 c = registry_find(l->import->package, name);
1666 /* try global package */
1667 c = registry_find("", name);
1670 /* try local "filename" package */
1671 c = registry_find(internal_filename_package, name);
1676 typedcode_t push_class(slotinfo_t*a)
1681 if(a->access == ACCESS_PACKAGEINTERNAL &&
1682 strcmp(a->package, state->package) &&
1683 strcmp(a->package, internal_filename_package)
1685 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
1686 infotypename(a), a->name, a->package, state->package);
1689 if(a->kind != INFOTYPE_CLASS) {
1691 x.c = abc_findpropstrict2(x.c, &m);
1692 x.c = abc_getproperty2(x.c, &m);
1693 if(a->kind == INFOTYPE_METHOD) {
1694 methodinfo_t*f = (methodinfo_t*)a;
1695 x.t = TYPE_FUNCTION(f);
1697 varinfo_t*v = (varinfo_t*)a;
1701 classinfo_t*c = (classinfo_t*)a;
1703 x.c = abc_getglobalscope(x.c);
1704 x.c = abc_getslot(x.c, c->slot);
1707 x.c = abc_getlex2(x.c, &m);
1709 x.t = TYPE_CLASS(c);
1714 static char is_getlocal(code_t*c)
1716 if(!c || c->prev || c->next)
1718 return(c->opcode == OPCODE_GETLOCAL
1719 || c->opcode == OPCODE_GETLOCAL_0
1720 || c->opcode == OPCODE_GETLOCAL_1
1721 || c->opcode == OPCODE_GETLOCAL_2
1722 || c->opcode == OPCODE_GETLOCAL_3);
1724 static int getlocalnr(code_t*c)
1726 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1727 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1728 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1729 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1730 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1731 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1735 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1739 [prefix code] [read instruction]
1743 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1745 if(in && in->opcode == OPCODE_COERCE_A) {
1746 in = code_cutlast(in);
1749 syntaxerror("internal error");
1751 /* chop off read instruction */
1755 prefix = r->prev;r->prev = 0;
1761 char use_temp_var = readbefore;
1763 /* generate the write instruction, and maybe append a dup to the prefix code */
1764 code_t* write = abc_nop(0);
1765 if(r->opcode == OPCODE_GETPROPERTY) {
1766 write->opcode = OPCODE_SETPROPERTY;
1767 multiname_t*m = (multiname_t*)r->data[0];
1768 write->data[0] = multiname_clone(m);
1769 if(m->type == QNAME || m->type == MULTINAME) {
1771 prefix = abc_dup(prefix); // we need the object, too
1774 } else if(m->type == MULTINAMEL) {
1776 /* dupping two values on the stack requires 5 operations and one register-
1777 couldn't adobe just have given us a dup2? */
1778 int temp = gettempvar();
1779 prefix = abc_setlocal(prefix, temp);
1780 prefix = abc_dup(prefix);
1781 prefix = abc_getlocal(prefix, temp);
1782 prefix = abc_swap(prefix);
1783 prefix = abc_getlocal(prefix, temp);
1785 prefix = abc_kill(prefix, temp);
1789 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1791 } else if(r->opcode == OPCODE_GETSLOT) {
1792 write->opcode = OPCODE_SETSLOT;
1793 write->data[0] = r->data[0];
1795 prefix = abc_dup(prefix); // we need the object, too
1798 } else if(r->opcode == OPCODE_GETLOCAL) {
1799 write->opcode = OPCODE_SETLOCAL;
1800 write->data[0] = r->data[0];
1801 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1802 write->opcode = OPCODE_SETLOCAL_0;
1803 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1804 write->opcode = OPCODE_SETLOCAL_1;
1805 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1806 write->opcode = OPCODE_SETLOCAL_2;
1807 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1808 write->opcode = OPCODE_SETLOCAL_3;
1809 } else if(r->opcode == OPCODE_GETSUPER) {
1810 write->opcode = OPCODE_SETSUPER;
1811 multiname_t*m = (multiname_t*)r->data[0];
1812 write->data[0] = multiname_clone(m);
1815 syntaxerror("illegal lvalue: can't assign a value to this expression");
1822 /* with getproperty/getslot, we have to be extra careful not
1823 to execute the read code twice, as it might have side-effects
1824 (e.g. if the property is in fact a setter/getter combination)
1826 So read the value, modify it, and write it again,
1827 using prefix only once and making sure (by using a temporary
1828 register) that the return value is what we just wrote */
1829 temp = gettempvar();
1830 c = code_append(c, prefix);
1831 c = code_append(c, r);
1834 c = abc_setlocal(c, temp);
1836 c = code_append(c, middlepart);
1839 c = abc_setlocal(c, temp);
1841 c = code_append(c, write);
1842 c = abc_getlocal(c, temp);
1843 c = abc_kill(c, temp);
1845 /* if we're allowed to execute the read code twice *and*
1846 the middlepart doesn't modify the code, things are easier.
1848 code_t* r2 = code_dup(r);
1849 //c = code_append(c, prefix);
1850 parserassert(!prefix);
1851 c = code_append(c, r);
1852 c = code_append(c, middlepart);
1853 c = code_append(c, write);
1854 c = code_append(c, r2);
1857 /* even smaller version: overwrite the value without reading
1861 c = code_append(c, prefix);
1864 c = code_append(c, middlepart);
1865 c = code_append(c, write);
1866 c = code_append(c, r);
1869 temp = gettempvar();
1871 c = code_append(c, prefix);
1873 c = code_append(c, middlepart);
1875 c = abc_setlocal(c, temp);
1876 c = code_append(c, write);
1877 c = abc_getlocal(c, temp);
1878 c = abc_kill(c, temp);
1884 char is_break_or_jump(code_t*c)
1888 if(c->opcode == OPCODE_JUMP ||
1889 c->opcode == OPCODE___BREAK__ ||
1890 c->opcode == OPCODE___CONTINUE__ ||
1891 c->opcode == OPCODE_THROW ||
1892 c->opcode == OPCODE_RETURNVOID ||
1893 c->opcode == OPCODE_RETURNVALUE) {
1900 #define IS_FINALLY_TARGET(op) \
1901 ((op) == OPCODE___CONTINUE__ || \
1902 (op) == OPCODE___BREAK__ || \
1903 (op) == OPCODE_RETURNVOID || \
1904 (op) == OPCODE_RETURNVALUE || \
1905 (op) == OPCODE___RETHROW__)
1907 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1909 #define NEED_EXTRA_STACK_ARG
1910 code_t*finally_label = abc_nop(0);
1911 NEW(lookupswitch_t, l);
1917 code_t*prev = i->prev;
1918 if(IS_FINALLY_TARGET(i->opcode)) {
1921 if(i->opcode == OPCODE___RETHROW__ ||
1922 i->opcode == OPCODE_RETURNVALUE) {
1923 if(i->opcode == OPCODE___RETHROW__)
1924 i->opcode = OPCODE_THROW;
1926 p = abc_coerce_a(p);
1927 p = abc_setlocal(p, tempvar);
1929 p = abc_pushbyte(p, count++);
1930 p = abc_jump(p, finally_label);
1931 code_t*target = p = abc_label(p);
1932 #ifdef NEED_EXTRA_STACK_ARG
1936 p = abc_getlocal(p, tempvar);
1939 p->next = i;i->prev = p;
1940 list_append(l->targets, target);
1946 c = abc_pushbyte(c, -1);
1947 c = code_append(c, finally_label);
1948 c = code_append(c, finally);
1950 #ifdef NEED_EXTRA_STACK_ARG
1953 c = abc_lookupswitch(c, l);
1954 c = l->def = abc_label(c);
1955 #ifdef NEED_EXTRA_STACK_ARG
1962 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1966 code_t*prev = i->prev;
1967 if(IS_FINALLY_TARGET(i->opcode)) {
1968 if(i->opcode == OPCODE___RETHROW__)
1969 i->opcode = OPCODE_THROW;
1970 code_t*end = code_dup(finally);
1971 code_t*start = code_start(end);
1972 if(prev) prev->next = start;
1979 return code_append(c, finally);
1982 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1988 int num_insertion_points=0;
1990 if(IS_FINALLY_TARGET(i->opcode))
1991 num_insertion_points++;
1998 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
2003 int simple_version_cost = (1+num_insertion_points)*code_size;
2004 int lookup_version_cost = 4*num_insertion_points + 5;
2006 if(cantdup || simple_version_cost > lookup_version_cost) {
2007 printf("lookup %d > *%d*\n", simple_version_cost, lookup_version_cost);
2008 return insert_finally_lookup(c, finally, tempvar);
2010 printf("simple *%d* < %d\n", simple_version_cost, lookup_version_cost);
2011 return insert_finally_simple(c, finally, tempvar);
2015 #define PASS1 }} if(as3_pass == 1) {{
2016 #define PASS1END }} if(as3_pass == 2) {{
2017 #define PASS2 }} if(as3_pass == 2) {{
2018 #define PASS12 }} {{
2019 #define PASS12END }} if(as3_pass == 2) {{
2023 /* Line 273 of skeleton.m4 */
2024 #line 2025 "parser.tab.c"
2031 typedef YYTYPE_UINT8 yytype_uint8;
2033 typedef unsigned char yytype_uint8;
2037 typedef YYTYPE_INT8 yytype_int8;
2038 #elif (defined __STDC__ || defined __C99__FUNC__ \
2039 || defined __cplusplus || defined _MSC_VER)
2040 typedef signed char yytype_int8;
2042 typedef short int yytype_int8;
2045 #ifdef YYTYPE_UINT16
2046 typedef YYTYPE_UINT16 yytype_uint16;
2048 typedef unsigned short int yytype_uint16;
2052 typedef YYTYPE_INT16 yytype_int16;
2054 typedef short int yytype_int16;
2058 # ifdef __SIZE_TYPE__
2059 # define YYSIZE_T __SIZE_TYPE__
2060 # elif defined size_t
2061 # define YYSIZE_T size_t
2062 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
2063 || defined __cplusplus || defined _MSC_VER)
2064 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
2065 # define YYSIZE_T size_t
2067 # define YYSIZE_T unsigned int
2071 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
2076 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
2077 # define YY_(msgid) dgettext ("bison-runtime", msgid)
2081 # define YY_(msgid) msgid
2085 /* Suppress unused-variable warnings by "using" E. */
2086 #if ! defined lint || defined __GNUC__
2087 # define YYUSE(e) ((void) (e))
2089 # define YYUSE(e) /* empty */
2092 /* Identity function, used to suppress warnings about constant conditions. */
2094 # define YYID(n) (n)
2096 #if (defined __STDC__ || defined __C99__FUNC__ \
2097 || defined __cplusplus || defined _MSC_VER)
2110 #if ! defined yyoverflow || YYERROR_VERBOSE
2112 /* The parser invokes alloca or malloc; define the necessary symbols. */
2114 # ifdef YYSTACK_USE_ALLOCA
2115 # if YYSTACK_USE_ALLOCA
2117 # define YYSTACK_ALLOC __builtin_alloca
2118 # elif defined __BUILTIN_VA_ARG_INCR
2119 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
2121 # define YYSTACK_ALLOC __alloca
2122 # elif defined _MSC_VER
2123 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
2124 # define alloca _alloca
2126 # define YYSTACK_ALLOC alloca
2127 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2128 || defined __cplusplus || defined _MSC_VER)
2129 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2131 # define _STDLIB_H 1
2138 # ifdef YYSTACK_ALLOC
2139 /* Pacify GCC's `empty if-body' warning. */
2140 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
2141 # ifndef YYSTACK_ALLOC_MAXIMUM
2142 /* The OS might guarantee only one guard page at the bottom of the stack,
2143 and a page size can be as small as 4096 bytes. So we cannot safely
2144 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
2145 to allow for a few compiler-allocated temporary stack slots. */
2146 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
2149 # define YYSTACK_ALLOC YYMALLOC
2150 # define YYSTACK_FREE YYFREE
2151 # ifndef YYSTACK_ALLOC_MAXIMUM
2152 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
2154 # if (defined __cplusplus && ! defined _STDLIB_H \
2155 && ! ((defined YYMALLOC || defined malloc) \
2156 && (defined YYFREE || defined free)))
2157 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
2159 # define _STDLIB_H 1
2163 # define YYMALLOC malloc
2164 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2165 || defined __cplusplus || defined _MSC_VER)
2166 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
2170 # define YYFREE free
2171 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
2172 || defined __cplusplus || defined _MSC_VER)
2173 void free (void *); /* INFRINGES ON USER NAME SPACE */
2177 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
2180 #if (! defined yyoverflow \
2181 && (! defined __cplusplus \
2182 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
2184 /* A type that is properly aligned for any stack member. */
2187 yytype_int16 yyss_alloc;
2191 /* The size of the maximum gap between one aligned stack and the next. */
2192 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
2194 /* The size of an array large to enough to hold all stacks, each with
2196 # define YYSTACK_BYTES(N) \
2197 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2198 + YYSTACK_GAP_MAXIMUM)
2200 /* Copy COUNT objects from FROM to TO. The source and destination do
2203 # if defined __GNUC__ && 1 < __GNUC__
2204 # define YYCOPY(To, From, Count) \
2205 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2207 # define YYCOPY(To, From, Count) \
2211 for (yyi = 0; yyi < (Count); yyi++) \
2212 (To)[yyi] = (From)[yyi]; \
2218 /* Relocate STACK from its old location to the new one. The
2219 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2220 elements in the stack, and YYPTR gives the new location of the
2221 stack. Advance YYPTR to a properly aligned location for the next
2223 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2226 YYSIZE_T yynewbytes; \
2227 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2228 Stack = &yyptr->Stack_alloc; \
2229 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2230 yyptr += yynewbytes / sizeof (*yyptr); \
2236 /* YYFINAL -- State number of the termination state. */
2238 /* YYLAST -- Last index in YYTABLE. */
2241 /* YYNTOKENS -- Number of terminals. */
2242 #define YYNTOKENS 134
2243 /* YYNNTS -- Number of nonterminals. */
2245 /* YYNRULES -- Number of rules. */
2246 #define YYNRULES 307
2247 /* YYNRULES -- Number of states. */
2248 #define YYNSTATES 519
2250 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2251 #define YYUNDEFTOK 2
2252 #define YYMAXUTOK 363
2254 #define YYTRANSLATE(YYX) \
2255 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2257 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2258 static const yytype_uint8 yytranslate[] =
2260 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2261 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2263 2, 2, 2, 118, 2, 2, 2, 116, 108, 2,
2264 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2265 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2266 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2269 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2272 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2285 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2286 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2287 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2288 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2289 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2290 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2291 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2292 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2293 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2294 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2295 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2300 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2302 static const yytype_uint16 yyprhs[] =
2304 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2305 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2306 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2307 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2308 85, 87, 89, 93, 96, 98, 100, 102, 104, 106,
2309 108, 110, 115, 118, 120, 122, 126, 129, 130, 133,
2310 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2311 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2312 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2313 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2314 275, 277, 280, 282, 283, 290, 293, 295, 301, 303,
2315 305, 309, 311, 312, 319, 320, 326, 329, 334, 335,
2316 337, 339, 342, 344, 346, 348, 350, 352, 354, 356,
2317 358, 360, 362, 363, 366, 367, 370, 371, 374, 375,
2318 385, 386, 395, 396, 398, 400, 403, 405, 410, 412,
2319 414, 416, 417, 419, 421, 424, 426, 429, 438, 440,
2320 442, 443, 448, 450, 454, 458, 459, 462, 464, 466,
2321 468, 470, 472, 474, 476, 478, 480, 481, 483, 486,
2322 491, 495, 497, 502, 505, 507, 509, 510, 511, 524,
2323 526, 527, 528, 539, 541, 545, 547, 549, 551, 555,
2324 557, 559, 561, 564, 565, 566, 570, 571, 573, 575,
2325 577, 580, 583, 584, 589, 594, 599, 602, 604, 607,
2326 609, 611, 615, 617, 619, 621, 623, 625, 627, 629,
2327 631, 633, 635, 637, 639, 641, 643, 645, 647, 649,
2328 651, 655, 659, 663, 667, 671, 675, 679, 683, 687,
2329 691, 694, 697, 701, 705, 709, 713, 717, 721, 725,
2330 729, 733, 737, 741, 745, 749, 753, 757, 762, 765,
2331 767, 771, 774, 779, 783, 784, 786, 790, 796, 800,
2332 804, 808, 812, 816, 820, 824, 828, 832, 836, 840,
2333 844, 850, 853, 856, 859, 862, 866, 869, 874, 880,
2334 884, 890, 894, 896, 899, 904, 909, 912
2337 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2338 static const yytype_int16 yyrhs[] =
2340 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2341 137, 138, -1, 185, -1, 197, -1, 195, -1, 216,
2342 -1, 206, -1, 147, -1, 148, 126, 136, 132, -1,
2343 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2344 197, -1, 195, -1, 216, -1, 206, -1, 147, -1,
2345 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2346 143, 145, -1, 145, -1, 188, -1, 159, -1, 160,
2347 -1, 161, -1, 163, -1, 171, -1, 154, -1, 182,
2348 -1, 179, -1, 238, -1, 246, -1, 245, -1, 126,
2349 143, 132, -1, 126, 132, -1, 99, -1, 144, -1,
2350 150, -1, 165, -1, 166, -1, 235, -1, 181, -1,
2351 148, 126, 143, 132, -1, 145, 99, -1, 145, -1,
2352 144, -1, 3, 89, 3, -1, 102, 236, -1, -1,
2353 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2354 152, -1, 3, 226, 149, -1, -1, 65, 146, -1,
2355 -1, 64, 122, 155, 237, 133, 146, 153, -1, -1,
2356 150, -1, 238, -1, 46, 3, 226, -1, 3, -1,
2357 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2358 237, 99, 238, 133, 146, -1, 158, 157, 68, 237,
2359 133, 146, -1, -1, 14, 122, 162, 237, 133, 146,
2360 -1, -1, 15, 164, 146, 14, 122, 237, 133, -1,
2361 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2362 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2363 168, 169, -1, 34, 239, 105, 142, -1, 62, 105,
2364 142, -1, -1, 16, 122, 172, 239, 133, 126, 167,
2365 132, -1, -1, 33, 122, 3, 226, 133, 174, 126,
2366 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2367 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2368 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2369 37, 237, -1, 37, -1, 39, 122, 237, 133, 146,
2370 -1, 3, -1, 19, -1, 184, 127, 183, -1, 183,
2371 -1, -1, 19, 184, 126, 186, 139, 132, -1, -1,
2372 19, 126, 187, 139, 132, -1, 41, 222, -1, 41,
2373 184, 127, 115, -1, -1, 190, -1, 191, -1, 190,
2374 191, -1, 21, -1, 22, -1, 20, -1, 38, -1,
2375 47, -1, 49, -1, 48, -1, 26, -1, 24, -1,
2376 4, -1, -1, 54, 223, -1, -1, 54, 224, -1,
2377 -1, 17, 224, -1, -1, 189, 31, 3, 192, 194,
2378 126, 196, 199, 132, -1, -1, 189, 44, 3, 193,
2379 126, 198, 202, 132, -1, -1, 200, -1, 201, -1,
2380 200, 201, -1, 99, -1, 148, 126, 199, 132, -1,
2381 206, -1, 216, -1, 144, -1, -1, 203, -1, 204,
2382 -1, 203, 204, -1, 99, -1, 46, 3, -1, 189,
2383 27, 215, 3, 122, 212, 133, 226, -1, 46, -1,
2384 32, -1, -1, 189, 205, 207, 208, -1, 209, -1,
2385 208, 100, 209, -1, 3, 226, 149, -1, -1, 102,
2386 211, -1, 10, -1, 8, -1, 9, -1, 12, -1,
2387 5, -1, 56, -1, 55, -1, 45, -1, 3, -1,
2388 -1, 213, -1, 93, 214, -1, 213, 100, 93, 214,
2389 -1, 213, 100, 214, -1, 214, -1, 3, 105, 225,
2390 210, -1, 3, 210, -1, 51, -1, 35, -1, -1,
2391 -1, 189, 27, 215, 3, 122, 212, 133, 226, 126,
2392 217, 142, 132, -1, 3, -1, -1, -1, 27, 218,
2393 122, 212, 133, 226, 126, 220, 142, 132, -1, 3,
2394 -1, 184, 127, 3, -1, 222, -1, 221, -1, 223,
2395 -1, 224, 100, 223, -1, 223, -1, 115, -1, 36,
2396 -1, 105, 225, -1, -1, -1, 122, 228, 133, -1,
2397 -1, 229, -1, 230, -1, 236, -1, 229, 100, -1,
2398 230, 236, -1, -1, 25, 239, 231, 227, -1, 239,
2399 122, 228, 133, -1, 53, 122, 228, 133, -1, 63,
2400 239, -1, 42, -1, 42, 237, -1, 239, -1, 239,
2401 -1, 237, 100, 239, -1, 237, -1, 219, -1, 240,
2402 -1, 243, -1, 232, -1, 234, -1, 233, -1, 6,
2403 -1, 10, -1, 11, -1, 8, -1, 9, -1, 12,
2404 -1, 5, -1, 29, -1, 56, -1, 55, -1, 45,
2405 -1, 239, 109, 239, -1, 239, 110, 239, -1, 239,
2406 75, 239, -1, 239, 76, 239, -1, 239, 71, 239,
2407 -1, 239, 72, 239, -1, 239, 74, 239, -1, 239,
2408 73, 239, -1, 239, 87, 239, -1, 239, 88, 239,
2409 -1, 118, 239, -1, 117, 239, -1, 239, 108, 239,
2410 -1, 239, 107, 239, -1, 239, 106, 239, -1, 239,
2411 96, 239, -1, 239, 95, 239, -1, 239, 94, 239,
2412 -1, 239, 114, 239, -1, 239, 116, 239, -1, 239,
2413 113, 239, -1, 239, 112, 239, -1, 239, 115, 239,
2414 -1, 239, 68, 239, -1, 239, 69, 239, -1, 239,
2415 40, 239, -1, 239, 67, 239, -1, 43, 122, 239,
2416 133, -1, 36, 239, -1, 36, -1, 122, 237, 133,
2417 -1, 112, 239, -1, 239, 124, 239, 125, -1, 124,
2418 228, 125, -1, -1, 242, -1, 236, 105, 236, -1,
2419 242, 100, 236, 105, 236, -1, 70, 241, 132, -1,
2420 239, 80, 239, -1, 239, 79, 239, -1, 239, 85,
2421 239, -1, 239, 84, 239, -1, 239, 86, 239, -1,
2422 239, 78, 239, -1, 239, 77, 239, -1, 239, 83,
2423 239, -1, 239, 81, 239, -1, 239, 82, 239, -1,
2424 239, 102, 239, -1, 239, 104, 239, 105, 239, -1,
2425 239, 91, -1, 239, 90, -1, 91, 239, -1, 90,
2426 239, -1, 53, 127, 3, -1, 128, 3, -1, 239,
2427 127, 128, 3, -1, 239, 127, 3, 89, 3, -1,
2428 239, 92, 3, -1, 239, 127, 122, 239, 133, -1,
2429 239, 127, 3, -1, 3, -1, 18, 3, -1, 18,
2430 3, 102, 3, -1, 18, 3, 102, 5, -1, 189,
2431 244, -1, 23, 18, 223, -1
2434 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2435 static const yytype_uint16 yyrline[] =
2437 0, 2003, 2003, 2005, 2005, 2006, 2007, 2009, 2010, 2011,
2438 2012, 2013, 2014, 2015, 2016, 2018, 2018, 2019, 2020, 2022,
2439 2023, 2024, 2025, 2026, 2027, 2028, 2030, 2031, 2033, 2034,
2440 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046,
2441 2047, 2048, 2049, 2050, 2053, 2054, 2055, 2056, 2057, 2058,
2442 2059, 2060, 2064, 2065, 2069, 2076, 2080, 2081, 2085, 2086,
2443 2088, 2089, 2091, 2152, 2153, 2156, 2156, 2175, 2176, 2177,
2444 2182, 2186, 2191, 2192, 2194, 2214, 2262, 2262, 2281, 2281,
2445 2296, 2299, 2302, 2305, 2309, 2310, 2311, 2312, 2313, 2314,
2446 2316, 2327, 2330, 2330, 2359, 2359, 2383, 2383, 2399, 2400,
2447 2401, 2402, 2410, 2419, 2419, 2464, 2468, 2479, 2488, 2489,
2448 2491, 2492, 2494, 2494, 2496, 2496, 2499, 2515, 2532, 2533,
2449 2534, 2535, 2543, 2544, 2545, 2546, 2547, 2548, 2549, 2550,
2450 2551, 2552, 2556, 2557, 2559, 2560, 2562, 2563, 2567, 2565,
2451 2573, 2571, 2580, 2581, 2582, 2583, 2584, 2585, 2586, 2587,
2452 2589, 2595, 2596, 2597, 2598, 2599, 2600, 2603, 2616, 2616,
2453 2618, 2618, 2620, 2621, 2623, 2698, 2699, 2701, 2702, 2703,
2454 2704, 2705, 2707, 2708, 2709, 2710, 2722, 2726, 2732, 2738,
2455 2746, 2751, 2757, 2765, 2773, 2774, 2775, 2778, 2777, 2794,
2456 2795, 2797, 2796, 2820, 2836, 2851, 2852, 2854, 2855, 2857,
2457 2858, 2859, 2868, 2869, 2873, 2874, 2876, 2877, 2878, 2880,
2458 2884, 2885, 2890, 2891, 2927, 2973, 2994, 3015, 3018, 3025,
2459 3026, 3027, 3033, 3039, 3041, 3043, 3045, 3047, 3049, 3051,
2460 3068, 3073, 3076, 3079, 3082, 3085, 3088, 3091, 3094, 3097,
2461 3101, 3104, 3107, 3110, 3113, 3116, 3119, 3122, 3126, 3137,
2462 3155, 3160, 3165, 3170, 3175, 3180, 3184, 3188, 3193, 3197,
2463 3201, 3210, 3219, 3229, 3234, 3246, 3252, 3257, 3263, 3269,
2464 3273, 3275, 3286, 3295, 3302, 3303, 3305, 3311, 3320, 3327,
2465 3339, 3345, 3351, 3357, 3363, 3369, 3375, 3381, 3394, 3405,
2466 3412, 3425, 3452, 3466, 3480, 3494, 3509, 3516, 3523, 3530,
2467 3537, 3548, 3598, 3703, 3710, 3717, 3724, 3731
2471 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2472 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2473 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2474 static const char *const yytname[] =
2476 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2477 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2478 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2479 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2480 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2481 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2482 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2483 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2484 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2485 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2486 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2487 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2488 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2489 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2490 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2491 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2492 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2493 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2494 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2495 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2496 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2497 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2498 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2499 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2500 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2501 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2502 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2503 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2504 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2505 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2506 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2507 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2508 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH",
2509 "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT",
2510 "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2511 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2512 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2513 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2514 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12", "SLOT_LIST",
2515 "ONE_SLOT", "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2516 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2517 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2518 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2519 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2520 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2521 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2522 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2523 "NAMESPACE_ID", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2528 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2530 static const yytype_uint16 yytoknum[] =
2532 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2533 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2534 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2535 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2536 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2537 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2538 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2539 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2540 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2541 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2542 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2543 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2544 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2549 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2550 static const yytype_uint8 yyr1[] =
2552 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2553 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2554 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2555 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2556 144, 144, 144, 144, 145, 145, 145, 145, 145, 145,
2557 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2558 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2559 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2560 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2561 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2562 178, 178, 178, 180, 179, 181, 181, 182, 183, 183,
2563 184, 184, 186, 185, 187, 185, 188, 188, 189, 189,
2564 190, 190, 191, 191, 191, 191, 191, 191, 191, 191,
2565 191, 191, 192, 192, 193, 193, 194, 194, 196, 195,
2566 198, 197, 199, 199, 200, 200, 201, 201, 201, 201,
2567 201, 202, 202, 203, 203, 204, 204, 204, 205, 205,
2568 207, 206, 208, 208, 209, 210, 210, 211, 211, 211,
2569 211, 211, 211, 211, 211, 211, 212, 212, 212, 212,
2570 213, 213, 214, 214, 215, 215, 215, 217, 216, 218,
2571 218, 220, 219, 221, 222, 223, 223, 224, 224, 225,
2572 225, 225, 226, 226, 227, 227, 228, 228, 228, 229,
2573 230, 229, 231, 232, 233, 233, 234, 235, 235, 236,
2574 237, 237, 238, 239, 239, 239, 239, 239, 239, 239,
2575 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
2576 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2577 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2578 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2579 239, 239, 239, 239, 241, 241, 242, 242, 239, 239,
2580 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2581 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2582 239, 239, 243, 244, 244, 244, 245, 246
2585 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2586 static const yytype_uint8 yyr2[] =
2588 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2589 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2590 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2591 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2592 1, 1, 3, 2, 1, 1, 1, 1, 1, 1,
2593 1, 4, 2, 1, 1, 3, 2, 0, 2, 2,
2594 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2595 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2596 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2597 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2598 1, 2, 1, 0, 6, 2, 1, 5, 1, 1,
2599 3, 1, 0, 6, 0, 5, 2, 4, 0, 1,
2600 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2601 1, 1, 0, 2, 0, 2, 0, 2, 0, 9,
2602 0, 8, 0, 1, 1, 2, 1, 4, 1, 1,
2603 1, 0, 1, 1, 2, 1, 2, 8, 1, 1,
2604 0, 4, 1, 3, 3, 0, 2, 1, 1, 1,
2605 1, 1, 1, 1, 1, 1, 0, 1, 2, 4,
2606 3, 1, 4, 2, 1, 1, 0, 0, 12, 1,
2607 0, 0, 10, 1, 3, 1, 1, 1, 3, 1,
2608 1, 1, 2, 0, 0, 3, 0, 1, 1, 1,
2609 2, 2, 0, 4, 4, 4, 2, 1, 2, 1,
2610 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
2611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2612 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2613 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
2614 3, 3, 3, 3, 3, 3, 3, 4, 2, 1,
2615 3, 2, 4, 3, 0, 1, 3, 5, 3, 3,
2616 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2617 5, 2, 2, 2, 2, 3, 2, 4, 5, 3,
2618 5, 3, 1, 2, 4, 4, 2, 3
2621 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2622 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2623 means the default is an error. */
2624 static const yytype_uint16 yydefact[] =
2626 118, 302, 131, 235, 229, 232, 233, 230, 231, 234,
2627 0, 0, 78, 0, 0, 124, 122, 123, 0, 130,
2628 0, 129, 190, 236, 269, 125, 0, 0, 0, 239,
2629 126, 128, 127, 0, 0, 238, 237, 0, 0, 274,
2630 0, 0, 14, 0, 0, 0, 0, 206, 118, 0,
2631 0, 2, 118, 5, 54, 12, 0, 36, 67, 31,
2632 32, 33, 34, 35, 38, 37, 7, 30, 0, 119,
2633 120, 9, 8, 11, 10, 223, 226, 228, 227, 222,
2634 39, 220, 224, 225, 41, 40, 0, 0, 72, 76,
2635 118, 92, 108, 109, 114, 111, 0, 0, 302, 212,
2636 189, 0, 268, 0, 0, 116, 0, 103, 206, 0,
2637 216, 65, 0, 219, 0, 275, 294, 293, 271, 251,
2638 250, 0, 0, 207, 208, 209, 82, 0, 106, 217,
2639 0, 80, 44, 43, 118, 45, 29, 0, 46, 47,
2640 48, 50, 0, 49, 296, 1, 6, 118, 302, 0,
2641 68, 0, 0, 69, 0, 186, 0, 159, 0, 158,
2642 160, 306, 121, 0, 0, 0, 0, 0, 0, 0,
2643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2644 0, 0, 0, 0, 0, 0, 292, 291, 0, 0,
2645 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2646 0, 0, 0, 0, 206, 0, 0, 55, 73, 0,
2647 53, 0, 0, 118, 112, 0, 193, 0, 196, 195,
2648 307, 204, 176, 0, 0, 0, 27, 0, 295, 0,
2649 0, 278, 0, 270, 273, 210, 211, 83, 203, 59,
2650 60, 105, 218, 58, 81, 42, 28, 118, 0, 203,
2651 0, 0, 303, 185, 184, 0, 132, 134, 0, 221,
2652 265, 266, 263, 264, 244, 245, 247, 246, 242, 243,
2653 285, 284, 280, 279, 287, 288, 286, 282, 281, 283,
2654 248, 249, 299, 257, 256, 255, 289, 0, 254, 253,
2655 252, 240, 241, 261, 260, 258, 262, 259, 0, 0,
2656 301, 0, 0, 0, 52, 0, 0, 25, 0, 118,
2657 17, 23, 0, 20, 19, 22, 21, 118, 110, 0,
2658 206, 213, 165, 0, 0, 177, 181, 118, 194, 117,
2659 267, 0, 26, 215, 0, 276, 0, 0, 57, 0,
2660 118, 13, 57, 0, 0, 0, 0, 0, 136, 0,
2661 0, 203, 161, 162, 0, 214, 272, 0, 0, 297,
2662 118, 0, 0, 115, 18, 118, 0, 0, 0, 0,
2663 183, 178, 203, 0, 107, 0, 118, 0, 201, 200,
2664 199, 202, 0, 62, 61, 51, 0, 118, 304, 305,
2665 176, 133, 0, 0, 197, 135, 140, 57, 0, 290,
2666 298, 300, 77, 0, 84, 0, 113, 205, 175, 171,
2667 168, 169, 167, 170, 174, 173, 172, 166, 165, 0,
2668 0, 180, 0, 0, 98, 102, 100, 104, 63, 277,
2669 56, 0, 75, 0, 137, 138, 0, 118, 164, 163,
2670 79, 0, 0, 0, 85, 88, 86, 24, 182, 191,
2671 179, 96, 0, 99, 101, 118, 66, 118, 203, 118,
2672 198, 0, 155, 0, 0, 118, 153, 0, 27, 93,
2673 89, 87, 27, 27, 203, 64, 74, 0, 146, 150,
2674 0, 0, 0, 118, 144, 148, 149, 156, 186, 141,
2675 154, 27, 91, 0, 0, 0, 187, 118, 139, 145,
2676 0, 90, 192, 97, 94, 27, 0, 0, 0, 0,
2677 147, 176, 27, 188, 0, 0, 203, 95, 157
2680 /* YYDEFGOTO[NTERM-NUM]. */
2681 static const yytype_int16 yydefgoto[] =
2683 -1, 50, 51, 52, 53, 308, 309, 310, 331, 332,
2684 135, 136, 211, 311, 137, 383, 138, 243, 240, 456,
2685 57, 229, 151, 152, 58, 59, 60, 61, 209, 62,
2686 90, 139, 140, 443, 444, 445, 446, 63, 212, 424,
2687 508, 425, 473, 426, 427, 64, 226, 141, 65, 95,
2688 217, 66, 317, 213, 67, 142, 69, 70, 348, 350,
2689 393, 313, 459, 314, 437, 482, 483, 484, 464, 465,
2690 466, 160, 315, 258, 352, 353, 370, 417, 324, 325,
2691 326, 255, 316, 505, 101, 75, 472, 218, 219, 380,
2692 395, 381, 338, 321, 122, 123, 124, 221, 76, 77,
2693 78, 143, 125, 79, 80, 81, 82, 114, 115, 83,
2697 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2699 #define YYPACT_NINF -386
2700 static const yytype_int16 yypact[] =
2702 1672, -68, -386, -386, -386, -386, -386, -386, -386, -386,
2703 -31, -80, -386, -72, 15, -386, -386, -386, 59, -386,
2704 2092, -386, 86, -386, 2162, -386, 6, 45, 11, -386,
2705 -386, -386, -386, -12, -43, -386, -386, 2092, 13, 2092,
2706 2092, 2092, -386, 2092, 2092, 2092, 2092, 2092, 632, 136,
2707 143, -386, 502, -386, -386, -386, 26, -386, 2022, -386,
2708 -386, -386, -386, -386, -386, -386, -386, -386, 312, 405,
2709 -386, -386, -386, -386, -386, -386, -386, -386, -386, 80,
2710 -386, 2567, -386, -386, -386, -386, 198, 84, -386, -386,
2711 1924, -386, -386, -386, -386, -386, -2, 83, -386, -62,
2712 -386, 95, -46, 2092, 89, -386, 2092, -386, 2092, 216,
2713 -46, -386, 115, 2567, 101, 130, -46, -46, 237, -46,
2714 -46, -74, 106, 138, 2092, -386, 233, 234, 2092, 2092,
2715 234, 236, -386, -386, 762, -386, -386, 117, -386, -386,
2716 -386, -386, 223, -386, -386, -386, -386, 1022, 178, 245,
2717 -386, 155, 188, -386, 254, 94, 260, -386, 262, -386,
2718 -386, -386, -386, 2092, 2092, 2092, 2092, 2092, 2092, 2092,
2719 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092,
2720 2092, 2092, 2092, 2092, 2092, 2092, -386, -386, 263, 2092,
2721 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092, 2092,
2722 2092, 2092, 2092, 2092, 2092, 2092, 8, -386, -386, 2092,
2723 168, 255, 2092, 1152, -386, 45, 141, 144, -386, -386,
2724 -386, 148, 22, -28, 19, 2187, 1798, 139, -386, 2092,
2725 2092, -386, 2092, -386, -386, -386, -386, -386, 169, 173,
2726 -386, 80, 80, 173, -386, -386, -386, 1924, 145, 169,
2727 2092, 2092, 179, -386, -386, 283, 240, 241, 284, 2567,
2728 1014, 494, 494, 494, 2872, 2872, 2872, 2872, 1014, 1014,
2729 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567,
2730 308, 2628, -386, 137, 137, 137, 2567, 2384, 2689, 2750,
2731 2811, 1014, 1014, 237, 237, -46, -46, -46, 164, 2445,
2732 209, 2092, 296, 7, -386, 186, 2258, -386, 181, 1282,
2733 -386, -386, 174, -386, -386, -386, -386, 1152, -386, 134,
2734 2092, -386, -1, 298, 182, 214, -386, 1924, 141, -386,
2735 -386, 184, 1798, -386, 21, -386, 215, 63, 219, 234,
2736 892, -386, -45, 111, 99, 38, 200, 83, 306, 83,
2737 205, 169, 224, -386, 2092, -386, -386, 323, 2321, -386,
2738 1924, 2092, 206, -386, -386, 1152, 201, 204, 280, 63,
2739 -386, -386, 169, 25, -386, 98, 1924, 2092, -386, -386,
2740 -386, -386, 2092, -386, -386, -386, 2092, 1924, -386, -386,
2741 22, -386, 83, 212, -386, 242, -386, 219, 284, 2567,
2742 -386, -386, -386, 102, 46, 208, -386, -386, -386, -386,
2743 -386, -386, -386, -386, -386, -386, -386, -386, 239, 228,
2744 298, -386, 247, 227, -386, -386, 98, -386, 295, -386,
2745 -386, 229, -386, 230, 242, -386, 83, 47, -386, -386,
2746 -386, 2092, 266, 246, 46, -386, -386, -386, -386, -386,
2747 -386, -386, 365, -386, -386, 1924, -386, 1924, 169, 1412,
2748 -386, 382, -386, 359, 256, 258, -386, 2506, 1798, -386,
2749 -386, -386, 1798, 1798, 169, -386, -386, 261, -386, -386,
2750 265, 194, 257, 1542, -386, -386, -386, -386, 94, -386,
2751 -386, 1798, -386, 269, 273, 259, -386, 1412, -386, -386,
2752 390, -386, -386, -386, -386, 1798, 274, 272, 271, 275,
2753 -386, 22, 1798, -386, 277, 276, 169, -386, -386
2756 /* YYPGOTO[NTERM-NUM]. */
2757 static const yytype_int16 yypgoto[] =
2759 -386, -386, 248, -386, 360, -290, -386, 104, -385, -38,
2760 1, -85, -313, 58, 2, 14, 361, 301, 97, -386,
2761 -386, -386, -386, -386, -386, -386, -386, -386, -386, -386,
2762 -386, -386, -386, -386, -386, -10, -5, -386, -386, 12,
2763 -386, 16, -386, -386, -386, -386, -386, -386, -386, -200,
2764 76, -386, -386, -386, -386, 0, -386, 371, -386, -386,
2765 -386, 60, -386, 61, -386, -56, -386, -39, -386, -386,
2766 -20, -386, 3, -386, -386, 48, 29, -386, -373, -386,
2767 -303, -40, 4, -386, -386, -386, -386, -386, 422, -89,
2768 64, 81, -240, -386, -95, -386, -386, -386, -386, -386,
2769 -386, -386, -32, -6, -52, -8, -386, -386, -386, -386,
2773 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2774 positive, shift that token. If negative, reduce the rule which
2775 number is the opposite. If zero, do what YYDEFACT says.
2776 If YYTABLE_NINF, syntax error. */
2777 #define YYTABLE_NINF -153
2778 static const yytype_int16 yytable[] =
2780 68, 54, 56, 73, 74, 210, 153, 112, 220, 342,
2781 134, 300, 99, 227, 374, 318, 102, 433, 92, 87,
2782 371, 86, 328, -70, 318, 322, 163, 366, 322, 110,
2783 188, 113, 116, 117, 93, 118, 119, 120, 93, 113,
2784 121, 388, 89, 389, 186, 187, 188, 402, 92, 246,
2785 91, 2, 68, 54, 56, 73, 74, 382, 55, 233,
2786 71, 72, 205, 428, 93, 206, 216, 15, 16, 17,
2787 421, 19, 163, 21, 432, 405, 204, 97, 205, 108,
2788 441, 206, 93, 492, 109, 25, 216, 493, 494, 100,
2789 96, 88, 236, 461, 30, 31, 32, 223, 225, 378,
2790 113, 368, 93, 104, 369, 327, 501, 163, 442, 298,
2791 55, 397, 71, 72, 107, 323, 113, 450, 420, 318,
2792 509, 163, 241, 242, 214, 215, 422, 515, 103, 253,
2793 301, 423, 419, 106, 329, 111, 302, 328, 514, 144,
2794 360, 94, 475, 145, 476, 254, 462, 68, 54, 56,
2795 73, 74, 147, 93, 376, 259, 260, 261, 262, 263,
2796 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
2797 274, 275, 276, 277, 278, 279, 280, 281, 379, -151,
2798 163, 283, 284, 285, 286, 287, 288, 289, 290, 291,
2799 292, 293, 294, 295, 296, 297, 113, 299, 335, 163,
2800 336, 207, 163, 303, 306, 55, 208, 71, 72, 340,
2801 386, 163, 154, 68, 54, 312, 224, 222, 477, 228,
2802 230, 155, 113, 334, 113, 367, 157, 186, 187, 188,
2803 232, 234, 387, 231, 495, 440, 237, 238, 235, 244,
2804 159, 154, 210, 247, 343, 344, -71, 246, 249, 199,
2805 200, 201, 202, 203, 250, 246, 251, 252, 391, 204,
2806 394, 205, 2, 256, 206, 257, 282, 304, -108, 305,
2807 320, 319, 333, 339, 337, 210, 518, 341, 15, 16,
2808 17, 345, 19, 408, 21, 409, 346, 351, 410, 411,
2809 412, 210, 413, 358, 347, 349, 25, 355, 357, 359,
2810 365, 322, 210, 394, 461, 30, 31, 32, 361, 68,
2811 54, 312, 113, 363, 373, 372, 375, 68, 54, 312,
2812 377, 382, 390, 392, 398, 414, 400, 186, 187, 188,
2813 154, 396, 404, 406, 431, 415, 416, 407, 435, 155,
2814 447, 368, 436, 156, 157, 429, 399, 460, 164, 452,
2815 430, 201, 202, 203, 449, 403, 158, 462, 159, 204,
2816 455, 205, 457, 458, 206, 68, 54, 312, 474, 113,
2817 210, 468, 210, 451, 113, 165, 166, 167, 469, 168,
2818 169, 170, 171, 172, 173, 487, 488, 496, 489, 498,
2819 -152, 497, 504, 507, 511, 248, 185, 512, 186, 187,
2820 188, 502, 189, 190, 191, 503, 510, 513, 517, 2,
2821 516, 438, 146, 364, 194, 195, 196, 197, 198, 150,
2822 199, 200, 201, 202, 203, 15, 16, 17, 239, 19,
2823 204, 21, 205, 467, 470, 206, 384, 463, 453, 471,
2824 162, 506, 454, 25, 499, 490, 439, 448, 500, 105,
2825 418, 0, 30, 31, 32, 0, 434, 0, 0, 481,
2826 479, 480, 485, 486, 0, 463, 0, 0, 0, 0,
2827 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2828 0, 0, 0, 481, 479, 480, 485, 486, 0, 0,
2829 0, 0, 0, 0, 0, 0, 0, 481, 479, 480,
2830 485, 486, -4, 0, 0, 1, 2, 3, 4, 0,
2831 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2832 0, 14, 15, 16, 17, 18, 19, 20, 21, 0,
2833 0, 23, 0, 0, 164, 0, 0, 0, 24, 0,
2834 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2835 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2836 0, -153, -153, -153, 0, 37, 38, 0, 0, 172,
2837 173, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2838 0, 0, 0, 0, 186, 187, 188, 0, 189, 190,
2839 191, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2840 0, 42, 0, 197, 198, 0, 199, 200, 201, 202,
2841 203, 0, 0, 0, 43, 0, 204, 0, 205, 44,
2842 45, 206, 0, 0, 46, 0, 47, 0, 48, 0,
2843 49, 0, 0, 0, -4, 1, 2, 3, 4, 0,
2844 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2845 0, 0, 15, 16, 17, 18, 19, 20, 21, 22,
2846 0, 23, 126, 0, 127, 0, 0, 0, 24, 128,
2847 25, 26, 0, 27, 129, 28, 0, 29, 130, 30,
2848 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2849 0, 0, 0, 0, 0, 37, 38, 0, 131, 0,
2850 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2851 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2852 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2853 0, 132, 0, 0, 0, 0, 0, 0, 0, 0,
2854 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2855 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2856 49, 0, 0, 0, 133, 1, 2, 3, 4, 0,
2857 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2858 0, 0, 15, 16, 17, 18, 19, 20, 21, 22,
2859 0, 23, 126, 0, 127, 0, 0, 0, 24, 128,
2860 25, 26, 0, 27, 129, 28, 0, 29, 130, 30,
2861 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2862 0, 0, 0, 0, 0, 37, 38, 0, 131, 0,
2863 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2865 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2866 0, 132, 0, 0, 0, 0, 0, 0, 0, 0,
2867 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2868 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2869 49, 0, 0, 0, 245, 1, 2, 3, 4, 0,
2870 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2871 0, 0, 15, 16, 17, 18, 19, 20, 21, 22,
2872 0, 23, 126, 0, 127, 0, 0, 0, 24, 128,
2873 25, 26, 0, 27, 129, 28, 0, 29, 130, 30,
2874 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2875 0, 0, 0, 0, 0, 37, 38, 0, 131, 0,
2876 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2877 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2878 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2879 0, 132, 0, 0, 0, 0, 0, 0, 0, 0,
2880 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2881 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2882 49, 0, 0, 0, 385, 1, 2, 3, 4, 0,
2883 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2884 0, 14, 15, 16, 17, 18, 19, 20, 21, 0,
2885 0, 23, 0, 0, -153, 0, 0, 0, 24, 0,
2886 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2887 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2888 0, 0, 0, 0, 0, 37, 38, 0, 0, -153,
2889 -153, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2890 0, 0, 0, 0, 186, 187, 188, 0, 189, 190,
2891 191, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2892 0, 42, 0, -153, -153, 0, 199, 200, 201, 202,
2893 203, 0, 0, 0, 43, 0, 204, 0, 205, 44,
2894 45, 206, 0, 0, 46, 0, 47, 0, 48, 0,
2895 49, 0, 0, 0, -3, 1, 2, 3, 4, 0,
2896 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2897 0, 0, 15, 16, 17, 18, 19, 20, 21, 0,
2898 0, 23, 0, 0, 0, 0, 0, 0, 24, 0,
2899 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2900 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2901 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2902 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2903 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2904 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2905 0, 307, 0, 0, 0, 0, 0, 0, 0, 0,
2906 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2907 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2908 49, 0, 0, 0, -15, 1, 2, 3, 4, 0,
2909 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2910 0, 0, 15, 16, 17, 18, 19, 20, 21, 0,
2911 0, 23, 0, 0, 0, 0, 0, 0, 24, 0,
2912 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2913 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2914 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2915 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2916 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2917 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2918 0, 307, 0, 0, 0, 0, 0, 0, 0, 0,
2919 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2920 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2921 49, 0, 0, 0, -16, 1, 2, 3, 4, 0,
2922 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2923 0, 0, 15, 16, 17, 18, 19, 20, 21, 0,
2924 0, 23, 0, 0, 0, 0, 0, 0, 24, 0,
2925 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2926 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2927 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2928 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2929 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2930 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2931 0, 478, 0, 0, 0, 0, 0, 0, 0, 0,
2932 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2933 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2934 49, 0, 0, 0, -142, 1, 2, 3, 4, 0,
2935 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2936 0, 0, 15, 16, 17, 18, 19, 20, 21, 0,
2937 0, 23, 0, 0, 0, 0, 0, 0, 24, 0,
2938 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2939 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2940 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2941 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2942 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2943 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2944 0, 478, 0, 0, 0, 0, 0, 0, 0, 0,
2945 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2946 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2947 49, 0, -3, 0, -143, 1, 2, 3, 4, 0,
2948 5, 6, 7, 8, 9, 10, 11, 12, 13, 0,
2949 0, 14, 15, 16, 17, 18, 19, 20, 21, 0,
2950 0, 23, 0, 0, 0, 0, 0, 0, 24, 0,
2951 25, 26, 0, 27, 0, 28, 0, 29, 0, 30,
2952 31, 32, 0, 0, 33, 34, 0, 35, 36, 0,
2953 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2954 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
2955 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2956 0, 0, 40, 41, 0, 0, 0, 0, 0, 0,
2957 0, 42, 0, 0, 0, 0, 0, 0, 0, 0,
2958 0, 0, 0, 0, 43, 0, 0, 0, 0, 44,
2959 45, 0, 0, 0, 46, 0, 47, 0, 48, 0,
2960 49, 1, 2, 3, 4, 0, 5, 6, 7, 8,
2961 9, 10, 11, 12, 13, 0, -118, 0, 15, 16,
2962 17, 18, 19, 20, 21, 22, 0, 23, 126, 0,
2963 127, 0, 0, 0, 24, 128, 25, 26, 0, 27,
2964 129, 28, 0, 29, 130, 30, 31, 32, 0, 0,
2965 33, 34, 0, 35, 36, 0, 0, 0, 0, 0,
2966 0, 37, 38, 0, 131, 0, 0, 0, 39, 0,
2967 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2968 0, 0, 0, 0, 0, 0, 0, 0, 40, 41,
2969 0, 0, 0, 0, 0, 0, 0, 132, 0, 0,
2970 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2971 43, 0, 0, 0, 0, 44, 45, 0, 0, 0,
2972 46, 0, 47, 0, 48, 0, 49, 1, 2, 3,
2973 4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
2974 13, 0, 0, 0, 15, 16, 17, 18, 19, 20,
2975 21, 22, 0, 23, 126, 0, 127, 0, 0, 0,
2976 24, 128, 25, 26, 0, 27, 129, 28, 0, 29,
2977 130, 30, 31, 32, 0, 0, 33, 34, 0, 35,
2978 36, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2979 131, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2981 0, 0, 0, 0, 40, 41, 0, 0, 0, 0,
2982 0, 0, 0, 132, 0, 148, 0, 3, 4, 0,
2983 5, 6, 7, 8, 9, 0, 43, 0, 0, 0,
2984 0, 44, 45, 0, 0, 0, 46, 20, 47, 22,
2985 48, 23, 49, 0, 127, 0, 0, 0, 24, 0,
2986 0, 0, 0, 0, 0, 28, 0, 29, 149, 0,
2987 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
2988 0, 0, 0, 0, 0, 37, 0, 0, 0, 0,
2989 0, 0, 39, 0, 0, 98, 0, 3, 4, 0,
2990 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,
2991 0, 0, 40, 41, 0, 0, 0, 20, 0, 22,
2992 0, 23, 0, 0, 0, 0, 0, 0, 24, 0,
2993 0, 0, 0, 0, 43, 28, 0, 29, 0, 44,
2994 45, 0, 0, 0, 46, 34, 47, 35, 36, 0,
2995 49, 0, 0, 0, 0, 37, 0, 0, 0, 0,
2996 0, 0, 39, 0, 0, 98, 0, 3, 4, 0,
2997 5, 6, 7, 8, 9, 0, 0, 0, 0, 0,
2998 0, 0, 40, 41, 0, 0, 0, 20, 0, 22,
2999 0, 23, 0, 0, 0, 0, 0, 0, 0, 0,
3000 0, 0, 0, 0, 43, 0, 0, 29, 0, 44,
3001 45, 0, 0, 0, 46, 34, 47, 35, 36, 0,
3002 49, 0, 0, 0, 0, 0, 0, 164, 0, 0,
3003 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
3004 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3005 0, 0, 40, 41, 165, 166, 167, 0, 168, 169,
3006 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
3007 180, 181, 182, 183, 184, 185, 0, 186, 187, 188,
3008 0, 189, 190, 191, 46, 0, 47, 0, 0, 192,
3009 49, 193, 0, 194, 195, 196, 197, 198, 164, 199,
3010 200, 201, 202, 203, 0, 0, 0, 0, 0, 204,
3011 0, 205, 0, 0, 206, 0, 0, 0, 0, 0,
3012 330, 0, 0, 0, 0, 165, 166, 167, 0, 168,
3013 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
3014 179, 180, 181, 182, 183, 184, 185, 0, 186, 187,
3015 188, 0, 189, 190, 191, 0, 0, 0, 0, 0,
3016 192, 164, 193, 0, 194, 195, 196, 197, 198, 0,
3017 199, 200, 201, 202, 203, 0, 0, 0, 0, 0,
3018 204, 0, 205, 0, 0, 206, 0, 0, 165, 166,
3019 167, 362, 168, 169, 170, 171, 172, 173, 174, 175,
3020 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
3021 0, 186, 187, 188, 0, 189, 190, 191, 0, 0,
3022 0, 0, 0, 192, 164, 193, 0, 194, 195, 196,
3023 197, 198, 0, 199, 200, 201, 202, 203, 0, 0,
3024 0, 0, 0, 204, 0, 205, 0, 0, 206, 0,
3025 0, 165, 166, 167, 401, 168, 169, 170, 171, 172,
3026 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
3027 183, 184, 185, 0, 186, 187, 188, 0, 189, 190,
3028 191, 0, 0, 0, 0, 164, 192, 0, 193, 354,
3029 194, 195, 196, 197, 198, 0, 199, 200, 201, 202,
3030 203, 0, 0, 0, 0, 0, 204, 0, 205, 0,
3031 0, 206, 165, 166, 167, 0, 168, 169, 170, 171,
3032 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
3033 182, 183, 184, 185, 0, 186, 187, 188, 0, 189,
3034 190, 191, 0, 0, 0, 0, 164, 192, 0, 193,
3035 0, 194, 195, 196, 197, 198, 0, 199, 200, 201,
3036 202, 203, 0, 0, 0, 0, 0, 204, 0, 205,
3037 356, 0, 206, 165, 166, 167, 0, 168, 169, 170,
3038 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
3039 181, 182, 183, 184, 185, 0, 186, 187, 188, 0,
3040 189, 190, 191, 0, 0, 0, 0, 164, 192, 0,
3041 193, 491, 194, 195, 196, 197, 198, 0, 199, 200,
3042 201, 202, 203, 0, 0, 0, 0, 0, 204, 0,
3043 205, 0, 0, 206, 165, 166, 167, 0, 168, 169,
3044 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
3045 180, 181, 182, 183, 184, 185, 0, 186, 187, 188,
3046 0, 189, 190, 191, 0, 0, 0, 0, 164, 192,
3047 0, 193, 0, 194, 195, 196, 197, 198, 0, 199,
3048 200, 201, 202, 203, 0, 0, 0, 0, 0, 204,
3049 0, 205, 0, 0, 206, 165, 166, 167, 0, 168,
3050 169, 170, 171, 172, 173, 0, 0, 0, 0, 0,
3051 0, 0, 0, 0, 0, 0, 0, 0, 186, 187,
3052 188, 0, 189, 190, 191, 0, 0, 0, 0, 164,
3053 0, 0, 0, 0, 194, 195, 196, 197, 198, 0,
3054 199, 200, 201, 202, 203, 0, 0, 0, 0, 0,
3055 204, 0, 205, 0, 0, 206, 165, 166, 167, 0,
3056 168, 169, 170, 171, 172, 173, 0, 0, 0, 0,
3057 0, 0, 0, 0, 0, 0, 0, 0, 0, 186,
3058 187, 188, 0, 189, 190, 191, 0, 0, 0, 0,
3059 164, 0, 0, 0, 0, 0, 195, 196, 197, 198,
3060 0, 199, 200, 201, 202, 203, 0, 0, 0, 0,
3061 0, 204, 0, 205, 0, 0, 206, 165, 166, 167,
3062 0, 168, 169, 170, 171, 172, 173, 0, 0, 0,
3063 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3064 186, 187, 188, 0, 189, 190, 191, 0, 0, 0,
3065 0, 164, 0, 0, 0, 0, 0, 0, 196, 197,
3066 198, 0, 199, 200, 201, 202, 203, 0, 0, 0,
3067 0, 0, 204, 0, 205, 0, 0, 206, 165, 166,
3068 167, 0, 168, 169, 170, 171, 172, 173, 0, 0,
3069 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3070 0, 186, 187, 188, 0, 189, 190, 191, 0, 0,
3071 0, 0, 164, 0, 0, 0, 0, 0, 0, -153,
3072 197, 198, 0, 199, 200, 201, 202, 203, 0, 0,
3073 0, 0, 0, 204, 0, 205, 0, 0, 206, 165,
3074 166, 167, 0, -153, -153, -153, -153, 172, 173, 0,
3075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3076 0, 0, 186, 187, 188, 0, 189, 190, 191, 0,
3077 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3078 0, 197, 198, 0, 199, 200, 201, 202, 203, 0,
3079 0, 0, 0, 0, 204, 0, 205, 0, 0, 206
3082 static const yytype_int16 yycheck[] =
3084 0, 0, 0, 0, 0, 90, 58, 39, 97, 249,
3085 48, 3, 20, 108, 327, 215, 24, 390, 3, 50,
3086 323, 89, 3, 68, 224, 3, 100, 317, 3, 37,
3087 92, 39, 40, 41, 19, 43, 44, 45, 19, 47,
3088 46, 3, 122, 5, 90, 91, 92, 360, 3, 134,
3089 122, 4, 52, 52, 52, 52, 52, 102, 0, 133,
3090 0, 0, 124, 376, 19, 127, 3, 20, 21, 22,
3091 373, 24, 100, 26, 387, 365, 122, 18, 124, 122,
3092 34, 127, 19, 468, 127, 38, 3, 472, 473, 3,
3093 14, 122, 124, 46, 47, 48, 49, 103, 106, 36,
3094 108, 102, 19, 27, 105, 133, 491, 100, 62, 204,
3095 52, 351, 52, 52, 126, 93, 124, 420, 93, 319,
3096 505, 100, 128, 129, 126, 127, 28, 512, 122, 35,
3097 122, 33, 372, 122, 115, 122, 128, 3, 511, 3,
3098 133, 126, 455, 0, 457, 51, 99, 147, 147, 147,
3099 147, 147, 126, 19, 133, 163, 164, 165, 166, 167,
3100 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
3101 178, 179, 180, 181, 182, 183, 184, 185, 115, 132,
3102 100, 189, 190, 191, 192, 193, 194, 195, 196, 197,
3103 198, 199, 200, 201, 202, 203, 204, 205, 230, 100,
3104 232, 3, 100, 209, 212, 147, 122, 147, 147, 247,
3105 99, 100, 18, 213, 213, 213, 127, 122, 458, 3,
3106 105, 27, 230, 229, 232, 320, 32, 90, 91, 92,
3107 100, 125, 133, 132, 474, 133, 3, 3, 100, 3,
3108 46, 18, 327, 126, 250, 251, 68, 332, 3, 112,
3109 113, 114, 115, 116, 99, 340, 68, 3, 347, 122,
3110 349, 124, 4, 3, 127, 3, 3, 99, 127, 14,
3111 122, 127, 133, 100, 105, 360, 516, 132, 20, 21,
3112 22, 102, 24, 3, 26, 5, 3, 3, 8, 9,
3113 10, 376, 12, 301, 54, 54, 38, 133, 89, 3,
3114 126, 3, 387, 392, 46, 47, 48, 49, 122, 309,
3115 309, 309, 320, 132, 100, 133, 132, 317, 317, 317,
3116 105, 102, 122, 17, 100, 45, 3, 90, 91, 92,
3117 18, 126, 126, 132, 386, 55, 56, 133, 126, 27,
3118 132, 102, 100, 31, 32, 377, 354, 436, 40, 122,
3119 382, 114, 115, 116, 126, 361, 44, 99, 46, 122,
3120 65, 124, 133, 133, 127, 365, 365, 365, 3, 377,
3121 455, 105, 457, 126, 382, 67, 68, 69, 132, 71,
3122 72, 73, 74, 75, 76, 3, 27, 126, 132, 132,
3123 132, 126, 133, 3, 122, 147, 88, 126, 90, 91,
3124 92, 132, 94, 95, 96, 132, 132, 132, 132, 4,
3125 133, 397, 52, 309, 106, 107, 108, 109, 110, 58,
3126 112, 113, 114, 115, 116, 20, 21, 22, 127, 24,
3127 122, 26, 124, 441, 444, 127, 339, 437, 426, 444,
3128 69, 497, 426, 38, 483, 465, 398, 418, 488, 27,
3129 369, -1, 47, 48, 49, -1, 392, -1, -1, 459,
3130 459, 459, 459, 459, -1, 465, -1, -1, -1, -1,
3131 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3132 -1, -1, -1, 483, 483, 483, 483, 483, -1, -1,
3133 -1, -1, -1, -1, -1, -1, -1, 497, 497, 497,
3134 497, 497, 0, -1, -1, 3, 4, 5, 6, -1,
3135 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3136 -1, 19, 20, 21, 22, 23, 24, 25, 26, -1,
3137 -1, 29, -1, -1, 40, -1, -1, -1, 36, -1,
3138 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3139 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3140 -1, 67, 68, 69, -1, 63, 64, -1, -1, 75,
3141 76, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3142 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3143 96, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3144 -1, 99, -1, 109, 110, -1, 112, 113, 114, 115,
3145 116, -1, -1, -1, 112, -1, 122, -1, 124, 117,
3146 118, 127, -1, -1, 122, -1, 124, -1, 126, -1,
3147 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3148 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3149 -1, -1, 20, 21, 22, 23, 24, 25, 26, 27,
3150 -1, 29, 30, -1, 32, -1, -1, -1, 36, 37,
3151 38, 39, -1, 41, 42, 43, -1, 45, 46, 47,
3152 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3153 -1, -1, -1, -1, -1, 63, 64, -1, 66, -1,
3154 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3155 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3156 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3157 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3158 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3159 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3160 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3161 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3162 -1, -1, 20, 21, 22, 23, 24, 25, 26, 27,
3163 -1, 29, 30, -1, 32, -1, -1, -1, 36, 37,
3164 38, 39, -1, 41, 42, 43, -1, 45, 46, 47,
3165 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3166 -1, -1, -1, -1, -1, 63, 64, -1, 66, -1,
3167 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3168 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3169 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3170 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3171 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3172 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3173 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3174 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3175 -1, -1, 20, 21, 22, 23, 24, 25, 26, 27,
3176 -1, 29, 30, -1, 32, -1, -1, -1, 36, 37,
3177 38, 39, -1, 41, 42, 43, -1, 45, 46, 47,
3178 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3179 -1, -1, -1, -1, -1, 63, 64, -1, 66, -1,
3180 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3181 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3182 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3183 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3184 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3185 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3186 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3187 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3188 -1, 19, 20, 21, 22, 23, 24, 25, 26, -1,
3189 -1, 29, -1, -1, 40, -1, -1, -1, 36, -1,
3190 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3191 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3192 -1, -1, -1, -1, -1, 63, 64, -1, -1, 75,
3193 76, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3194 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3195 96, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3196 -1, 99, -1, 109, 110, -1, 112, 113, 114, 115,
3197 116, -1, -1, -1, 112, -1, 122, -1, 124, 117,
3198 118, 127, -1, -1, 122, -1, 124, -1, 126, -1,
3199 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3200 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3201 -1, -1, 20, 21, 22, 23, 24, 25, 26, -1,
3202 -1, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3203 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3204 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3205 -1, -1, -1, -1, -1, 63, 64, -1, -1, -1,
3206 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3207 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3208 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3209 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3210 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3211 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3212 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3213 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3214 -1, -1, 20, 21, 22, 23, 24, 25, 26, -1,
3215 -1, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3216 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3217 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3218 -1, -1, -1, -1, -1, 63, 64, -1, -1, -1,
3219 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3220 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3221 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3222 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3223 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3224 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3225 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3226 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3227 -1, -1, 20, 21, 22, 23, 24, 25, 26, -1,
3228 -1, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3229 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3230 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3231 -1, -1, -1, -1, -1, 63, 64, -1, -1, -1,
3232 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3233 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3234 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3235 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3236 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3237 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3238 128, -1, -1, -1, 132, 3, 4, 5, 6, -1,
3239 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3240 -1, -1, 20, 21, 22, 23, 24, 25, 26, -1,
3241 -1, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3242 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3243 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3244 -1, -1, -1, -1, -1, 63, 64, -1, -1, -1,
3245 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3246 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3247 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3248 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3249 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3250 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3251 128, -1, 0, -1, 132, 3, 4, 5, 6, -1,
3252 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
3253 -1, 19, 20, 21, 22, 23, 24, 25, 26, -1,
3254 -1, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3255 38, 39, -1, 41, -1, 43, -1, 45, -1, 47,
3256 48, 49, -1, -1, 52, 53, -1, 55, 56, -1,
3257 -1, -1, -1, -1, -1, 63, 64, -1, -1, -1,
3258 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3259 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3260 -1, -1, 90, 91, -1, -1, -1, -1, -1, -1,
3261 -1, 99, -1, -1, -1, -1, -1, -1, -1, -1,
3262 -1, -1, -1, -1, 112, -1, -1, -1, -1, 117,
3263 118, -1, -1, -1, 122, -1, 124, -1, 126, -1,
3264 128, 3, 4, 5, 6, -1, 8, 9, 10, 11,
3265 12, 13, 14, 15, 16, -1, 18, -1, 20, 21,
3266 22, 23, 24, 25, 26, 27, -1, 29, 30, -1,
3267 32, -1, -1, -1, 36, 37, 38, 39, -1, 41,
3268 42, 43, -1, 45, 46, 47, 48, 49, -1, -1,
3269 52, 53, -1, 55, 56, -1, -1, -1, -1, -1,
3270 -1, 63, 64, -1, 66, -1, -1, -1, 70, -1,
3271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3272 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3273 -1, -1, -1, -1, -1, -1, -1, 99, -1, -1,
3274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3275 112, -1, -1, -1, -1, 117, 118, -1, -1, -1,
3276 122, -1, 124, -1, 126, -1, 128, 3, 4, 5,
3277 6, -1, 8, 9, 10, 11, 12, 13, 14, 15,
3278 16, -1, -1, -1, 20, 21, 22, 23, 24, 25,
3279 26, 27, -1, 29, 30, -1, 32, -1, -1, -1,
3280 36, 37, 38, 39, -1, 41, 42, 43, -1, 45,
3281 46, 47, 48, 49, -1, -1, 52, 53, -1, 55,
3282 56, -1, -1, -1, -1, -1, -1, 63, 64, -1,
3283 66, -1, -1, -1, 70, -1, -1, -1, -1, -1,
3284 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3285 -1, -1, -1, -1, 90, 91, -1, -1, -1, -1,
3286 -1, -1, -1, 99, -1, 3, -1, 5, 6, -1,
3287 8, 9, 10, 11, 12, -1, 112, -1, -1, -1,
3288 -1, 117, 118, -1, -1, -1, 122, 25, 124, 27,
3289 126, 29, 128, -1, 32, -1, -1, -1, 36, -1,
3290 -1, -1, -1, -1, -1, 43, -1, 45, 46, -1,
3291 -1, -1, -1, -1, -1, 53, -1, 55, 56, -1,
3292 -1, -1, -1, -1, -1, 63, -1, -1, -1, -1,
3293 -1, -1, 70, -1, -1, 3, -1, 5, 6, -1,
3294 8, 9, 10, 11, 12, -1, -1, -1, -1, -1,
3295 -1, -1, 90, 91, -1, -1, -1, 25, -1, 27,
3296 -1, 29, -1, -1, -1, -1, -1, -1, 36, -1,
3297 -1, -1, -1, -1, 112, 43, -1, 45, -1, 117,
3298 118, -1, -1, -1, 122, 53, 124, 55, 56, -1,
3299 128, -1, -1, -1, -1, 63, -1, -1, -1, -1,
3300 -1, -1, 70, -1, -1, 3, -1, 5, 6, -1,
3301 8, 9, 10, 11, 12, -1, -1, -1, -1, -1,
3302 -1, -1, 90, 91, -1, -1, -1, 25, -1, 27,
3303 -1, 29, -1, -1, -1, -1, -1, -1, -1, -1,
3304 -1, -1, -1, -1, 112, -1, -1, 45, -1, 117,
3305 118, -1, -1, -1, 122, 53, 124, 55, 56, -1,
3306 128, -1, -1, -1, -1, -1, -1, 40, -1, -1,
3307 -1, -1, 70, -1, -1, -1, -1, -1, -1, -1,
3308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3309 -1, -1, 90, 91, 67, 68, 69, -1, 71, 72,
3310 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3311 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3312 -1, 94, 95, 96, 122, -1, 124, -1, -1, 102,
3313 128, 104, -1, 106, 107, 108, 109, 110, 40, 112,
3314 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3315 -1, 124, -1, -1, 127, -1, -1, -1, -1, -1,
3316 133, -1, -1, -1, -1, 67, 68, 69, -1, 71,
3317 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
3318 82, 83, 84, 85, 86, 87, 88, -1, 90, 91,
3319 92, -1, 94, 95, 96, -1, -1, -1, -1, -1,
3320 102, 40, 104, -1, 106, 107, 108, 109, 110, -1,
3321 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3322 122, -1, 124, -1, -1, 127, -1, -1, 67, 68,
3323 69, 133, 71, 72, 73, 74, 75, 76, 77, 78,
3324 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3325 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3326 -1, -1, -1, 102, 40, 104, -1, 106, 107, 108,
3327 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3328 -1, -1, -1, 122, -1, 124, -1, -1, 127, -1,
3329 -1, 67, 68, 69, 133, 71, 72, 73, 74, 75,
3330 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
3331 86, 87, 88, -1, 90, 91, 92, -1, 94, 95,
3332 96, -1, -1, -1, -1, 40, 102, -1, 104, 105,
3333 106, 107, 108, 109, 110, -1, 112, 113, 114, 115,
3334 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3335 -1, 127, 67, 68, 69, -1, 71, 72, 73, 74,
3336 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3337 85, 86, 87, 88, -1, 90, 91, 92, -1, 94,
3338 95, 96, -1, -1, -1, -1, 40, 102, -1, 104,
3339 -1, 106, 107, 108, 109, 110, -1, 112, 113, 114,
3340 115, 116, -1, -1, -1, -1, -1, 122, -1, 124,
3341 125, -1, 127, 67, 68, 69, -1, 71, 72, 73,
3342 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3343 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3344 94, 95, 96, -1, -1, -1, -1, 40, 102, -1,
3345 104, 105, 106, 107, 108, 109, 110, -1, 112, 113,
3346 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3347 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3348 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3349 83, 84, 85, 86, 87, 88, -1, 90, 91, 92,
3350 -1, 94, 95, 96, -1, -1, -1, -1, 40, 102,
3351 -1, 104, -1, 106, 107, 108, 109, 110, -1, 112,
3352 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3353 -1, 124, -1, -1, 127, 67, 68, 69, -1, 71,
3354 72, 73, 74, 75, 76, -1, -1, -1, -1, -1,
3355 -1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
3356 92, -1, 94, 95, 96, -1, -1, -1, -1, 40,
3357 -1, -1, -1, -1, 106, 107, 108, 109, 110, -1,
3358 112, 113, 114, 115, 116, -1, -1, -1, -1, -1,
3359 122, -1, 124, -1, -1, 127, 67, 68, 69, -1,
3360 71, 72, 73, 74, 75, 76, -1, -1, -1, -1,
3361 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
3362 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3363 40, -1, -1, -1, -1, -1, 107, 108, 109, 110,
3364 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3365 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3366 -1, 71, 72, 73, 74, 75, 76, -1, -1, -1,
3367 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3368 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3369 -1, 40, -1, -1, -1, -1, -1, -1, 108, 109,
3370 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3371 -1, -1, 122, -1, 124, -1, -1, 127, 67, 68,
3372 69, -1, 71, 72, 73, 74, 75, 76, -1, -1,
3373 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3374 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3375 -1, -1, 40, -1, -1, -1, -1, -1, -1, 108,
3376 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3377 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3378 68, 69, -1, 71, 72, 73, 74, 75, 76, -1,
3379 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3380 -1, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3381 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3382 -1, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3383 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127
3386 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3387 symbol of state STATE-NUM. */
3388 static const yytype_uint8 yystos[] =
3390 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3391 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3392 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3393 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3394 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3395 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3396 160, 161, 163, 171, 179, 182, 185, 188, 189, 190,
3397 191, 195, 197, 206, 216, 219, 232, 233, 234, 237,
3398 238, 239, 240, 243, 245, 246, 89, 50, 122, 122,
3399 164, 122, 3, 19, 126, 183, 184, 18, 3, 239,
3400 3, 218, 239, 122, 184, 222, 122, 126, 122, 127,
3401 239, 122, 236, 239, 241, 242, 239, 239, 239, 239,
3402 239, 237, 228, 229, 230, 236, 30, 32, 37, 42,
3403 46, 66, 99, 132, 143, 144, 145, 148, 150, 165,
3404 166, 181, 189, 235, 3, 0, 138, 126, 3, 46,
3405 150, 156, 157, 238, 18, 27, 31, 32, 44, 46,
3406 205, 244, 191, 100, 40, 67, 68, 69, 71, 72,
3407 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
3408 83, 84, 85, 86, 87, 88, 90, 91, 92, 94,
3409 95, 96, 102, 104, 106, 107, 108, 109, 110, 112,
3410 113, 114, 115, 116, 122, 124, 127, 3, 122, 162,
3411 145, 146, 172, 187, 126, 127, 3, 184, 221, 222,
3412 223, 231, 122, 237, 127, 239, 180, 228, 3, 155,
3413 105, 132, 100, 133, 125, 100, 236, 3, 3, 151,
3414 152, 237, 237, 151, 3, 132, 145, 126, 136, 3,
3415 99, 68, 3, 35, 51, 215, 3, 3, 207, 239,
3416 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
3417 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
3418 239, 239, 3, 239, 239, 239, 239, 239, 239, 239,
3419 239, 239, 239, 239, 239, 239, 239, 239, 228, 239,
3420 3, 122, 128, 237, 99, 14, 239, 99, 139, 140,
3421 141, 147, 148, 195, 197, 206, 216, 186, 183, 127,
3422 122, 227, 3, 93, 212, 213, 214, 133, 3, 115,
3423 133, 142, 143, 133, 237, 236, 236, 105, 226, 100,
3424 143, 132, 226, 237, 237, 102, 3, 54, 192, 54,
3425 193, 3, 208, 209, 105, 133, 125, 89, 239, 3,
3426 133, 122, 133, 132, 141, 126, 139, 228, 102, 105,
3427 210, 214, 133, 100, 146, 132, 133, 105, 36, 115,
3428 223, 225, 102, 149, 152, 132, 99, 133, 3, 5,
3429 122, 223, 17, 194, 223, 224, 126, 226, 100, 239,
3430 3, 133, 146, 237, 126, 139, 132, 133, 3, 5,
3431 8, 9, 10, 12, 45, 55, 56, 211, 225, 226,
3432 93, 214, 28, 33, 173, 175, 177, 178, 146, 236,
3433 236, 238, 146, 212, 224, 126, 100, 198, 149, 209,
3434 133, 34, 62, 167, 168, 169, 170, 132, 210, 126,
3435 214, 126, 122, 173, 175, 65, 153, 133, 133, 196,
3436 223, 46, 99, 189, 202, 203, 204, 239, 105, 132,
3437 169, 170, 220, 176, 3, 146, 146, 226, 99, 144,
3438 148, 189, 199, 200, 201, 206, 216, 3, 27, 132,
3439 204, 105, 142, 142, 142, 226, 126, 126, 132, 201,
3440 215, 142, 132, 132, 133, 217, 199, 3, 174, 142,
3441 132, 122, 126, 132, 212, 142, 133, 132, 226
3444 #define yyerrok (yyerrstatus = 0)
3445 #define yyclearin (yychar = YYEMPTY)
3446 #define YYEMPTY (-2)
3449 #define YYACCEPT goto yyacceptlab
3450 #define YYABORT goto yyabortlab
3451 #define YYERROR goto yyerrorlab
3454 /* Like YYERROR except do call yyerror. This remains here temporarily
3455 to ease the transition to the new meaning of YYERROR, for GCC.
3456 Once GCC version 2 has supplanted version 1, this can go. */
3458 #define YYFAIL goto yyerrlab
3460 #define YYRECOVERING() (!!yyerrstatus)
3462 #define YYBACKUP(Token, Value) \
3464 if (yychar == YYEMPTY && yylen == 1) \
3468 yytoken = YYTRANSLATE (yychar); \
3474 yyerror (YY_("syntax error: cannot back up")); \
3481 #define YYERRCODE 256
3484 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3485 If N is 0, then set CURRENT to the empty location which ends
3486 the previous symbol: RHS[0] (always defined). */
3488 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3489 #ifndef YYLLOC_DEFAULT
3490 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3494 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3495 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3496 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3497 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3501 (Current).first_line = (Current).last_line = \
3502 YYRHSLOC (Rhs, 0).last_line; \
3503 (Current).first_column = (Current).last_column = \
3504 YYRHSLOC (Rhs, 0).last_column; \
3510 /* YY_LOCATION_PRINT -- Print the location on the stream.
3511 This macro was not mandated originally: define only if we know
3512 we won't break user code: when these are the locations we know. */
3514 #ifndef YY_LOCATION_PRINT
3515 # if YYLTYPE_IS_TRIVIAL
3516 # define YY_LOCATION_PRINT(File, Loc) \
3517 fprintf (File, "%d.%d-%d.%d", \
3518 (Loc).first_line, (Loc).first_column, \
3519 (Loc).last_line, (Loc).last_column)
3521 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3526 /* YYLEX -- calling `yylex' with the right arguments. */
3529 # define YYLEX yylex (YYLEX_PARAM)
3531 # define YYLEX yylex ()
3534 /* Enable debugging if requested. */
3538 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3539 # define YYFPRINTF fprintf
3542 # define YYDPRINTF(Args) \
3548 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3552 YYFPRINTF (stderr, "%s ", Title); \
3553 yy_symbol_print (stderr, \
3555 YYFPRINTF (stderr, "\n"); \
3560 /*--------------------------------.
3561 | Print this symbol on YYOUTPUT. |
3562 `--------------------------------*/
3565 #if (defined __STDC__ || defined __C99__FUNC__ \
3566 || defined __cplusplus || defined _MSC_VER)
3568 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3571 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3574 YYSTYPE const * const yyvaluep;
3580 if (yytype < YYNTOKENS)
3581 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3593 /*--------------------------------.
3594 | Print this symbol on YYOUTPUT. |
3595 `--------------------------------*/
3597 #if (defined __STDC__ || defined __C99__FUNC__ \
3598 || defined __cplusplus || defined _MSC_VER)
3600 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3603 yy_symbol_print (yyoutput, yytype, yyvaluep)
3606 YYSTYPE const * const yyvaluep;
3609 if (yytype < YYNTOKENS)
3610 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3612 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3614 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3615 YYFPRINTF (yyoutput, ")");
3618 /*------------------------------------------------------------------.
3619 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3621 `------------------------------------------------------------------*/
3623 #if (defined __STDC__ || defined __C99__FUNC__ \
3624 || defined __cplusplus || defined _MSC_VER)
3626 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3629 yy_stack_print (yybottom, yytop)
3630 yytype_int16 *yybottom;
3631 yytype_int16 *yytop;
3634 YYFPRINTF (stderr, "Stack now");
3635 for (; yybottom <= yytop; yybottom++)
3637 int yybot = *yybottom;
3638 YYFPRINTF (stderr, " %d", yybot);
3640 YYFPRINTF (stderr, "\n");
3643 # define YY_STACK_PRINT(Bottom, Top) \
3646 yy_stack_print ((Bottom), (Top)); \
3650 /*------------------------------------------------.
3651 | Report that the YYRULE is going to be reduced. |
3652 `------------------------------------------------*/
3654 #if (defined __STDC__ || defined __C99__FUNC__ \
3655 || defined __cplusplus || defined _MSC_VER)
3657 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3660 yy_reduce_print (yyvsp, yyrule)
3665 int yynrhs = yyr2[yyrule];
3667 unsigned long int yylno = yyrline[yyrule];
3668 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3670 /* The symbols being reduced. */
3671 for (yyi = 0; yyi < yynrhs; yyi++)
3673 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3674 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3675 &(yyvsp[(yyi + 1) - (yynrhs)])
3677 YYFPRINTF (stderr, "\n");
3681 # define YY_REDUCE_PRINT(Rule) \
3684 yy_reduce_print (yyvsp, Rule); \
3687 /* Nonzero means print parse trace. It is left uninitialized so that
3688 multiple parsers can coexist. */
3690 #else /* !YYDEBUG */
3691 # define YYDPRINTF(Args)
3692 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3693 # define YY_STACK_PRINT(Bottom, Top)
3694 # define YY_REDUCE_PRINT(Rule)
3695 #endif /* !YYDEBUG */
3698 /* YYINITDEPTH -- initial size of the parser's stacks. */
3700 # define YYINITDEPTH 200
3703 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3704 if the built-in stack extension method is used).
3706 Do not make this value too large; the results are undefined if
3707 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3708 evaluated with infinite-precision integer arithmetic. */
3711 # define YYMAXDEPTH 10000
3719 # if defined __GLIBC__ && defined _STRING_H
3720 # define yystrlen strlen
3722 /* Return the length of YYSTR. */
3723 #if (defined __STDC__ || defined __C99__FUNC__ \
3724 || defined __cplusplus || defined _MSC_VER)
3726 yystrlen (const char *yystr)
3734 for (yylen = 0; yystr[yylen]; yylen++)
3742 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3743 # define yystpcpy stpcpy
3745 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3747 #if (defined __STDC__ || defined __C99__FUNC__ \
3748 || defined __cplusplus || defined _MSC_VER)
3750 yystpcpy (char *yydest, const char *yysrc)
3753 yystpcpy (yydest, yysrc)
3759 const char *yys = yysrc;
3761 while ((*yyd++ = *yys++) != '\0')
3770 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3771 quotes and backslashes, so that it's suitable for yyerror. The
3772 heuristic is that double-quoting is unnecessary unless the string
3773 contains an apostrophe, a comma, or backslash (other than
3774 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3775 null, do not copy; instead, return the length of what the result
3778 yytnamerr (char *yyres, const char *yystr)
3783 char const *yyp = yystr;
3790 goto do_not_strip_quotes;
3794 goto do_not_strip_quotes;
3807 do_not_strip_quotes: ;
3811 return yystrlen (yystr);
3813 return yystpcpy (yyres, yystr) - yyres;
3817 /* Copy into YYRESULT an error message about the unexpected token
3818 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3819 including the terminating null byte. If YYRESULT is null, do not
3820 copy anything; just return the number of bytes that would be
3821 copied. As a special case, return 0 if an ordinary "syntax error"
3822 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3823 size calculation. */
3825 yysyntax_error (char *yyresult, int yystate, int yychar)
3827 int yyn = yypact[yystate];
3829 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3833 int yytype = YYTRANSLATE (yychar);
3834 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3835 YYSIZE_T yysize = yysize0;
3837 int yysize_overflow = 0;
3838 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3839 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3843 /* This is so xgettext sees the translatable formats that are
3844 constructed on the fly. */
3845 YY_("syntax error, unexpected %s");
3846 YY_("syntax error, unexpected %s, expecting %s");
3847 YY_("syntax error, unexpected %s, expecting %s or %s");
3848 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3849 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3853 static char const yyunexpected[] = "syntax error, unexpected %s";
3854 static char const yyexpecting[] = ", expecting %s";
3855 static char const yyor[] = " or %s";
3856 char yyformat[sizeof yyunexpected
3857 + sizeof yyexpecting - 1
3858 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3859 * (sizeof yyor - 1))];
3860 char const *yyprefix = yyexpecting;
3862 /* Start YYX at -YYN if negative to avoid negative indexes in
3864 int yyxbegin = yyn < 0 ? -yyn : 0;
3866 /* Stay within bounds of both yycheck and yytname. */
3867 int yychecklim = YYLAST - yyn + 1;
3868 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3871 yyarg[0] = yytname[yytype];
3872 yyfmt = yystpcpy (yyformat, yyunexpected);
3874 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3875 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3877 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3881 yyformat[sizeof yyunexpected - 1] = '\0';
3884 yyarg[yycount++] = yytname[yyx];
3885 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3886 yysize_overflow |= (yysize1 < yysize);
3888 yyfmt = yystpcpy (yyfmt, yyprefix);
3892 yyf = YY_(yyformat);
3893 yysize1 = yysize + yystrlen (yyf);
3894 yysize_overflow |= (yysize1 < yysize);
3897 if (yysize_overflow)
3898 return YYSIZE_MAXIMUM;
3902 /* Avoid sprintf, as that infringes on the user's name space.
3903 Don't have undefined behavior even if the translation
3904 produced a string with the wrong number of "%s"s. */
3905 char *yyp = yyresult;
3907 while ((*yyp = *yyf) != '\0')
3909 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3911 yyp += yytnamerr (yyp, yyarg[yyi++]);
3924 #endif /* YYERROR_VERBOSE */
3927 /*-----------------------------------------------.
3928 | Release the memory associated to this symbol. |
3929 `-----------------------------------------------*/
3932 #if (defined __STDC__ || defined __C99__FUNC__ \
3933 || defined __cplusplus || defined _MSC_VER)
3935 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3938 yydestruct (yymsg, yytype, yyvaluep)
3948 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3958 /* Prevent warnings from -Wmissing-prototypes. */
3959 #ifdef YYPARSE_PARAM
3960 #if defined __STDC__ || defined __cplusplus
3961 int yyparse (void *YYPARSE_PARAM);
3965 #else /* ! YYPARSE_PARAM */
3966 #if defined __STDC__ || defined __cplusplus
3971 #endif /* ! YYPARSE_PARAM */
3974 /* The lookahead symbol. */
3977 /* The semantic value of the lookahead symbol. */
3980 /* Number of syntax errors so far. */
3985 /*-------------------------.
3986 | yyparse or yypush_parse. |
3987 `-------------------------*/
3989 #ifdef YYPARSE_PARAM
3990 #if (defined __STDC__ || defined __C99__FUNC__ \
3991 || defined __cplusplus || defined _MSC_VER)
3993 yyparse (void *YYPARSE_PARAM)
3996 yyparse (YYPARSE_PARAM)
3997 void *YYPARSE_PARAM;
3999 #else /* ! YYPARSE_PARAM */
4000 #if (defined __STDC__ || defined __C99__FUNC__ \
4001 || defined __cplusplus || defined _MSC_VER)
4014 /* Number of tokens to shift before error messages enabled. */
4017 /* The stacks and their tools:
4018 `yyss': related to states.
4019 `yyvs': related to semantic values.
4021 Refer to the stacks thru separate pointers, to allow yyoverflow
4022 to reallocate them elsewhere. */
4024 /* The state stack. */
4025 yytype_int16 yyssa[YYINITDEPTH];
4027 yytype_int16 *yyssp;
4029 /* The semantic value stack. */
4030 YYSTYPE yyvsa[YYINITDEPTH];
4034 YYSIZE_T yystacksize;
4038 /* Lookahead token as an internal (translated) token number. */
4040 /* The variables used to return semantic value and location from the
4045 /* Buffer for error messages, and its allocated size. */
4047 char *yymsg = yymsgbuf;
4048 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
4051 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
4053 /* The number of symbols on the RHS of the reduced rule.
4054 Keep to zero when no symbol should be popped. */
4060 yystacksize = YYINITDEPTH;
4062 YYDPRINTF ((stderr, "Starting parse\n"));
4067 yychar = YYEMPTY; /* Cause a token to be read. */
4069 /* Initialize stack pointers.
4070 Waste one element of value and location stack
4071 so that they stay on the same level as the state stack.
4072 The wasted elements are never initialized. */
4078 /*------------------------------------------------------------.
4079 | yynewstate -- Push a new state, which is found in yystate. |
4080 `------------------------------------------------------------*/
4082 /* In all cases, when you get here, the value and location stacks
4083 have just been pushed. So pushing a state here evens the stacks. */
4089 if (yyss + yystacksize - 1 <= yyssp)
4091 /* Get the current used size of the three stacks, in elements. */
4092 YYSIZE_T yysize = yyssp - yyss + 1;
4096 /* Give user a chance to reallocate the stack. Use copies of
4097 these so that the &'s don't force the real ones into
4099 YYSTYPE *yyvs1 = yyvs;
4100 yytype_int16 *yyss1 = yyss;
4102 /* Each stack pointer address is followed by the size of the
4103 data in use in that stack, in bytes. This used to be a
4104 conditional around just the two extra args, but that might
4105 be undefined if yyoverflow is a macro. */
4106 yyoverflow (YY_("memory exhausted"),
4107 &yyss1, yysize * sizeof (*yyssp),
4108 &yyvs1, yysize * sizeof (*yyvsp),
4114 #else /* no yyoverflow */
4115 # ifndef YYSTACK_RELOCATE
4116 goto yyexhaustedlab;
4118 /* Extend the stack our own way. */
4119 if (YYMAXDEPTH <= yystacksize)
4120 goto yyexhaustedlab;
4122 if (YYMAXDEPTH < yystacksize)
4123 yystacksize = YYMAXDEPTH;
4126 yytype_int16 *yyss1 = yyss;
4127 union yyalloc *yyptr =
4128 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
4130 goto yyexhaustedlab;
4131 YYSTACK_RELOCATE (yyss_alloc, yyss);
4132 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
4133 # undef YYSTACK_RELOCATE
4135 YYSTACK_FREE (yyss1);
4138 #endif /* no yyoverflow */
4140 yyssp = yyss + yysize - 1;
4141 yyvsp = yyvs + yysize - 1;
4143 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
4144 (unsigned long int) yystacksize));
4146 if (yyss + yystacksize - 1 <= yyssp)
4150 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
4152 if (yystate == YYFINAL)
4162 /* Do appropriate processing given the current state. Read a
4163 lookahead token if we need one and don't already have one. */
4165 /* First try to decide what to do without reference to lookahead token. */
4166 yyn = yypact[yystate];
4167 if (yyn == YYPACT_NINF)
4170 /* Not known => get a lookahead token if don't already have one. */
4172 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
4173 if (yychar == YYEMPTY)
4175 YYDPRINTF ((stderr, "Reading a token: "));
4179 if (yychar <= YYEOF)
4181 yychar = yytoken = YYEOF;
4182 YYDPRINTF ((stderr, "Now at end of input.\n"));
4186 yytoken = YYTRANSLATE (yychar);
4187 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
4190 /* If the proper action on seeing token YYTOKEN is to reduce or to
4191 detect an error, take that action. */
4193 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
4198 if (yyn == 0 || yyn == YYTABLE_NINF)
4204 /* Count tokens shifted since error; after three, turn off error
4209 /* Shift the lookahead token. */
4210 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4212 /* Discard the shifted token. */
4221 /*-----------------------------------------------------------.
4222 | yydefault -- do the default action for the current state. |
4223 `-----------------------------------------------------------*/
4225 yyn = yydefact[yystate];
4231 /*-----------------------------.
4232 | yyreduce -- Do a reduction. |
4233 `-----------------------------*/
4235 /* yyn is the number of a rule to reduce with. */
4238 /* If YYLEN is nonzero, implement the default value of the action:
4241 Otherwise, the following line sets YYVAL to garbage.
4242 This behavior is undocumented and Bison
4243 users should not rely upon it. Assigning to YYVAL
4244 unconditionally makes the parser a bit smaller, and it avoids a
4245 GCC warning that YYVAL may be used uninitialized. */
4246 yyval = yyvsp[1-yylen];
4249 YY_REDUCE_PRINT (yyn);
4256 /* Line 1464 of skeleton.m4 */
4257 #line 2030 "parser.y"
4258 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4267 /* Line 1464 of skeleton.m4 */
4268 #line 2031 "parser.y"
4269 {(yyval.code)=code_new();}
4278 /* Line 1464 of skeleton.m4 */
4279 #line 2033 "parser.y"
4280 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4289 /* Line 1464 of skeleton.m4 */
4290 #line 2034 "parser.y"
4291 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4300 /* Line 1464 of skeleton.m4 */
4301 #line 2049 "parser.y"
4302 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4311 /* Line 1464 of skeleton.m4 */
4312 #line 2050 "parser.y"
4322 /* Line 1464 of skeleton.m4 */
4323 #line 2053 "parser.y"
4333 /* Line 1464 of skeleton.m4 */
4334 #line 2060 "parser.y"
4335 {(yyval.code)=(yyvsp[(3) - (4)].code);}
4344 /* Line 1464 of skeleton.m4 */
4345 #line 2064 "parser.y"
4346 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4355 /* Line 1464 of skeleton.m4 */
4356 #line 2065 "parser.y"
4357 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4366 /* Line 1464 of skeleton.m4 */
4367 #line 2069 "parser.y"
4369 code_t**cc = &global->init->method->body->code;
4370 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4380 /* Line 1464 of skeleton.m4 */
4381 #line 2080 "parser.y"
4382 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4391 /* Line 1464 of skeleton.m4 */
4392 #line 2081 "parser.y"
4393 {(yyval.value).c=abc_pushundefined(0);
4394 (yyval.value).t=TYPE_ANY;
4404 /* Line 1464 of skeleton.m4 */
4405 #line 2085 "parser.y"
4406 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4415 /* Line 1464 of skeleton.m4 */
4416 #line 2086 "parser.y"
4417 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4426 /* Line 1464 of skeleton.m4 */
4427 #line 2088 "parser.y"
4428 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4437 /* Line 1464 of skeleton.m4 */
4438 #line 2089 "parser.y"
4439 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4448 /* Line 1464 of skeleton.m4 */
4449 #line 2092 "parser.y"
4452 if(variable_exists((yyvsp[(1) - (3)].id)))
4453 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4455 new_variable((yyvsp[(1) - (3)].id), 0, 1, 0);
4458 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4459 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4460 (yyvsp[(2) - (3)].classinfo)->name);
4465 if(state->method->uses_slots) {
4466 variable_t* v = find_slot(state, (yyvsp[(1) - (3)].id));
4468 // this variable is stored in a slot
4470 v->type = (yyvsp[(2) - (3)].classinfo);
4476 index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0);
4479 (yyval.code) = slot?abc_getscopeobject(0, 1):0;
4481 if((yyvsp[(2) - (3)].classinfo)) {
4482 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4483 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4484 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4486 code_free((yyvsp[(3) - (3)].value).c);
4487 (yyval.code) = defaultvalue((yyval.code), (yyvsp[(2) - (3)].classinfo));
4490 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4491 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (3)].value).c);
4492 (yyval.code) = abc_coerce_a((yyval.code));
4494 // don't do anything
4495 code_free((yyvsp[(3) - (3)].value).c);
4496 code_free((yyval.code));
4502 (yyval.code) = abc_setslot((yyval.code), index);
4504 (yyval.code) = abc_setlocal((yyval.code), index);
4515 /* Line 1464 of skeleton.m4 */
4516 #line 2152 "parser.y"
4517 {(yyval.code) = code_new();}
4526 /* Line 1464 of skeleton.m4 */
4527 #line 2153 "parser.y"
4528 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4537 /* Line 1464 of skeleton.m4 */
4538 #line 2156 "parser.y"
4539 {PASS12 new_state();}
4548 /* Line 1464 of skeleton.m4 */
4549 #line 2156 "parser.y"
4552 (yyval.code) = code_new();
4553 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4554 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4556 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4557 if((yyvsp[(7) - (7)].code)) {
4558 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4560 myif->branch = (yyval.code) = abc_nop((yyval.code));
4561 if((yyvsp[(7) - (7)].code)) {
4562 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4563 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4565 (yyval.code) = var_block((yyval.code));
4576 /* Line 1464 of skeleton.m4 */
4577 #line 2175 "parser.y"
4578 {(yyval.code)=code_new();}
4587 /* Line 1464 of skeleton.m4 */
4588 #line 2182 "parser.y"
4590 PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0);
4591 PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0);
4601 /* Line 1464 of skeleton.m4 */
4602 #line 2186 "parser.y"
4605 (yyval.id)=(yyvsp[(1) - (1)].id);
4615 /* Line 1464 of skeleton.m4 */
4616 #line 2191 "parser.y"
4617 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4626 /* Line 1464 of skeleton.m4 */
4627 #line 2192 "parser.y"
4628 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4637 /* Line 1464 of skeleton.m4 */
4638 #line 2194 "parser.y"
4640 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4641 (yyval.code) = code_new();
4642 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4643 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4644 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4645 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4646 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4647 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4648 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4649 (yyval.code) = abc_jump((yyval.code), loopstart);
4650 code_t*out = (yyval.code) = abc_nop((yyval.code));
4651 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4652 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4655 (yyval.code) = var_block((yyval.code));
4666 /* Line 1464 of skeleton.m4 */
4667 #line 2214 "parser.y"
4669 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4671 syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id));
4674 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4675 int it = new_variable(tmp1name, TYPE_INT, 0, 0);
4676 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4677 int array = new_variable(tmp1name, 0, 0, 0);
4679 (yyval.code) = code_new();
4680 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4681 (yyval.code) = abc_coerce_a((yyval.code));
4682 (yyval.code) = abc_setlocal((yyval.code), array);
4683 (yyval.code) = abc_pushbyte((yyval.code), 0);
4684 (yyval.code) = abc_setlocal((yyval.code), it);
4686 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4688 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4689 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4690 (yyval.code) = abc_getlocal((yyval.code), array);
4691 (yyval.code) = abc_getlocal((yyval.code), it);
4692 if(!(yyvsp[(1) - (6)].for_start).each)
4693 (yyval.code) = abc_nextname((yyval.code));
4695 (yyval.code) = abc_nextvalue((yyval.code));
4696 (yyval.code) = converttype((yyval.code), 0, var->type);
4697 (yyval.code) = abc_setlocal((yyval.code), var->index);
4699 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4700 (yyval.code) = abc_jump((yyval.code), loopstart);
4702 code_t*out = (yyval.code) = abc_nop((yyval.code));
4703 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4704 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4708 (yyval.code) = var_block((yyval.code));
4723 /* Line 1464 of skeleton.m4 */
4724 #line 2262 "parser.y"
4725 {PASS12 new_state();}
4734 /* Line 1464 of skeleton.m4 */
4735 #line 2262 "parser.y"
4738 (yyval.code) = code_new();
4740 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4741 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4742 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4743 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4744 myjmp->branch = cont;
4745 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4746 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4747 code_t*out = (yyval.code) = abc_nop((yyval.code));
4748 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4749 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4751 (yyval.code) = var_block((yyval.code));
4762 /* Line 1464 of skeleton.m4 */
4763 #line 2281 "parser.y"
4764 {PASS12 new_state();}
4773 /* Line 1464 of skeleton.m4 */
4774 #line 2281 "parser.y"
4776 (yyval.code) = code_new();
4777 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4778 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4779 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4780 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4781 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4782 code_t*out = (yyval.code) = abc_nop((yyval.code));
4783 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4784 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4786 (yyval.code) = var_block((yyval.code));
4797 /* Line 1464 of skeleton.m4 */
4798 #line 2296 "parser.y"
4800 (yyval.code) = abc___break__(0, "");
4810 /* Line 1464 of skeleton.m4 */
4811 #line 2299 "parser.y"
4813 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4823 /* Line 1464 of skeleton.m4 */
4824 #line 2302 "parser.y"
4826 (yyval.code) = abc___continue__(0, "");
4836 /* Line 1464 of skeleton.m4 */
4837 #line 2305 "parser.y"
4839 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4849 /* Line 1464 of skeleton.m4 */
4850 #line 2309 "parser.y"
4860 /* Line 1464 of skeleton.m4 */
4861 #line 2310 "parser.y"
4862 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4871 /* Line 1464 of skeleton.m4 */
4872 #line 2311 "parser.y"
4873 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4882 /* Line 1464 of skeleton.m4 */
4883 #line 2312 "parser.y"
4884 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4893 /* Line 1464 of skeleton.m4 */
4894 #line 2313 "parser.y"
4895 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4904 /* Line 1464 of skeleton.m4 */
4905 #line 2314 "parser.y"
4906 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
4915 /* Line 1464 of skeleton.m4 */
4916 #line 2316 "parser.y"
4918 (yyval.code) = abc_dup(0);
4919 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
4920 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
4921 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
4922 if((yyval.code)->opcode != OPCODE___BREAK__) {
4923 (yyval.code) = abc___fallthrough__((yyval.code), "");
4925 code_t*e = (yyval.code) = abc_nop((yyval.code));
4936 /* Line 1464 of skeleton.m4 */
4937 #line 2327 "parser.y"
4939 (yyval.code) = (yyvsp[(3) - (3)].code);
4949 /* Line 1464 of skeleton.m4 */
4950 #line 2330 "parser.y"
4951 {PASS12 new_state();}
4960 /* Line 1464 of skeleton.m4 */
4961 #line 2330 "parser.y"
4963 (yyval.code)=(yyvsp[(4) - (8)].value).c;
4964 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
4965 code_t*out = (yyval.code) = abc_pop((yyval.code));
4966 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
4968 code_t*c = (yyval.code),*lastblock=0;
4970 if(c->opcode == OPCODE_IFNE) {
4971 if(!c->next) syntaxerror("internal error in fallthrough handling");
4973 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
4975 c->opcode = OPCODE_JUMP;
4976 c->branch = lastblock;
4978 /* fall through end of switch */
4979 c->opcode = OPCODE_NOP;
4985 (yyval.code) = var_block((yyval.code));
4996 /* Line 1464 of skeleton.m4 */
4997 #line 2359 "parser.y"
4998 {PASS12 new_state();
4999 state->exception_name=(yyvsp[(3) - (5)].id);
5000 PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0);
5001 PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0);
5011 /* Line 1464 of skeleton.m4 */
5012 #line 2364 "parser.y"
5014 namespace_t name_ns = {ACCESS_PACKAGE, ""};
5015 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
5017 NEW(abc_exception_t, e)
5018 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
5019 e->var_name = multiname_clone(&name);
5020 (yyval.exception) = e;
5023 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
5024 e->target = c = abc_nop(0);
5025 c = abc_setlocal(c, i);
5026 c = code_append(c, (yyvsp[(8) - (9)].code));
5040 /* Line 1464 of skeleton.m4 */
5041 #line 2383 "parser.y"
5042 {PASS12 new_state();state->exception_name=0;}
5051 /* Line 1464 of skeleton.m4 */
5052 #line 2383 "parser.y"
5054 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
5055 if(!(yyvsp[(4) - (5)].code)) {
5056 (yyval.exception)=0;
5058 NEW(abc_exception_t, e)
5059 e->exc_type = 0; //all exceptions
5060 e->var_name = 0; //no name
5063 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
5064 (yyval.exception) = e;
5076 /* Line 1464 of skeleton.m4 */
5077 #line 2399 "parser.y"
5078 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
5087 /* Line 1464 of skeleton.m4 */
5088 #line 2400 "parser.y"
5089 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
5098 /* Line 1464 of skeleton.m4 */
5099 #line 2401 "parser.y"
5100 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
5109 /* Line 1464 of skeleton.m4 */
5110 #line 2402 "parser.y"
5112 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
5113 (yyval.catch_list).finally = 0;
5114 if((yyvsp[(2) - (2)].exception)) {
5115 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
5116 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
5127 /* Line 1464 of skeleton.m4 */
5128 #line 2410 "parser.y"
5130 (yyval.catch_list).l=list_new();
5131 (yyval.catch_list).finally = 0;
5132 if((yyvsp[(1) - (1)].exception)) {
5133 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
5134 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
5145 /* Line 1464 of skeleton.m4 */
5146 #line 2419 "parser.y"
5147 {PASS12 new_state();}
5156 /* Line 1464 of skeleton.m4 */
5157 #line 2419 "parser.y"
5159 code_t*out = abc_nop(0);
5161 code_t*start = abc_nop(0);
5162 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
5163 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
5164 (yyval.code) = abc_jump((yyval.code), out);
5166 code_t*end = (yyval.code) = abc_nop((yyval.code));
5169 if((yyvsp[(6) - (6)].catch_list).finally)
5170 tmp = new_variable("__finally__", 0, 0, 0);
5172 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
5175 abc_exception_t*e = l->abc_exception;
5177 (yyval.code) = code_append((yyval.code), e->target);
5178 (yyval.code) = abc_jump((yyval.code), out);
5180 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
5182 e->target = (yyval.code) = abc_nop((yyval.code));
5183 (yyval.code) = abc___rethrow__((yyval.code));
5191 (yyval.code) = code_append((yyval.code), out);
5193 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
5195 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
5197 (yyval.code) = var_block((yyval.code));
5208 /* Line 1464 of skeleton.m4 */
5209 #line 2464 "parser.y"
5211 (yyval.code)=(yyvsp[(2) - (2)].value).c;
5212 (yyval.code)=abc_throw((yyval.code));
5222 /* Line 1464 of skeleton.m4 */
5223 #line 2468 "parser.y"
5225 if(!state->exception_name)
5226 syntaxerror("re-throw only possible within a catch block");
5227 variable_t*v = find_variable(state, state->exception_name);
5228 (yyval.code)=code_new();
5229 (yyval.code)=abc_getlocal((yyval.code), v->index);
5230 (yyval.code)=abc_throw((yyval.code));
5240 /* Line 1464 of skeleton.m4 */
5241 #line 2479 "parser.y"
5243 (yyval.code) = (yyvsp[(3) - (5)].value).c;
5244 (yyval.code) = abc_pushwith((yyval.code));
5245 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
5246 (yyval.code) = abc_popscope((yyval.code));
5256 /* Line 1464 of skeleton.m4 */
5257 #line 2489 "parser.y"
5258 {PASS12 (yyval.id)="package";}
5267 /* Line 1464 of skeleton.m4 */
5268 #line 2491 "parser.y"
5269 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5278 /* Line 1464 of skeleton.m4 */
5279 #line 2492 "parser.y"
5280 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5289 /* Line 1464 of skeleton.m4 */
5290 #line 2494 "parser.y"
5291 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5300 /* Line 1464 of skeleton.m4 */
5301 #line 2495 "parser.y"
5302 {PASS12 endpackage();(yyval.code)=0;}
5311 /* Line 1464 of skeleton.m4 */
5312 #line 2496 "parser.y"
5313 {PASS12 startpackage("");}
5322 /* Line 1464 of skeleton.m4 */
5323 #line 2497 "parser.y"
5324 {PASS12 endpackage();(yyval.code)=0;}
5333 /* Line 1464 of skeleton.m4 */
5334 #line 2499 "parser.y"
5337 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5338 if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
5339 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5343 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5345 syntaxerror("Couldn't import class\n");
5346 state_has_imports();
5347 dict_put(state->imports, c->name, c);
5348 import_toplevel(c->package);
5359 /* Line 1464 of skeleton.m4 */
5360 #line 2515 "parser.y"
5363 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) {
5364 as3_schedule_package((yyvsp[(2) - (4)].id));
5369 i->package = (yyvsp[(2) - (4)].id);
5370 state_has_imports();
5371 list_append(state->wildcard_imports, i);
5372 import_toplevel(i->package);
5383 /* Line 1464 of skeleton.m4 */
5384 #line 2532 "parser.y"
5385 {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;}
5394 /* Line 1464 of skeleton.m4 */
5395 #line 2533 "parser.y"
5396 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5405 /* Line 1464 of skeleton.m4 */
5406 #line 2534 "parser.y"
5407 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5416 /* Line 1464 of skeleton.m4 */
5417 #line 2535 "parser.y"
5420 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags;
5421 if((yyvsp[(1) - (2)].flags).ns && (yyvsp[(2) - (2)].flags).ns) syntaxerror("only one namespace allowed in one declaration");
5422 (yyval.flags).ns=(yyvsp[(1) - (2)].flags).ns?(yyvsp[(1) - (2)].flags).ns:(yyvsp[(2) - (2)].flags).ns;
5433 /* Line 1464 of skeleton.m4 */
5434 #line 2543 "parser.y"
5435 {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;}
5444 /* Line 1464 of skeleton.m4 */
5445 #line 2544 "parser.y"
5446 {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;}
5455 /* Line 1464 of skeleton.m4 */
5456 #line 2545 "parser.y"
5457 {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;}
5466 /* Line 1464 of skeleton.m4 */
5467 #line 2546 "parser.y"
5468 {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;}
5477 /* Line 1464 of skeleton.m4 */
5478 #line 2547 "parser.y"
5479 {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;}
5488 /* Line 1464 of skeleton.m4 */
5489 #line 2548 "parser.y"
5490 {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;}
5499 /* Line 1464 of skeleton.m4 */
5500 #line 2549 "parser.y"
5501 {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;}
5510 /* Line 1464 of skeleton.m4 */
5511 #line 2550 "parser.y"
5512 {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;}
5521 /* Line 1464 of skeleton.m4 */
5522 #line 2551 "parser.y"
5523 {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;}
5532 /* Line 1464 of skeleton.m4 */
5533 #line 2552 "parser.y"
5534 {PASS12 (yyval.flags).flags=FLAG_NAMESPACE;
5535 (yyval.flags).ns=(yyvsp[(1) - (1)].id);
5545 /* Line 1464 of skeleton.m4 */
5546 #line 2556 "parser.y"
5547 {(yyval.classinfo)=0;}
5556 /* Line 1464 of skeleton.m4 */
5557 #line 2557 "parser.y"
5558 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5567 /* Line 1464 of skeleton.m4 */
5568 #line 2559 "parser.y"
5569 {PASS12 (yyval.classinfo_list)=list_new();}
5578 /* Line 1464 of skeleton.m4 */
5579 #line 2560 "parser.y"
5580 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5589 /* Line 1464 of skeleton.m4 */
5590 #line 2562 "parser.y"
5591 {PASS12 (yyval.classinfo_list)=list_new();}
5600 /* Line 1464 of skeleton.m4 */
5601 #line 2563 "parser.y"
5602 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5611 /* Line 1464 of skeleton.m4 */
5612 #line 2567 "parser.y"
5613 {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5622 /* Line 1464 of skeleton.m4 */
5623 #line 2569 "parser.y"
5624 {PASS12 endclass();(yyval.code)=0;}
5633 /* Line 1464 of skeleton.m4 */
5634 #line 2573 "parser.y"
5635 {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE;
5636 startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5645 /* Line 1464 of skeleton.m4 */
5646 #line 2576 "parser.y"
5647 {PASS12 endclass();(yyval.code)=0;}
5656 /* Line 1464 of skeleton.m4 */
5657 #line 2589 "parser.y"
5659 code_t*c = state->cls->static_init->header;
5660 c = code_append(c, (yyvsp[(1) - (1)].code));
5661 state->cls->static_init->header = c;
5671 /* Line 1464 of skeleton.m4 */
5672 #line 2600 "parser.y"
5674 syntaxerror("variable declarations not allowed in interfaces");
5684 /* Line 1464 of skeleton.m4 */
5685 #line 2603 "parser.y"
5688 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC;
5689 if((yyvsp[(1) - (8)].flags).flags&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5690 syntaxerror("invalid method modifiers: interface methods always need to be public");
5692 startfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5693 endfunction(&(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5694 list_deep_free((yyvsp[(6) - (8)].params).list);
5704 /* Line 1464 of skeleton.m4 */
5705 #line 2618 "parser.y"
5706 {setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));}
5715 /* Line 1464 of skeleton.m4 */
5716 #line 2618 "parser.y"
5717 {(yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);}
5726 /* Line 1464 of skeleton.m4 */
5727 #line 2620 "parser.y"
5728 {(yyval.code) = (yyvsp[(1) - (1)].code);}
5737 /* Line 1464 of skeleton.m4 */
5738 #line 2621 "parser.y"
5739 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
5748 /* Line 1464 of skeleton.m4 */
5749 #line 2624 "parser.y"
5751 int flags = slotstate_flags->flags;
5752 namespace_t ns = modifiers2access(slotstate_flags);
5754 varinfo_t* info = 0;
5756 memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1);
5758 check_override(i, flags);
5760 info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id));
5762 slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id));
5764 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(1) - (3)].id));
5766 if(ns.name && ns.name[0]) {
5767 syntaxerror("namespaces not allowed on package-level variables");
5769 info = varinfo_register_global(ns.access, state->package, (yyvsp[(1) - (3)].id));
5772 info->type = (yyvsp[(2) - (3)].classinfo);
5773 info->flags = flags;
5776 multiname_t mname = {QNAME, &ns, 0, (yyvsp[(1) - (3)].id)};
5778 trait_list_t**traits;
5782 ns.name = state->package;
5783 traits = &global->init->traits;
5784 code = &global->init->method->body->code;
5785 } else if(flags&FLAG_STATIC) {
5787 traits = &state->cls->abc->static_traits;
5788 code = &state->cls->static_init->header;
5790 // instance variable
5791 traits = &state->cls->abc->traits;
5792 code = &state->cls->init->header;
5796 if((yyvsp[(2) - (3)].classinfo)) {
5797 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
5798 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5800 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5802 info->slot = t->slot_id;
5804 /* initalization code (if needed) */
5806 if((yyvsp[(3) - (3)].value).c && !is_pushundefined((yyvsp[(3) - (3)].value).c)) {
5807 c = abc_getlocal_0(c);
5808 c = code_append(c, (yyvsp[(3) - (3)].value).c);
5809 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
5810 c = abc_setslot(c, t->slot_id);
5813 *code = code_append(*code, c);
5815 if(slotstate_varconst==KW_CONST) {
5816 t->kind= TRAIT_CONST;
5829 /* Line 1464 of skeleton.m4 */
5830 #line 2698 "parser.y"
5831 {(yyval.constant)=0;}
5840 /* Line 1464 of skeleton.m4 */
5841 #line 2699 "parser.y"
5842 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
5851 /* Line 1464 of skeleton.m4 */
5852 #line 2701 "parser.y"
5853 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
5862 /* Line 1464 of skeleton.m4 */
5863 #line 2702 "parser.y"
5864 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
5873 /* Line 1464 of skeleton.m4 */
5874 #line 2703 "parser.y"
5875 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
5884 /* Line 1464 of skeleton.m4 */
5885 #line 2704 "parser.y"
5886 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
5895 /* Line 1464 of skeleton.m4 */
5896 #line 2705 "parser.y"
5897 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
5906 /* Line 1464 of skeleton.m4 */
5907 #line 2707 "parser.y"
5908 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
5917 /* Line 1464 of skeleton.m4 */
5918 #line 2708 "parser.y"
5919 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
5928 /* Line 1464 of skeleton.m4 */
5929 #line 2709 "parser.y"
5930 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
5939 /* Line 1464 of skeleton.m4 */
5940 #line 2710 "parser.y"
5942 if(!strcmp((yyvsp[(1) - (1)].id), "NaN")) {
5943 (yyval.constant) = constant_new_float(__builtin_nan(""));
5945 as3_warning("Couldn't evaluate constant value of %s", (yyvsp[(1) - (1)].id));
5946 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
5957 /* Line 1464 of skeleton.m4 */
5958 #line 2722 "parser.y"
5961 memset(&(yyval.params),0,sizeof((yyval.params)));
5971 /* Line 1464 of skeleton.m4 */
5972 #line 2726 "parser.y"
5975 (yyval.params)=(yyvsp[(1) - (1)].params);
5985 /* Line 1464 of skeleton.m4 */
5986 #line 2732 "parser.y"
5989 memset(&(yyval.params),0,sizeof((yyval.params)));
5990 (yyval.params).varargs=1;
5991 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
6001 /* Line 1464 of skeleton.m4 */
6002 #line 2738 "parser.y"
6005 (yyval.params) =(yyvsp[(1) - (4)].params);
6006 (yyval.params).varargs=1;
6007 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
6017 /* Line 1464 of skeleton.m4 */
6018 #line 2746 "parser.y"
6021 (yyval.params) = (yyvsp[(1) - (3)].params);
6022 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
6032 /* Line 1464 of skeleton.m4 */
6033 #line 2751 "parser.y"
6036 memset(&(yyval.params),0,sizeof((yyval.params)));
6037 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
6047 /* Line 1464 of skeleton.m4 */
6048 #line 2757 "parser.y"
6051 (yyval.param) = rfx_calloc(sizeof(param_t));
6052 (yyval.param)->name=(yyvsp[(1) - (4)].id);
6053 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
6055 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
6065 /* Line 1464 of skeleton.m4 */
6066 #line 2765 "parser.y"
6069 (yyval.param) = rfx_calloc(sizeof(param_t));
6070 (yyval.param)->name=(yyvsp[(1) - (2)].id);
6071 (yyval.param)->type = TYPE_ANY;
6073 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
6083 /* Line 1464 of skeleton.m4 */
6084 #line 2775 "parser.y"
6085 {PASS12 (yyval.token)=0;}
6094 /* Line 1464 of skeleton.m4 */
6095 #line 2778 "parser.y"
6096 {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
6105 /* Line 1464 of skeleton.m4 */
6106 #line 2779 "parser.y"
6109 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
6111 if(!state->method->info) syntaxerror("internal error");
6113 code_t*c = method_header(state->method);
6114 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
6116 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
6118 list_deep_free((yyvsp[(6) - (12)].params).list);
6129 /* Line 1464 of skeleton.m4 */
6130 #line 2795 "parser.y"
6131 {PASS12 (yyval.id)=0;}
6140 /* Line 1464 of skeleton.m4 */
6141 #line 2797 "parser.y"
6142 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
6151 /* Line 1464 of skeleton.m4 */
6152 #line 2798 "parser.y"
6155 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
6157 methodinfo_t*f = state->method->info;
6158 if(!f || !f->kind) syntaxerror("internal error");
6160 code_t*c = method_header(state->method);
6161 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
6163 int index = state->method->var_index;
6164 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
6166 (yyval.value).c = abc_getlocal(0, index);
6167 (yyval.value).t = TYPE_FUNCTION(f);
6169 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
6179 /* Line 1464 of skeleton.m4 */
6180 #line 2820 "parser.y"
6182 PASS1 static classinfo_t c;
6183 memset(&c, 0, sizeof(c));
6184 c.kind = INFOTYPE_CLASS;
6186 c.name = (yyvsp[(1) - (1)].id);
6187 (yyval.classinfo) = &c;
6189 /* let the compiler know that we might be looking for this soon */
6190 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
6192 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
6193 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
6194 (yyval.classinfo) = (classinfo_t*)s;
6204 /* Line 1464 of skeleton.m4 */
6205 #line 2836 "parser.y"
6207 PASS1 static classinfo_t c;
6208 memset(&c, 0, sizeof(c));
6209 c.kind = INFOTYPE_CLASS;
6211 c.package = (yyvsp[(1) - (3)].id);
6212 c.name = (yyvsp[(3) - (3)].id);
6213 (yyval.classinfo) = &c;
6215 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6216 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
6217 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
6218 (yyval.classinfo) = (classinfo_t*)s;
6228 /* Line 1464 of skeleton.m4 */
6229 #line 2854 "parser.y"
6230 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
6239 /* Line 1464 of skeleton.m4 */
6240 #line 2855 "parser.y"
6241 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6250 /* Line 1464 of skeleton.m4 */
6251 #line 2857 "parser.y"
6252 {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6261 /* Line 1464 of skeleton.m4 */
6262 #line 2858 "parser.y"
6263 {PASS12 (yyval.classinfo)=registry_getanytype();}
6272 /* Line 1464 of skeleton.m4 */
6273 #line 2859 "parser.y"
6274 {PASS12 (yyval.classinfo)=registry_getanytype();}
6283 /* Line 1464 of skeleton.m4 */
6284 #line 2868 "parser.y"
6285 {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6294 /* Line 1464 of skeleton.m4 */
6295 #line 2869 "parser.y"
6296 {PASS12 (yyval.classinfo)=0;}
6305 /* Line 1464 of skeleton.m4 */
6306 #line 2873 "parser.y"
6307 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
6316 /* Line 1464 of skeleton.m4 */
6317 #line 2874 "parser.y"
6318 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6327 /* Line 1464 of skeleton.m4 */
6328 #line 2876 "parser.y"
6329 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
6338 /* Line 1464 of skeleton.m4 */
6339 #line 2880 "parser.y"
6340 {(yyval.value_list).len=1;
6341 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6351 /* Line 1464 of skeleton.m4 */
6352 #line 2884 "parser.y"
6353 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6362 /* Line 1464 of skeleton.m4 */
6363 #line 2885 "parser.y"
6365 (yyval.value_list).len= (yyvsp[(1) - (2)].value_list).len+1;
6366 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6376 /* Line 1464 of skeleton.m4 */
6377 #line 2891 "parser.y"
6379 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6380 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6382 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6383 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6384 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6385 (yyval.value).c = code_cutlast((yyval.value).c);
6386 (yyval.value).c = code_append((yyval.value).c, paramcode);
6387 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).len);
6388 multiname_destroy(name);
6389 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6390 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6391 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);//FIXME
6392 multiname_t*name = t->name;
6393 (yyval.value).c = code_cutlast((yyval.value).c);
6394 (yyval.value).c = code_append((yyval.value).c, paramcode);
6395 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).len);
6397 (yyval.value).c = code_append((yyval.value).c, paramcode);
6398 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).len);
6401 (yyval.value).t = TYPE_ANY;
6402 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6403 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6405 (yyval.value).c = abc_coerce_a((yyval.value).c);
6406 (yyval.value).t = TYPE_ANY;
6417 /* Line 1464 of skeleton.m4 */
6418 #line 2927 "parser.y"
6421 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6422 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6423 (yyval.value).c = code_cutlast((yyval.value).c);
6425 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6427 (yyval.value).t = TYPE_ANY;
6428 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6429 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6430 (yyval.value).c = code_cutlast((yyval.value).c);
6431 (yyval.value).c = code_append((yyval.value).c, paramcode);
6432 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
6433 multiname_destroy(name);
6434 } else if((yyval.value).c->opcode == OPCODE_GETSLOT && (yyval.value).c->prev->opcode != OPCODE_GETSCOPEOBJECT) {
6435 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6436 trait_t*t = traits_find_slotid(state->cls->abc->traits,slot);
6437 if(t->kind!=TRAIT_METHOD) {
6438 //ok: flash allows to assign closures to members.
6440 multiname_t*name = t->name;
6441 (yyval.value).c = code_cutlast((yyval.value).c);
6442 (yyval.value).c = code_append((yyval.value).c, paramcode);
6443 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6444 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
6445 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6446 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6447 (yyval.value).c = code_cutlast((yyval.value).c);
6448 (yyval.value).c = code_append((yyval.value).c, paramcode);
6449 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
6450 multiname_destroy(name);
6452 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6453 (yyval.value).c = code_append((yyval.value).c, paramcode);
6454 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
6457 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6458 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6460 (yyval.value).c = abc_coerce_a((yyval.value).c);
6461 (yyval.value).t = TYPE_ANY;
6472 /* Line 1464 of skeleton.m4 */
6473 #line 2973 "parser.y"
6475 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6476 if(!state->method) syntaxerror("super() not allowed outside of a function");
6477 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6479 (yyval.value).c = code_new();
6480 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6482 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6484 this is dependent on the control path, check this somewhere else
6485 if(state->method->has_super)
6486 syntaxerror("constructor may call super() only once");
6488 state->method->has_super = 1;
6490 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
6491 (yyval.value).c = abc_pushundefined((yyval.value).c);
6492 (yyval.value).t = TYPE_ANY;
6502 /* Line 1464 of skeleton.m4 */
6503 #line 2994 "parser.y"
6505 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6506 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6507 (yyval.value).c = code_cutlast((yyval.value).c);
6509 multiname_t*name = 0;
6510 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6511 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6512 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6513 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6514 multiname_t*name = traits_find_slotid(state->cls->abc->traits,slot)->name;
6515 (yyval.value).c = code_cutlast((yyval.value).c);
6516 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6518 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6519 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6520 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6522 (yyval.value).t = TYPE_BOOLEAN;
6532 /* Line 1464 of skeleton.m4 */
6533 #line 3015 "parser.y"
6535 (yyval.code) = abc_returnvoid(0);
6545 /* Line 1464 of skeleton.m4 */
6546 #line 3018 "parser.y"
6548 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6549 (yyval.code) = abc_returnvalue((yyval.code));
6559 /* Line 1464 of skeleton.m4 */
6560 #line 3025 "parser.y"
6561 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6570 /* Line 1464 of skeleton.m4 */
6571 #line 3026 "parser.y"
6572 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6581 /* Line 1464 of skeleton.m4 */
6582 #line 3027 "parser.y"
6584 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6585 (yyval.value).c = cut_last_push((yyval.value).c);
6586 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6587 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6597 /* Line 1464 of skeleton.m4 */
6598 #line 3033 "parser.y"
6600 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6610 /* Line 1464 of skeleton.m4 */
6611 #line 3039 "parser.y"
6612 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6621 /* Line 1464 of skeleton.m4 */
6622 #line 3043 "parser.y"
6623 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6632 /* Line 1464 of skeleton.m4 */
6633 #line 3045 "parser.y"
6634 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6643 /* Line 1464 of skeleton.m4 */
6644 #line 3047 "parser.y"
6645 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6654 /* Line 1464 of skeleton.m4 */
6655 #line 3051 "parser.y"
6657 (yyval.value).c = 0;
6658 namespace_t ns = {ACCESS_PACKAGE, ""};
6659 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6660 if(!(yyvsp[(1) - (1)].regexp).options) {
6661 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6662 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6663 (yyval.value).c = abc_construct((yyval.value).c, 1);
6665 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6666 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6667 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6668 (yyval.value).c = abc_construct((yyval.value).c, 2);
6670 (yyval.value).t = TYPE_REGEXP;
6680 /* Line 1464 of skeleton.m4 */
6681 #line 3068 "parser.y"
6682 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6683 //MULTINAME(m, registry_getintclass());
6684 //$$.c = abc_coerce2($$.c, &m); // FIXME
6685 (yyval.value).t = TYPE_INT;
6695 /* Line 1464 of skeleton.m4 */
6696 #line 3073 "parser.y"
6697 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6698 (yyval.value).t = TYPE_INT;
6708 /* Line 1464 of skeleton.m4 */
6709 #line 3076 "parser.y"
6710 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6711 (yyval.value).t = TYPE_INT;
6721 /* Line 1464 of skeleton.m4 */
6722 #line 3079 "parser.y"
6723 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6724 (yyval.value).t = TYPE_UINT;
6734 /* Line 1464 of skeleton.m4 */
6735 #line 3082 "parser.y"
6736 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6737 (yyval.value).t = TYPE_FLOAT;
6747 /* Line 1464 of skeleton.m4 */
6748 #line 3085 "parser.y"
6749 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6750 (yyval.value).t = TYPE_STRING;
6760 /* Line 1464 of skeleton.m4 */
6761 #line 3088 "parser.y"
6762 {(yyval.value).c = abc_pushundefined(0);
6763 (yyval.value).t = TYPE_ANY;
6773 /* Line 1464 of skeleton.m4 */
6774 #line 3091 "parser.y"
6775 {(yyval.value).c = abc_pushtrue(0);
6776 (yyval.value).t = TYPE_BOOLEAN;
6786 /* Line 1464 of skeleton.m4 */
6787 #line 3094 "parser.y"
6788 {(yyval.value).c = abc_pushfalse(0);
6789 (yyval.value).t = TYPE_BOOLEAN;
6799 /* Line 1464 of skeleton.m4 */
6800 #line 3097 "parser.y"
6801 {(yyval.value).c = abc_pushnull(0);
6802 (yyval.value).t = TYPE_NULL;
6812 /* Line 1464 of skeleton.m4 */
6813 #line 3101 "parser.y"
6814 {(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);
6815 (yyval.value).t = TYPE_BOOLEAN;
6825 /* Line 1464 of skeleton.m4 */
6826 #line 3104 "parser.y"
6827 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6828 (yyval.value).t = TYPE_BOOLEAN;
6838 /* Line 1464 of skeleton.m4 */
6839 #line 3107 "parser.y"
6840 {(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);
6841 (yyval.value).t = TYPE_BOOLEAN;
6851 /* Line 1464 of skeleton.m4 */
6852 #line 3110 "parser.y"
6853 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
6854 (yyval.value).t = TYPE_BOOLEAN;
6864 /* Line 1464 of skeleton.m4 */
6865 #line 3113 "parser.y"
6866 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
6867 (yyval.value).t = TYPE_BOOLEAN;
6877 /* Line 1464 of skeleton.m4 */
6878 #line 3116 "parser.y"
6879 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
6880 (yyval.value).t = TYPE_BOOLEAN;
6890 /* Line 1464 of skeleton.m4 */
6891 #line 3119 "parser.y"
6892 {(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);
6893 (yyval.value).t = TYPE_BOOLEAN;
6903 /* Line 1464 of skeleton.m4 */
6904 #line 3122 "parser.y"
6905 {(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);
6906 (yyval.value).t = TYPE_BOOLEAN;
6916 /* Line 1464 of skeleton.m4 */
6917 #line 3126 "parser.y"
6918 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
6919 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6920 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6921 (yyval.value).c = abc_dup((yyval.value).c);
6922 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
6923 (yyval.value).c = cut_last_push((yyval.value).c);
6924 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6925 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6926 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6927 jmp->branch = label;
6937 /* Line 1464 of skeleton.m4 */
6938 #line 3137 "parser.y"
6940 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
6941 /*printf("%08x:\n",$1.t);
6942 code_dump($1.c, 0, 0, "", stdout);
6943 printf("%08x:\n",$3.t);
6944 code_dump($3.c, 0, 0, "", stdout);
6945 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
6946 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6947 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6948 (yyval.value).c = abc_dup((yyval.value).c);
6949 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
6950 (yyval.value).c = cut_last_push((yyval.value).c);
6951 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6952 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6953 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6954 jmp->branch = label;
6964 /* Line 1464 of skeleton.m4 */
6965 #line 3155 "parser.y"
6966 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6967 (yyval.value).c = abc_not((yyval.value).c);
6968 (yyval.value).t = TYPE_BOOLEAN;
6978 /* Line 1464 of skeleton.m4 */
6979 #line 3160 "parser.y"
6980 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6981 (yyval.value).c = abc_bitnot((yyval.value).c);
6982 (yyval.value).t = TYPE_INT;
6992 /* Line 1464 of skeleton.m4 */
6993 #line 3165 "parser.y"
6994 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6995 (yyval.value).c = abc_bitand((yyval.value).c);
6996 (yyval.value).t = TYPE_INT;
7006 /* Line 1464 of skeleton.m4 */
7007 #line 3170 "parser.y"
7008 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7009 (yyval.value).c = abc_bitxor((yyval.value).c);
7010 (yyval.value).t = TYPE_INT;
7020 /* Line 1464 of skeleton.m4 */
7021 #line 3175 "parser.y"
7022 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7023 (yyval.value).c = abc_bitor((yyval.value).c);
7024 (yyval.value).t = TYPE_INT;
7034 /* Line 1464 of skeleton.m4 */
7035 #line 3180 "parser.y"
7036 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7037 (yyval.value).c = abc_rshift((yyval.value).c);
7038 (yyval.value).t = TYPE_INT;
7048 /* Line 1464 of skeleton.m4 */
7049 #line 3184 "parser.y"
7050 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7051 (yyval.value).c = abc_urshift((yyval.value).c);
7052 (yyval.value).t = TYPE_INT;
7062 /* Line 1464 of skeleton.m4 */
7063 #line 3188 "parser.y"
7064 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7065 (yyval.value).c = abc_lshift((yyval.value).c);
7066 (yyval.value).t = TYPE_INT;
7076 /* Line 1464 of skeleton.m4 */
7077 #line 3193 "parser.y"
7078 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7079 (yyval.value).c = abc_divide((yyval.value).c);
7080 (yyval.value).t = TYPE_NUMBER;
7090 /* Line 1464 of skeleton.m4 */
7091 #line 3197 "parser.y"
7092 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7093 (yyval.value).c = abc_modulo((yyval.value).c);
7094 (yyval.value).t = TYPE_NUMBER;
7104 /* Line 1464 of skeleton.m4 */
7105 #line 3201 "parser.y"
7106 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7107 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
7108 (yyval.value).c = abc_add_i((yyval.value).c);
7109 (yyval.value).t = TYPE_INT;
7111 (yyval.value).c = abc_add((yyval.value).c);
7112 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
7123 /* Line 1464 of skeleton.m4 */
7124 #line 3210 "parser.y"
7125 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7126 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7127 (yyval.value).c = abc_subtract_i((yyval.value).c);
7128 (yyval.value).t = TYPE_INT;
7130 (yyval.value).c = abc_subtract((yyval.value).c);
7131 (yyval.value).t = TYPE_NUMBER;
7142 /* Line 1464 of skeleton.m4 */
7143 #line 3219 "parser.y"
7144 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7145 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7146 (yyval.value).c = abc_multiply_i((yyval.value).c);
7147 (yyval.value).t = TYPE_INT;
7149 (yyval.value).c = abc_multiply((yyval.value).c);
7150 (yyval.value).t = TYPE_NUMBER;
7161 /* Line 1464 of skeleton.m4 */
7162 #line 3229 "parser.y"
7163 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
7164 (yyval.value).c = abc_in((yyval.value).c);
7165 (yyval.value).t = TYPE_BOOLEAN;
7175 /* Line 1464 of skeleton.m4 */
7176 #line 3234 "parser.y"
7177 {char use_astype=0; // flash player's astype works differently than astypelate
7178 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
7179 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
7180 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
7181 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
7183 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7184 (yyval.value).c = abc_astypelate((yyval.value).c);
7185 (yyval.value).t = TYPE_ANY;
7196 /* Line 1464 of skeleton.m4 */
7197 #line 3247 "parser.y"
7198 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7199 (yyval.value).c = abc_instanceof((yyval.value).c);
7200 (yyval.value).t = TYPE_BOOLEAN;
7210 /* Line 1464 of skeleton.m4 */
7211 #line 3252 "parser.y"
7212 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
7213 (yyval.value).c = abc_istypelate((yyval.value).c);
7214 (yyval.value).t = TYPE_BOOLEAN;
7224 /* Line 1464 of skeleton.m4 */
7225 #line 3257 "parser.y"
7227 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
7228 (yyval.value).c = abc_typeof((yyval.value).c);
7229 (yyval.value).t = TYPE_STRING;
7239 /* Line 1464 of skeleton.m4 */
7240 #line 3263 "parser.y"
7242 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
7243 (yyval.value).c = abc_pushundefined((yyval.value).c);
7244 (yyval.value).t = TYPE_ANY;
7254 /* Line 1464 of skeleton.m4 */
7255 #line 3269 "parser.y"
7256 { (yyval.value).c = abc_pushundefined(0);
7257 (yyval.value).t = TYPE_ANY;
7267 /* Line 1464 of skeleton.m4 */
7268 #line 3273 "parser.y"
7269 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7278 /* Line 1464 of skeleton.m4 */
7279 #line 3275 "parser.y"
7281 (yyval.value)=(yyvsp[(2) - (2)].value);
7282 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7283 (yyval.value).c=abc_negate_i((yyval.value).c);
7284 (yyval.value).t = TYPE_INT;
7286 (yyval.value).c=abc_negate((yyval.value).c);
7287 (yyval.value).t = TYPE_NUMBER;
7298 /* Line 1464 of skeleton.m4 */
7299 #line 3286 "parser.y"
7301 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7302 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7304 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7305 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7306 (yyval.value).t = 0; // array elements have unknown type
7316 /* Line 1464 of skeleton.m4 */
7317 #line 3295 "parser.y"
7319 (yyval.value).c = code_new();
7320 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7321 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len);
7322 (yyval.value).t = registry_getarrayclass();
7332 /* Line 1464 of skeleton.m4 */
7333 #line 3302 "parser.y"
7334 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
7343 /* Line 1464 of skeleton.m4 */
7344 #line 3303 "parser.y"
7345 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7354 /* Line 1464 of skeleton.m4 */
7355 #line 3305 "parser.y"
7357 (yyval.value_list).cc = 0;
7358 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7359 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7360 (yyval.value_list).len = 2;
7370 /* Line 1464 of skeleton.m4 */
7371 #line 3311 "parser.y"
7373 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7374 (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2;
7375 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7376 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7386 /* Line 1464 of skeleton.m4 */
7387 #line 3320 "parser.y"
7389 (yyval.value).c = code_new();
7390 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7391 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2);
7392 (yyval.value).t = registry_getobjectclass();
7402 /* Line 1464 of skeleton.m4 */
7403 #line 3327 "parser.y"
7405 code_t*c = (yyvsp[(3) - (3)].value).c;
7406 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7407 c=abc_multiply_i(c);
7411 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
7412 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7413 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7423 /* Line 1464 of skeleton.m4 */
7424 #line 3339 "parser.y"
7426 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
7427 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
7428 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7429 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7439 /* Line 1464 of skeleton.m4 */
7440 #line 3345 "parser.y"
7442 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
7443 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
7444 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7445 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7455 /* Line 1464 of skeleton.m4 */
7456 #line 3351 "parser.y"
7458 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7459 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7460 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7461 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7471 /* Line 1464 of skeleton.m4 */
7472 #line 3357 "parser.y"
7474 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7475 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7476 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7477 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7487 /* Line 1464 of skeleton.m4 */
7488 #line 3363 "parser.y"
7490 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7491 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7492 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7493 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7503 /* Line 1464 of skeleton.m4 */
7504 #line 3369 "parser.y"
7506 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
7507 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7508 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7509 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7519 /* Line 1464 of skeleton.m4 */
7520 #line 3375 "parser.y"
7522 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7523 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7524 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7525 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7535 /* Line 1464 of skeleton.m4 */
7536 #line 3381 "parser.y"
7538 code_t*c = (yyvsp[(3) - (3)].value).c;
7540 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7544 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7547 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7548 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7558 /* Line 1464 of skeleton.m4 */
7559 #line 3394 "parser.y"
7560 { code_t*c = (yyvsp[(3) - (3)].value).c;
7561 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7562 c=abc_subtract_i(c);
7565 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7568 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7569 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7579 /* Line 1464 of skeleton.m4 */
7580 #line 3405 "parser.y"
7582 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7583 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7584 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7585 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7595 /* Line 1464 of skeleton.m4 */
7596 #line 3412 "parser.y"
7598 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7599 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7600 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7601 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7602 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7603 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7604 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7605 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7606 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(5) - (5)].value).t, (yyval.value).t);
7607 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7617 /* Line 1464 of skeleton.m4 */
7618 #line 3425 "parser.y"
7620 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7621 if(is_getlocal((yyvsp[(1) - (2)].value).c) && (TYPE_IS_INT((yyvsp[(1) - (2)].value).t) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t))) {
7622 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7623 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7624 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7625 (yyval.value).c = abc_getlocal(0, nr);
7626 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7627 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7628 (yyval.value).c = abc_getlocal(0, nr);
7629 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7630 } else syntaxerror("internal error");
7632 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7633 c=abc_increment_i(c);
7639 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7640 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7641 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7652 /* Line 1464 of skeleton.m4 */
7653 #line 3452 "parser.y"
7655 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7656 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7657 c=abc_decrement_i(c);
7663 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7664 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7665 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7675 /* Line 1464 of skeleton.m4 */
7676 #line 3466 "parser.y"
7678 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7679 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7680 c=abc_increment_i(c);
7686 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7687 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7688 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7698 /* Line 1464 of skeleton.m4 */
7699 #line 3480 "parser.y"
7701 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7702 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7703 c=abc_decrement_i(c);
7709 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7710 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7711 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7721 /* Line 1464 of skeleton.m4 */
7722 #line 3495 "parser.y"
7723 { if(!state->cls->info)
7724 syntaxerror("super keyword not allowed outside a class");
7725 classinfo_t*t = state->cls->info->superclass;
7726 if(!t) t = TYPE_OBJECT;
7728 memberinfo_t*f = registry_findmember_nsset(t, state->active_namespaces, (yyvsp[(3) - (3)].id), 1);
7730 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7731 (yyval.value).c = 0;
7732 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7733 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7734 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7744 /* Line 1464 of skeleton.m4 */
7745 #line 3509 "parser.y"
7748 (yyval.value).c = abc_pushundefined(0);
7749 (yyval.value).t = 0;
7750 as3_warning("ignored @ operator");
7760 /* Line 1464 of skeleton.m4 */
7761 #line 3516 "parser.y"
7763 // child attribute TODO
7764 (yyval.value).c = abc_pushundefined(0);
7765 (yyval.value).t = 0;
7766 as3_warning("ignored .@ operator");
7776 /* Line 1464 of skeleton.m4 */
7777 #line 3523 "parser.y"
7779 // namespace declaration TODO
7780 (yyval.value).c = abc_pushundefined(0);
7781 (yyval.value).t = 0;
7782 as3_warning("ignored :: operator");
7792 /* Line 1464 of skeleton.m4 */
7793 #line 3530 "parser.y"
7796 (yyval.value).c = abc_pushundefined(0);
7797 (yyval.value).t = 0;
7798 as3_warning("ignored .. operator");
7808 /* Line 1464 of skeleton.m4 */
7809 #line 3537 "parser.y"
7812 (yyval.value).c = abc_pushundefined(0);
7813 (yyval.value).t = 0;
7814 as3_warning("ignored .() operator");
7824 /* Line 1464 of skeleton.m4 */
7825 #line 3548 "parser.y"
7827 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7828 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7830 if(TYPE_IS_CLASS(t) && t->data) {
7835 if(t->subtype==0xff) {
7836 syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name);
7838 memberinfo_t*f = registry_findmember_nsset(t, state->active_namespaces, (yyvsp[(3) - (3)].id), 1);
7840 if(f && !is_static != !(f->flags&FLAG_STATIC))
7842 if(f && f->slot && !noslot) {
7843 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7845 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7846 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7848 /* determine type */
7849 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7850 if(!(yyval.value).t)
7851 (yyval.value).c = abc_coerce_a((yyval.value).c);
7852 } else if((yyvsp[(1) - (3)].value).c && (yyvsp[(1) - (3)].value).c->opcode == OPCODE___PUSHPACKAGE__) {
7853 string_t*package = (yyvsp[(1) - (3)].value).c->data[0];
7854 char*package2 = concat3(package->str, ".", (yyvsp[(3) - (3)].id));
7855 if(dict_contains(state->import_toplevel_packages, package2)) {
7856 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
7857 (yyval.value).c->data[0] = string_new4(package2);
7858 (yyval.value).t = 0;
7860 slotinfo_t*a = registry_find(package->str, (yyvsp[(3) - (3)].id));
7862 syntaxerror("couldn't resolve %s", package2);
7863 (yyval.value) = push_class(a);
7866 /* when resolving a property on an unknown type, we do know the
7867 name of the property (and don't seem to need the package), but
7868 we need to make avm2 try out all access modes */
7869 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
7870 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7871 (yyval.value).c = abc_coerce_a((yyval.value).c);
7872 (yyval.value).t = registry_getanytype();
7883 /* Line 1464 of skeleton.m4 */
7884 #line 3598 "parser.y"
7887 /* Queue unresolved identifiers for checking against the parent
7888 function's variables.
7889 We consider everything which is not a local variable "unresolved".
7890 This encompasses class names, members of the surrounding class
7891 etc. which is *correct* because local variables of the parent function
7894 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
7895 unknown_variable((yyvsp[(1) - (1)].id));
7898 /* let the compiler know that it might check the current directory/package
7899 for this identifier- maybe there's a file $1.as defining $1. */
7900 as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id));
7903 (yyval.value).t = 0;
7904 (yyval.value).c = 0;
7909 /* look at variables */
7910 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
7911 // $1 is a local variable
7912 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
7913 (yyval.value).t = v->type;
7916 if((v = find_slot(state, (yyvsp[(1) - (1)].id)))) {
7917 (yyval.value).c = abc_getscopeobject((yyval.value).c, 1);
7918 (yyval.value).c = abc_getslot((yyval.value).c, v->index);
7919 (yyval.value).t = v->type;
7923 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
7925 /* look at current class' members */
7926 if(state->cls && (f = registry_findmember_nsset(state->cls->info, state->active_namespaces, (yyvsp[(1) - (1)].id), 1)) &&
7927 (f->flags&FLAG_STATIC) >= i_am_static) {
7928 // $1 is a function in this class
7929 int var_is_static = (f->flags&FLAG_STATIC);
7931 if(f->kind == INFOTYPE_METHOD) {
7932 (yyval.value).t = TYPE_FUNCTION(f);
7934 (yyval.value).t = f->type;
7936 if(var_is_static && !i_am_static) {
7937 /* access to a static member from a non-static location.
7938 do this via findpropstrict:
7939 there doesn't seem to be any non-lookup way to access
7940 static properties of a class */
7941 state->method->late_binding = 1;
7942 (yyval.value).t = f->type;
7943 namespace_t ns = {f->access, ""};
7944 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7945 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7946 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7948 } else if(f->slot>0) {
7949 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7950 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7953 namespace_t ns = {f->access, ""};
7954 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7955 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7956 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7961 /* look at actual classes, in the current package and imported */
7962 if((a = find_class((yyvsp[(1) - (1)].id)))) {
7963 (yyval.value) = push_class(a);
7967 /* look through package prefixes */
7968 if(dict_contains(state->import_toplevel_packages, (yyvsp[(1) - (1)].id))) {
7969 (yyval.value).c = abc___pushpackage__((yyval.value).c, (yyvsp[(1) - (1)].id));
7970 (yyval.value).t = 0;
7974 /* unknown object, let the avm2 resolve it */
7976 //as3_softwarning("Couldn't resolve '%s', doing late binding", $1);
7977 as3_warning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
7978 state->method->late_binding = 1;
7980 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
7982 (yyval.value).t = 0;
7983 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7984 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7995 /* Line 1464 of skeleton.m4 */
7996 #line 3703 "parser.y"
7999 NEW(namespace_decl_t,n);
8000 n->name = (yyvsp[(2) - (2)].id);
8002 (yyval.namespace_decl)=n;
8012 /* Line 1464 of skeleton.m4 */
8013 #line 3710 "parser.y"
8016 NEW(namespace_decl_t,n);
8017 n->name = (yyvsp[(2) - (4)].id);
8018 n->url = (yyvsp[(4) - (4)].id);
8019 (yyval.namespace_decl)=n;
8029 /* Line 1464 of skeleton.m4 */
8030 #line 3717 "parser.y"
8033 NEW(namespace_decl_t,n);
8034 n->name = (yyvsp[(2) - (4)].id);
8035 n->url = (yyvsp[(4) - (4)].str).str;
8036 (yyval.namespace_decl)=n;
8046 /* Line 1464 of skeleton.m4 */
8047 #line 3724 "parser.y"
8050 list_append(state->new_namespaces, (yyvsp[(2) - (2)].namespace_decl));
8051 tokenizer_register_namespace((yyvsp[(2) - (2)].namespace_decl)->name);
8062 /* Line 1464 of skeleton.m4 */
8063 #line 3731 "parser.y"
8066 NEW(namespace_decl_t,n);
8067 n->name = (yyvsp[(3) - (3)].classinfo)->name;
8069 /* FIXME: for pass2, we should now try to figure out what the URL of
8071 list_append(state->new_namespaces, n);
8072 tokenizer_register_namespace((yyvsp[(3) - (3)].classinfo)->name);
8081 /* Line 1464 of skeleton.m4 */
8082 #line 8083 "parser.tab.c"
8085 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
8089 YY_STACK_PRINT (yyss, yyssp);
8093 /* Now `shift' the result of the reduction. Determine what state
8094 that goes to, based on the state we popped back to and the rule
8095 number reduced by. */
8099 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
8100 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
8101 yystate = yytable[yystate];
8103 yystate = yydefgoto[yyn - YYNTOKENS];
8108 /*------------------------------------.
8109 | yyerrlab -- here on detecting error |
8110 `------------------------------------*/
8112 /* If not already recovering from an error, report this error. */
8116 #if ! YYERROR_VERBOSE
8117 yyerror (YY_("syntax error"));
8120 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
8121 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
8123 YYSIZE_T yyalloc = 2 * yysize;
8124 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
8125 yyalloc = YYSTACK_ALLOC_MAXIMUM;
8126 if (yymsg != yymsgbuf)
8127 YYSTACK_FREE (yymsg);
8128 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
8130 yymsg_alloc = yyalloc;
8134 yymsg_alloc = sizeof yymsgbuf;
8138 if (0 < yysize && yysize <= yymsg_alloc)
8140 (void) yysyntax_error (yymsg, yystate, yychar);
8145 yyerror (YY_("syntax error"));
8147 goto yyexhaustedlab;
8155 if (yyerrstatus == 3)
8157 /* If just tried and failed to reuse lookahead token after an
8158 error, discard it. */
8160 if (yychar <= YYEOF)
8162 /* Return failure if at end of input. */
8163 if (yychar == YYEOF)
8168 yydestruct ("Error: discarding",
8174 /* Else will try to reuse lookahead token after shifting the error
8179 /*---------------------------------------------------.
8180 | yyerrorlab -- error raised explicitly by YYERROR. |
8181 `---------------------------------------------------*/
8184 /* Pacify compilers like GCC when the user code never invokes
8185 YYERROR and the label yyerrorlab therefore never appears in user
8187 if (/*CONSTCOND*/ 0)
8190 /* Do not reclaim the symbols of the rule which action triggered
8194 YY_STACK_PRINT (yyss, yyssp);
8199 /*-------------------------------------------------------------.
8200 | yyerrlab1 -- common code for both syntax error and YYERROR. |
8201 `-------------------------------------------------------------*/
8203 yyerrstatus = 3; /* Each real token shifted decrements this. */
8207 yyn = yypact[yystate];
8208 if (yyn != YYPACT_NINF)
8211 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
8219 /* Pop the current state because it cannot handle the error token. */
8224 yydestruct ("Error: popping",
8225 yystos[yystate], yyvsp);
8228 YY_STACK_PRINT (yyss, yyssp);
8234 /* Shift the error token. */
8235 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
8241 /*-------------------------------------.
8242 | yyacceptlab -- YYACCEPT comes here. |
8243 `-------------------------------------*/
8248 /*-----------------------------------.
8249 | yyabortlab -- YYABORT comes here. |
8250 `-----------------------------------*/
8255 #if !defined(yyoverflow) || YYERROR_VERBOSE
8256 /*-------------------------------------------------.
8257 | yyexhaustedlab -- memory exhaustion comes here. |
8258 `-------------------------------------------------*/
8260 yyerror (YY_("memory exhausted"));
8266 if (yychar != YYEMPTY)
8267 yydestruct ("Cleanup: discarding lookahead",
8269 /* Do not reclaim the symbols of the rule which action triggered
8270 this YYABORT or YYACCEPT. */
8272 YY_STACK_PRINT (yyss, yyssp);
8273 while (yyssp != yyss)
8275 yydestruct ("Cleanup: popping",
8276 yystos[*yyssp], yyvsp);
8281 YYSTACK_FREE (yyss);
8284 if (yymsg != yymsgbuf)
8285 YYSTACK_FREE (yymsg);
8287 /* Make sure YYID is used. */
8288 return YYID (yyresult);